func (h *serviceHandler) PostAllocate(ctx context.Context, in *pb.AllocationRequest) (*pb.AllocationResponse, error) {
	logger.WithField("request", in).Infof("allocation request received.")
	gsa := converters.ConvertAllocationRequestV1Alpha1ToGSAV1(in)
	resultObj, err := h.allocationCallback(gsa)
	if err != nil {
		logger.WithField("gsa", gsa).WithError(err).Info("allocation failed")
		return nil, err
	}

	if s, ok := resultObj.(*metav1.Status); ok {
		return nil, status.Errorf(codes.Code(s.Code), s.Message, resultObj)
	}

	allocatedGsa, ok := resultObj.(*allocationv1.GameServerAllocation)
	if !ok {
		logger.Errorf("internal server error - Bad GSA format %v", resultObj)
		return nil, status.Errorf(codes.Internal, "internal server error- Bad GSA format %v", resultObj)
	}
	response := converters.ConvertGSAV1ToAllocationResponseV1Alpha1(allocatedGsa)
	logger.WithField("response", response).Infof("allocation response is being sent")

	return response, nil
}
// PostAllocate implements the PostAllocate gRPC method definition
PostAllocate implements the PostAllocate gRPC method definition
// PostAllocate implements the PostAllocate gRPC method definition
func (h *serviceHandler) PostAllocate(ctx context.Context, in *pb.AllocationRequest) (*pb.AllocationResponse, error) {
	logger.WithField("request", in).Infof("allocation request received.")
	gsa := converters.ConvertAllocationRequestV1Alpha1ToGSAV1(in)
	resultObj, err := h.allocationCallback(gsa)
	if err != nil {
		logger.WithField("gsa", gsa).WithError(err).Info("allocation failed")
		return nil, err
	}
	if s, ok := resultObj.(*metav1.Status); ok {
		return nil, status.Errorf(codes.Code(s.Code), s.Message, resultObj)
	}
	allocatedGsa, ok := resultObj.(*allocationv1.GameServerAllocation)
	if !ok {
		logger.Errorf("internal server error - Bad GSA format %v", resultObj)
		return nil, status.Errorf(codes.Internal, "internal server error- Bad GSA format %v", resultObj)
	}
	response := converters.ConvertGSAV1ToAllocationResponseV1Alpha1(allocatedGsa)
	logger.WithField("response", response).Infof("allocation response is being sent")
	return response, nil
}
func ( h * serviceHandler ) PostAllocate ( ctx context . Context , in * pb . AllocationRequest ) ( * pb . AllocationResponse , error ) { logger . WithField ( " " , in ) . Infof ( " " ) gsa := converters . ConvertAllocationRequestV1Alpha1ToGSAV1 ( in ) resultObj , err := h . allocationCallback ( gsa ) if err != nil { logger . WithField ( " " , gsa ) . WithError ( err ) . Info ( " " ) return nil , err } if s , ok := resultObj . ( * metav1 . Status ) ; ok { return nil , status . Errorf ( codes . Code ( s . Code ) , s . Message , resultObj ) } allocatedGsa , ok := resultObj . ( * allocationv1 . GameServerAllocation ) if ! ok { logger . Errorf ( " " , resultObj ) return nil , status . Errorf ( codes . Internal , " " , resultObj ) } response := converters . ConvertGSAV1ToAllocationResponseV1Alpha1 ( allocatedGsa ) logger . WithField ( " " , response ) . Infof ( " " ) return response , nil }
PostAllocate implements the PostAllocate gRPC method definition
PostAllocate implements the PostAllocate gRPC method definition