Пример #1
0
func request_API_GetDistance_0(ctx context.Context, client APIClient, req *http.Request, pathParams map[string]string) (proto.Message, error) {
	var protoReq GetDistanceRequest

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["source_airport_id"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "source_airport_id")
	}

	protoReq.SourceAirportId, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	val, ok = pathParams["destination_airport_id"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "destination_airport_id")
	}

	protoReq.DestinationAirportId, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	return client.GetDistance(ctx, &protoReq)
}
func request_API_GetVolume_0(ctx context.Context, marshaler runtime.Marshaler, client APIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq NameRequest
	var metadata runtime.ServerMetadata

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["name"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
	}

	protoReq.Name, err = runtime.String(val)

	if err != nil {
		return nil, metadata, err
	}

	msg, err := client.GetVolume(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}
Пример #3
0
func request_Admin_DatabaseDetails_0(ctx context.Context, client AdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq DatabaseDetailsRequest
	var metadata runtime.ServerMetadata

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["database"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "database")
	}

	protoReq.Database, err = runtime.String(val)

	if err != nil {
		return nil, metadata, err
	}

	msg, err := client.DatabaseDetails(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}
func request_FlowCombination_RpcBodyStream_6(ctx context.Context, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (FlowCombination_RpcBodyStreamClient, error) {
	var protoReq NonEmptyProto

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["a"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "a")
	}

	protoReq.A, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_FlowCombination_RpcBodyStream_6); err != nil {
		return nil, grpc.Errorf(codes.InvalidArgument, "%v", err)
	}

	return client.RpcBodyStream(ctx, &protoReq)
}
func request_ABitOfEverythingService_Update_0(ctx context.Context, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, error) {
	var protoReq ABitOfEverything

	if err := json.NewDecoder(req.Body).Decode(&protoReq); err != nil {
		return nil, grpc.Errorf(codes.InvalidArgument, "%v", err)
	}

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["uuid"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "uuid")
	}

	protoReq.Uuid, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	return client.Update(ctx, &protoReq)
}
func request_ABitOfEverythingService_Delete_0(ctx context.Context, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq sub2.IdMessage
	var metadata runtime.ServerMetadata

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["uuid"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "uuid")
	}

	protoReq.Uuid, err = runtime.String(val)

	if err != nil {
		return nil, metadata, err
	}

	msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}
func request_EchoService_Echo_0(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq SimpleMessage
	var metadata runtime.ServerMetadata

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["id"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
	}

	protoReq.Id, err = runtime.String(val)

	if err != nil {
		return nil, metadata, err
	}

	msg, err := client.Echo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}
func request_FlowCombination_RpcBodyStream_1(ctx context.Context, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (FlowCombination_RpcBodyStreamClient, error) {
	var protoReq NonEmptyProto

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["a"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "a")
	}

	protoReq.A, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	val, ok = pathParams["b"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "b")
	}

	protoReq.B, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	val, ok = pathParams["c"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "c")
	}

	protoReq.C, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	return client.RpcBodyStream(ctx, &protoReq)
}
func request_FlowCombination_RpcBodyRpc_3(ctx context.Context, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (proto.Message, error) {
	var protoReq NonEmptyProto

	if err := json.NewDecoder(req.Body).Decode(&protoReq.C); err != nil {
		return nil, grpc.Errorf(codes.InvalidArgument, "%v", err)
	}

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["a"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "a")
	}

	protoReq.A, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	val, ok = pathParams["b"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "b")
	}

	protoReq.B, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	return client.RpcBodyRpc(ctx, &protoReq)
}
Пример #10
0
func request_Deployments_GetFlagz_0(ctx context.Context, client DeploymentsClient, req *http.Request, pathParams map[string]string) (msg proto.Message, err error) {
	var protoReq FlagzId

	var val string
	var ok bool

	val, ok = pathParams["deployment.name"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "deployment.name")
	}
	if protoReq.Deployment == nil {
		v := reflect.ValueOf(&protoReq)
		fieldV := v.FieldByName("Deployment")
		fmt.Printf("%v", fieldV)
		protoReq.Deployment = &DeploymentId{}
	}
	protoReq.Deployment.Name, err = runtime.String(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["name"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
	}
	protoReq.Name, err = runtime.String(val)
	if err != nil {
		return nil, err
	}

	if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Deployments_GetFlagz_0); err != nil {
		return nil, grpc.Errorf(codes.InvalidArgument, "%v", err)
	}

	return client.GetFlagz(ctx, &protoReq)
}
func request_ABitOfEverythingService_Delete_0(ctx context.Context, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (msg proto.Message, err error) {
	var protoReq IdMessage

	var val string
	var ok bool

	val, ok = pathParams["uuid"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "uuid")
	}
	protoReq.Uuid, err = runtime.String(val)
	if err != nil {
		return nil, err
	}

	return client.Delete(ctx, &protoReq)
}
Пример #12
0
func request_EchoService_Echo_0(ctx context.Context, client EchoServiceClient, req *http.Request, pathParams map[string]string) (msg proto.Message, err error) {
	var protoReq SimpleMessage

	var val string
	var ok bool

	val, ok = pathParams["id"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
	}
	protoReq.Id, err = runtime.String(val)
	if err != nil {
		return nil, err
	}

	return client.Echo(ctx, &protoReq)
}
func request_FlowCombination_RpcPathNestedStream_0(ctx context.Context, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (FlowCombination_RpcPathNestedStreamClient, error) {
	var protoReq NestedProto

	if err := json.NewDecoder(req.Body).Decode(&protoReq.C); err != nil {
		return nil, grpc.Errorf(codes.InvalidArgument, "%v", err)
	}

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["a.str"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "a.str")
	}

	err = runtime.PopulateFieldFromPath(&protoReq, "a.str", val)

	if err != nil {
		return nil, err
	}

	val, ok = pathParams["b"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "b")
	}

	protoReq.B, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_FlowCombination_RpcPathNestedStream_0); err != nil {
		return nil, grpc.Errorf(codes.InvalidArgument, "%v", err)
	}

	return client.RpcPathNestedStream(ctx, &protoReq)
}
Пример #14
0
func request_API_GetAirline_0(ctx context.Context, client APIClient, req *http.Request, pathParams map[string]string) (proto.Message, error) {
	var protoReq GetAirlineRequest

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["id"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
	}

	protoReq.Id, err = runtime.String(val)

	if err != nil {
		return nil, err
	}

	return client.GetAirline(ctx, &protoReq)
}
func request_ABitOfEverythingService_Create_0(ctx context.Context, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (msg proto.Message, err error) {
	var protoReq ABitOfEverything

	var val string
	var ok bool

	val, ok = pathParams["float_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "float_value")
	}
	protoReq.FloatValue, err = runtime.Float32(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["double_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "double_value")
	}
	protoReq.DoubleValue, err = runtime.Float64(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["int64_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "int64_value")
	}
	protoReq.Int64Value, err = runtime.Int64(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["uint64_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "uint64_value")
	}
	protoReq.Uint64Value, err = runtime.Uint64(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["int32_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "int32_value")
	}
	protoReq.Int32Value, err = runtime.Int32(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["fixed64_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "fixed64_value")
	}
	protoReq.Fixed64Value, err = runtime.Uint64(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["fixed32_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "fixed32_value")
	}
	protoReq.Fixed32Value, err = runtime.Uint32(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["bool_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "bool_value")
	}
	protoReq.BoolValue, err = runtime.Bool(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["string_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "string_value")
	}
	protoReq.StringValue, err = runtime.String(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["uint32_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "uint32_value")
	}
	protoReq.Uint32Value, err = runtime.Uint32(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["sfixed32_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "sfixed32_value")
	}
	protoReq.Sfixed32Value, err = runtime.Int32(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["sfixed64_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "sfixed64_value")
	}
	protoReq.Sfixed64Value, err = runtime.Int64(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["sint32_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "sint32_value")
	}
	protoReq.Sint32Value, err = runtime.Int32(val)
	if err != nil {
		return nil, err
	}

	val, ok = pathParams["sint64_value"]
	if !ok {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "sint64_value")
	}
	protoReq.Sint64Value, err = runtime.Int64(val)
	if err != nil {
		return nil, err
	}

	if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ABitOfEverythingService_Create_0); err != nil {
		return nil, grpc.Errorf(codes.InvalidArgument, "%v", err)
	}

	return client.Create(ctx, &protoReq)
}
func request_ABitOfEverythingService_Create_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq ABitOfEverything
	var metadata runtime.ServerMetadata

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["float_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "float_value")
	}

	protoReq.FloatValue, err = runtime.Float32(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["double_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "double_value")
	}

	protoReq.DoubleValue, err = runtime.Float64(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["int64_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "int64_value")
	}

	protoReq.Int64Value, err = runtime.Int64(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["uint64_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "uint64_value")
	}

	protoReq.Uint64Value, err = runtime.Uint64(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["int32_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "int32_value")
	}

	protoReq.Int32Value, err = runtime.Int32(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["fixed64_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "fixed64_value")
	}

	protoReq.Fixed64Value, err = runtime.Uint64(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["fixed32_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "fixed32_value")
	}

	protoReq.Fixed32Value, err = runtime.Uint32(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["bool_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "bool_value")
	}

	protoReq.BoolValue, err = runtime.Bool(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["string_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "string_value")
	}

	protoReq.StringValue, err = runtime.String(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["uint32_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "uint32_value")
	}

	protoReq.Uint32Value, err = runtime.Uint32(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["sfixed32_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "sfixed32_value")
	}

	protoReq.Sfixed32Value, err = runtime.Int32(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["sfixed64_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "sfixed64_value")
	}

	protoReq.Sfixed64Value, err = runtime.Int64(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["sint32_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "sint32_value")
	}

	protoReq.Sint32Value, err = runtime.Int32(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["sint64_value"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "sint64_value")
	}

	protoReq.Sint64Value, err = runtime.Int64(val)

	if err != nil {
		return nil, metadata, err
	}

	val, ok = pathParams["nonConventionalNameValue"]
	if !ok {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "missing parameter %s", "nonConventionalNameValue")
	}

	protoReq.NonConventionalNameValue, err = runtime.String(val)

	if err != nil {
		return nil, metadata, err
	}

	if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ABitOfEverythingService_Create_0); err != nil {
		return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}