func AssignmentToProto(resource *bigqueryreservation.Assignment) *bigqueryreservationpb.BigqueryreservationAssignment {
	p := &bigqueryreservationpb.BigqueryreservationAssignment{}
	p.SetName(dcl.ValueOrEmptyString(resource.Name))
	p.SetAssignee(dcl.ValueOrEmptyString(resource.Assignee))
	p.SetJobType(BigqueryreservationAssignmentJobTypeEnumToProto(resource.JobType))
	p.SetState(BigqueryreservationAssignmentStateEnumToProto(resource.State))
	p.SetProject(dcl.ValueOrEmptyString(resource.Project))
	p.SetLocation(dcl.ValueOrEmptyString(resource.Location))
	p.SetReservation(dcl.ValueOrEmptyString(resource.Reservation))
	return p
}
AssignmentToProto converts a Assignment resource to its proto representation.
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 AssignmentServer struct{}
func ProtoToBigqueryreservationAssignmentJobTypeEnum(e bigqueryreservationpb.BigqueryreservationAssignmentJobTypeEnum) *bigqueryreservation.AssignmentJobTypeEnum {
	if e == 0 {
		return nil
	}
	if n, ok := bigqueryreservationpb.BigqueryreservationAssignmentJobTypeEnum_name[int32(e)]; ok {
		e := bigqueryreservation.AssignmentJobTypeEnum(n[len("BigqueryreservationAssignmentJobTypeEnum"):])
		return &e
	}
	return nil
}
func ProtoToBigqueryreservationAssignmentStateEnum(e bigqueryreservationpb.BigqueryreservationAssignmentStateEnum) *bigqueryreservation.AssignmentStateEnum {
	if e == 0 {
		return nil
	}
	if n, ok := bigqueryreservationpb.BigqueryreservationAssignmentStateEnum_name[int32(e)]; ok {
		e := bigqueryreservation.AssignmentStateEnum(n[len("BigqueryreservationAssignmentStateEnum"):])
		return &e
	}
	return nil
}
func ProtoToAssignment(p *bigqueryreservationpb.BigqueryreservationAssignment) *bigqueryreservation.Assignment {
	obj := &bigqueryreservation.Assignment{
		Name:        dcl.StringOrNil(p.GetName()),
		Assignee:    dcl.StringOrNil(p.GetAssignee()),
		JobType:     ProtoToBigqueryreservationAssignmentJobTypeEnum(p.GetJobType()),
		State:       ProtoToBigqueryreservationAssignmentStateEnum(p.GetState()),
		Project:     dcl.StringOrNil(p.GetProject()),
		Location:    dcl.StringOrNil(p.GetLocation()),
		Reservation: dcl.StringOrNil(p.GetReservation()),
	}
	return obj
}
func BigqueryreservationAssignmentJobTypeEnumToProto(e *bigqueryreservation.AssignmentJobTypeEnum) bigqueryreservationpb.BigqueryreservationAssignmentJobTypeEnum {
	if e == nil {
		return bigqueryreservationpb.BigqueryreservationAssignmentJobTypeEnum(0)
	}
	if v, ok := bigqueryreservationpb.BigqueryreservationAssignmentJobTypeEnum_value["AssignmentJobTypeEnum"+string(*e)]; ok {
		return bigqueryreservationpb.BigqueryreservationAssignmentJobTypeEnum(v)
	}
	return bigqueryreservationpb.BigqueryreservationAssignmentJobTypeEnum(0)
}
func BigqueryreservationAssignmentStateEnumToProto(e *bigqueryreservation.AssignmentStateEnum) bigqueryreservationpb.BigqueryreservationAssignmentStateEnum {
	if e == nil {
		return bigqueryreservationpb.BigqueryreservationAssignmentStateEnum(0)
	}
	if v, ok := bigqueryreservationpb.BigqueryreservationAssignmentStateEnum_value["AssignmentStateEnum"+string(*e)]; ok {
		return bigqueryreservationpb.BigqueryreservationAssignmentStateEnum(v)
	}
	return bigqueryreservationpb.BigqueryreservationAssignmentStateEnum(0)
}