From 7e72ef31d0262fb4d3c2e488ec70328904e340eb Mon Sep 17 00:00:00 2001 From: Antoine Grondin Date: Mon, 15 Sep 2025 18:09:15 +0900 Subject: [PATCH] get a product --- .../v1/productv1connect/service.connect.go | 29 +++ go/svc/product/v1/service.pb.go | 177 ++++++++++++++---- .../v1/service-ProductService_connectquery.ts | 5 + js/svc/product/v1/service_pb.ts | 55 +++++- proto/svc/product/v1/service.proto | 10 + 5 files changed, 238 insertions(+), 38 deletions(-) diff --git a/go/svc/product/v1/productv1connect/service.connect.go b/go/svc/product/v1/productv1connect/service.connect.go index 8f99c0b..d3161c2 100644 --- a/go/svc/product/v1/productv1connect/service.connect.go +++ b/go/svc/product/v1/productv1connect/service.connect.go @@ -33,6 +33,9 @@ const ( // reflection-formatted method names, remove the leading slash and convert the remaining slash to a // period. const ( + // ProductServiceGetProductProcedure is the fully-qualified name of the ProductService's GetProduct + // RPC. + ProductServiceGetProductProcedure = "/svc.product.v1.ProductService/GetProduct" // ProductServiceListProductProcedure is the fully-qualified name of the ProductService's // ListProduct RPC. ProductServiceListProductProcedure = "/svc.product.v1.ProductService/ListProduct" @@ -40,6 +43,7 @@ const ( // ProductServiceClient is a client for the svc.product.v1.ProductService service. type ProductServiceClient interface { + GetProduct(context.Context, *connect.Request[v1.GetProductRequest]) (*connect.Response[v1.GetProductResponse], error) ListProduct(context.Context, *connect.Request[v1.ListProductRequest]) (*connect.Response[v1.ListProductResponse], error) } @@ -54,6 +58,12 @@ func NewProductServiceClient(httpClient connect.HTTPClient, baseURL string, opts baseURL = strings.TrimRight(baseURL, "/") productServiceMethods := v1.File_svc_product_v1_service_proto.Services().ByName("ProductService").Methods() return &productServiceClient{ + getProduct: connect.NewClient[v1.GetProductRequest, v1.GetProductResponse]( + httpClient, + baseURL+ProductServiceGetProductProcedure, + connect.WithSchema(productServiceMethods.ByName("GetProduct")), + connect.WithClientOptions(opts...), + ), listProduct: connect.NewClient[v1.ListProductRequest, v1.ListProductResponse]( httpClient, baseURL+ProductServiceListProductProcedure, @@ -65,9 +75,15 @@ func NewProductServiceClient(httpClient connect.HTTPClient, baseURL string, opts // productServiceClient implements ProductServiceClient. type productServiceClient struct { + getProduct *connect.Client[v1.GetProductRequest, v1.GetProductResponse] listProduct *connect.Client[v1.ListProductRequest, v1.ListProductResponse] } +// GetProduct calls svc.product.v1.ProductService.GetProduct. +func (c *productServiceClient) GetProduct(ctx context.Context, req *connect.Request[v1.GetProductRequest]) (*connect.Response[v1.GetProductResponse], error) { + return c.getProduct.CallUnary(ctx, req) +} + // ListProduct calls svc.product.v1.ProductService.ListProduct. func (c *productServiceClient) ListProduct(ctx context.Context, req *connect.Request[v1.ListProductRequest]) (*connect.Response[v1.ListProductResponse], error) { return c.listProduct.CallUnary(ctx, req) @@ -75,6 +91,7 @@ func (c *productServiceClient) ListProduct(ctx context.Context, req *connect.Req // ProductServiceHandler is an implementation of the svc.product.v1.ProductService service. type ProductServiceHandler interface { + GetProduct(context.Context, *connect.Request[v1.GetProductRequest]) (*connect.Response[v1.GetProductResponse], error) ListProduct(context.Context, *connect.Request[v1.ListProductRequest]) (*connect.Response[v1.ListProductResponse], error) } @@ -85,6 +102,12 @@ type ProductServiceHandler interface { // and JSON codecs. They also support gzip compression. func NewProductServiceHandler(svc ProductServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { productServiceMethods := v1.File_svc_product_v1_service_proto.Services().ByName("ProductService").Methods() + productServiceGetProductHandler := connect.NewUnaryHandler( + ProductServiceGetProductProcedure, + svc.GetProduct, + connect.WithSchema(productServiceMethods.ByName("GetProduct")), + connect.WithHandlerOptions(opts...), + ) productServiceListProductHandler := connect.NewUnaryHandler( ProductServiceListProductProcedure, svc.ListProduct, @@ -93,6 +116,8 @@ func NewProductServiceHandler(svc ProductServiceHandler, opts ...connect.Handler ) return "/svc.product.v1.ProductService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { + case ProductServiceGetProductProcedure: + productServiceGetProductHandler.ServeHTTP(w, r) case ProductServiceListProductProcedure: productServiceListProductHandler.ServeHTTP(w, r) default: @@ -104,6 +129,10 @@ func NewProductServiceHandler(svc ProductServiceHandler, opts ...connect.Handler // UnimplementedProductServiceHandler returns CodeUnimplemented from all methods. type UnimplementedProductServiceHandler struct{} +func (UnimplementedProductServiceHandler) GetProduct(context.Context, *connect.Request[v1.GetProductRequest]) (*connect.Response[v1.GetProductResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("svc.product.v1.ProductService.GetProduct is not implemented")) +} + func (UnimplementedProductServiceHandler) ListProduct(context.Context, *connect.Request[v1.ListProductRequest]) (*connect.Response[v1.ListProductResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("svc.product.v1.ProductService.ListProduct is not implemented")) } diff --git a/go/svc/product/v1/service.pb.go b/go/svc/product/v1/service.pb.go index 64e2e7e..3d11953 100644 --- a/go/svc/product/v1/service.pb.go +++ b/go/svc/product/v1/service.pb.go @@ -22,6 +22,102 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type GetProductRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + StripeId string `protobuf:"bytes,1,opt,name=stripe_id,json=stripeId,proto3" json:"stripe_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProductRequest) Reset() { + *x = GetProductRequest{} + mi := &file_svc_product_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProductRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProductRequest) ProtoMessage() {} + +func (x *GetProductRequest) ProtoReflect() protoreflect.Message { + mi := &file_svc_product_v1_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProductRequest.ProtoReflect.Descriptor instead. +func (*GetProductRequest) Descriptor() ([]byte, []int) { + return file_svc_product_v1_service_proto_rawDescGZIP(), []int{0} +} + +func (x *GetProductRequest) GetStripeId() string { + if x != nil { + return x.StripeId + } + return "" +} + +type GetProductResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Product *v1.Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"` + Prices []*v1.Price `protobuf:"bytes,2,rep,name=prices,proto3" json:"prices,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProductResponse) Reset() { + *x = GetProductResponse{} + mi := &file_svc_product_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProductResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProductResponse) ProtoMessage() {} + +func (x *GetProductResponse) ProtoReflect() protoreflect.Message { + mi := &file_svc_product_v1_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProductResponse.ProtoReflect.Descriptor instead. +func (*GetProductResponse) Descriptor() ([]byte, []int) { + return file_svc_product_v1_service_proto_rawDescGZIP(), []int{1} +} + +func (x *GetProductResponse) GetProduct() *v1.Product { + if x != nil { + return x.Product + } + return nil +} + +func (x *GetProductResponse) GetPrices() []*v1.Price { + if x != nil { + return x.Prices + } + return nil +} + type ListProductRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Cursor *v1.Cursor `protobuf:"bytes,1,opt,name=cursor,proto3" json:"cursor,omitempty"` @@ -35,7 +131,7 @@ type ListProductRequest struct { func (x *ListProductRequest) Reset() { *x = ListProductRequest{} - mi := &file_svc_product_v1_service_proto_msgTypes[0] + mi := &file_svc_product_v1_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +143,7 @@ func (x *ListProductRequest) String() string { func (*ListProductRequest) ProtoMessage() {} func (x *ListProductRequest) ProtoReflect() protoreflect.Message { - mi := &file_svc_product_v1_service_proto_msgTypes[0] + mi := &file_svc_product_v1_service_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -60,7 +156,7 @@ func (x *ListProductRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListProductRequest.ProtoReflect.Descriptor instead. func (*ListProductRequest) Descriptor() ([]byte, []int) { - return file_svc_product_v1_service_proto_rawDescGZIP(), []int{0} + return file_svc_product_v1_service_proto_rawDescGZIP(), []int{2} } func (x *ListProductRequest) GetCursor() *v1.Cursor { @@ -102,7 +198,7 @@ type ListProductResponse struct { func (x *ListProductResponse) Reset() { *x = ListProductResponse{} - mi := &file_svc_product_v1_service_proto_msgTypes[1] + mi := &file_svc_product_v1_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -114,7 +210,7 @@ func (x *ListProductResponse) String() string { func (*ListProductResponse) ProtoMessage() {} func (x *ListProductResponse) ProtoReflect() protoreflect.Message { - mi := &file_svc_product_v1_service_proto_msgTypes[1] + mi := &file_svc_product_v1_service_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -127,7 +223,7 @@ func (x *ListProductResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListProductResponse.ProtoReflect.Descriptor instead. func (*ListProductResponse) Descriptor() ([]byte, []int) { - return file_svc_product_v1_service_proto_rawDescGZIP(), []int{1} + return file_svc_product_v1_service_proto_rawDescGZIP(), []int{3} } func (x *ListProductResponse) GetNext() *v1.Cursor { @@ -161,7 +257,7 @@ type ListProductResponse_ListItem struct { func (x *ListProductResponse_ListItem) Reset() { *x = ListProductResponse_ListItem{} - mi := &file_svc_product_v1_service_proto_msgTypes[2] + mi := &file_svc_product_v1_service_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -173,7 +269,7 @@ func (x *ListProductResponse_ListItem) String() string { func (*ListProductResponse_ListItem) ProtoMessage() {} func (x *ListProductResponse_ListItem) ProtoReflect() protoreflect.Message { - mi := &file_svc_product_v1_service_proto_msgTypes[2] + mi := &file_svc_product_v1_service_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -186,7 +282,7 @@ func (x *ListProductResponse_ListItem) ProtoReflect() protoreflect.Message { // Deprecated: Use ListProductResponse_ListItem.ProtoReflect.Descriptor instead. func (*ListProductResponse_ListItem) Descriptor() ([]byte, []int) { - return file_svc_product_v1_service_proto_rawDescGZIP(), []int{1, 0} + return file_svc_product_v1_service_proto_rawDescGZIP(), []int{3, 0} } func (x *ListProductResponse_ListItem) GetProduct() *v1.Product { @@ -207,7 +303,12 @@ var File_svc_product_v1_service_proto protoreflect.FileDescriptor const file_svc_product_v1_service_proto_rawDesc = "" + "\n" + - "\x1csvc/product/v1/service.proto\x12\x0esvc.product.v1\x1a\x15types/v1/cursor.proto\x1a\x14types/v1/price.proto\x1a\x16types/v1/product.proto\"\xaf\x01\n" + + "\x1csvc/product/v1/service.proto\x12\x0esvc.product.v1\x1a\x15types/v1/cursor.proto\x1a\x14types/v1/price.proto\x1a\x16types/v1/product.proto\"0\n" + + "\x11GetProductRequest\x12\x1b\n" + + "\tstripe_id\x18\x01 \x01(\tR\bstripeId\"j\n" + + "\x12GetProductResponse\x12+\n" + + "\aproduct\x18\x01 \x01(\v2\x11.types.v1.ProductR\aproduct\x12'\n" + + "\x06prices\x18\x02 \x03(\v2\x0f.types.v1.PriceR\x06prices\"\xaf\x01\n" + "\x12ListProductRequest\x12(\n" + "\x06cursor\x18\x01 \x01(\v2\x10.types.v1.CursorR\x06cursor\x12\x14\n" + "\x05limit\x18\x02 \x01(\x05R\x05limit\x12\x1a\n" + @@ -220,8 +321,10 @@ const file_svc_product_v1_service_proto_rawDesc = "" + "\x0fdefault_product\x18\x03 \x01(\v2\x11.types.v1.ProductR\x0edefaultProduct\x1a`\n" + "\bListItem\x12+\n" + "\aproduct\x18\x01 \x01(\v2\x11.types.v1.ProductR\aproduct\x12'\n" + - "\x06prices\x18\x02 \x03(\v2\x0f.types.v1.PriceR\x06prices2h\n" + - "\x0eProductService\x12V\n" + + "\x06prices\x18\x02 \x03(\v2\x0f.types.v1.PriceR\x06prices2\xbd\x01\n" + + "\x0eProductService\x12S\n" + + "\n" + + "GetProduct\x12!.svc.product.v1.GetProductRequest\x1a\".svc.product.v1.GetProductResponse\x12V\n" + "\vListProduct\x12\".svc.product.v1.ListProductRequest\x1a#.svc.product.v1.ListProductResponseB\xb3\x01\n" + "\x12com.svc.product.v1B\fServiceProtoP\x01Z5github.com/humanlogio/api/go/svc/product/v1;productv1\xa2\x02\x03SPX\xaa\x02\x0eSvc.Product.V1\xca\x02\x0eSvc\\Product\\V1\xe2\x02\x1aSvc\\Product\\V1\\GPBMetadata\xea\x02\x10Svc::Product::V1b\x06proto3" @@ -237,31 +340,37 @@ func file_svc_product_v1_service_proto_rawDescGZIP() []byte { return file_svc_product_v1_service_proto_rawDescData } -var file_svc_product_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_svc_product_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_svc_product_v1_service_proto_goTypes = []any{ - (*ListProductRequest)(nil), // 0: svc.product.v1.ListProductRequest - (*ListProductResponse)(nil), // 1: svc.product.v1.ListProductResponse - (*ListProductResponse_ListItem)(nil), // 2: svc.product.v1.ListProductResponse.ListItem - (*v1.Cursor)(nil), // 3: types.v1.Cursor - (v1.Product_Scope)(0), // 4: types.v1.Product.Scope + (*GetProductRequest)(nil), // 0: svc.product.v1.GetProductRequest + (*GetProductResponse)(nil), // 1: svc.product.v1.GetProductResponse + (*ListProductRequest)(nil), // 2: svc.product.v1.ListProductRequest + (*ListProductResponse)(nil), // 3: svc.product.v1.ListProductResponse + (*ListProductResponse_ListItem)(nil), // 4: svc.product.v1.ListProductResponse.ListItem (*v1.Product)(nil), // 5: types.v1.Product (*v1.Price)(nil), // 6: types.v1.Price + (*v1.Cursor)(nil), // 7: types.v1.Cursor + (v1.Product_Scope)(0), // 8: types.v1.Product.Scope } var file_svc_product_v1_service_proto_depIdxs = []int32{ - 3, // 0: svc.product.v1.ListProductRequest.cursor:type_name -> types.v1.Cursor - 4, // 1: svc.product.v1.ListProductRequest.scope:type_name -> types.v1.Product.Scope - 3, // 2: svc.product.v1.ListProductResponse.next:type_name -> types.v1.Cursor - 2, // 3: svc.product.v1.ListProductResponse.items:type_name -> svc.product.v1.ListProductResponse.ListItem - 5, // 4: svc.product.v1.ListProductResponse.default_product:type_name -> types.v1.Product - 5, // 5: svc.product.v1.ListProductResponse.ListItem.product:type_name -> types.v1.Product - 6, // 6: svc.product.v1.ListProductResponse.ListItem.prices:type_name -> types.v1.Price - 0, // 7: svc.product.v1.ProductService.ListProduct:input_type -> svc.product.v1.ListProductRequest - 1, // 8: svc.product.v1.ProductService.ListProduct:output_type -> svc.product.v1.ListProductResponse - 8, // [8:9] is the sub-list for method output_type - 7, // [7:8] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 5, // 0: svc.product.v1.GetProductResponse.product:type_name -> types.v1.Product + 6, // 1: svc.product.v1.GetProductResponse.prices:type_name -> types.v1.Price + 7, // 2: svc.product.v1.ListProductRequest.cursor:type_name -> types.v1.Cursor + 8, // 3: svc.product.v1.ListProductRequest.scope:type_name -> types.v1.Product.Scope + 7, // 4: svc.product.v1.ListProductResponse.next:type_name -> types.v1.Cursor + 4, // 5: svc.product.v1.ListProductResponse.items:type_name -> svc.product.v1.ListProductResponse.ListItem + 5, // 6: svc.product.v1.ListProductResponse.default_product:type_name -> types.v1.Product + 5, // 7: svc.product.v1.ListProductResponse.ListItem.product:type_name -> types.v1.Product + 6, // 8: svc.product.v1.ListProductResponse.ListItem.prices:type_name -> types.v1.Price + 0, // 9: svc.product.v1.ProductService.GetProduct:input_type -> svc.product.v1.GetProductRequest + 2, // 10: svc.product.v1.ProductService.ListProduct:input_type -> svc.product.v1.ListProductRequest + 1, // 11: svc.product.v1.ProductService.GetProduct:output_type -> svc.product.v1.GetProductResponse + 3, // 12: svc.product.v1.ProductService.ListProduct:output_type -> svc.product.v1.ListProductResponse + 11, // [11:13] is the sub-list for method output_type + 9, // [9:11] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_svc_product_v1_service_proto_init() } @@ -269,14 +378,14 @@ func file_svc_product_v1_service_proto_init() { if File_svc_product_v1_service_proto != nil { return } - file_svc_product_v1_service_proto_msgTypes[0].OneofWrappers = []any{} + file_svc_product_v1_service_proto_msgTypes[2].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_svc_product_v1_service_proto_rawDesc), len(file_svc_product_v1_service_proto_rawDesc)), NumEnums: 0, - NumMessages: 3, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/js/svc/product/v1/service-ProductService_connectquery.ts b/js/svc/product/v1/service-ProductService_connectquery.ts index 4715070..684789e 100644 --- a/js/svc/product/v1/service-ProductService_connectquery.ts +++ b/js/svc/product/v1/service-ProductService_connectquery.ts @@ -4,6 +4,11 @@ import { ProductService } from "./service_pb"; +/** + * @generated from rpc svc.product.v1.ProductService.GetProduct + */ +export const getProduct = ProductService.method.getProduct; + /** * @generated from rpc svc.product.v1.ProductService.ListProduct */ diff --git a/js/svc/product/v1/service_pb.ts b/js/svc/product/v1/service_pb.ts index 28ba218..c2c5856 100644 --- a/js/svc/product/v1/service_pb.ts +++ b/js/svc/product/v1/service_pb.ts @@ -16,7 +16,46 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file svc/product/v1/service.proto. */ export const file_svc_product_v1_service: GenFile = /*@__PURE__*/ - fileDesc("ChxzdmMvcHJvZHVjdC92MS9zZXJ2aWNlLnByb3RvEg5zdmMucHJvZHVjdC52MSKPAQoSTGlzdFByb2R1Y3RSZXF1ZXN0EiAKBmN1cnNvchgBIAEoCzIQLnR5cGVzLnYxLkN1cnNvchINCgVsaW1pdBgCIAEoBRIQCghjYXRlZ29yeRgDIAEoCRIsCgVzY29wZRiQAyABKA4yFy50eXBlcy52MS5Qcm9kdWN0LlNjb3BlSACIAQFCCAoGX3Njb3BlIu8BChNMaXN0UHJvZHVjdFJlc3BvbnNlEh4KBG5leHQYASABKAsyEC50eXBlcy52MS5DdXJzb3ISOwoFaXRlbXMYAiADKAsyLC5zdmMucHJvZHVjdC52MS5MaXN0UHJvZHVjdFJlc3BvbnNlLkxpc3RJdGVtEioKD2RlZmF1bHRfcHJvZHVjdBgDIAEoCzIRLnR5cGVzLnYxLlByb2R1Y3QaTwoITGlzdEl0ZW0SIgoHcHJvZHVjdBgBIAEoCzIRLnR5cGVzLnYxLlByb2R1Y3QSHwoGcHJpY2VzGAIgAygLMg8udHlwZXMudjEuUHJpY2UyaAoOUHJvZHVjdFNlcnZpY2USVgoLTGlzdFByb2R1Y3QSIi5zdmMucHJvZHVjdC52MS5MaXN0UHJvZHVjdFJlcXVlc3QaIy5zdmMucHJvZHVjdC52MS5MaXN0UHJvZHVjdFJlc3BvbnNlQrMBChJjb20uc3ZjLnByb2R1Y3QudjFCDFNlcnZpY2VQcm90b1ABWjVnaXRodWIuY29tL2h1bWFubG9naW8vYXBpL2dvL3N2Yy9wcm9kdWN0L3YxO3Byb2R1Y3R2MaICA1NQWKoCDlN2Yy5Qcm9kdWN0LlYxygIOU3ZjXFByb2R1Y3RcVjHiAhpTdmNcUHJvZHVjdFxWMVxHUEJNZXRhZGF0YeoCEFN2Yzo6UHJvZHVjdDo6VjFiBnByb3RvMw", [file_types_v1_cursor, file_types_v1_price, file_types_v1_product]); + fileDesc("ChxzdmMvcHJvZHVjdC92MS9zZXJ2aWNlLnByb3RvEg5zdmMucHJvZHVjdC52MSImChFHZXRQcm9kdWN0UmVxdWVzdBIRCglzdHJpcGVfaWQYASABKAkiWQoSR2V0UHJvZHVjdFJlc3BvbnNlEiIKB3Byb2R1Y3QYASABKAsyES50eXBlcy52MS5Qcm9kdWN0Eh8KBnByaWNlcxgCIAMoCzIPLnR5cGVzLnYxLlByaWNlIo8BChJMaXN0UHJvZHVjdFJlcXVlc3QSIAoGY3Vyc29yGAEgASgLMhAudHlwZXMudjEuQ3Vyc29yEg0KBWxpbWl0GAIgASgFEhAKCGNhdGVnb3J5GAMgASgJEiwKBXNjb3BlGJADIAEoDjIXLnR5cGVzLnYxLlByb2R1Y3QuU2NvcGVIAIgBAUIICgZfc2NvcGUi7wEKE0xpc3RQcm9kdWN0UmVzcG9uc2USHgoEbmV4dBgBIAEoCzIQLnR5cGVzLnYxLkN1cnNvchI7CgVpdGVtcxgCIAMoCzIsLnN2Yy5wcm9kdWN0LnYxLkxpc3RQcm9kdWN0UmVzcG9uc2UuTGlzdEl0ZW0SKgoPZGVmYXVsdF9wcm9kdWN0GAMgASgLMhEudHlwZXMudjEuUHJvZHVjdBpPCghMaXN0SXRlbRIiCgdwcm9kdWN0GAEgASgLMhEudHlwZXMudjEuUHJvZHVjdBIfCgZwcmljZXMYAiADKAsyDy50eXBlcy52MS5QcmljZTK9AQoOUHJvZHVjdFNlcnZpY2USUwoKR2V0UHJvZHVjdBIhLnN2Yy5wcm9kdWN0LnYxLkdldFByb2R1Y3RSZXF1ZXN0GiIuc3ZjLnByb2R1Y3QudjEuR2V0UHJvZHVjdFJlc3BvbnNlElYKC0xpc3RQcm9kdWN0EiIuc3ZjLnByb2R1Y3QudjEuTGlzdFByb2R1Y3RSZXF1ZXN0GiMuc3ZjLnByb2R1Y3QudjEuTGlzdFByb2R1Y3RSZXNwb25zZUKzAQoSY29tLnN2Yy5wcm9kdWN0LnYxQgxTZXJ2aWNlUHJvdG9QAVo1Z2l0aHViLmNvbS9odW1hbmxvZ2lvL2FwaS9nby9zdmMvcHJvZHVjdC92MTtwcm9kdWN0djGiAgNTUFiqAg5TdmMuUHJvZHVjdC5WMcoCDlN2Y1xQcm9kdWN0XFYx4gIaU3ZjXFByb2R1Y3RcVjFcR1BCTWV0YWRhdGHqAhBTdmM6OlByb2R1Y3Q6OlYxYgZwcm90bzM", [file_types_v1_cursor, file_types_v1_price, file_types_v1_product]); + +/** + * @generated from message svc.product.v1.GetProductRequest + */ +export type GetProductRequest = Message<"svc.product.v1.GetProductRequest"> & { + /** + * @generated from field: string stripe_id = 1; + */ + stripeId: string; +}; + +/** + * Describes the message svc.product.v1.GetProductRequest. + * Use `create(GetProductRequestSchema)` to create a new message. + */ +export const GetProductRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_svc_product_v1_service, 0); + +/** + * @generated from message svc.product.v1.GetProductResponse + */ +export type GetProductResponse = Message<"svc.product.v1.GetProductResponse"> & { + /** + * @generated from field: types.v1.Product product = 1; + */ + product?: Product; + + /** + * @generated from field: repeated types.v1.Price prices = 2; + */ + prices: Price[]; +}; + +/** + * Describes the message svc.product.v1.GetProductResponse. + * Use `create(GetProductResponseSchema)` to create a new message. + */ +export const GetProductResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_svc_product_v1_service, 1); /** * @generated from message svc.product.v1.ListProductRequest @@ -50,7 +89,7 @@ export type ListProductRequest = Message<"svc.product.v1.ListProductRequest"> & * Use `create(ListProductRequestSchema)` to create a new message. */ export const ListProductRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_svc_product_v1_service, 0); + messageDesc(file_svc_product_v1_service, 2); /** * @generated from message svc.product.v1.ListProductResponse @@ -77,7 +116,7 @@ export type ListProductResponse = Message<"svc.product.v1.ListProductResponse"> * Use `create(ListProductResponseSchema)` to create a new message. */ export const ListProductResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_svc_product_v1_service, 1); + messageDesc(file_svc_product_v1_service, 3); /** * @generated from message svc.product.v1.ListProductResponse.ListItem @@ -99,12 +138,20 @@ export type ListProductResponse_ListItem = Message<"svc.product.v1.ListProductRe * Use `create(ListProductResponse_ListItemSchema)` to create a new message. */ export const ListProductResponse_ListItemSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_svc_product_v1_service, 1, 0); + messageDesc(file_svc_product_v1_service, 3, 0); /** * @generated from service svc.product.v1.ProductService */ export const ProductService: GenService<{ + /** + * @generated from rpc svc.product.v1.ProductService.GetProduct + */ + getProduct: { + methodKind: "unary"; + input: typeof GetProductRequestSchema; + output: typeof GetProductResponseSchema; + }, /** * @generated from rpc svc.product.v1.ProductService.ListProduct */ diff --git a/proto/svc/product/v1/service.proto b/proto/svc/product/v1/service.proto index 496edb7..09e6d30 100644 --- a/proto/svc/product/v1/service.proto +++ b/proto/svc/product/v1/service.proto @@ -9,9 +9,19 @@ import "types/v1/product.proto"; option go_package = "svc/product/v1;productv1"; service ProductService { + rpc GetProduct(GetProductRequest) returns (GetProductResponse); rpc ListProduct(ListProductRequest) returns (ListProductResponse); } +message GetProductRequest { + string stripe_id = 1; +} + +message GetProductResponse { + types.v1.Product product = 1; + repeated types.v1.Price prices = 2; +} + message ListProductRequest { types.v1.Cursor cursor = 1; int32 limit = 2;