func (s *ReservationServer) applyReservation(ctx context.Context, c *bigqueryreservation.Client, request *bigqueryreservationpb.ApplyBigqueryreservationReservationRequest) (*bigqueryreservationpb.BigqueryreservationReservation, error) {
	p := ProtoToReservation(request.GetResource())
	res, err := c.ApplyReservation(ctx, p)
	if err != nil {
		return nil, err
	}
	r := ReservationToProto(res)
	return r, nil
}
applyReservation handles the gRPC request by passing it to the underlying Reservation Apply() method.
package server
import (
	"context"
	"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
	bigqueryreservationpb "github.com/GoogleCloudPlatform/declarative-resource-client-library/python/proto/bigqueryreservation/bigqueryreservation_go_proto"
	emptypb "github.com/GoogleCloudPlatform/declarative-resource-client-library/python/proto/empty_go_proto"
	"github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/bigqueryreservation"
)
type ReservationServer struct{}
func ProtoToReservation(p *bigqueryreservationpb.BigqueryreservationReservation) *bigqueryreservation.Reservation {
	obj := &bigqueryreservation.Reservation{
		Name:            dcl.StringOrNil(p.GetName()),
		SlotCapacity:    dcl.Int64OrNil(p.GetSlotCapacity()),
		IgnoreIdleSlots: dcl.Bool(p.GetIgnoreIdleSlots()),
		CreationTime:    dcl.StringOrNil(p.GetCreationTime()),
		UpdateTime:      dcl.StringOrNil(p.GetUpdateTime()),
		Project:         dcl.StringOrNil(p.GetProject()),
		Location:        dcl.StringOrNil(p.GetLocation()),
	}
	return obj
}
func ReservationToProto(resource *bigqueryreservation.Reservation) *bigqueryreservationpb.BigqueryreservationReservation {
	p := &bigqueryreservationpb.BigqueryreservationReservation{}
	p.SetName(dcl.ValueOrEmptyString(resource.Name))
	p.SetSlotCapacity(dcl.ValueOrEmptyInt64(resource.SlotCapacity))
	p.SetIgnoreIdleSlots(dcl.ValueOrEmptyBool(resource.IgnoreIdleSlots))
	p.SetCreationTime(dcl.ValueOrEmptyString(resource.CreationTime))
	p.SetUpdateTime(dcl.ValueOrEmptyString(resource.UpdateTime))
	p.SetProject(dcl.ValueOrEmptyString(resource.Project))
	p.SetLocation(dcl.ValueOrEmptyString(resource.Location))
	return p
}