diff --git a/docs/docs.json b/docs/docs.json index 34dc3e6d..8b09a978 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -7110,6 +7110,29 @@ "hasMessages": true, "hasServices": true, "enums": [ + { + "name": "ProductTier", + "longName": "ProductTier", + "fullName": "api.v1.ProductTier", + "description": "ProductTier is an explicit indicator for the state in which the customer is using the products.", + "values": [ + { + "name": "PRODUCT_TIER_UNSPECIFIED", + "number": "0", + "description": "PRODUCT_TIER_UNSPECIFIED is unspecified" + }, + { + "name": "PRODUCT_TIER_TRIAL", + "number": "1", + "description": "PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information." + }, + { + "name": "PRODUCT_TIER_PAID", + "number": "2", + "description": "PRODUCT_TIER_PAID indicates a customer that has provided payment information." + } + ] + }, { "name": "ProductType", "longName": "ProductType", @@ -7622,14 +7645,26 @@ "isoneof": true, "oneofdecl": "_balance", "defaultValue": "" + }, + { + "name": "tier", + "description": "Tier describes the state in which the customer is using the products.", + "label": "", + "type": "ProductTier", + "longType": "ProductTier", + "fullType": "api.v1.ProductTier", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" } ] }, { - "name": "PaymentServiceCreateOrUpdateCustomerRequest", - "longName": "PaymentServiceCreateOrUpdateCustomerRequest", - "fullName": "api.v1.PaymentServiceCreateOrUpdateCustomerRequest", - "description": "PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request", + "name": "PaymentServiceCreateRequest", + "longName": "PaymentServiceCreateRequest", + "fullName": "api.v1.PaymentServiceCreateRequest", + "description": "PaymentServiceCreateRequest is the request payload for providing payment data", "hasExtensions": false, "hasFields": true, "hasOneofs": true, @@ -7637,7 +7672,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -7650,49 +7685,37 @@ { "name": "name", "description": "Name of the customer to be billed", - "label": "optional", + "label": "", "type": "string", "longType": "string", "fullType": "string", "ismap": false, - "isoneof": true, - "oneofdecl": "_name", + "isoneof": false, + "oneofdecl": "", "defaultValue": "" }, { "name": "payment_method_id", "description": "PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api", - "label": "optional", + "label": "", "type": "string", "longType": "string", "fullType": "string", "ismap": false, - "isoneof": true, - "oneofdecl": "_payment_method_id", + "isoneof": false, + "oneofdecl": "", "defaultValue": "" }, { "name": "email", "description": "Email of the customer to be billed", - "label": "optional", + "label": "", "type": "string", "longType": "string", "fullType": "string", "ismap": false, - "isoneof": true, - "oneofdecl": "_email", - "defaultValue": "" - }, - { - "name": "card", - "description": "Card the customer to be billed", - "label": "optional", - "type": "Card", - "longType": "Card", - "fullType": "api.v1.Card", - "ismap": false, - "isoneof": true, - "oneofdecl": "_card", + "isoneof": false, + "oneofdecl": "", "defaultValue": "" }, { @@ -7710,13 +7733,13 @@ { "name": "vat", "description": "Vat which applies to the customer to be billed", - "label": "optional", + "label": "", "type": "string", "longType": "string", "fullType": "string", "ismap": false, - "isoneof": true, - "oneofdecl": "_vat", + "isoneof": false, + "oneofdecl": "", "defaultValue": "" }, { @@ -7734,10 +7757,10 @@ ] }, { - "name": "PaymentServiceCreateOrUpdateCustomerResponse", - "longName": "PaymentServiceCreateOrUpdateCustomerResponse", - "fullName": "api.v1.PaymentServiceCreateOrUpdateCustomerResponse", - "description": "PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request", + "name": "PaymentServiceCreateResponse", + "longName": "PaymentServiceCreateResponse", + "fullName": "api.v1.PaymentServiceCreateResponse", + "description": "PaymentServiceCreateResponse is the response payload for a payment create request", "hasExtensions": false, "hasFields": true, "hasOneofs": false, @@ -7745,7 +7768,7 @@ "fields": [ { "name": "customer", - "description": "Customer is the customer", + "description": "Customer is the created customer", "label": "", "type": "PaymentCustomer", "longType": "PaymentCustomer", @@ -7758,10 +7781,10 @@ ] }, { - "name": "PaymentServiceDeletePaymentMethodRequest", - "longName": "PaymentServiceDeletePaymentMethodRequest", - "fullName": "api.v1.PaymentServiceDeletePaymentMethodRequest", - "description": "PaymentServiceDeletePaymentMethodRequest is the request payload for a delete payment request", + "name": "PaymentServiceDeleteRequest", + "longName": "PaymentServiceDeleteRequest", + "fullName": "api.v1.PaymentServiceDeleteRequest", + "description": "PaymentServiceDeleteRequest is the request payload for a delete payment request", "hasExtensions": false, "hasFields": true, "hasOneofs": false, @@ -7769,7 +7792,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -7782,76 +7805,16 @@ ] }, { - "name": "PaymentServiceDeletePaymentMethodResponse", - "longName": "PaymentServiceDeletePaymentMethodResponse", - "fullName": "api.v1.PaymentServiceDeletePaymentMethodResponse", - "description": "PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request", + "name": "PaymentServiceDeleteResponse", + "longName": "PaymentServiceDeleteResponse", + "fullName": "api.v1.PaymentServiceDeleteResponse", + "description": "PaymentServiceDeleteResponse is the response payload for a delete payment request", "hasExtensions": false, "hasFields": false, "hasOneofs": false, "extensions": [], "fields": [] }, - { - "name": "PaymentServiceGetCustomerRequest", - "longName": "PaymentServiceGetCustomerRequest", - "fullName": "api.v1.PaymentServiceGetCustomerRequest", - "description": "PaymentServiceGetCustomerRequest is the request payload for a payment get customer request", - "hasExtensions": false, - "hasFields": true, - "hasOneofs": false, - "extensions": [], - "fields": [ - { - "name": "login", - "description": "Login of the customer", - "label": "", - "type": "string", - "longType": "string", - "fullType": "string", - "ismap": false, - "isoneof": false, - "oneofdecl": "", - "defaultValue": "" - }, - { - "name": "customer_id", - "description": "CustomerId of the customer", - "label": "", - "type": "string", - "longType": "string", - "fullType": "string", - "ismap": false, - "isoneof": false, - "oneofdecl": "", - "defaultValue": "" - } - ] - }, - { - "name": "PaymentServiceGetCustomerResponse", - "longName": "PaymentServiceGetCustomerResponse", - "fullName": "api.v1.PaymentServiceGetCustomerResponse", - "description": "PaymentServiceGetCustomerResponse is the response payload for a payment get customer request", - "hasExtensions": false, - "hasFields": true, - "hasOneofs": false, - "extensions": [], - "fields": [ - { - "name": "customer", - "description": "Customer is the customer", - "label": "", - "type": "PaymentCustomer", - "longType": "PaymentCustomer", - "fullType": "api.v1.PaymentCustomer", - "ismap": false, - "isoneof": false, - "oneofdecl": "", - "defaultValue": "" - } - ] - }, { "name": "PaymentServiceGetDefaultPricesRequest", "longName": "PaymentServiceGetDefaultPricesRequest", @@ -7899,7 +7862,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -7947,6 +7910,54 @@ } ] }, + { + "name": "PaymentServiceGetRequest", + "longName": "PaymentServiceGetRequest", + "fullName": "api.v1.PaymentServiceGetRequest", + "description": "PaymentServiceGetRequest is the request payload for getting the payment data", + "hasExtensions": false, + "hasFields": true, + "hasOneofs": false, + "extensions": [], + "fields": [ + { + "name": "login", + "description": "Login of the tenant", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + } + ] + }, + { + "name": "PaymentServiceGetResponse", + "longName": "PaymentServiceGetResponse", + "fullName": "api.v1.PaymentServiceGetResponse", + "description": "PaymentServiceGetResponse is the response payload for a payment get request", + "hasExtensions": false, + "hasFields": true, + "hasOneofs": false, + "extensions": [], + "fields": [ + { + "name": "customer", + "description": "Customer is the payment customer", + "label": "", + "type": "PaymentCustomer", + "longType": "PaymentCustomer", + "fullType": "api.v1.PaymentCustomer", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + } + ] + }, { "name": "PaymentServiceGetSubscriptionDiscountsRequest", "longName": "PaymentServiceGetSubscriptionDiscountsRequest", @@ -8007,7 +8018,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -8055,7 +8066,7 @@ "fields": [ { "name": "login", - "description": "Login of the customer", + "description": "Login of the tenant", "label": "", "type": "string", "longType": "string", @@ -8103,6 +8114,126 @@ } ] }, + { + "name": "PaymentServiceUpdateRequest", + "longName": "PaymentServiceUpdateRequest", + "fullName": "api.v1.PaymentServiceUpdateRequest", + "description": "PaymentServiceUpdateRequest is the request payload for updating payment data", + "hasExtensions": false, + "hasFields": true, + "hasOneofs": true, + "extensions": [], + "fields": [ + { + "name": "login", + "description": "Login of the tenant", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + }, + { + "name": "name", + "description": "Name of the customer to be billed", + "label": "optional", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": true, + "oneofdecl": "_name", + "defaultValue": "" + }, + { + "name": "payment_method_id", + "description": "PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api", + "label": "optional", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": true, + "oneofdecl": "_payment_method_id", + "defaultValue": "" + }, + { + "name": "email", + "description": "Email of the customer to be billed", + "label": "optional", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": true, + "oneofdecl": "_email", + "defaultValue": "" + }, + { + "name": "address", + "description": "Address is the postal address of the customer to be billed", + "label": "", + "type": "Address", + "longType": "Address", + "fullType": "api.v1.Address", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + }, + { + "name": "vat", + "description": "Vat which applies to the customer to be billed", + "label": "optional", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": true, + "oneofdecl": "_vat", + "defaultValue": "" + }, + { + "name": "phone_number", + "description": "PhoneNumber of the customer to be billed", + "label": "optional", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": true, + "oneofdecl": "_phone_number", + "defaultValue": "" + } + ] + }, + { + "name": "PaymentServiceUpdateResponse", + "longName": "PaymentServiceUpdateResponse", + "fullName": "api.v1.PaymentServiceUpdateResponse", + "description": "PaymentServiceUpdateResponse is the response payload for a payment update request", + "hasExtensions": false, + "hasFields": true, + "hasOneofs": false, + "extensions": [], + "fields": [ + { + "name": "customer", + "description": "Customer is the updated customer", + "label": "", + "type": "PaymentCustomer", + "longType": "PaymentCustomer", + "fullType": "api.v1.PaymentCustomer", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + } + ] + }, { "name": "Price", "longName": "Price", @@ -8304,27 +8435,51 @@ "description": "PaymentService serves payment related functions", "methods": [ { - "name": "CreateOrUpdateCustomer", - "description": "CreateOrUpdateCustomer the payment data on the payment processor", - "requestType": "PaymentServiceCreateOrUpdateCustomerRequest", - "requestLongType": "PaymentServiceCreateOrUpdateCustomerRequest", - "requestFullType": "api.v1.PaymentServiceCreateOrUpdateCustomerRequest", + "name": "Create", + "description": "Create the payment data used for billing api resources", + "requestType": "PaymentServiceCreateRequest", + "requestLongType": "PaymentServiceCreateRequest", + "requestFullType": "api.v1.PaymentServiceCreateRequest", "requestStreaming": false, - "responseType": "PaymentServiceCreateOrUpdateCustomerResponse", - "responseLongType": "PaymentServiceCreateOrUpdateCustomerResponse", - "responseFullType": "api.v1.PaymentServiceCreateOrUpdateCustomerResponse", + "responseType": "PaymentServiceCreateResponse", + "responseLongType": "PaymentServiceCreateResponse", + "responseFullType": "api.v1.PaymentServiceCreateResponse", "responseStreaming": false }, { - "name": "GetCustomer", - "description": "GetCustomer from the payment processor", - "requestType": "PaymentServiceGetCustomerRequest", - "requestLongType": "PaymentServiceGetCustomerRequest", - "requestFullType": "api.v1.PaymentServiceGetCustomerRequest", + "name": "Update", + "description": "Update the payment data", + "requestType": "PaymentServiceUpdateRequest", + "requestLongType": "PaymentServiceUpdateRequest", + "requestFullType": "api.v1.PaymentServiceUpdateRequest", "requestStreaming": false, - "responseType": "PaymentServiceGetCustomerResponse", - "responseLongType": "PaymentServiceGetCustomerResponse", - "responseFullType": "api.v1.PaymentServiceGetCustomerResponse", + "responseType": "PaymentServiceUpdateResponse", + "responseLongType": "PaymentServiceUpdateResponse", + "responseFullType": "api.v1.PaymentServiceUpdateResponse", + "responseStreaming": false + }, + { + "name": "Delete", + "description": "Delete the payment data", + "requestType": "PaymentServiceDeleteRequest", + "requestLongType": "PaymentServiceDeleteRequest", + "requestFullType": "api.v1.PaymentServiceDeleteRequest", + "requestStreaming": false, + "responseType": "PaymentServiceDeleteResponse", + "responseLongType": "PaymentServiceDeleteResponse", + "responseFullType": "api.v1.PaymentServiceDeleteResponse", + "responseStreaming": false + }, + { + "name": "Get", + "description": "Get the payment data", + "requestType": "PaymentServiceGetRequest", + "requestLongType": "PaymentServiceGetRequest", + "requestFullType": "api.v1.PaymentServiceGetRequest", + "requestStreaming": false, + "responseType": "PaymentServiceGetResponse", + "responseLongType": "PaymentServiceGetResponse", + "responseFullType": "api.v1.PaymentServiceGetResponse", "responseStreaming": false }, { @@ -8339,18 +8494,6 @@ "responseFullType": "api.v1.PaymentServiceHasPaymentMethodResponse", "responseStreaming": false }, - { - "name": "DeletePaymentMethod", - "description": "DeletePaymentMethod of the customer", - "requestType": "PaymentServiceDeletePaymentMethodRequest", - "requestLongType": "PaymentServiceDeletePaymentMethodRequest", - "requestFullType": "api.v1.PaymentServiceDeletePaymentMethodRequest", - "requestStreaming": false, - "responseType": "PaymentServiceDeletePaymentMethodResponse", - "responseLongType": "PaymentServiceDeletePaymentMethodResponse", - "responseFullType": "api.v1.PaymentServiceDeletePaymentMethodResponse", - "responseStreaming": false - }, { "name": "GetSubscriptionUsage", "description": "GetSubscriptionUsage of the customer", diff --git a/go/api/v1/apiv1connect/payment.connect.go b/go/api/v1/apiv1connect/payment.connect.go index f870b4db..447ced2e 100644 --- a/go/api/v1/apiv1connect/payment.connect.go +++ b/go/api/v1/apiv1connect/payment.connect.go @@ -33,18 +33,17 @@ const ( // reflection-formatted method names, remove the leading slash and convert the remaining slash to a // period. const ( - // PaymentServiceCreateOrUpdateCustomerProcedure is the fully-qualified name of the PaymentService's - // CreateOrUpdateCustomer RPC. - PaymentServiceCreateOrUpdateCustomerProcedure = "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/api.v1.PaymentService/CreateOrUpdateCustomer" - // PaymentServiceGetCustomerProcedure is the fully-qualified name of the PaymentService's - // GetCustomer RPC. - PaymentServiceGetCustomerProcedure = "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/api.v1.PaymentService/GetCustomer" + // PaymentServiceCreateProcedure is the fully-qualified name of the PaymentService's Create RPC. + PaymentServiceCreateProcedure = "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/api.v1.PaymentService/Create" + // PaymentServiceUpdateProcedure is the fully-qualified name of the PaymentService's Update RPC. + PaymentServiceUpdateProcedure = "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/api.v1.PaymentService/Update" + // PaymentServiceDeleteProcedure is the fully-qualified name of the PaymentService's Delete RPC. + PaymentServiceDeleteProcedure = "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/api.v1.PaymentService/Delete" + // PaymentServiceGetProcedure is the fully-qualified name of the PaymentService's Get RPC. + PaymentServiceGetProcedure = "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/api.v1.PaymentService/Get" // PaymentServiceHasPaymentMethodProcedure is the fully-qualified name of the PaymentService's // HasPaymentMethod RPC. PaymentServiceHasPaymentMethodProcedure = "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/api.v1.PaymentService/HasPaymentMethod" - // PaymentServiceDeletePaymentMethodProcedure is the fully-qualified name of the PaymentService's - // DeletePaymentMethod RPC. - PaymentServiceDeletePaymentMethodProcedure = "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/api.v1.PaymentService/DeletePaymentMethod" // PaymentServiceGetSubscriptionUsageProcedure is the fully-qualified name of the PaymentService's // GetSubscriptionUsage RPC. PaymentServiceGetSubscriptionUsageProcedure = "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/api.v1.PaymentService/GetSubscriptionUsage" @@ -61,14 +60,16 @@ const ( // PaymentServiceClient is a client for the api.v1.PaymentService service. type PaymentServiceClient interface { - // CreateOrUpdateCustomer the payment data on the payment processor - CreateOrUpdateCustomer(context.Context, *connect.Request[v1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[v1.PaymentServiceCreateOrUpdateCustomerResponse], error) - // GetCustomer from the payment processor - GetCustomer(context.Context, *connect.Request[v1.PaymentServiceGetCustomerRequest]) (*connect.Response[v1.PaymentServiceGetCustomerResponse], error) + // Create the payment data used for billing api resources + Create(context.Context, *connect.Request[v1.PaymentServiceCreateRequest]) (*connect.Response[v1.PaymentServiceCreateResponse], error) + // Update the payment data + Update(context.Context, *connect.Request[v1.PaymentServiceUpdateRequest]) (*connect.Response[v1.PaymentServiceUpdateResponse], error) + // Delete the payment data + Delete(context.Context, *connect.Request[v1.PaymentServiceDeleteRequest]) (*connect.Response[v1.PaymentServiceDeleteResponse], error) + // Get the payment data + Get(context.Context, *connect.Request[v1.PaymentServiceGetRequest]) (*connect.Response[v1.PaymentServiceGetResponse], error) // HasPaymentMethod check if the customer has a payment method provided HasPaymentMethod(context.Context, *connect.Request[v1.PaymentServiceHasPaymentMethodRequest]) (*connect.Response[v1.PaymentServiceHasPaymentMethodResponse], error) - // DeletePaymentMethod of the customer - DeletePaymentMethod(context.Context, *connect.Request[v1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[v1.PaymentServiceDeletePaymentMethodResponse], error) // GetSubscriptionUsage of the customer GetSubscriptionUsage(context.Context, *connect.Request[v1.PaymentServiceGetSubscriptionUsageRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionUsageResponse], error) // GetInvoices of the customer @@ -90,28 +91,34 @@ func NewPaymentServiceClient(httpClient connect.HTTPClient, baseURL string, opts baseURL = strings.TrimRight(baseURL, "/") paymentServiceMethods := v1.File_api_v1_payment_proto.Services().ByName("PaymentService").Methods() return &paymentServiceClient{ - createOrUpdateCustomer: connect.NewClient[v1.PaymentServiceCreateOrUpdateCustomerRequest, v1.PaymentServiceCreateOrUpdateCustomerResponse]( + create: connect.NewClient[v1.PaymentServiceCreateRequest, v1.PaymentServiceCreateResponse]( httpClient, - baseURL+PaymentServiceCreateOrUpdateCustomerProcedure, - connect.WithSchema(paymentServiceMethods.ByName("CreateOrUpdateCustomer")), + baseURL+PaymentServiceCreateProcedure, + connect.WithSchema(paymentServiceMethods.ByName("Create")), connect.WithClientOptions(opts...), ), - getCustomer: connect.NewClient[v1.PaymentServiceGetCustomerRequest, v1.PaymentServiceGetCustomerResponse]( + update: connect.NewClient[v1.PaymentServiceUpdateRequest, v1.PaymentServiceUpdateResponse]( httpClient, - baseURL+PaymentServiceGetCustomerProcedure, - connect.WithSchema(paymentServiceMethods.ByName("GetCustomer")), + baseURL+PaymentServiceUpdateProcedure, + connect.WithSchema(paymentServiceMethods.ByName("Update")), connect.WithClientOptions(opts...), ), - hasPaymentMethod: connect.NewClient[v1.PaymentServiceHasPaymentMethodRequest, v1.PaymentServiceHasPaymentMethodResponse]( + delete: connect.NewClient[v1.PaymentServiceDeleteRequest, v1.PaymentServiceDeleteResponse]( httpClient, - baseURL+PaymentServiceHasPaymentMethodProcedure, - connect.WithSchema(paymentServiceMethods.ByName("HasPaymentMethod")), + baseURL+PaymentServiceDeleteProcedure, + connect.WithSchema(paymentServiceMethods.ByName("Delete")), connect.WithClientOptions(opts...), ), - deletePaymentMethod: connect.NewClient[v1.PaymentServiceDeletePaymentMethodRequest, v1.PaymentServiceDeletePaymentMethodResponse]( + get: connect.NewClient[v1.PaymentServiceGetRequest, v1.PaymentServiceGetResponse]( + httpClient, + baseURL+PaymentServiceGetProcedure, + connect.WithSchema(paymentServiceMethods.ByName("Get")), + connect.WithClientOptions(opts...), + ), + hasPaymentMethod: connect.NewClient[v1.PaymentServiceHasPaymentMethodRequest, v1.PaymentServiceHasPaymentMethodResponse]( httpClient, - baseURL+PaymentServiceDeletePaymentMethodProcedure, - connect.WithSchema(paymentServiceMethods.ByName("DeletePaymentMethod")), + baseURL+PaymentServiceHasPaymentMethodProcedure, + connect.WithSchema(paymentServiceMethods.ByName("HasPaymentMethod")), connect.WithClientOptions(opts...), ), getSubscriptionUsage: connect.NewClient[v1.PaymentServiceGetSubscriptionUsageRequest, v1.PaymentServiceGetSubscriptionUsageResponse]( @@ -143,24 +150,35 @@ func NewPaymentServiceClient(httpClient connect.HTTPClient, baseURL string, opts // paymentServiceClient implements PaymentServiceClient. type paymentServiceClient struct { - createOrUpdateCustomer *connect.Client[v1.PaymentServiceCreateOrUpdateCustomerRequest, v1.PaymentServiceCreateOrUpdateCustomerResponse] - getCustomer *connect.Client[v1.PaymentServiceGetCustomerRequest, v1.PaymentServiceGetCustomerResponse] + create *connect.Client[v1.PaymentServiceCreateRequest, v1.PaymentServiceCreateResponse] + update *connect.Client[v1.PaymentServiceUpdateRequest, v1.PaymentServiceUpdateResponse] + delete *connect.Client[v1.PaymentServiceDeleteRequest, v1.PaymentServiceDeleteResponse] + get *connect.Client[v1.PaymentServiceGetRequest, v1.PaymentServiceGetResponse] hasPaymentMethod *connect.Client[v1.PaymentServiceHasPaymentMethodRequest, v1.PaymentServiceHasPaymentMethodResponse] - deletePaymentMethod *connect.Client[v1.PaymentServiceDeletePaymentMethodRequest, v1.PaymentServiceDeletePaymentMethodResponse] getSubscriptionUsage *connect.Client[v1.PaymentServiceGetSubscriptionUsageRequest, v1.PaymentServiceGetSubscriptionUsageResponse] getInvoices *connect.Client[v1.PaymentServiceGetInvoicesRequest, v1.PaymentServiceGetInvoicesResponse] getDefaultPrices *connect.Client[v1.PaymentServiceGetDefaultPricesRequest, v1.PaymentServiceGetDefaultPricesResponse] getSubscriptionDiscounts *connect.Client[v1.PaymentServiceGetSubscriptionDiscountsRequest, v1.PaymentServiceGetSubscriptionDiscountsResponse] } -// CreateOrUpdateCustomer calls api.v1.PaymentService.CreateOrUpdateCustomer. -func (c *paymentServiceClient) CreateOrUpdateCustomer(ctx context.Context, req *connect.Request[v1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[v1.PaymentServiceCreateOrUpdateCustomerResponse], error) { - return c.createOrUpdateCustomer.CallUnary(ctx, req) +// Create calls api.v1.PaymentService.Create. +func (c *paymentServiceClient) Create(ctx context.Context, req *connect.Request[v1.PaymentServiceCreateRequest]) (*connect.Response[v1.PaymentServiceCreateResponse], error) { + return c.create.CallUnary(ctx, req) +} + +// Update calls api.v1.PaymentService.Update. +func (c *paymentServiceClient) Update(ctx context.Context, req *connect.Request[v1.PaymentServiceUpdateRequest]) (*connect.Response[v1.PaymentServiceUpdateResponse], error) { + return c.update.CallUnary(ctx, req) } -// GetCustomer calls api.v1.PaymentService.GetCustomer. -func (c *paymentServiceClient) GetCustomer(ctx context.Context, req *connect.Request[v1.PaymentServiceGetCustomerRequest]) (*connect.Response[v1.PaymentServiceGetCustomerResponse], error) { - return c.getCustomer.CallUnary(ctx, req) +// Delete calls api.v1.PaymentService.Delete. +func (c *paymentServiceClient) Delete(ctx context.Context, req *connect.Request[v1.PaymentServiceDeleteRequest]) (*connect.Response[v1.PaymentServiceDeleteResponse], error) { + return c.delete.CallUnary(ctx, req) +} + +// Get calls api.v1.PaymentService.Get. +func (c *paymentServiceClient) Get(ctx context.Context, req *connect.Request[v1.PaymentServiceGetRequest]) (*connect.Response[v1.PaymentServiceGetResponse], error) { + return c.get.CallUnary(ctx, req) } // HasPaymentMethod calls api.v1.PaymentService.HasPaymentMethod. @@ -168,11 +186,6 @@ func (c *paymentServiceClient) HasPaymentMethod(ctx context.Context, req *connec return c.hasPaymentMethod.CallUnary(ctx, req) } -// DeletePaymentMethod calls api.v1.PaymentService.DeletePaymentMethod. -func (c *paymentServiceClient) DeletePaymentMethod(ctx context.Context, req *connect.Request[v1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[v1.PaymentServiceDeletePaymentMethodResponse], error) { - return c.deletePaymentMethod.CallUnary(ctx, req) -} - // GetSubscriptionUsage calls api.v1.PaymentService.GetSubscriptionUsage. func (c *paymentServiceClient) GetSubscriptionUsage(ctx context.Context, req *connect.Request[v1.PaymentServiceGetSubscriptionUsageRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionUsageResponse], error) { return c.getSubscriptionUsage.CallUnary(ctx, req) @@ -195,14 +208,16 @@ func (c *paymentServiceClient) GetSubscriptionDiscounts(ctx context.Context, req // PaymentServiceHandler is an implementation of the api.v1.PaymentService service. type PaymentServiceHandler interface { - // CreateOrUpdateCustomer the payment data on the payment processor - CreateOrUpdateCustomer(context.Context, *connect.Request[v1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[v1.PaymentServiceCreateOrUpdateCustomerResponse], error) - // GetCustomer from the payment processor - GetCustomer(context.Context, *connect.Request[v1.PaymentServiceGetCustomerRequest]) (*connect.Response[v1.PaymentServiceGetCustomerResponse], error) + // Create the payment data used for billing api resources + Create(context.Context, *connect.Request[v1.PaymentServiceCreateRequest]) (*connect.Response[v1.PaymentServiceCreateResponse], error) + // Update the payment data + Update(context.Context, *connect.Request[v1.PaymentServiceUpdateRequest]) (*connect.Response[v1.PaymentServiceUpdateResponse], error) + // Delete the payment data + Delete(context.Context, *connect.Request[v1.PaymentServiceDeleteRequest]) (*connect.Response[v1.PaymentServiceDeleteResponse], error) + // Get the payment data + Get(context.Context, *connect.Request[v1.PaymentServiceGetRequest]) (*connect.Response[v1.PaymentServiceGetResponse], error) // HasPaymentMethod check if the customer has a payment method provided HasPaymentMethod(context.Context, *connect.Request[v1.PaymentServiceHasPaymentMethodRequest]) (*connect.Response[v1.PaymentServiceHasPaymentMethodResponse], error) - // DeletePaymentMethod of the customer - DeletePaymentMethod(context.Context, *connect.Request[v1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[v1.PaymentServiceDeletePaymentMethodResponse], error) // GetSubscriptionUsage of the customer GetSubscriptionUsage(context.Context, *connect.Request[v1.PaymentServiceGetSubscriptionUsageRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionUsageResponse], error) // GetInvoices of the customer @@ -220,16 +235,28 @@ type PaymentServiceHandler interface { // and JSON codecs. They also support gzip compression. func NewPaymentServiceHandler(svc PaymentServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { paymentServiceMethods := v1.File_api_v1_payment_proto.Services().ByName("PaymentService").Methods() - paymentServiceCreateOrUpdateCustomerHandler := connect.NewUnaryHandler( - PaymentServiceCreateOrUpdateCustomerProcedure, - svc.CreateOrUpdateCustomer, - connect.WithSchema(paymentServiceMethods.ByName("CreateOrUpdateCustomer")), + paymentServiceCreateHandler := connect.NewUnaryHandler( + PaymentServiceCreateProcedure, + svc.Create, + connect.WithSchema(paymentServiceMethods.ByName("Create")), + connect.WithHandlerOptions(opts...), + ) + paymentServiceUpdateHandler := connect.NewUnaryHandler( + PaymentServiceUpdateProcedure, + svc.Update, + connect.WithSchema(paymentServiceMethods.ByName("Update")), connect.WithHandlerOptions(opts...), ) - paymentServiceGetCustomerHandler := connect.NewUnaryHandler( - PaymentServiceGetCustomerProcedure, - svc.GetCustomer, - connect.WithSchema(paymentServiceMethods.ByName("GetCustomer")), + paymentServiceDeleteHandler := connect.NewUnaryHandler( + PaymentServiceDeleteProcedure, + svc.Delete, + connect.WithSchema(paymentServiceMethods.ByName("Delete")), + connect.WithHandlerOptions(opts...), + ) + paymentServiceGetHandler := connect.NewUnaryHandler( + PaymentServiceGetProcedure, + svc.Get, + connect.WithSchema(paymentServiceMethods.ByName("Get")), connect.WithHandlerOptions(opts...), ) paymentServiceHasPaymentMethodHandler := connect.NewUnaryHandler( @@ -238,12 +265,6 @@ func NewPaymentServiceHandler(svc PaymentServiceHandler, opts ...connect.Handler connect.WithSchema(paymentServiceMethods.ByName("HasPaymentMethod")), connect.WithHandlerOptions(opts...), ) - paymentServiceDeletePaymentMethodHandler := connect.NewUnaryHandler( - PaymentServiceDeletePaymentMethodProcedure, - svc.DeletePaymentMethod, - connect.WithSchema(paymentServiceMethods.ByName("DeletePaymentMethod")), - connect.WithHandlerOptions(opts...), - ) paymentServiceGetSubscriptionUsageHandler := connect.NewUnaryHandler( PaymentServiceGetSubscriptionUsageProcedure, svc.GetSubscriptionUsage, @@ -270,14 +291,16 @@ func NewPaymentServiceHandler(svc PaymentServiceHandler, opts ...connect.Handler ) return "/api.v1.PaymentService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { - case PaymentServiceCreateOrUpdateCustomerProcedure: - paymentServiceCreateOrUpdateCustomerHandler.ServeHTTP(w, r) - case PaymentServiceGetCustomerProcedure: - paymentServiceGetCustomerHandler.ServeHTTP(w, r) + case PaymentServiceCreateProcedure: + paymentServiceCreateHandler.ServeHTTP(w, r) + case PaymentServiceUpdateProcedure: + paymentServiceUpdateHandler.ServeHTTP(w, r) + case PaymentServiceDeleteProcedure: + paymentServiceDeleteHandler.ServeHTTP(w, r) + case PaymentServiceGetProcedure: + paymentServiceGetHandler.ServeHTTP(w, r) case PaymentServiceHasPaymentMethodProcedure: paymentServiceHasPaymentMethodHandler.ServeHTTP(w, r) - case PaymentServiceDeletePaymentMethodProcedure: - paymentServiceDeletePaymentMethodHandler.ServeHTTP(w, r) case PaymentServiceGetSubscriptionUsageProcedure: paymentServiceGetSubscriptionUsageHandler.ServeHTTP(w, r) case PaymentServiceGetInvoicesProcedure: @@ -295,20 +318,24 @@ func NewPaymentServiceHandler(svc PaymentServiceHandler, opts ...connect.Handler // UnimplementedPaymentServiceHandler returns CodeUnimplemented from all methods. type UnimplementedPaymentServiceHandler struct{} -func (UnimplementedPaymentServiceHandler) CreateOrUpdateCustomer(context.Context, *connect.Request[v1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[v1.PaymentServiceCreateOrUpdateCustomerResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.CreateOrUpdateCustomer is not implemented")) +func (UnimplementedPaymentServiceHandler) Create(context.Context, *connect.Request[v1.PaymentServiceCreateRequest]) (*connect.Response[v1.PaymentServiceCreateResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.Create is not implemented")) } -func (UnimplementedPaymentServiceHandler) GetCustomer(context.Context, *connect.Request[v1.PaymentServiceGetCustomerRequest]) (*connect.Response[v1.PaymentServiceGetCustomerResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.GetCustomer is not implemented")) +func (UnimplementedPaymentServiceHandler) Update(context.Context, *connect.Request[v1.PaymentServiceUpdateRequest]) (*connect.Response[v1.PaymentServiceUpdateResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.Update is not implemented")) } -func (UnimplementedPaymentServiceHandler) HasPaymentMethod(context.Context, *connect.Request[v1.PaymentServiceHasPaymentMethodRequest]) (*connect.Response[v1.PaymentServiceHasPaymentMethodResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.HasPaymentMethod is not implemented")) +func (UnimplementedPaymentServiceHandler) Delete(context.Context, *connect.Request[v1.PaymentServiceDeleteRequest]) (*connect.Response[v1.PaymentServiceDeleteResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.Delete is not implemented")) +} + +func (UnimplementedPaymentServiceHandler) Get(context.Context, *connect.Request[v1.PaymentServiceGetRequest]) (*connect.Response[v1.PaymentServiceGetResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.Get is not implemented")) } -func (UnimplementedPaymentServiceHandler) DeletePaymentMethod(context.Context, *connect.Request[v1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[v1.PaymentServiceDeletePaymentMethodResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.DeletePaymentMethod is not implemented")) +func (UnimplementedPaymentServiceHandler) HasPaymentMethod(context.Context, *connect.Request[v1.PaymentServiceHasPaymentMethodRequest]) (*connect.Response[v1.PaymentServiceHasPaymentMethodResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.HasPaymentMethod is not implemented")) } func (UnimplementedPaymentServiceHandler) GetSubscriptionUsage(context.Context, *connect.Request[v1.PaymentServiceGetSubscriptionUsageRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionUsageResponse], error) { diff --git a/go/api/v1/payment.pb.go b/go/api/v1/payment.pb.go index d8ca0171..5999ff67 100644 --- a/go/api/v1/payment.pb.go +++ b/go/api/v1/payment.pb.go @@ -137,6 +137,59 @@ func (UsageType) EnumDescriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{1} } +// ProductTier is an explicit indicator for the state in which the customer is using the products. +type ProductTier int32 + +const ( + // PRODUCT_TIER_UNSPECIFIED is unspecified + ProductTier_PRODUCT_TIER_UNSPECIFIED ProductTier = 0 + // PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information. + ProductTier_PRODUCT_TIER_TRIAL ProductTier = 1 + // PRODUCT_TIER_PAID indicates a customer that has provided payment information. + ProductTier_PRODUCT_TIER_PAID ProductTier = 2 +) + +// Enum value maps for ProductTier. +var ( + ProductTier_name = map[int32]string{ + 0: "PRODUCT_TIER_UNSPECIFIED", + 1: "PRODUCT_TIER_TRIAL", + 2: "PRODUCT_TIER_PAID", + } + ProductTier_value = map[string]int32{ + "PRODUCT_TIER_UNSPECIFIED": 0, + "PRODUCT_TIER_TRIAL": 1, + "PRODUCT_TIER_PAID": 2, + } +) + +func (x ProductTier) Enum() *ProductTier { + p := new(ProductTier) + *p = x + return p +} + +func (x ProductTier) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProductTier) Descriptor() protoreflect.EnumDescriptor { + return file_api_v1_payment_proto_enumTypes[2].Descriptor() +} + +func (ProductTier) Type() protoreflect.EnumType { + return &file_api_v1_payment_proto_enumTypes[2] +} + +func (x ProductTier) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProductTier.Descriptor instead. +func (ProductTier) EnumDescriptor() ([]byte, []int) { + return file_api_v1_payment_proto_rawDescGZIP(), []int{2} +} + // PaymentCustomer is a customer at the payment processor type PaymentCustomer struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -163,7 +216,9 @@ type PaymentCustomer struct { // PhoneNumber of the customer PhoneNumber *string `protobuf:"bytes,12,opt,name=phone_number,json=phoneNumber,proto3,oneof" json:"phone_number,omitempty"` // Balance actual balance of the customer - Balance *int64 `protobuf:"varint,13,opt,name=balance,proto3,oneof" json:"balance,omitempty"` + Balance *int64 `protobuf:"varint,13,opt,name=balance,proto3,oneof" json:"balance,omitempty"` + // Tier describes the state in which the customer is using the products. + Tier ProductTier `protobuf:"varint,14,opt,name=tier,proto3,enum=api.v1.ProductTier" json:"tier,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -282,6 +337,13 @@ func (x *PaymentCustomer) GetBalance() int64 { return 0 } +func (x *PaymentCustomer) GetTier() ProductTier { + if x != nil { + return x.Tier + } + return ProductTier_PRODUCT_TIER_UNSPECIFIED +} + // Card is the payment card the customer pays with type Card struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -819,43 +881,41 @@ func (x *Invoice) GetPeriodEnd() *timestamppb.Timestamp { return nil } -// PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request -type PaymentServiceCreateOrUpdateCustomerRequest struct { +// PaymentServiceCreateRequest is the request payload for providing payment data +type PaymentServiceCreateRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` // Name of the customer to be billed - Name *string `protobuf:"bytes,4,opt,name=name,proto3,oneof" json:"name,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api - PaymentMethodId *string `protobuf:"bytes,5,opt,name=payment_method_id,json=paymentMethodId,proto3,oneof" json:"payment_method_id,omitempty"` + PaymentMethodId string `protobuf:"bytes,3,opt,name=payment_method_id,json=paymentMethodId,proto3" json:"payment_method_id,omitempty"` // Email of the customer to be billed - Email *string `protobuf:"bytes,6,opt,name=email,proto3,oneof" json:"email,omitempty"` - // Card the customer to be billed - Card *Card `protobuf:"bytes,7,opt,name=card,proto3,oneof" json:"card,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` // Address is the postal address of the customer to be billed - Address *Address `protobuf:"bytes,8,opt,name=address,proto3" json:"address,omitempty"` + Address *Address `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` // Vat which applies to the customer to be billed - Vat *string `protobuf:"bytes,9,opt,name=vat,proto3,oneof" json:"vat,omitempty"` + Vat string `protobuf:"bytes,6,opt,name=vat,proto3" json:"vat,omitempty"` // PhoneNumber of the customer to be billed - PhoneNumber *string `protobuf:"bytes,10,opt,name=phone_number,json=phoneNumber,proto3,oneof" json:"phone_number,omitempty"` + PhoneNumber *string `protobuf:"bytes,7,opt,name=phone_number,json=phoneNumber,proto3,oneof" json:"phone_number,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) Reset() { - *x = PaymentServiceCreateOrUpdateCustomerRequest{} +func (x *PaymentServiceCreateRequest) Reset() { + *x = PaymentServiceCreateRequest{} mi := &file_api_v1_payment_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) String() string { +func (x *PaymentServiceCreateRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceCreateOrUpdateCustomerRequest) ProtoMessage() {} +func (*PaymentServiceCreateRequest) ProtoMessage() {} -func (x *PaymentServiceCreateOrUpdateCustomerRequest) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceCreateRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -867,90 +927,83 @@ func (x *PaymentServiceCreateOrUpdateCustomerRequest) ProtoReflect() protoreflec return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceCreateOrUpdateCustomerRequest.ProtoReflect.Descriptor instead. -func (*PaymentServiceCreateOrUpdateCustomerRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceCreateRequest.ProtoReflect.Descriptor instead. +func (*PaymentServiceCreateRequest) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{7} } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetLogin() string { +func (x *PaymentServiceCreateRequest) GetLogin() string { if x != nil { return x.Login } return "" } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetPaymentMethodId() string { - if x != nil && x.PaymentMethodId != nil { - return *x.PaymentMethodId +func (x *PaymentServiceCreateRequest) GetName() string { + if x != nil { + return x.Name } return "" } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email +func (x *PaymentServiceCreateRequest) GetPaymentMethodId() string { + if x != nil { + return x.PaymentMethodId } return "" } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetCard() *Card { +func (x *PaymentServiceCreateRequest) GetEmail() string { if x != nil { - return x.Card + return x.Email } - return nil + return "" } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetAddress() *Address { +func (x *PaymentServiceCreateRequest) GetAddress() *Address { if x != nil { return x.Address } return nil } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetVat() string { - if x != nil && x.Vat != nil { - return *x.Vat +func (x *PaymentServiceCreateRequest) GetVat() string { + if x != nil { + return x.Vat } return "" } -func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetPhoneNumber() string { +func (x *PaymentServiceCreateRequest) GetPhoneNumber() string { if x != nil && x.PhoneNumber != nil { return *x.PhoneNumber } return "" } -// PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request -type PaymentServiceCreateOrUpdateCustomerResponse struct { +// PaymentServiceCreateResponse is the response payload for a payment create request +type PaymentServiceCreateResponse struct { state protoimpl.MessageState `protogen:"open.v1"` - // Customer is the customer + // Customer is the created customer Customer *PaymentCustomer `protobuf:"bytes,1,opt,name=customer,proto3" json:"customer,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceCreateOrUpdateCustomerResponse) Reset() { - *x = PaymentServiceCreateOrUpdateCustomerResponse{} +func (x *PaymentServiceCreateResponse) Reset() { + *x = PaymentServiceCreateResponse{} mi := &file_api_v1_payment_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceCreateOrUpdateCustomerResponse) String() string { +func (x *PaymentServiceCreateResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceCreateOrUpdateCustomerResponse) ProtoMessage() {} +func (*PaymentServiceCreateResponse) ProtoMessage() {} -func (x *PaymentServiceCreateOrUpdateCustomerResponse) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceCreateResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -962,43 +1015,53 @@ func (x *PaymentServiceCreateOrUpdateCustomerResponse) ProtoReflect() protorefle return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceCreateOrUpdateCustomerResponse.ProtoReflect.Descriptor instead. -func (*PaymentServiceCreateOrUpdateCustomerResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceCreateResponse.ProtoReflect.Descriptor instead. +func (*PaymentServiceCreateResponse) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{8} } -func (x *PaymentServiceCreateOrUpdateCustomerResponse) GetCustomer() *PaymentCustomer { +func (x *PaymentServiceCreateResponse) GetCustomer() *PaymentCustomer { if x != nil { return x.Customer } return nil } -// PaymentServiceGetCustomerRequest is the request payload for a payment get customer request -type PaymentServiceGetCustomerRequest struct { +// PaymentServiceUpdateRequest is the request payload for updating payment data +type PaymentServiceUpdateRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` - // CustomerId of the customer - CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + // Name of the customer to be billed + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` + // PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api + PaymentMethodId *string `protobuf:"bytes,3,opt,name=payment_method_id,json=paymentMethodId,proto3,oneof" json:"payment_method_id,omitempty"` + // Email of the customer to be billed + Email *string `protobuf:"bytes,4,opt,name=email,proto3,oneof" json:"email,omitempty"` + // Address is the postal address of the customer to be billed + Address *Address `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` + // Vat which applies to the customer to be billed + Vat *string `protobuf:"bytes,6,opt,name=vat,proto3,oneof" json:"vat,omitempty"` + // PhoneNumber of the customer to be billed + PhoneNumber *string `protobuf:"bytes,7,opt,name=phone_number,json=phoneNumber,proto3,oneof" json:"phone_number,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceGetCustomerRequest) Reset() { - *x = PaymentServiceGetCustomerRequest{} +func (x *PaymentServiceUpdateRequest) Reset() { + *x = PaymentServiceUpdateRequest{} mi := &file_api_v1_payment_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceGetCustomerRequest) String() string { +func (x *PaymentServiceUpdateRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceGetCustomerRequest) ProtoMessage() {} +func (*PaymentServiceUpdateRequest) ProtoMessage() {} -func (x *PaymentServiceGetCustomerRequest) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceUpdateRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1010,48 +1073,83 @@ func (x *PaymentServiceGetCustomerRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceGetCustomerRequest.ProtoReflect.Descriptor instead. -func (*PaymentServiceGetCustomerRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceUpdateRequest.ProtoReflect.Descriptor instead. +func (*PaymentServiceUpdateRequest) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{9} } -func (x *PaymentServiceGetCustomerRequest) GetLogin() string { +func (x *PaymentServiceUpdateRequest) GetLogin() string { if x != nil { return x.Login } return "" } -func (x *PaymentServiceGetCustomerRequest) GetCustomerId() string { +func (x *PaymentServiceUpdateRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *PaymentServiceUpdateRequest) GetPaymentMethodId() string { + if x != nil && x.PaymentMethodId != nil { + return *x.PaymentMethodId + } + return "" +} + +func (x *PaymentServiceUpdateRequest) GetEmail() string { + if x != nil && x.Email != nil { + return *x.Email + } + return "" +} + +func (x *PaymentServiceUpdateRequest) GetAddress() *Address { if x != nil { - return x.CustomerId + return x.Address + } + return nil +} + +func (x *PaymentServiceUpdateRequest) GetVat() string { + if x != nil && x.Vat != nil { + return *x.Vat } return "" } -// PaymentServiceGetCustomerResponse is the response payload for a payment get customer request -type PaymentServiceGetCustomerResponse struct { +func (x *PaymentServiceUpdateRequest) GetPhoneNumber() string { + if x != nil && x.PhoneNumber != nil { + return *x.PhoneNumber + } + return "" +} + +// PaymentServiceUpdateResponse is the response payload for a payment update request +type PaymentServiceUpdateResponse struct { state protoimpl.MessageState `protogen:"open.v1"` - // Customer is the customer + // Customer is the updated customer Customer *PaymentCustomer `protobuf:"bytes,1,opt,name=customer,proto3" json:"customer,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceGetCustomerResponse) Reset() { - *x = PaymentServiceGetCustomerResponse{} +func (x *PaymentServiceUpdateResponse) Reset() { + *x = PaymentServiceUpdateResponse{} mi := &file_api_v1_payment_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceGetCustomerResponse) String() string { +func (x *PaymentServiceUpdateResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceGetCustomerResponse) ProtoMessage() {} +func (*PaymentServiceUpdateResponse) ProtoMessage() {} -func (x *PaymentServiceGetCustomerResponse) ProtoReflect() protoreflect.Message { +func (x *PaymentServiceUpdateResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v1_payment_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1063,12 +1161,104 @@ func (x *PaymentServiceGetCustomerResponse) ProtoReflect() protoreflect.Message return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceGetCustomerResponse.ProtoReflect.Descriptor instead. -func (*PaymentServiceGetCustomerResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use PaymentServiceUpdateResponse.ProtoReflect.Descriptor instead. +func (*PaymentServiceUpdateResponse) Descriptor() ([]byte, []int) { return file_api_v1_payment_proto_rawDescGZIP(), []int{10} } -func (x *PaymentServiceGetCustomerResponse) GetCustomer() *PaymentCustomer { +func (x *PaymentServiceUpdateResponse) GetCustomer() *PaymentCustomer { + if x != nil { + return x.Customer + } + return nil +} + +// PaymentServiceGetRequest is the request payload for getting the payment data +type PaymentServiceGetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Login of the tenant + Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PaymentServiceGetRequest) Reset() { + *x = PaymentServiceGetRequest{} + mi := &file_api_v1_payment_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PaymentServiceGetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaymentServiceGetRequest) ProtoMessage() {} + +func (x *PaymentServiceGetRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_payment_proto_msgTypes[11] + 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 PaymentServiceGetRequest.ProtoReflect.Descriptor instead. +func (*PaymentServiceGetRequest) Descriptor() ([]byte, []int) { + return file_api_v1_payment_proto_rawDescGZIP(), []int{11} +} + +func (x *PaymentServiceGetRequest) GetLogin() string { + if x != nil { + return x.Login + } + return "" +} + +// PaymentServiceGetResponse is the response payload for a payment get request +type PaymentServiceGetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Customer is the payment customer + Customer *PaymentCustomer `protobuf:"bytes,1,opt,name=customer,proto3" json:"customer,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PaymentServiceGetResponse) Reset() { + *x = PaymentServiceGetResponse{} + mi := &file_api_v1_payment_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PaymentServiceGetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaymentServiceGetResponse) ProtoMessage() {} + +func (x *PaymentServiceGetResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_payment_proto_msgTypes[12] + 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 PaymentServiceGetResponse.ProtoReflect.Descriptor instead. +func (*PaymentServiceGetResponse) Descriptor() ([]byte, []int) { + return file_api_v1_payment_proto_rawDescGZIP(), []int{12} +} + +func (x *PaymentServiceGetResponse) GetCustomer() *PaymentCustomer { if x != nil { return x.Customer } @@ -1078,7 +1268,7 @@ func (x *PaymentServiceGetCustomerResponse) GetCustomer() *PaymentCustomer { // PaymentServiceHasPaymentMethodRequest is the request payload for a has payment request type PaymentServiceHasPaymentMethodRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -1086,7 +1276,7 @@ type PaymentServiceHasPaymentMethodRequest struct { func (x *PaymentServiceHasPaymentMethodRequest) Reset() { *x = PaymentServiceHasPaymentMethodRequest{} - mi := &file_api_v1_payment_proto_msgTypes[11] + mi := &file_api_v1_payment_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1098,7 +1288,7 @@ func (x *PaymentServiceHasPaymentMethodRequest) String() string { func (*PaymentServiceHasPaymentMethodRequest) ProtoMessage() {} func (x *PaymentServiceHasPaymentMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[11] + mi := &file_api_v1_payment_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1111,7 +1301,7 @@ func (x *PaymentServiceHasPaymentMethodRequest) ProtoReflect() protoreflect.Mess // Deprecated: Use PaymentServiceHasPaymentMethodRequest.ProtoReflect.Descriptor instead. func (*PaymentServiceHasPaymentMethodRequest) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{11} + return file_api_v1_payment_proto_rawDescGZIP(), []int{13} } func (x *PaymentServiceHasPaymentMethodRequest) GetLogin() string { @@ -1134,7 +1324,7 @@ type PaymentServiceHasPaymentMethodResponse struct { func (x *PaymentServiceHasPaymentMethodResponse) Reset() { *x = PaymentServiceHasPaymentMethodResponse{} - mi := &file_api_v1_payment_proto_msgTypes[12] + mi := &file_api_v1_payment_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1146,7 +1336,7 @@ func (x *PaymentServiceHasPaymentMethodResponse) String() string { func (*PaymentServiceHasPaymentMethodResponse) ProtoMessage() {} func (x *PaymentServiceHasPaymentMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[12] + mi := &file_api_v1_payment_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1159,7 +1349,7 @@ func (x *PaymentServiceHasPaymentMethodResponse) ProtoReflect() protoreflect.Mes // Deprecated: Use PaymentServiceHasPaymentMethodResponse.ProtoReflect.Descriptor instead. func (*PaymentServiceHasPaymentMethodResponse) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{12} + return file_api_v1_payment_proto_rawDescGZIP(), []int{14} } func (x *PaymentServiceHasPaymentMethodResponse) GetExists() bool { @@ -1176,30 +1366,30 @@ func (x *PaymentServiceHasPaymentMethodResponse) GetPositiveBalance() bool { return false } -// PaymentServiceDeletePaymentMethodRequest is the request payload for a delete payment request -type PaymentServiceDeletePaymentMethodRequest struct { +// PaymentServiceDeleteRequest is the request payload for a delete payment request +type PaymentServiceDeleteRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceDeletePaymentMethodRequest) Reset() { - *x = PaymentServiceDeletePaymentMethodRequest{} - mi := &file_api_v1_payment_proto_msgTypes[13] +func (x *PaymentServiceDeleteRequest) Reset() { + *x = PaymentServiceDeleteRequest{} + mi := &file_api_v1_payment_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceDeletePaymentMethodRequest) String() string { +func (x *PaymentServiceDeleteRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceDeletePaymentMethodRequest) ProtoMessage() {} +func (*PaymentServiceDeleteRequest) ProtoMessage() {} -func (x *PaymentServiceDeletePaymentMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[13] +func (x *PaymentServiceDeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_payment_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1210,40 +1400,40 @@ func (x *PaymentServiceDeletePaymentMethodRequest) ProtoReflect() protoreflect.M return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceDeletePaymentMethodRequest.ProtoReflect.Descriptor instead. -func (*PaymentServiceDeletePaymentMethodRequest) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{13} +// Deprecated: Use PaymentServiceDeleteRequest.ProtoReflect.Descriptor instead. +func (*PaymentServiceDeleteRequest) Descriptor() ([]byte, []int) { + return file_api_v1_payment_proto_rawDescGZIP(), []int{15} } -func (x *PaymentServiceDeletePaymentMethodRequest) GetLogin() string { +func (x *PaymentServiceDeleteRequest) GetLogin() string { if x != nil { return x.Login } return "" } -// PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request -type PaymentServiceDeletePaymentMethodResponse struct { +// PaymentServiceDeleteResponse is the response payload for a delete payment request +type PaymentServiceDeleteResponse struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *PaymentServiceDeletePaymentMethodResponse) Reset() { - *x = PaymentServiceDeletePaymentMethodResponse{} - mi := &file_api_v1_payment_proto_msgTypes[14] +func (x *PaymentServiceDeleteResponse) Reset() { + *x = PaymentServiceDeleteResponse{} + mi := &file_api_v1_payment_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PaymentServiceDeletePaymentMethodResponse) String() string { +func (x *PaymentServiceDeleteResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PaymentServiceDeletePaymentMethodResponse) ProtoMessage() {} +func (*PaymentServiceDeleteResponse) ProtoMessage() {} -func (x *PaymentServiceDeletePaymentMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[14] +func (x *PaymentServiceDeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_payment_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1254,15 +1444,15 @@ func (x *PaymentServiceDeletePaymentMethodResponse) ProtoReflect() protoreflect. return mi.MessageOf(x) } -// Deprecated: Use PaymentServiceDeletePaymentMethodResponse.ProtoReflect.Descriptor instead. -func (*PaymentServiceDeletePaymentMethodResponse) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{14} +// Deprecated: Use PaymentServiceDeleteResponse.ProtoReflect.Descriptor instead. +func (*PaymentServiceDeleteResponse) Descriptor() ([]byte, []int) { + return file_api_v1_payment_proto_rawDescGZIP(), []int{16} } // PaymentServiceGetSubscriptionUsageRequest is the request payload for a get subscription usage request type PaymentServiceGetSubscriptionUsageRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -1270,7 +1460,7 @@ type PaymentServiceGetSubscriptionUsageRequest struct { func (x *PaymentServiceGetSubscriptionUsageRequest) Reset() { *x = PaymentServiceGetSubscriptionUsageRequest{} - mi := &file_api_v1_payment_proto_msgTypes[15] + mi := &file_api_v1_payment_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1282,7 +1472,7 @@ func (x *PaymentServiceGetSubscriptionUsageRequest) String() string { func (*PaymentServiceGetSubscriptionUsageRequest) ProtoMessage() {} func (x *PaymentServiceGetSubscriptionUsageRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[15] + mi := &file_api_v1_payment_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1295,7 +1485,7 @@ func (x *PaymentServiceGetSubscriptionUsageRequest) ProtoReflect() protoreflect. // Deprecated: Use PaymentServiceGetSubscriptionUsageRequest.ProtoReflect.Descriptor instead. func (*PaymentServiceGetSubscriptionUsageRequest) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{15} + return file_api_v1_payment_proto_rawDescGZIP(), []int{17} } func (x *PaymentServiceGetSubscriptionUsageRequest) GetLogin() string { @@ -1316,7 +1506,7 @@ type PaymentServiceGetSubscriptionUsageResponse struct { func (x *PaymentServiceGetSubscriptionUsageResponse) Reset() { *x = PaymentServiceGetSubscriptionUsageResponse{} - mi := &file_api_v1_payment_proto_msgTypes[16] + mi := &file_api_v1_payment_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1328,7 +1518,7 @@ func (x *PaymentServiceGetSubscriptionUsageResponse) String() string { func (*PaymentServiceGetSubscriptionUsageResponse) ProtoMessage() {} func (x *PaymentServiceGetSubscriptionUsageResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[16] + mi := &file_api_v1_payment_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1341,7 +1531,7 @@ func (x *PaymentServiceGetSubscriptionUsageResponse) ProtoReflect() protoreflect // Deprecated: Use PaymentServiceGetSubscriptionUsageResponse.ProtoReflect.Descriptor instead. func (*PaymentServiceGetSubscriptionUsageResponse) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{16} + return file_api_v1_payment_proto_rawDescGZIP(), []int{18} } func (x *PaymentServiceGetSubscriptionUsageResponse) GetSubscriptionUsageItems() []*SubscriptionUsageItem { @@ -1354,7 +1544,7 @@ func (x *PaymentServiceGetSubscriptionUsageResponse) GetSubscriptionUsageItems() // PaymentServiceHasPaymentMethodRequest is the request payload for a get invoices request type PaymentServiceGetInvoicesRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Login of the customer + // Login of the tenant Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` // CustomerId is the id of the customer CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` @@ -1364,7 +1554,7 @@ type PaymentServiceGetInvoicesRequest struct { func (x *PaymentServiceGetInvoicesRequest) Reset() { *x = PaymentServiceGetInvoicesRequest{} - mi := &file_api_v1_payment_proto_msgTypes[17] + mi := &file_api_v1_payment_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1376,7 +1566,7 @@ func (x *PaymentServiceGetInvoicesRequest) String() string { func (*PaymentServiceGetInvoicesRequest) ProtoMessage() {} func (x *PaymentServiceGetInvoicesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[17] + mi := &file_api_v1_payment_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1389,7 +1579,7 @@ func (x *PaymentServiceGetInvoicesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentServiceGetInvoicesRequest.ProtoReflect.Descriptor instead. func (*PaymentServiceGetInvoicesRequest) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{17} + return file_api_v1_payment_proto_rawDescGZIP(), []int{19} } func (x *PaymentServiceGetInvoicesRequest) GetLogin() string { @@ -1417,7 +1607,7 @@ type PaymentServiceGetInvoicesResponse struct { func (x *PaymentServiceGetInvoicesResponse) Reset() { *x = PaymentServiceGetInvoicesResponse{} - mi := &file_api_v1_payment_proto_msgTypes[18] + mi := &file_api_v1_payment_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1429,7 +1619,7 @@ func (x *PaymentServiceGetInvoicesResponse) String() string { func (*PaymentServiceGetInvoicesResponse) ProtoMessage() {} func (x *PaymentServiceGetInvoicesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[18] + mi := &file_api_v1_payment_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1442,7 +1632,7 @@ func (x *PaymentServiceGetInvoicesResponse) ProtoReflect() protoreflect.Message // Deprecated: Use PaymentServiceGetInvoicesResponse.ProtoReflect.Descriptor instead. func (*PaymentServiceGetInvoicesResponse) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{18} + return file_api_v1_payment_proto_rawDescGZIP(), []int{20} } func (x *PaymentServiceGetInvoicesResponse) GetInvoices() []*Invoice { @@ -1461,7 +1651,7 @@ type PaymentServiceGetDefaultPricesRequest struct { func (x *PaymentServiceGetDefaultPricesRequest) Reset() { *x = PaymentServiceGetDefaultPricesRequest{} - mi := &file_api_v1_payment_proto_msgTypes[19] + mi := &file_api_v1_payment_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1473,7 +1663,7 @@ func (x *PaymentServiceGetDefaultPricesRequest) String() string { func (*PaymentServiceGetDefaultPricesRequest) ProtoMessage() {} func (x *PaymentServiceGetDefaultPricesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[19] + mi := &file_api_v1_payment_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1486,7 +1676,7 @@ func (x *PaymentServiceGetDefaultPricesRequest) ProtoReflect() protoreflect.Mess // Deprecated: Use PaymentServiceGetDefaultPricesRequest.ProtoReflect.Descriptor instead. func (*PaymentServiceGetDefaultPricesRequest) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{19} + return file_api_v1_payment_proto_rawDescGZIP(), []int{21} } // PaymentServiceGetDefaultPricesResponse is the response payload for a get default prices request @@ -1500,7 +1690,7 @@ type PaymentServiceGetDefaultPricesResponse struct { func (x *PaymentServiceGetDefaultPricesResponse) Reset() { *x = PaymentServiceGetDefaultPricesResponse{} - mi := &file_api_v1_payment_proto_msgTypes[20] + mi := &file_api_v1_payment_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1512,7 +1702,7 @@ func (x *PaymentServiceGetDefaultPricesResponse) String() string { func (*PaymentServiceGetDefaultPricesResponse) ProtoMessage() {} func (x *PaymentServiceGetDefaultPricesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[20] + mi := &file_api_v1_payment_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1525,7 +1715,7 @@ func (x *PaymentServiceGetDefaultPricesResponse) ProtoReflect() protoreflect.Mes // Deprecated: Use PaymentServiceGetDefaultPricesResponse.ProtoReflect.Descriptor instead. func (*PaymentServiceGetDefaultPricesResponse) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{20} + return file_api_v1_payment_proto_rawDescGZIP(), []int{22} } func (x *PaymentServiceGetDefaultPricesResponse) GetPrices() []*Price { @@ -1546,7 +1736,7 @@ type PaymentServiceGetSubscriptionDiscountsRequest struct { func (x *PaymentServiceGetSubscriptionDiscountsRequest) Reset() { *x = PaymentServiceGetSubscriptionDiscountsRequest{} - mi := &file_api_v1_payment_proto_msgTypes[21] + mi := &file_api_v1_payment_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1558,7 +1748,7 @@ func (x *PaymentServiceGetSubscriptionDiscountsRequest) String() string { func (*PaymentServiceGetSubscriptionDiscountsRequest) ProtoMessage() {} func (x *PaymentServiceGetSubscriptionDiscountsRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[21] + mi := &file_api_v1_payment_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1571,7 +1761,7 @@ func (x *PaymentServiceGetSubscriptionDiscountsRequest) ProtoReflect() protorefl // Deprecated: Use PaymentServiceGetSubscriptionDiscountsRequest.ProtoReflect.Descriptor instead. func (*PaymentServiceGetSubscriptionDiscountsRequest) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{21} + return file_api_v1_payment_proto_rawDescGZIP(), []int{23} } func (x *PaymentServiceGetSubscriptionDiscountsRequest) GetLogin() string { @@ -1592,7 +1782,7 @@ type PaymentServiceGetSubscriptionDiscountsResponse struct { func (x *PaymentServiceGetSubscriptionDiscountsResponse) Reset() { *x = PaymentServiceGetSubscriptionDiscountsResponse{} - mi := &file_api_v1_payment_proto_msgTypes[22] + mi := &file_api_v1_payment_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1604,7 +1794,7 @@ func (x *PaymentServiceGetSubscriptionDiscountsResponse) String() string { func (*PaymentServiceGetSubscriptionDiscountsResponse) ProtoMessage() {} func (x *PaymentServiceGetSubscriptionDiscountsResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[22] + mi := &file_api_v1_payment_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1617,7 +1807,7 @@ func (x *PaymentServiceGetSubscriptionDiscountsResponse) ProtoReflect() protoref // Deprecated: Use PaymentServiceGetSubscriptionDiscountsResponse.ProtoReflect.Descriptor instead. func (*PaymentServiceGetSubscriptionDiscountsResponse) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{22} + return file_api_v1_payment_proto_rawDescGZIP(), []int{24} } func (x *PaymentServiceGetSubscriptionDiscountsResponse) GetDiscounts() []*Discount { @@ -1631,7 +1821,7 @@ var File_api_v1_payment_proto protoreflect.FileDescriptor const file_api_v1_payment_proto_rawDesc = "" + "\n" + - "\x14api/v1/payment.proto\x12\x06api.v1\x1a\x13api/v1/common.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb0\x04\n" + + "\x14api/v1/payment.proto\x12\x06api.v1\x1a\x13api/v1/common.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd9\x04\n" + "\x0fPaymentCustomer\x12\x14\n" + "\x05login\x18\x01 \x01(\tR\x05login\x12\x17\n" + "\x04name\x18\x02 \x01(\tH\x00R\x04name\x88\x01\x01\x12$\n" + @@ -1645,7 +1835,8 @@ const file_api_v1_payment_proto_rawDesc = "" + "\aaddress\x18\t \x01(\v2\x0f.api.v1.AddressR\aaddress\x12\x15\n" + "\x03vat\x18\v \x01(\tH\x05R\x03vat\x88\x01\x01\x12&\n" + "\fphone_number\x18\f \x01(\tH\x06R\vphoneNumber\x88\x01\x01\x12\x1d\n" + - "\abalance\x18\r \x01(\x03H\aR\abalance\x88\x01\x01B\a\n" + + "\abalance\x18\r \x01(\x03H\aR\abalance\x88\x01\x01\x12'\n" + + "\x04tier\x18\x0e \x01(\x0e2\x13.api.v1.ProductTierR\x04tierB\a\n" + "\x05_nameB\x0e\n" + "\f_customer_idB\x14\n" + "\x12_payment_method_idB\b\n" + @@ -1706,43 +1897,50 @@ const file_api_v1_payment_proto_rawDesc = "" + "\x10pdf_download_url\x18\x02 \x01(\tR\x0epdfDownloadUrl\x12=\n" + "\fperiod_start\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\vperiodStart\x129\n" + "\n" + - "period_end\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tperiodEnd\"\xce\x03\n" + - "+PaymentServiceCreateOrUpdateCustomerRequest\x12 \n" + + "period_end\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tperiodEnd\"\xc8\x02\n" + + "\x1bPaymentServiceCreateRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\x12\x17\n" + - "\x04name\x18\x04 \x01(\tH\x00R\x04name\x88\x01\x01\x12/\n" + - "\x11payment_method_id\x18\x05 \x01(\tH\x01R\x0fpaymentMethodId\x88\x01\x01\x12\"\n" + - "\x05email\x18\x06 \x01(\tB\a\xbaH\x04r\x02`\x01H\x02R\x05email\x88\x01\x01\x12%\n" + - "\x04card\x18\a \x01(\v2\f.api.v1.CardH\x03R\x04card\x88\x01\x01\x12)\n" + - "\aaddress\x18\b \x01(\v2\x0f.api.v1.AddressR\aaddress\x12\x15\n" + - "\x03vat\x18\t \x01(\tH\x04R\x03vat\x88\x01\x01\x12&\n" + - "\fphone_number\x18\n" + - " \x01(\tH\x05R\vphoneNumber\x88\x01\x01B\a\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\x12\x1a\n" + + "\x04name\x18\x02 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\x04name\x12E\n" + + "\x11payment_method_id\x18\x03 \x01(\tB\x19\xbaH\x16r\x14\x10\x032\x10pm_[a-zA-Z0-9]*$R\x0fpaymentMethodId\x12\x1d\n" + + "\x05email\x18\x04 \x01(\tB\a\xbaH\x04r\x02`\x01R\x05email\x12)\n" + + "\aaddress\x18\x05 \x01(\v2\x0f.api.v1.AddressR\aaddress\x12\x18\n" + + "\x03vat\x18\x06 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\x03vat\x12/\n" + + "\fphone_number\x18\a \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\vphoneNumber\x88\x01\x01B\x0f\n" + + "\r_phone_number\"S\n" + + "\x1cPaymentServiceCreateResponse\x123\n" + + "\bcustomer\x18\x01 \x01(\v2\x17.api.v1.PaymentCustomerR\bcustomer\"\x8f\x03\n" + + "\x1bPaymentServiceUpdateRequest\x12 \n" + + "\x05login\x18\x01 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\x12 \n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\x04name\x88\x01\x01\x12J\n" + + "\x11payment_method_id\x18\x03 \x01(\tB\x19\xbaH\x16r\x14\x10\x032\x10pm_[a-zA-Z0-9]*$H\x01R\x0fpaymentMethodId\x88\x01\x01\x12\"\n" + + "\x05email\x18\x04 \x01(\tB\a\xbaH\x04r\x02`\x01H\x02R\x05email\x88\x01\x01\x12)\n" + + "\aaddress\x18\x05 \x01(\v2\x0f.api.v1.AddressR\aaddress\x12\x1e\n" + + "\x03vat\x18\x06 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x03R\x03vat\x88\x01\x01\x12/\n" + + "\fphone_number\x18\a \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x04R\vphoneNumber\x88\x01\x01B\a\n" + "\x05_nameB\x14\n" + "\x12_payment_method_idB\b\n" + - "\x06_emailB\a\n" + - "\x05_cardB\x06\n" + + "\x06_emailB\x06\n" + "\x04_vatB\x0f\n" + - "\r_phone_numberJ\x04\b\x02\x10\x03J\x04\b\x03\x10\x04R\bcustomerR\x1daccepted_terms_and_conditions\"c\n" + - ",PaymentServiceCreateOrUpdateCustomerResponse\x123\n" + - "\bcustomer\x18\x01 \x01(\v2\x17.api.v1.PaymentCustomerR\bcustomer\"e\n" + - " PaymentServiceGetCustomerRequest\x12 \n" + + "\r_phone_number\"S\n" + + "\x1cPaymentServiceUpdateResponse\x123\n" + + "\bcustomer\x18\x01 \x01(\v2\x17.api.v1.PaymentCustomerR\bcustomer\"<\n" + + "\x18PaymentServiceGetRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\x12\x1f\n" + - "\vcustomer_id\x18\x02 \x01(\tR\n" + - "customerId\"X\n" + - "!PaymentServiceGetCustomerResponse\x123\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"P\n" + + "\x19PaymentServiceGetResponse\x123\n" + "\bcustomer\x18\x01 \x01(\v2\x17.api.v1.PaymentCustomerR\bcustomer\"I\n" + "%PaymentServiceHasPaymentMethodRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"~\n" + "&PaymentServiceHasPaymentMethodResponse\x12\x16\n" + "\x06exists\x18\x01 \x01(\bR\x06exists\x12)\n" + - "\x10positive_balance\x18\x03 \x01(\bR\x0fpositiveBalanceJ\x04\b\x02\x10\x03R\vcoupon_left\"L\n" + - "(PaymentServiceDeletePaymentMethodRequest\x12 \n" + + "\x10positive_balance\x18\x03 \x01(\bR\x0fpositiveBalanceJ\x04\b\x02\x10\x03R\vcoupon_left\"?\n" + + "\x1bPaymentServiceDeleteRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"+\n" + - ")PaymentServiceDeletePaymentMethodResponse\"M\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"\x1e\n" + + "\x1cPaymentServiceDeleteResponse\"M\n" + ")PaymentServiceGetSubscriptionUsageRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"\x85\x01\n" + @@ -1772,12 +1970,17 @@ const file_api_v1_payment_proto_rawDesc = "" + "\tUsageType\x12\x1a\n" + "\x16USAGE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n" + "\x12USAGE_TYPE_METERED\x10\x01\x12\x17\n" + - "\x13USAGE_TYPE_LICENSED\x10\x022\x9f\b\n" + - "\x0ePaymentService\x12\x8a\x01\n" + - "\x16CreateOrUpdateCustomer\x123.api.v1.PaymentServiceCreateOrUpdateCustomerRequest\x1a4.api.v1.PaymentServiceCreateOrUpdateCustomerResponse\"\x05\xc2\xf3\x18\x01\x01\x12m\n" + - "\vGetCustomer\x12(.api.v1.PaymentServiceGetCustomerRequest\x1a).api.v1.PaymentServiceGetCustomerResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12\x7f\n" + - "\x10HasPaymentMethod\x12-.api.v1.PaymentServiceHasPaymentMethodRequest\x1a..api.v1.PaymentServiceHasPaymentMethodResponse\"\f\xc2\xf3\x18\x04\x01\x02\x03\x04\xe8\xf3\x18\x02\x12\x81\x01\n" + - "\x13DeletePaymentMethod\x120.api.v1.PaymentServiceDeletePaymentMethodRequest\x1a1.api.v1.PaymentServiceDeletePaymentMethodResponse\"\x05\xc2\xf3\x18\x01\x01\x12\x88\x01\n" + + "\x13USAGE_TYPE_LICENSED\x10\x02*Z\n" + + "\vProductTier\x12\x1c\n" + + "\x18PRODUCT_TIER_UNSPECIFIED\x10\x00\x12\x16\n" + + "\x12PRODUCT_TIER_TRIAL\x10\x01\x12\x15\n" + + "\x11PRODUCT_TIER_PAID\x10\x022\x8a\b\n" + + "\x0ePaymentService\x12Z\n" + + "\x06Create\x12#.api.v1.PaymentServiceCreateRequest\x1a$.api.v1.PaymentServiceCreateResponse\"\x05\xc2\xf3\x18\x01\x01\x12Z\n" + + "\x06Update\x12#.api.v1.PaymentServiceUpdateRequest\x1a$.api.v1.PaymentServiceUpdateResponse\"\x05\xc2\xf3\x18\x01\x01\x12Z\n" + + "\x06Delete\x12#.api.v1.PaymentServiceDeleteRequest\x1a$.api.v1.PaymentServiceDeleteResponse\"\x05\xc2\xf3\x18\x01\x01\x12U\n" + + "\x03Get\x12 .api.v1.PaymentServiceGetRequest\x1a!.api.v1.PaymentServiceGetResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12\x7f\n" + + "\x10HasPaymentMethod\x12-.api.v1.PaymentServiceHasPaymentMethodRequest\x1a..api.v1.PaymentServiceHasPaymentMethodResponse\"\f\xc2\xf3\x18\x04\x01\x02\x03\x04\xe8\xf3\x18\x02\x12\x88\x01\n" + "\x14GetSubscriptionUsage\x121.api.v1.PaymentServiceGetSubscriptionUsageRequest\x1a2.api.v1.PaymentServiceGetSubscriptionUsageResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12m\n" + "\vGetInvoices\x12(.api.v1.PaymentServiceGetInvoicesRequest\x1a).api.v1.PaymentServiceGetInvoicesResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12{\n" + "\x10GetDefaultPrices\x12-.api.v1.PaymentServiceGetDefaultPricesRequest\x1a..api.v1.PaymentServiceGetDefaultPricesResponse\"\b\xd8\xf3\x18\x01\xe8\xf3\x18\x02\x12\x94\x01\n" + @@ -1797,76 +2000,83 @@ func file_api_v1_payment_proto_rawDescGZIP() []byte { return file_api_v1_payment_proto_rawDescData } -var file_api_v1_payment_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_api_v1_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_api_v1_payment_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_api_v1_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_api_v1_payment_proto_goTypes = []any{ - (ProductType)(0), // 0: api.v1.ProductType - (UsageType)(0), // 1: api.v1.UsageType - (*PaymentCustomer)(nil), // 2: api.v1.PaymentCustomer - (*Card)(nil), // 3: api.v1.Card - (*Price)(nil), // 4: api.v1.Price - (*Address)(nil), // 5: api.v1.Address - (*SubscriptionUsageItem)(nil), // 6: api.v1.SubscriptionUsageItem - (*Discount)(nil), // 7: api.v1.Discount - (*Invoice)(nil), // 8: api.v1.Invoice - (*PaymentServiceCreateOrUpdateCustomerRequest)(nil), // 9: api.v1.PaymentServiceCreateOrUpdateCustomerRequest - (*PaymentServiceCreateOrUpdateCustomerResponse)(nil), // 10: api.v1.PaymentServiceCreateOrUpdateCustomerResponse - (*PaymentServiceGetCustomerRequest)(nil), // 11: api.v1.PaymentServiceGetCustomerRequest - (*PaymentServiceGetCustomerResponse)(nil), // 12: api.v1.PaymentServiceGetCustomerResponse - (*PaymentServiceHasPaymentMethodRequest)(nil), // 13: api.v1.PaymentServiceHasPaymentMethodRequest - (*PaymentServiceHasPaymentMethodResponse)(nil), // 14: api.v1.PaymentServiceHasPaymentMethodResponse - (*PaymentServiceDeletePaymentMethodRequest)(nil), // 15: api.v1.PaymentServiceDeletePaymentMethodRequest - (*PaymentServiceDeletePaymentMethodResponse)(nil), // 16: api.v1.PaymentServiceDeletePaymentMethodResponse - (*PaymentServiceGetSubscriptionUsageRequest)(nil), // 17: api.v1.PaymentServiceGetSubscriptionUsageRequest - (*PaymentServiceGetSubscriptionUsageResponse)(nil), // 18: api.v1.PaymentServiceGetSubscriptionUsageResponse - (*PaymentServiceGetInvoicesRequest)(nil), // 19: api.v1.PaymentServiceGetInvoicesRequest - (*PaymentServiceGetInvoicesResponse)(nil), // 20: api.v1.PaymentServiceGetInvoicesResponse - (*PaymentServiceGetDefaultPricesRequest)(nil), // 21: api.v1.PaymentServiceGetDefaultPricesRequest - (*PaymentServiceGetDefaultPricesResponse)(nil), // 22: api.v1.PaymentServiceGetDefaultPricesResponse - (*PaymentServiceGetSubscriptionDiscountsRequest)(nil), // 23: api.v1.PaymentServiceGetSubscriptionDiscountsRequest - (*PaymentServiceGetSubscriptionDiscountsResponse)(nil), // 24: api.v1.PaymentServiceGetSubscriptionDiscountsResponse - (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp + (ProductType)(0), // 0: api.v1.ProductType + (UsageType)(0), // 1: api.v1.UsageType + (ProductTier)(0), // 2: api.v1.ProductTier + (*PaymentCustomer)(nil), // 3: api.v1.PaymentCustomer + (*Card)(nil), // 4: api.v1.Card + (*Price)(nil), // 5: api.v1.Price + (*Address)(nil), // 6: api.v1.Address + (*SubscriptionUsageItem)(nil), // 7: api.v1.SubscriptionUsageItem + (*Discount)(nil), // 8: api.v1.Discount + (*Invoice)(nil), // 9: api.v1.Invoice + (*PaymentServiceCreateRequest)(nil), // 10: api.v1.PaymentServiceCreateRequest + (*PaymentServiceCreateResponse)(nil), // 11: api.v1.PaymentServiceCreateResponse + (*PaymentServiceUpdateRequest)(nil), // 12: api.v1.PaymentServiceUpdateRequest + (*PaymentServiceUpdateResponse)(nil), // 13: api.v1.PaymentServiceUpdateResponse + (*PaymentServiceGetRequest)(nil), // 14: api.v1.PaymentServiceGetRequest + (*PaymentServiceGetResponse)(nil), // 15: api.v1.PaymentServiceGetResponse + (*PaymentServiceHasPaymentMethodRequest)(nil), // 16: api.v1.PaymentServiceHasPaymentMethodRequest + (*PaymentServiceHasPaymentMethodResponse)(nil), // 17: api.v1.PaymentServiceHasPaymentMethodResponse + (*PaymentServiceDeleteRequest)(nil), // 18: api.v1.PaymentServiceDeleteRequest + (*PaymentServiceDeleteResponse)(nil), // 19: api.v1.PaymentServiceDeleteResponse + (*PaymentServiceGetSubscriptionUsageRequest)(nil), // 20: api.v1.PaymentServiceGetSubscriptionUsageRequest + (*PaymentServiceGetSubscriptionUsageResponse)(nil), // 21: api.v1.PaymentServiceGetSubscriptionUsageResponse + (*PaymentServiceGetInvoicesRequest)(nil), // 22: api.v1.PaymentServiceGetInvoicesRequest + (*PaymentServiceGetInvoicesResponse)(nil), // 23: api.v1.PaymentServiceGetInvoicesResponse + (*PaymentServiceGetDefaultPricesRequest)(nil), // 24: api.v1.PaymentServiceGetDefaultPricesRequest + (*PaymentServiceGetDefaultPricesResponse)(nil), // 25: api.v1.PaymentServiceGetDefaultPricesResponse + (*PaymentServiceGetSubscriptionDiscountsRequest)(nil), // 26: api.v1.PaymentServiceGetSubscriptionDiscountsRequest + (*PaymentServiceGetSubscriptionDiscountsResponse)(nil), // 27: api.v1.PaymentServiceGetSubscriptionDiscountsResponse + (*timestamppb.Timestamp)(nil), // 28: google.protobuf.Timestamp } var file_api_v1_payment_proto_depIdxs = []int32{ - 3, // 0: api.v1.PaymentCustomer.card:type_name -> api.v1.Card - 4, // 1: api.v1.PaymentCustomer.prices:type_name -> api.v1.Price - 5, // 2: api.v1.PaymentCustomer.address:type_name -> api.v1.Address - 0, // 3: api.v1.Price.product_type:type_name -> api.v1.ProductType - 1, // 4: api.v1.Price.usage_type:type_name -> api.v1.UsageType - 25, // 5: api.v1.SubscriptionUsageItem.period_start:type_name -> google.protobuf.Timestamp - 25, // 6: api.v1.SubscriptionUsageItem.period_end:type_name -> google.protobuf.Timestamp - 7, // 7: api.v1.SubscriptionUsageItem.discounts:type_name -> api.v1.Discount - 25, // 8: api.v1.Invoice.period_start:type_name -> google.protobuf.Timestamp - 25, // 9: api.v1.Invoice.period_end:type_name -> google.protobuf.Timestamp - 3, // 10: api.v1.PaymentServiceCreateOrUpdateCustomerRequest.card:type_name -> api.v1.Card - 5, // 11: api.v1.PaymentServiceCreateOrUpdateCustomerRequest.address:type_name -> api.v1.Address - 2, // 12: api.v1.PaymentServiceCreateOrUpdateCustomerResponse.customer:type_name -> api.v1.PaymentCustomer - 2, // 13: api.v1.PaymentServiceGetCustomerResponse.customer:type_name -> api.v1.PaymentCustomer - 6, // 14: api.v1.PaymentServiceGetSubscriptionUsageResponse.subscription_usage_items:type_name -> api.v1.SubscriptionUsageItem - 8, // 15: api.v1.PaymentServiceGetInvoicesResponse.invoices:type_name -> api.v1.Invoice - 4, // 16: api.v1.PaymentServiceGetDefaultPricesResponse.prices:type_name -> api.v1.Price - 7, // 17: api.v1.PaymentServiceGetSubscriptionDiscountsResponse.discounts:type_name -> api.v1.Discount - 9, // 18: api.v1.PaymentService.CreateOrUpdateCustomer:input_type -> api.v1.PaymentServiceCreateOrUpdateCustomerRequest - 11, // 19: api.v1.PaymentService.GetCustomer:input_type -> api.v1.PaymentServiceGetCustomerRequest - 13, // 20: api.v1.PaymentService.HasPaymentMethod:input_type -> api.v1.PaymentServiceHasPaymentMethodRequest - 15, // 21: api.v1.PaymentService.DeletePaymentMethod:input_type -> api.v1.PaymentServiceDeletePaymentMethodRequest - 17, // 22: api.v1.PaymentService.GetSubscriptionUsage:input_type -> api.v1.PaymentServiceGetSubscriptionUsageRequest - 19, // 23: api.v1.PaymentService.GetInvoices:input_type -> api.v1.PaymentServiceGetInvoicesRequest - 21, // 24: api.v1.PaymentService.GetDefaultPrices:input_type -> api.v1.PaymentServiceGetDefaultPricesRequest - 23, // 25: api.v1.PaymentService.GetSubscriptionDiscounts:input_type -> api.v1.PaymentServiceGetSubscriptionDiscountsRequest - 10, // 26: api.v1.PaymentService.CreateOrUpdateCustomer:output_type -> api.v1.PaymentServiceCreateOrUpdateCustomerResponse - 12, // 27: api.v1.PaymentService.GetCustomer:output_type -> api.v1.PaymentServiceGetCustomerResponse - 14, // 28: api.v1.PaymentService.HasPaymentMethod:output_type -> api.v1.PaymentServiceHasPaymentMethodResponse - 16, // 29: api.v1.PaymentService.DeletePaymentMethod:output_type -> api.v1.PaymentServiceDeletePaymentMethodResponse - 18, // 30: api.v1.PaymentService.GetSubscriptionUsage:output_type -> api.v1.PaymentServiceGetSubscriptionUsageResponse - 20, // 31: api.v1.PaymentService.GetInvoices:output_type -> api.v1.PaymentServiceGetInvoicesResponse - 22, // 32: api.v1.PaymentService.GetDefaultPrices:output_type -> api.v1.PaymentServiceGetDefaultPricesResponse - 24, // 33: api.v1.PaymentService.GetSubscriptionDiscounts:output_type -> api.v1.PaymentServiceGetSubscriptionDiscountsResponse - 26, // [26:34] is the sub-list for method output_type - 18, // [18:26] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 4, // 0: api.v1.PaymentCustomer.card:type_name -> api.v1.Card + 5, // 1: api.v1.PaymentCustomer.prices:type_name -> api.v1.Price + 6, // 2: api.v1.PaymentCustomer.address:type_name -> api.v1.Address + 2, // 3: api.v1.PaymentCustomer.tier:type_name -> api.v1.ProductTier + 0, // 4: api.v1.Price.product_type:type_name -> api.v1.ProductType + 1, // 5: api.v1.Price.usage_type:type_name -> api.v1.UsageType + 28, // 6: api.v1.SubscriptionUsageItem.period_start:type_name -> google.protobuf.Timestamp + 28, // 7: api.v1.SubscriptionUsageItem.period_end:type_name -> google.protobuf.Timestamp + 8, // 8: api.v1.SubscriptionUsageItem.discounts:type_name -> api.v1.Discount + 28, // 9: api.v1.Invoice.period_start:type_name -> google.protobuf.Timestamp + 28, // 10: api.v1.Invoice.period_end:type_name -> google.protobuf.Timestamp + 6, // 11: api.v1.PaymentServiceCreateRequest.address:type_name -> api.v1.Address + 3, // 12: api.v1.PaymentServiceCreateResponse.customer:type_name -> api.v1.PaymentCustomer + 6, // 13: api.v1.PaymentServiceUpdateRequest.address:type_name -> api.v1.Address + 3, // 14: api.v1.PaymentServiceUpdateResponse.customer:type_name -> api.v1.PaymentCustomer + 3, // 15: api.v1.PaymentServiceGetResponse.customer:type_name -> api.v1.PaymentCustomer + 7, // 16: api.v1.PaymentServiceGetSubscriptionUsageResponse.subscription_usage_items:type_name -> api.v1.SubscriptionUsageItem + 9, // 17: api.v1.PaymentServiceGetInvoicesResponse.invoices:type_name -> api.v1.Invoice + 5, // 18: api.v1.PaymentServiceGetDefaultPricesResponse.prices:type_name -> api.v1.Price + 8, // 19: api.v1.PaymentServiceGetSubscriptionDiscountsResponse.discounts:type_name -> api.v1.Discount + 10, // 20: api.v1.PaymentService.Create:input_type -> api.v1.PaymentServiceCreateRequest + 12, // 21: api.v1.PaymentService.Update:input_type -> api.v1.PaymentServiceUpdateRequest + 18, // 22: api.v1.PaymentService.Delete:input_type -> api.v1.PaymentServiceDeleteRequest + 14, // 23: api.v1.PaymentService.Get:input_type -> api.v1.PaymentServiceGetRequest + 16, // 24: api.v1.PaymentService.HasPaymentMethod:input_type -> api.v1.PaymentServiceHasPaymentMethodRequest + 20, // 25: api.v1.PaymentService.GetSubscriptionUsage:input_type -> api.v1.PaymentServiceGetSubscriptionUsageRequest + 22, // 26: api.v1.PaymentService.GetInvoices:input_type -> api.v1.PaymentServiceGetInvoicesRequest + 24, // 27: api.v1.PaymentService.GetDefaultPrices:input_type -> api.v1.PaymentServiceGetDefaultPricesRequest + 26, // 28: api.v1.PaymentService.GetSubscriptionDiscounts:input_type -> api.v1.PaymentServiceGetSubscriptionDiscountsRequest + 11, // 29: api.v1.PaymentService.Create:output_type -> api.v1.PaymentServiceCreateResponse + 13, // 30: api.v1.PaymentService.Update:output_type -> api.v1.PaymentServiceUpdateResponse + 19, // 31: api.v1.PaymentService.Delete:output_type -> api.v1.PaymentServiceDeleteResponse + 15, // 32: api.v1.PaymentService.Get:output_type -> api.v1.PaymentServiceGetResponse + 17, // 33: api.v1.PaymentService.HasPaymentMethod:output_type -> api.v1.PaymentServiceHasPaymentMethodResponse + 21, // 34: api.v1.PaymentService.GetSubscriptionUsage:output_type -> api.v1.PaymentServiceGetSubscriptionUsageResponse + 23, // 35: api.v1.PaymentService.GetInvoices:output_type -> api.v1.PaymentServiceGetInvoicesResponse + 25, // 36: api.v1.PaymentService.GetDefaultPrices:output_type -> api.v1.PaymentServiceGetDefaultPricesResponse + 27, // 37: api.v1.PaymentService.GetSubscriptionDiscounts:output_type -> api.v1.PaymentServiceGetSubscriptionDiscountsResponse + 29, // [29:38] is the sub-list for method output_type + 20, // [20:29] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_api_v1_payment_proto_init() } @@ -1878,13 +2088,14 @@ func file_api_v1_payment_proto_init() { file_api_v1_payment_proto_msgTypes[0].OneofWrappers = []any{} file_api_v1_payment_proto_msgTypes[2].OneofWrappers = []any{} file_api_v1_payment_proto_msgTypes[7].OneofWrappers = []any{} + file_api_v1_payment_proto_msgTypes[9].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_v1_payment_proto_rawDesc), len(file_api_v1_payment_proto_rawDesc)), - NumEnums: 2, - NumMessages: 23, + NumEnums: 3, + NumMessages: 25, NumExtensions: 0, NumServices: 1, }, diff --git a/go/permissions/servicepermissions.go b/go/permissions/servicepermissions.go index 79df3376..e1a6f575 100755 --- a/go/permissions/servicepermissions.go +++ b/go/permissions/servicepermissions.go @@ -87,10 +87,11 @@ func GetServicePermissions() *ServicePermissions { "TENANT_ROLE_OWNER": []string{ "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/api.v1.AuditService/Get", "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/api.v1.AuditService/List", - "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/api.v1.PaymentService/CreateOrUpdateCustomer", - "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/api.v1.PaymentService/GetCustomer", + "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/api.v1.PaymentService/Create", + "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/api.v1.PaymentService/Update", + "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/api.v1.PaymentService/Delete", + "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/api.v1.PaymentService/Get", "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/api.v1.PaymentService/HasPaymentMethod", - "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/api.v1.PaymentService/DeletePaymentMethod", "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/api.v1.PaymentService/GetSubscriptionUsage", "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/api.v1.PaymentService/GetInvoices", "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/api.v1.PaymentService/GetSubscriptionDiscounts", @@ -224,14 +225,15 @@ func GetServicePermissions() *ServicePermissions { "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/api.v1.IPService/Update": true, "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/api.v1.MethodService/List": true, "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/api.v1.MethodService/TokenScopedList": true, - "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/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "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/api.v1.PaymentService/DeletePaymentMethod": true, - "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/api.v1.PaymentService/GetCustomer": true, + "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/api.v1.PaymentService/Create": true, + "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/api.v1.PaymentService/Delete": true, + "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/api.v1.PaymentService/Get": true, "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/api.v1.PaymentService/GetDefaultPrices": true, "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/api.v1.PaymentService/GetInvoices": true, "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/api.v1.PaymentService/GetSubscriptionDiscounts": true, "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/api.v1.PaymentService/GetSubscriptionUsage": true, "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/api.v1.PaymentService/HasPaymentMethod": true, + "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/api.v1.PaymentService/Update": true, "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/api.v1.ProjectService/Create": true, "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/api.v1.ProjectService/Delete": true, "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/api.v1.ProjectService/Get": true, @@ -325,13 +327,14 @@ func GetServicePermissions() *ServicePermissions { Tenant: map[string]bool{ "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/api.v1.AuditService/Get": true, "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/api.v1.AuditService/List": true, - "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/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "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/api.v1.PaymentService/DeletePaymentMethod": true, - "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/api.v1.PaymentService/GetCustomer": true, + "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/api.v1.PaymentService/Create": true, + "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/api.v1.PaymentService/Delete": true, + "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/api.v1.PaymentService/Get": true, "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/api.v1.PaymentService/GetInvoices": true, "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/api.v1.PaymentService/GetSubscriptionDiscounts": true, "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/api.v1.PaymentService/GetSubscriptionUsage": true, "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/api.v1.PaymentService/HasPaymentMethod": true, + "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/api.v1.PaymentService/Update": true, "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/api.v1.ProjectService/Create": true, "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/api.v1.TenantService/Delete": true, "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/api.v1.TenantService/Get": true, @@ -422,14 +425,15 @@ func GetServicePermissions() *ServicePermissions { "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/api.v1.IPService/Update": true, "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/api.v1.MethodService/List": true, "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/api.v1.MethodService/TokenScopedList": true, - "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/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "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/api.v1.PaymentService/DeletePaymentMethod": true, - "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/api.v1.PaymentService/GetCustomer": false, + "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/api.v1.PaymentService/Create": true, + "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/api.v1.PaymentService/Delete": true, + "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/api.v1.PaymentService/Get": false, "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/api.v1.PaymentService/GetDefaultPrices": false, "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/api.v1.PaymentService/GetInvoices": false, "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/api.v1.PaymentService/GetSubscriptionDiscounts": false, "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/api.v1.PaymentService/GetSubscriptionUsage": false, "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/api.v1.PaymentService/HasPaymentMethod": false, + "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/api.v1.PaymentService/Update": true, "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/api.v1.ProjectService/Create": true, "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/api.v1.ProjectService/Delete": true, "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/api.v1.ProjectService/Get": false, diff --git a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go index 1c889c7e..521199a2 100644 --- a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go +++ b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go @@ -39,27 +39,27 @@ func (_m *PaymentServiceClient) EXPECT() *PaymentServiceClient_Expecter { return &PaymentServiceClient_Expecter{mock: &_m.Mock} } -// CreateOrUpdateCustomer provides a mock function for the type PaymentServiceClient -func (_mock *PaymentServiceClient) CreateOrUpdateCustomer(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], error) { +// Create provides a mock function for the type PaymentServiceClient +func (_mock *PaymentServiceClient) Create(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateRequest]) (*connect.Response[apiv1.PaymentServiceCreateResponse], error) { ret := _mock.Called(context1, request) if len(ret) == 0 { - panic("no return value specified for CreateOrUpdateCustomer") + panic("no return value specified for Create") } - var r0 *connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse] + var r0 *connect.Response[apiv1.PaymentServiceCreateResponse] var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) (*connect.Response[apiv1.PaymentServiceCreateResponse], error)); ok { return returnFunc(context1, request) } - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) *connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse]); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) *connect.Response[apiv1.PaymentServiceCreateResponse]); ok { r0 = returnFunc(context1, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceCreateResponse]) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) error); ok { r1 = returnFunc(context1, request) } else { r1 = ret.Error(1) @@ -67,27 +67,27 @@ func (_mock *PaymentServiceClient) CreateOrUpdateCustomer(context1 context.Conte return r0, r1 } -// PaymentServiceClient_CreateOrUpdateCustomer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrUpdateCustomer' -type PaymentServiceClient_CreateOrUpdateCustomer_Call struct { +// PaymentServiceClient_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type PaymentServiceClient_Create_Call struct { *mock.Call } -// CreateOrUpdateCustomer is a helper method to define mock.On call +// Create is a helper method to define mock.On call // - context1 context.Context -// - request *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest] -func (_e *PaymentServiceClient_Expecter) CreateOrUpdateCustomer(context1 any, request any) *PaymentServiceClient_CreateOrUpdateCustomer_Call { - return &PaymentServiceClient_CreateOrUpdateCustomer_Call{Call: _e.mock.On("CreateOrUpdateCustomer", context1, request)} +// - request *connect.Request[apiv1.PaymentServiceCreateRequest] +func (_e *PaymentServiceClient_Expecter) Create(context1 any, request any) *PaymentServiceClient_Create_Call { + return &PaymentServiceClient_Create_Call{Call: _e.mock.On("Create", context1, request)} } -func (_c *PaymentServiceClient_CreateOrUpdateCustomer_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest])) *PaymentServiceClient_CreateOrUpdateCustomer_Call { +func (_c *PaymentServiceClient_Create_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateRequest])) *PaymentServiceClient_Create_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } - var arg1 *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest] + var arg1 *connect.Request[apiv1.PaymentServiceCreateRequest] if args[1] != nil { - arg1 = args[1].(*connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) + arg1 = args[1].(*connect.Request[apiv1.PaymentServiceCreateRequest]) } run( arg0, @@ -97,37 +97,37 @@ func (_c *PaymentServiceClient_CreateOrUpdateCustomer_Call) Run(run func(context return _c } -func (_c *PaymentServiceClient_CreateOrUpdateCustomer_Call) Return(response *connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], err error) *PaymentServiceClient_CreateOrUpdateCustomer_Call { +func (_c *PaymentServiceClient_Create_Call) Return(response *connect.Response[apiv1.PaymentServiceCreateResponse], err error) *PaymentServiceClient_Create_Call { _c.Call.Return(response, err) return _c } -func (_c *PaymentServiceClient_CreateOrUpdateCustomer_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], error)) *PaymentServiceClient_CreateOrUpdateCustomer_Call { +func (_c *PaymentServiceClient_Create_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateRequest]) (*connect.Response[apiv1.PaymentServiceCreateResponse], error)) *PaymentServiceClient_Create_Call { _c.Call.Return(run) return _c } -// DeletePaymentMethod provides a mock function for the type PaymentServiceClient -func (_mock *PaymentServiceClient) DeletePaymentMethod(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], error) { +// Delete provides a mock function for the type PaymentServiceClient +func (_mock *PaymentServiceClient) Delete(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeleteRequest]) (*connect.Response[apiv1.PaymentServiceDeleteResponse], error) { ret := _mock.Called(context1, request) if len(ret) == 0 { - panic("no return value specified for DeletePaymentMethod") + panic("no return value specified for Delete") } - var r0 *connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse] + var r0 *connect.Response[apiv1.PaymentServiceDeleteResponse] var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) (*connect.Response[apiv1.PaymentServiceDeleteResponse], error)); ok { return returnFunc(context1, request) } - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) *connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse]); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) *connect.Response[apiv1.PaymentServiceDeleteResponse]); ok { r0 = returnFunc(context1, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceDeleteResponse]) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) error); ok { r1 = returnFunc(context1, request) } else { r1 = ret.Error(1) @@ -135,27 +135,27 @@ func (_mock *PaymentServiceClient) DeletePaymentMethod(context1 context.Context, return r0, r1 } -// PaymentServiceClient_DeletePaymentMethod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePaymentMethod' -type PaymentServiceClient_DeletePaymentMethod_Call struct { +// PaymentServiceClient_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type PaymentServiceClient_Delete_Call struct { *mock.Call } -// DeletePaymentMethod is a helper method to define mock.On call +// Delete is a helper method to define mock.On call // - context1 context.Context -// - request *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest] -func (_e *PaymentServiceClient_Expecter) DeletePaymentMethod(context1 any, request any) *PaymentServiceClient_DeletePaymentMethod_Call { - return &PaymentServiceClient_DeletePaymentMethod_Call{Call: _e.mock.On("DeletePaymentMethod", context1, request)} +// - request *connect.Request[apiv1.PaymentServiceDeleteRequest] +func (_e *PaymentServiceClient_Expecter) Delete(context1 any, request any) *PaymentServiceClient_Delete_Call { + return &PaymentServiceClient_Delete_Call{Call: _e.mock.On("Delete", context1, request)} } -func (_c *PaymentServiceClient_DeletePaymentMethod_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest])) *PaymentServiceClient_DeletePaymentMethod_Call { +func (_c *PaymentServiceClient_Delete_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeleteRequest])) *PaymentServiceClient_Delete_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } - var arg1 *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest] + var arg1 *connect.Request[apiv1.PaymentServiceDeleteRequest] if args[1] != nil { - arg1 = args[1].(*connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) + arg1 = args[1].(*connect.Request[apiv1.PaymentServiceDeleteRequest]) } run( arg0, @@ -165,37 +165,37 @@ func (_c *PaymentServiceClient_DeletePaymentMethod_Call) Run(run func(context1 c return _c } -func (_c *PaymentServiceClient_DeletePaymentMethod_Call) Return(response *connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], err error) *PaymentServiceClient_DeletePaymentMethod_Call { +func (_c *PaymentServiceClient_Delete_Call) Return(response *connect.Response[apiv1.PaymentServiceDeleteResponse], err error) *PaymentServiceClient_Delete_Call { _c.Call.Return(response, err) return _c } -func (_c *PaymentServiceClient_DeletePaymentMethod_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], error)) *PaymentServiceClient_DeletePaymentMethod_Call { +func (_c *PaymentServiceClient_Delete_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeleteRequest]) (*connect.Response[apiv1.PaymentServiceDeleteResponse], error)) *PaymentServiceClient_Delete_Call { _c.Call.Return(run) return _c } -// GetCustomer provides a mock function for the type PaymentServiceClient -func (_mock *PaymentServiceClient) GetCustomer(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) (*connect.Response[apiv1.PaymentServiceGetCustomerResponse], error) { +// Get provides a mock function for the type PaymentServiceClient +func (_mock *PaymentServiceClient) Get(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetRequest]) (*connect.Response[apiv1.PaymentServiceGetResponse], error) { ret := _mock.Called(context1, request) if len(ret) == 0 { - panic("no return value specified for GetCustomer") + panic("no return value specified for Get") } - var r0 *connect.Response[apiv1.PaymentServiceGetCustomerResponse] + var r0 *connect.Response[apiv1.PaymentServiceGetResponse] var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) (*connect.Response[apiv1.PaymentServiceGetCustomerResponse], error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) (*connect.Response[apiv1.PaymentServiceGetResponse], error)); ok { return returnFunc(context1, request) } - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) *connect.Response[apiv1.PaymentServiceGetCustomerResponse]); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) *connect.Response[apiv1.PaymentServiceGetResponse]); ok { r0 = returnFunc(context1, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceGetCustomerResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceGetResponse]) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) error); ok { r1 = returnFunc(context1, request) } else { r1 = ret.Error(1) @@ -203,27 +203,27 @@ func (_mock *PaymentServiceClient) GetCustomer(context1 context.Context, request return r0, r1 } -// PaymentServiceClient_GetCustomer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCustomer' -type PaymentServiceClient_GetCustomer_Call struct { +// PaymentServiceClient_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type PaymentServiceClient_Get_Call struct { *mock.Call } -// GetCustomer is a helper method to define mock.On call +// Get is a helper method to define mock.On call // - context1 context.Context -// - request *connect.Request[apiv1.PaymentServiceGetCustomerRequest] -func (_e *PaymentServiceClient_Expecter) GetCustomer(context1 any, request any) *PaymentServiceClient_GetCustomer_Call { - return &PaymentServiceClient_GetCustomer_Call{Call: _e.mock.On("GetCustomer", context1, request)} +// - request *connect.Request[apiv1.PaymentServiceGetRequest] +func (_e *PaymentServiceClient_Expecter) Get(context1 any, request any) *PaymentServiceClient_Get_Call { + return &PaymentServiceClient_Get_Call{Call: _e.mock.On("Get", context1, request)} } -func (_c *PaymentServiceClient_GetCustomer_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetCustomerRequest])) *PaymentServiceClient_GetCustomer_Call { +func (_c *PaymentServiceClient_Get_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetRequest])) *PaymentServiceClient_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } - var arg1 *connect.Request[apiv1.PaymentServiceGetCustomerRequest] + var arg1 *connect.Request[apiv1.PaymentServiceGetRequest] if args[1] != nil { - arg1 = args[1].(*connect.Request[apiv1.PaymentServiceGetCustomerRequest]) + arg1 = args[1].(*connect.Request[apiv1.PaymentServiceGetRequest]) } run( arg0, @@ -233,12 +233,12 @@ func (_c *PaymentServiceClient_GetCustomer_Call) Run(run func(context1 context.C return _c } -func (_c *PaymentServiceClient_GetCustomer_Call) Return(response *connect.Response[apiv1.PaymentServiceGetCustomerResponse], err error) *PaymentServiceClient_GetCustomer_Call { +func (_c *PaymentServiceClient_Get_Call) Return(response *connect.Response[apiv1.PaymentServiceGetResponse], err error) *PaymentServiceClient_Get_Call { _c.Call.Return(response, err) return _c } -func (_c *PaymentServiceClient_GetCustomer_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) (*connect.Response[apiv1.PaymentServiceGetCustomerResponse], error)) *PaymentServiceClient_GetCustomer_Call { +func (_c *PaymentServiceClient_Get_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetRequest]) (*connect.Response[apiv1.PaymentServiceGetResponse], error)) *PaymentServiceClient_Get_Call { _c.Call.Return(run) return _c } @@ -582,3 +582,71 @@ func (_c *PaymentServiceClient_HasPaymentMethod_Call) RunAndReturn(run func(cont _c.Call.Return(run) return _c } + +// Update provides a mock function for the type PaymentServiceClient +func (_mock *PaymentServiceClient) Update(context1 context.Context, request *connect.Request[apiv1.PaymentServiceUpdateRequest]) (*connect.Response[apiv1.PaymentServiceUpdateResponse], error) { + ret := _mock.Called(context1, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *connect.Response[apiv1.PaymentServiceUpdateResponse] + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) (*connect.Response[apiv1.PaymentServiceUpdateResponse], error)); ok { + return returnFunc(context1, request) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) *connect.Response[apiv1.PaymentServiceUpdateResponse]); ok { + r0 = returnFunc(context1, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceUpdateResponse]) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) error); ok { + r1 = returnFunc(context1, request) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// PaymentServiceClient_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type PaymentServiceClient_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - context1 context.Context +// - request *connect.Request[apiv1.PaymentServiceUpdateRequest] +func (_e *PaymentServiceClient_Expecter) Update(context1 any, request any) *PaymentServiceClient_Update_Call { + return &PaymentServiceClient_Update_Call{Call: _e.mock.On("Update", context1, request)} +} + +func (_c *PaymentServiceClient_Update_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceUpdateRequest])) *PaymentServiceClient_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *connect.Request[apiv1.PaymentServiceUpdateRequest] + if args[1] != nil { + arg1 = args[1].(*connect.Request[apiv1.PaymentServiceUpdateRequest]) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *PaymentServiceClient_Update_Call) Return(response *connect.Response[apiv1.PaymentServiceUpdateResponse], err error) *PaymentServiceClient_Update_Call { + _c.Call.Return(response, err) + return _c +} + +func (_c *PaymentServiceClient_Update_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceUpdateRequest]) (*connect.Response[apiv1.PaymentServiceUpdateResponse], error)) *PaymentServiceClient_Update_Call { + _c.Call.Return(run) + return _c +} diff --git a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go index 698d3b16..42ee369c 100644 --- a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go +++ b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go @@ -39,27 +39,27 @@ func (_m *PaymentServiceHandler) EXPECT() *PaymentServiceHandler_Expecter { return &PaymentServiceHandler_Expecter{mock: &_m.Mock} } -// CreateOrUpdateCustomer provides a mock function for the type PaymentServiceHandler -func (_mock *PaymentServiceHandler) CreateOrUpdateCustomer(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], error) { +// Create provides a mock function for the type PaymentServiceHandler +func (_mock *PaymentServiceHandler) Create(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateRequest]) (*connect.Response[apiv1.PaymentServiceCreateResponse], error) { ret := _mock.Called(context1, request) if len(ret) == 0 { - panic("no return value specified for CreateOrUpdateCustomer") + panic("no return value specified for Create") } - var r0 *connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse] + var r0 *connect.Response[apiv1.PaymentServiceCreateResponse] var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) (*connect.Response[apiv1.PaymentServiceCreateResponse], error)); ok { return returnFunc(context1, request) } - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) *connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse]); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) *connect.Response[apiv1.PaymentServiceCreateResponse]); ok { r0 = returnFunc(context1, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceCreateResponse]) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceCreateRequest]) error); ok { r1 = returnFunc(context1, request) } else { r1 = ret.Error(1) @@ -67,27 +67,27 @@ func (_mock *PaymentServiceHandler) CreateOrUpdateCustomer(context1 context.Cont return r0, r1 } -// PaymentServiceHandler_CreateOrUpdateCustomer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrUpdateCustomer' -type PaymentServiceHandler_CreateOrUpdateCustomer_Call struct { +// PaymentServiceHandler_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type PaymentServiceHandler_Create_Call struct { *mock.Call } -// CreateOrUpdateCustomer is a helper method to define mock.On call +// Create is a helper method to define mock.On call // - context1 context.Context -// - request *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest] -func (_e *PaymentServiceHandler_Expecter) CreateOrUpdateCustomer(context1 any, request any) *PaymentServiceHandler_CreateOrUpdateCustomer_Call { - return &PaymentServiceHandler_CreateOrUpdateCustomer_Call{Call: _e.mock.On("CreateOrUpdateCustomer", context1, request)} +// - request *connect.Request[apiv1.PaymentServiceCreateRequest] +func (_e *PaymentServiceHandler_Expecter) Create(context1 any, request any) *PaymentServiceHandler_Create_Call { + return &PaymentServiceHandler_Create_Call{Call: _e.mock.On("Create", context1, request)} } -func (_c *PaymentServiceHandler_CreateOrUpdateCustomer_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest])) *PaymentServiceHandler_CreateOrUpdateCustomer_Call { +func (_c *PaymentServiceHandler_Create_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateRequest])) *PaymentServiceHandler_Create_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } - var arg1 *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest] + var arg1 *connect.Request[apiv1.PaymentServiceCreateRequest] if args[1] != nil { - arg1 = args[1].(*connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) + arg1 = args[1].(*connect.Request[apiv1.PaymentServiceCreateRequest]) } run( arg0, @@ -97,37 +97,37 @@ func (_c *PaymentServiceHandler_CreateOrUpdateCustomer_Call) Run(run func(contex return _c } -func (_c *PaymentServiceHandler_CreateOrUpdateCustomer_Call) Return(response *connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], err error) *PaymentServiceHandler_CreateOrUpdateCustomer_Call { +func (_c *PaymentServiceHandler_Create_Call) Return(response *connect.Response[apiv1.PaymentServiceCreateResponse], err error) *PaymentServiceHandler_Create_Call { _c.Call.Return(response, err) return _c } -func (_c *PaymentServiceHandler_CreateOrUpdateCustomer_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateOrUpdateCustomerRequest]) (*connect.Response[apiv1.PaymentServiceCreateOrUpdateCustomerResponse], error)) *PaymentServiceHandler_CreateOrUpdateCustomer_Call { +func (_c *PaymentServiceHandler_Create_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceCreateRequest]) (*connect.Response[apiv1.PaymentServiceCreateResponse], error)) *PaymentServiceHandler_Create_Call { _c.Call.Return(run) return _c } -// DeletePaymentMethod provides a mock function for the type PaymentServiceHandler -func (_mock *PaymentServiceHandler) DeletePaymentMethod(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], error) { +// Delete provides a mock function for the type PaymentServiceHandler +func (_mock *PaymentServiceHandler) Delete(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeleteRequest]) (*connect.Response[apiv1.PaymentServiceDeleteResponse], error) { ret := _mock.Called(context1, request) if len(ret) == 0 { - panic("no return value specified for DeletePaymentMethod") + panic("no return value specified for Delete") } - var r0 *connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse] + var r0 *connect.Response[apiv1.PaymentServiceDeleteResponse] var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) (*connect.Response[apiv1.PaymentServiceDeleteResponse], error)); ok { return returnFunc(context1, request) } - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) *connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse]); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) *connect.Response[apiv1.PaymentServiceDeleteResponse]); ok { r0 = returnFunc(context1, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceDeleteResponse]) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceDeleteRequest]) error); ok { r1 = returnFunc(context1, request) } else { r1 = ret.Error(1) @@ -135,27 +135,27 @@ func (_mock *PaymentServiceHandler) DeletePaymentMethod(context1 context.Context return r0, r1 } -// PaymentServiceHandler_DeletePaymentMethod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePaymentMethod' -type PaymentServiceHandler_DeletePaymentMethod_Call struct { +// PaymentServiceHandler_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type PaymentServiceHandler_Delete_Call struct { *mock.Call } -// DeletePaymentMethod is a helper method to define mock.On call +// Delete is a helper method to define mock.On call // - context1 context.Context -// - request *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest] -func (_e *PaymentServiceHandler_Expecter) DeletePaymentMethod(context1 any, request any) *PaymentServiceHandler_DeletePaymentMethod_Call { - return &PaymentServiceHandler_DeletePaymentMethod_Call{Call: _e.mock.On("DeletePaymentMethod", context1, request)} +// - request *connect.Request[apiv1.PaymentServiceDeleteRequest] +func (_e *PaymentServiceHandler_Expecter) Delete(context1 any, request any) *PaymentServiceHandler_Delete_Call { + return &PaymentServiceHandler_Delete_Call{Call: _e.mock.On("Delete", context1, request)} } -func (_c *PaymentServiceHandler_DeletePaymentMethod_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest])) *PaymentServiceHandler_DeletePaymentMethod_Call { +func (_c *PaymentServiceHandler_Delete_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeleteRequest])) *PaymentServiceHandler_Delete_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } - var arg1 *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest] + var arg1 *connect.Request[apiv1.PaymentServiceDeleteRequest] if args[1] != nil { - arg1 = args[1].(*connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) + arg1 = args[1].(*connect.Request[apiv1.PaymentServiceDeleteRequest]) } run( arg0, @@ -165,37 +165,37 @@ func (_c *PaymentServiceHandler_DeletePaymentMethod_Call) Run(run func(context1 return _c } -func (_c *PaymentServiceHandler_DeletePaymentMethod_Call) Return(response *connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], err error) *PaymentServiceHandler_DeletePaymentMethod_Call { +func (_c *PaymentServiceHandler_Delete_Call) Return(response *connect.Response[apiv1.PaymentServiceDeleteResponse], err error) *PaymentServiceHandler_Delete_Call { _c.Call.Return(response, err) return _c } -func (_c *PaymentServiceHandler_DeletePaymentMethod_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeletePaymentMethodRequest]) (*connect.Response[apiv1.PaymentServiceDeletePaymentMethodResponse], error)) *PaymentServiceHandler_DeletePaymentMethod_Call { +func (_c *PaymentServiceHandler_Delete_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceDeleteRequest]) (*connect.Response[apiv1.PaymentServiceDeleteResponse], error)) *PaymentServiceHandler_Delete_Call { _c.Call.Return(run) return _c } -// GetCustomer provides a mock function for the type PaymentServiceHandler -func (_mock *PaymentServiceHandler) GetCustomer(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) (*connect.Response[apiv1.PaymentServiceGetCustomerResponse], error) { +// Get provides a mock function for the type PaymentServiceHandler +func (_mock *PaymentServiceHandler) Get(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetRequest]) (*connect.Response[apiv1.PaymentServiceGetResponse], error) { ret := _mock.Called(context1, request) if len(ret) == 0 { - panic("no return value specified for GetCustomer") + panic("no return value specified for Get") } - var r0 *connect.Response[apiv1.PaymentServiceGetCustomerResponse] + var r0 *connect.Response[apiv1.PaymentServiceGetResponse] var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) (*connect.Response[apiv1.PaymentServiceGetCustomerResponse], error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) (*connect.Response[apiv1.PaymentServiceGetResponse], error)); ok { return returnFunc(context1, request) } - if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) *connect.Response[apiv1.PaymentServiceGetCustomerResponse]); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) *connect.Response[apiv1.PaymentServiceGetResponse]); ok { r0 = returnFunc(context1, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceGetCustomerResponse]) + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceGetResponse]) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetRequest]) error); ok { r1 = returnFunc(context1, request) } else { r1 = ret.Error(1) @@ -203,27 +203,27 @@ func (_mock *PaymentServiceHandler) GetCustomer(context1 context.Context, reques return r0, r1 } -// PaymentServiceHandler_GetCustomer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCustomer' -type PaymentServiceHandler_GetCustomer_Call struct { +// PaymentServiceHandler_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type PaymentServiceHandler_Get_Call struct { *mock.Call } -// GetCustomer is a helper method to define mock.On call +// Get is a helper method to define mock.On call // - context1 context.Context -// - request *connect.Request[apiv1.PaymentServiceGetCustomerRequest] -func (_e *PaymentServiceHandler_Expecter) GetCustomer(context1 any, request any) *PaymentServiceHandler_GetCustomer_Call { - return &PaymentServiceHandler_GetCustomer_Call{Call: _e.mock.On("GetCustomer", context1, request)} +// - request *connect.Request[apiv1.PaymentServiceGetRequest] +func (_e *PaymentServiceHandler_Expecter) Get(context1 any, request any) *PaymentServiceHandler_Get_Call { + return &PaymentServiceHandler_Get_Call{Call: _e.mock.On("Get", context1, request)} } -func (_c *PaymentServiceHandler_GetCustomer_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetCustomerRequest])) *PaymentServiceHandler_GetCustomer_Call { +func (_c *PaymentServiceHandler_Get_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetRequest])) *PaymentServiceHandler_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } - var arg1 *connect.Request[apiv1.PaymentServiceGetCustomerRequest] + var arg1 *connect.Request[apiv1.PaymentServiceGetRequest] if args[1] != nil { - arg1 = args[1].(*connect.Request[apiv1.PaymentServiceGetCustomerRequest]) + arg1 = args[1].(*connect.Request[apiv1.PaymentServiceGetRequest]) } run( arg0, @@ -233,12 +233,12 @@ func (_c *PaymentServiceHandler_GetCustomer_Call) Run(run func(context1 context. return _c } -func (_c *PaymentServiceHandler_GetCustomer_Call) Return(response *connect.Response[apiv1.PaymentServiceGetCustomerResponse], err error) *PaymentServiceHandler_GetCustomer_Call { +func (_c *PaymentServiceHandler_Get_Call) Return(response *connect.Response[apiv1.PaymentServiceGetResponse], err error) *PaymentServiceHandler_Get_Call { _c.Call.Return(response, err) return _c } -func (_c *PaymentServiceHandler_GetCustomer_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetCustomerRequest]) (*connect.Response[apiv1.PaymentServiceGetCustomerResponse], error)) *PaymentServiceHandler_GetCustomer_Call { +func (_c *PaymentServiceHandler_Get_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetRequest]) (*connect.Response[apiv1.PaymentServiceGetResponse], error)) *PaymentServiceHandler_Get_Call { _c.Call.Return(run) return _c } @@ -582,3 +582,71 @@ func (_c *PaymentServiceHandler_HasPaymentMethod_Call) RunAndReturn(run func(con _c.Call.Return(run) return _c } + +// Update provides a mock function for the type PaymentServiceHandler +func (_mock *PaymentServiceHandler) Update(context1 context.Context, request *connect.Request[apiv1.PaymentServiceUpdateRequest]) (*connect.Response[apiv1.PaymentServiceUpdateResponse], error) { + ret := _mock.Called(context1, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *connect.Response[apiv1.PaymentServiceUpdateResponse] + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) (*connect.Response[apiv1.PaymentServiceUpdateResponse], error)); ok { + return returnFunc(context1, request) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) *connect.Response[apiv1.PaymentServiceUpdateResponse]); ok { + r0 = returnFunc(context1, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceUpdateResponse]) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceUpdateRequest]) error); ok { + r1 = returnFunc(context1, request) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// PaymentServiceHandler_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type PaymentServiceHandler_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - context1 context.Context +// - request *connect.Request[apiv1.PaymentServiceUpdateRequest] +func (_e *PaymentServiceHandler_Expecter) Update(context1 any, request any) *PaymentServiceHandler_Update_Call { + return &PaymentServiceHandler_Update_Call{Call: _e.mock.On("Update", context1, request)} +} + +func (_c *PaymentServiceHandler_Update_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceUpdateRequest])) *PaymentServiceHandler_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *connect.Request[apiv1.PaymentServiceUpdateRequest] + if args[1] != nil { + arg1 = args[1].(*connect.Request[apiv1.PaymentServiceUpdateRequest]) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *PaymentServiceHandler_Update_Call) Return(response *connect.Response[apiv1.PaymentServiceUpdateResponse], err error) *PaymentServiceHandler_Update_Call { + _c.Call.Return(response, err) + return _c +} + +func (_c *PaymentServiceHandler_Update_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceUpdateRequest]) (*connect.Response[apiv1.PaymentServiceUpdateResponse], error)) *PaymentServiceHandler_Update_Call { + _c.Call.Return(run) + return _c +} diff --git a/js/api/v1/payment_pb.d.ts b/js/api/v1/payment_pb.d.ts index 52a6d23e..f6eef375 100644 --- a/js/api/v1/payment_pb.d.ts +++ b/js/api/v1/payment_pb.d.ts @@ -83,6 +83,12 @@ export type PaymentCustomer = Message<"api.v1.PaymentCustomer"> & { * @generated from field: optional int64 balance = 13; */ balance?: bigint | undefined; + /** + * Tier describes the state in which the customer is using the products. + * + * @generated from field: api.v1.ProductTier tier = 14; + */ + tier: ProductTier; }; /** * Describes the message api.v1.PaymentCustomer. @@ -372,13 +378,13 @@ export type Invoice = Message<"api.v1.Invoice"> & { */ export declare const InvoiceSchema: GenMessage; /** - * PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request + * PaymentServiceCreateRequest is the request payload for providing payment data * - * @generated from message api.v1.PaymentServiceCreateOrUpdateCustomerRequest + * @generated from message api.v1.PaymentServiceCreateRequest */ -export type PaymentServiceCreateOrUpdateCustomerRequest = Message<"api.v1.PaymentServiceCreateOrUpdateCustomerRequest"> & { +export type PaymentServiceCreateRequest = Message<"api.v1.PaymentServiceCreateRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -386,111 +392,171 @@ export type PaymentServiceCreateOrUpdateCustomerRequest = Message<"api.v1.Paymen /** * Name of the customer to be billed * - * @generated from field: optional string name = 4; + * @generated from field: string name = 2; */ - name?: string | undefined; + name: string; /** * PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api * - * @generated from field: optional string payment_method_id = 5; + * @generated from field: string payment_method_id = 3; */ - paymentMethodId?: string | undefined; + paymentMethodId: string; /** * Email of the customer to be billed * - * @generated from field: optional string email = 6; + * @generated from field: string email = 4; */ - email?: string | undefined; + email: string; /** - * Card the customer to be billed + * Address is the postal address of the customer to be billed * - * @generated from field: optional api.v1.Card card = 7; + * @generated from field: api.v1.Address address = 5; */ - card?: Card | undefined; + address?: Address | undefined; + /** + * Vat which applies to the customer to be billed + * + * @generated from field: string vat = 6; + */ + vat: string; + /** + * PhoneNumber of the customer to be billed + * + * @generated from field: optional string phone_number = 7; + */ + phoneNumber?: string | undefined; +}; +/** + * Describes the message api.v1.PaymentServiceCreateRequest. + * Use `create(PaymentServiceCreateRequestSchema)` to create a new message. + */ +export declare const PaymentServiceCreateRequestSchema: GenMessage; +/** + * PaymentServiceCreateResponse is the response payload for a payment create request + * + * @generated from message api.v1.PaymentServiceCreateResponse + */ +export type PaymentServiceCreateResponse = Message<"api.v1.PaymentServiceCreateResponse"> & { + /** + * Customer is the created customer + * + * @generated from field: api.v1.PaymentCustomer customer = 1; + */ + customer?: PaymentCustomer | undefined; +}; +/** + * Describes the message api.v1.PaymentServiceCreateResponse. + * Use `create(PaymentServiceCreateResponseSchema)` to create a new message. + */ +export declare const PaymentServiceCreateResponseSchema: GenMessage; +/** + * PaymentServiceUpdateRequest is the request payload for updating payment data + * + * @generated from message api.v1.PaymentServiceUpdateRequest + */ +export type PaymentServiceUpdateRequest = Message<"api.v1.PaymentServiceUpdateRequest"> & { + /** + * Login of the tenant + * + * @generated from field: string login = 1; + */ + login: string; + /** + * Name of the customer to be billed + * + * @generated from field: optional string name = 2; + */ + name?: string | undefined; + /** + * PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api + * + * @generated from field: optional string payment_method_id = 3; + */ + paymentMethodId?: string | undefined; + /** + * Email of the customer to be billed + * + * @generated from field: optional string email = 4; + */ + email?: string | undefined; /** * Address is the postal address of the customer to be billed * - * @generated from field: api.v1.Address address = 8; + * @generated from field: api.v1.Address address = 5; */ address?: Address | undefined; /** * Vat which applies to the customer to be billed * - * @generated from field: optional string vat = 9; + * @generated from field: optional string vat = 6; */ vat?: string | undefined; /** * PhoneNumber of the customer to be billed * - * @generated from field: optional string phone_number = 10; + * @generated from field: optional string phone_number = 7; */ phoneNumber?: string | undefined; }; /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerRequest. - * Use `create(PaymentServiceCreateOrUpdateCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateRequest. + * Use `create(PaymentServiceUpdateRequestSchema)` to create a new message. */ -export declare const PaymentServiceCreateOrUpdateCustomerRequestSchema: GenMessage; +export declare const PaymentServiceUpdateRequestSchema: GenMessage; /** - * PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request + * PaymentServiceUpdateResponse is the response payload for a payment update request * - * @generated from message api.v1.PaymentServiceCreateOrUpdateCustomerResponse + * @generated from message api.v1.PaymentServiceUpdateResponse */ -export type PaymentServiceCreateOrUpdateCustomerResponse = Message<"api.v1.PaymentServiceCreateOrUpdateCustomerResponse"> & { +export type PaymentServiceUpdateResponse = Message<"api.v1.PaymentServiceUpdateResponse"> & { /** - * Customer is the customer + * Customer is the updated customer * * @generated from field: api.v1.PaymentCustomer customer = 1; */ customer?: PaymentCustomer | undefined; }; /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerResponse. - * Use `create(PaymentServiceCreateOrUpdateCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateResponse. + * Use `create(PaymentServiceUpdateResponseSchema)` to create a new message. */ -export declare const PaymentServiceCreateOrUpdateCustomerResponseSchema: GenMessage; +export declare const PaymentServiceUpdateResponseSchema: GenMessage; /** - * PaymentServiceGetCustomerRequest is the request payload for a payment get customer request + * PaymentServiceGetRequest is the request payload for getting the payment data * - * @generated from message api.v1.PaymentServiceGetCustomerRequest + * @generated from message api.v1.PaymentServiceGetRequest */ -export type PaymentServiceGetCustomerRequest = Message<"api.v1.PaymentServiceGetCustomerRequest"> & { +export type PaymentServiceGetRequest = Message<"api.v1.PaymentServiceGetRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ login: string; - /** - * CustomerId of the customer - * - * @generated from field: string customer_id = 2; - */ - customerId: string; }; /** - * Describes the message api.v1.PaymentServiceGetCustomerRequest. - * Use `create(PaymentServiceGetCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceGetRequest. + * Use `create(PaymentServiceGetRequestSchema)` to create a new message. */ -export declare const PaymentServiceGetCustomerRequestSchema: GenMessage; +export declare const PaymentServiceGetRequestSchema: GenMessage; /** - * PaymentServiceGetCustomerResponse is the response payload for a payment get customer request + * PaymentServiceGetResponse is the response payload for a payment get request * - * @generated from message api.v1.PaymentServiceGetCustomerResponse + * @generated from message api.v1.PaymentServiceGetResponse */ -export type PaymentServiceGetCustomerResponse = Message<"api.v1.PaymentServiceGetCustomerResponse"> & { +export type PaymentServiceGetResponse = Message<"api.v1.PaymentServiceGetResponse"> & { /** - * Customer is the customer + * Customer is the payment customer * * @generated from field: api.v1.PaymentCustomer customer = 1; */ customer?: PaymentCustomer | undefined; }; /** - * Describes the message api.v1.PaymentServiceGetCustomerResponse. - * Use `create(PaymentServiceGetCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceGetResponse. + * Use `create(PaymentServiceGetResponseSchema)` to create a new message. */ -export declare const PaymentServiceGetCustomerResponseSchema: GenMessage; +export declare const PaymentServiceGetResponseSchema: GenMessage; /** * PaymentServiceHasPaymentMethodRequest is the request payload for a has payment request * @@ -498,7 +564,7 @@ export declare const PaymentServiceGetCustomerResponseSchema: GenMessage & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -534,34 +600,34 @@ export type PaymentServiceHasPaymentMethodResponse = Message<"api.v1.PaymentServ */ export declare const PaymentServiceHasPaymentMethodResponseSchema: GenMessage; /** - * PaymentServiceDeletePaymentMethodRequest is the request payload for a delete payment request + * PaymentServiceDeleteRequest is the request payload for a delete payment request * - * @generated from message api.v1.PaymentServiceDeletePaymentMethodRequest + * @generated from message api.v1.PaymentServiceDeleteRequest */ -export type PaymentServiceDeletePaymentMethodRequest = Message<"api.v1.PaymentServiceDeletePaymentMethodRequest"> & { +export type PaymentServiceDeleteRequest = Message<"api.v1.PaymentServiceDeleteRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ login: string; }; /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodRequest. - * Use `create(PaymentServiceDeletePaymentMethodRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteRequest. + * Use `create(PaymentServiceDeleteRequestSchema)` to create a new message. */ -export declare const PaymentServiceDeletePaymentMethodRequestSchema: GenMessage; +export declare const PaymentServiceDeleteRequestSchema: GenMessage; /** - * PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request + * PaymentServiceDeleteResponse is the response payload for a delete payment request * - * @generated from message api.v1.PaymentServiceDeletePaymentMethodResponse + * @generated from message api.v1.PaymentServiceDeleteResponse */ -export type PaymentServiceDeletePaymentMethodResponse = Message<"api.v1.PaymentServiceDeletePaymentMethodResponse"> & {}; +export type PaymentServiceDeleteResponse = Message<"api.v1.PaymentServiceDeleteResponse"> & {}; /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodResponse. - * Use `create(PaymentServiceDeletePaymentMethodResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteResponse. + * Use `create(PaymentServiceDeleteResponseSchema)` to create a new message. */ -export declare const PaymentServiceDeletePaymentMethodResponseSchema: GenMessage; +export declare const PaymentServiceDeleteResponseSchema: GenMessage; /** * PaymentServiceGetSubscriptionUsageRequest is the request payload for a get subscription usage request * @@ -569,7 +635,7 @@ export declare const PaymentServiceDeletePaymentMethodResponseSchema: GenMessage */ export type PaymentServiceGetSubscriptionUsageRequest = Message<"api.v1.PaymentServiceGetSubscriptionUsageRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -605,7 +671,7 @@ export declare const PaymentServiceGetSubscriptionUsageResponseSchema: GenMessag */ export type PaymentServiceGetInvoicesRequest = Message<"api.v1.PaymentServiceGetInvoicesRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -775,6 +841,35 @@ export declare enum UsageType { * Describes the enum api.v1.UsageType. */ export declare const UsageTypeSchema: GenEnum; +/** + * ProductTier is an explicit indicator for the state in which the customer is using the products. + * + * @generated from enum api.v1.ProductTier + */ +export declare enum ProductTier { + /** + * PRODUCT_TIER_UNSPECIFIED is unspecified + * + * @generated from enum value: PRODUCT_TIER_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information. + * + * @generated from enum value: PRODUCT_TIER_TRIAL = 1; + */ + TRIAL = 1, + /** + * PRODUCT_TIER_PAID indicates a customer that has provided payment information. + * + * @generated from enum value: PRODUCT_TIER_PAID = 2; + */ + PAID = 2 +} +/** + * Describes the enum api.v1.ProductTier. + */ +export declare const ProductTierSchema: GenEnum; /** * PaymentService serves payment related functions * @@ -782,44 +877,54 @@ export declare const UsageTypeSchema: GenEnum; */ export declare const PaymentService: GenService<{ /** - * CreateOrUpdateCustomer the payment data on the payment processor + * Create the payment data used for billing api resources * - * @generated from rpc api.v1.PaymentService.CreateOrUpdateCustomer + * @generated from rpc api.v1.PaymentService.Create */ - createOrUpdateCustomer: { + create: { methodKind: "unary"; - input: typeof PaymentServiceCreateOrUpdateCustomerRequestSchema; - output: typeof PaymentServiceCreateOrUpdateCustomerResponseSchema; + input: typeof PaymentServiceCreateRequestSchema; + output: typeof PaymentServiceCreateResponseSchema; }; /** - * GetCustomer from the payment processor + * Update the payment data * - * @generated from rpc api.v1.PaymentService.GetCustomer + * @generated from rpc api.v1.PaymentService.Update */ - getCustomer: { + update: { methodKind: "unary"; - input: typeof PaymentServiceGetCustomerRequestSchema; - output: typeof PaymentServiceGetCustomerResponseSchema; + input: typeof PaymentServiceUpdateRequestSchema; + output: typeof PaymentServiceUpdateResponseSchema; }; /** - * HasPaymentMethod check if the customer has a payment method provided + * Delete the payment data * - * @generated from rpc api.v1.PaymentService.HasPaymentMethod + * @generated from rpc api.v1.PaymentService.Delete */ - hasPaymentMethod: { + delete: { methodKind: "unary"; - input: typeof PaymentServiceHasPaymentMethodRequestSchema; - output: typeof PaymentServiceHasPaymentMethodResponseSchema; + input: typeof PaymentServiceDeleteRequestSchema; + output: typeof PaymentServiceDeleteResponseSchema; + }; + /** + * Get the payment data + * + * @generated from rpc api.v1.PaymentService.Get + */ + get: { + methodKind: "unary"; + input: typeof PaymentServiceGetRequestSchema; + output: typeof PaymentServiceGetResponseSchema; }; /** - * DeletePaymentMethod of the customer + * HasPaymentMethod check if the customer has a payment method provided * - * @generated from rpc api.v1.PaymentService.DeletePaymentMethod + * @generated from rpc api.v1.PaymentService.HasPaymentMethod */ - deletePaymentMethod: { + hasPaymentMethod: { methodKind: "unary"; - input: typeof PaymentServiceDeletePaymentMethodRequestSchema; - output: typeof PaymentServiceDeletePaymentMethodResponseSchema; + input: typeof PaymentServiceHasPaymentMethodRequestSchema; + output: typeof PaymentServiceHasPaymentMethodResponseSchema; }; /** * GetSubscriptionUsage of the customer diff --git a/js/api/v1/payment_pb.js b/js/api/v1/payment_pb.js index d4e5c574..f303beda 100644 --- a/js/api/v1/payment_pb.js +++ b/js/api/v1/payment_pb.js @@ -8,7 +8,7 @@ import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; /** * Describes the file api/v1/payment.proto. */ -export const file_api_v1_payment = /*@__PURE__*/ fileDesc("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIr0DCg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcxgJIAEoCzIPLmFwaS52MS5BZGRyZXNzEhAKA3ZhdBgLIAEoCUgFiAEBEhkKDHBob25lX251bWJlchgMIAEoCUgGiAEBEhQKB2JhbGFuY2UYDSABKANIB4gBAUIHCgVfbmFtZUIOCgxfY3VzdG9tZXJfaWRCFAoSX3BheW1lbnRfbWV0aG9kX2lkQggKBl9lbWFpbEIHCgVfY2FyZEIGCgRfdmF0Qg8KDV9waG9uZV9udW1iZXJCCgoIX2JhbGFuY2VKBAgKEAtSBmNvdXBvbiJbCgRDYXJkEg0KBWJyYW5kGAEgASgJEg8KB2Nv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BvbnNlIgXC8xgBARKIAQoUR2V0U3Vic2NyaXB0aW9uVXNhZ2USMS5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRTdWJzY3JpcHRpb25Vc2FnZVJlcXVlc3QaMi5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRTdWJzY3JpcHRpb25Vc2FnZVJlc3BvbnNlIgnC8xgBAejzGAISbQoLR2V0SW52b2ljZXMSKC5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRJbnZvaWNlc1JlcXVlc3QaKS5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRJbnZvaWNlc1Jlc3BvbnNlIgnC8xgBAejzGAISewoQR2V0RGVmYXVsdFByaWNlcxItLmFwaS52MS5QYXltZW50U2VydmljZUdldERlZmF1bHRQcmljZXNSZXF1ZXN0Gi4uYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0RGVmYXVsdFByaWNlc1Jlc3BvbnNlIgjY8xgB6PMYAhKUAQoYR2V0U3Vic2NyaXB0aW9uRGlzY291bnRzEjUuYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0U3Vic2NyaXB0aW9uRGlzY291bnRzUmVxdWVzdBo2LmFwaS52MS5QYXltZW50U2VydmljZUdldFN1YnNjcmlwdGlvbkRpc2NvdW50c1Jlc3BvbnNlIgnC8xgBAejzGAJChQEKCmNvbS5hcGkudjFCDFBheW1lbnRQcm90b1ABWjBnaXRodWIuY29tL21ldGFsLXN0YWNrLWNsb3VkL2FwaS9nby9hcGkvdjE7YXBpdjGiAgNBWFiqAgZBcGkuVjHKAgZBcGlcVjHiAhJBcGlcVjFcR1BCTWV0YWRhdGHqAgdBcGk6OlYxYgZwcm90bzM", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); +export const file_api_v1_payment = /*@__PURE__*/ fileDesc("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIuADCg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZR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JzY3JpcHRpb25Vc2FnZVJlcXVlc3QaMi5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRTdWJzY3JpcHRpb25Vc2FnZVJlc3BvbnNlIgnC8xgBAejzGAISbQoLR2V0SW52b2ljZXMSKC5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRJbnZvaWNlc1JlcXVlc3QaKS5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRJbnZvaWNlc1Jlc3BvbnNlIgnC8xgBAejzGAISewoQR2V0RGVmYXVsdFByaWNlcxItLmFwaS52MS5QYXltZW50U2VydmljZUdldERlZmF1bHRQcmljZXNSZXF1ZXN0Gi4uYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0RGVmYXVsdFByaWNlc1Jlc3BvbnNlIgjY8xgB6PMYAhKUAQoYR2V0U3Vic2NyaXB0aW9uRGlzY291bnRzEjUuYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0U3Vic2NyaXB0aW9uRGlzY291bnRzUmVxdWVzdBo2LmFwaS52MS5QYXltZW50U2VydmljZUdldFN1YnNjcmlwdGlvbkRpc2NvdW50c1Jlc3BvbnNlIgnC8xgBAejzGAJChQEKCmNvbS5hcGkudjFCDFBheW1lbnRQcm90b1ABWjBnaXRodWIuY29tL21ldGFsLXN0YWNrLWNsb3VkL2FwaS9nby9hcGkvdjE7YXBpdjGiAgNBWFiqAgZBcGkuVjHKAgZBcGlcVjHiAhJBcGlcVjFcR1BCTWV0YWRhdGHqAgdBcGk6OlYxYgZwcm90bzM", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); /** * Describes the message api.v1.PaymentCustomer. * Use `create(PaymentCustomerSchema)` to create a new message. @@ -45,85 +45,95 @@ export const DiscountSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 5); */ export const InvoiceSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 6); /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerRequest. - * Use `create(PaymentServiceCreateOrUpdateCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceCreateRequest. + * Use `create(PaymentServiceCreateRequestSchema)` to create a new message. */ -export const PaymentServiceCreateOrUpdateCustomerRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 7); +export const PaymentServiceCreateRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 7); /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerResponse. - * Use `create(PaymentServiceCreateOrUpdateCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceCreateResponse. + * Use `create(PaymentServiceCreateResponseSchema)` to create a new message. */ -export const PaymentServiceCreateOrUpdateCustomerResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 8); +export const PaymentServiceCreateResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 8); /** - * Describes the message api.v1.PaymentServiceGetCustomerRequest. - * Use `create(PaymentServiceGetCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateRequest. + * Use `create(PaymentServiceUpdateRequestSchema)` to create a new message. */ -export const PaymentServiceGetCustomerRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 9); +export const PaymentServiceUpdateRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 9); /** - * Describes the message api.v1.PaymentServiceGetCustomerResponse. - * Use `create(PaymentServiceGetCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateResponse. + * Use `create(PaymentServiceUpdateResponseSchema)` to create a new message. */ -export const PaymentServiceGetCustomerResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 10); +export const PaymentServiceUpdateResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 10); +/** + * Describes the message api.v1.PaymentServiceGetRequest. + * Use `create(PaymentServiceGetRequestSchema)` to create a new message. + */ +export const PaymentServiceGetRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 11); +/** + * Describes the message api.v1.PaymentServiceGetResponse. + * Use `create(PaymentServiceGetResponseSchema)` to create a new message. + */ +export const PaymentServiceGetResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 12); /** * Describes the message api.v1.PaymentServiceHasPaymentMethodRequest. * Use `create(PaymentServiceHasPaymentMethodRequestSchema)` to create a new message. */ -export const PaymentServiceHasPaymentMethodRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 11); +export const PaymentServiceHasPaymentMethodRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 13); /** * Describes the message api.v1.PaymentServiceHasPaymentMethodResponse. * Use `create(PaymentServiceHasPaymentMethodResponseSchema)` to create a new message. */ -export const PaymentServiceHasPaymentMethodResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 12); +export const PaymentServiceHasPaymentMethodResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 14); /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodRequest. - * Use `create(PaymentServiceDeletePaymentMethodRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteRequest. + * Use `create(PaymentServiceDeleteRequestSchema)` to create a new message. */ -export const PaymentServiceDeletePaymentMethodRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 13); +export const PaymentServiceDeleteRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 15); /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodResponse. - * Use `create(PaymentServiceDeletePaymentMethodResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteResponse. + * Use `create(PaymentServiceDeleteResponseSchema)` to create a new message. */ -export const PaymentServiceDeletePaymentMethodResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 14); +export const PaymentServiceDeleteResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 16); /** * Describes the message api.v1.PaymentServiceGetSubscriptionUsageRequest. * Use `create(PaymentServiceGetSubscriptionUsageRequestSchema)` to create a new message. */ -export const PaymentServiceGetSubscriptionUsageRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 15); +export const PaymentServiceGetSubscriptionUsageRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 17); /** * Describes the message api.v1.PaymentServiceGetSubscriptionUsageResponse. * Use `create(PaymentServiceGetSubscriptionUsageResponseSchema)` to create a new message. */ -export const PaymentServiceGetSubscriptionUsageResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 16); +export const PaymentServiceGetSubscriptionUsageResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 18); /** * Describes the message api.v1.PaymentServiceGetInvoicesRequest. * Use `create(PaymentServiceGetInvoicesRequestSchema)` to create a new message. */ -export const PaymentServiceGetInvoicesRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 17); +export const PaymentServiceGetInvoicesRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 19); /** * Describes the message api.v1.PaymentServiceGetInvoicesResponse. * Use `create(PaymentServiceGetInvoicesResponseSchema)` to create a new message. */ -export const PaymentServiceGetInvoicesResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 18); +export const PaymentServiceGetInvoicesResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 20); /** * Describes the message api.v1.PaymentServiceGetDefaultPricesRequest. * Use `create(PaymentServiceGetDefaultPricesRequestSchema)` to create a new message. */ -export const PaymentServiceGetDefaultPricesRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 19); +export const PaymentServiceGetDefaultPricesRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 21); /** * Describes the message api.v1.PaymentServiceGetDefaultPricesResponse. * Use `create(PaymentServiceGetDefaultPricesResponseSchema)` to create a new message. */ -export const PaymentServiceGetDefaultPricesResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 20); +export const PaymentServiceGetDefaultPricesResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 22); /** * Describes the message api.v1.PaymentServiceGetSubscriptionDiscountsRequest. * Use `create(PaymentServiceGetSubscriptionDiscountsRequestSchema)` to create a new message. */ -export const PaymentServiceGetSubscriptionDiscountsRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 21); +export const PaymentServiceGetSubscriptionDiscountsRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 23); /** * Describes the message api.v1.PaymentServiceGetSubscriptionDiscountsResponse. * Use `create(PaymentServiceGetSubscriptionDiscountsResponseSchema)` to create a new message. */ -export const PaymentServiceGetSubscriptionDiscountsResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 22); +export const PaymentServiceGetSubscriptionDiscountsResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 24); /** * ProductType defines for which type of product a price applies * @@ -196,6 +206,36 @@ export var UsageType; * Describes the enum api.v1.UsageType. */ export const UsageTypeSchema = /*@__PURE__*/ enumDesc(file_api_v1_payment, 1); +/** + * ProductTier is an explicit indicator for the state in which the customer is using the products. + * + * @generated from enum api.v1.ProductTier + */ +export var ProductTier; +(function (ProductTier) { + /** + * PRODUCT_TIER_UNSPECIFIED is unspecified + * + * @generated from enum value: PRODUCT_TIER_UNSPECIFIED = 0; + */ + ProductTier[ProductTier["UNSPECIFIED"] = 0] = "UNSPECIFIED"; + /** + * PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information. + * + * @generated from enum value: PRODUCT_TIER_TRIAL = 1; + */ + ProductTier[ProductTier["TRIAL"] = 1] = "TRIAL"; + /** + * PRODUCT_TIER_PAID indicates a customer that has provided payment information. + * + * @generated from enum value: PRODUCT_TIER_PAID = 2; + */ + ProductTier[ProductTier["PAID"] = 2] = "PAID"; +})(ProductTier || (ProductTier = {})); +/** + * Describes the enum api.v1.ProductTier. + */ +export const ProductTierSchema = /*@__PURE__*/ enumDesc(file_api_v1_payment, 2); /** * PaymentService serves payment related functions * diff --git a/js/api/v1/payment_pb.ts b/js/api/v1/payment_pb.ts index 6f5326e8..a62317a2 100644 --- a/js/api/v1/payment_pb.ts +++ b/js/api/v1/payment_pb.ts @@ -14,7 +14,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file api/v1/payment.proto. */ export const file_api_v1_payment: GenFile = /*@__PURE__*/ - fileDesc("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIr0DCg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcxgJIAEoCzIPLmFwaS52MS5BZGRyZXNzEhAKA3ZhdBgLIAEoCUgFiAEBEhkKDHBob25lX251bWJlchgMIAEoCUgGiAEBEhQKB2JhbGFuY2UYDSABKANIB4gBAUIHCgVfbmFtZUIOCgxfY3VzdG9tZXJfaWRCFAoSX3BheW1lbnRfbWV0aG9kX2lkQggKBl9lbWFpbEIHCgVfY2FyZEIGCgRfdmF0Qg8KDV9waG9uZV9udW1iZXJCCgoIX2JhbGFuY2VKBAgKEAtSBmNvdXBvbiJbCgRDYXJkEg0KBWJyYW5kGAEgASgJEg8KB2NvdW50cnkYAiABKAkSEQoJZXhwX21vbnRoGAMgASgDEhAKCGV4cF95ZWFyGAQgASgDEg4KBmxhc3RfNBgFIAEoCSLgAQoFUHJpY2USDAoEbmFtZRgBIAEoCRIbChN1bml0X2Ftb3VudF9kZWNpbWFsGAIgASgBEhAKCGN1cnJlbmN5GAMgASgJEhIKCnVuaXRfbGFiZWwYBCABKAkSKQoMcHJvZHVjdF90eXBlGAUgASgOMhMuYXBpLnYxLlBy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ZpY2VHZXRJbnZvaWNlc1JlcXVlc3QaKS5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRJbnZvaWNlc1Jlc3BvbnNlIgnC8xgBAejzGAISewoQR2V0RGVmYXVsdFByaWNlcxItLmFwaS52MS5QYXltZW50U2VydmljZUdldERlZmF1bHRQcmljZXNSZXF1ZXN0Gi4uYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0RGVmYXVsdFByaWNlc1Jlc3BvbnNlIgjY8xgB6PMYAhKUAQoYR2V0U3Vic2NyaXB0aW9uRGlzY291bnRzEjUuYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0U3Vic2NyaXB0aW9uRGlzY291bnRzUmVxdWVzdBo2LmFwaS52MS5QYXltZW50U2VydmljZUdldFN1YnNjcmlwdGlvbkRpc2NvdW50c1Jlc3BvbnNlIgnC8xgBAejzGAJChQEKCmNvbS5hcGkudjFCDFBheW1lbnRQcm90b1ABWjBnaXRodWIuY29tL21ldGFsLXN0YWNrLWNsb3VkL2FwaS9nby9hcGkvdjE7YXBpdjGiAgNBWFiqAgZBcGkuVjHKAgZBcGlcVjHiAhJBcGlcVjFcR1BCTWV0YWRhdGHqAgdBcGk6OlYxYgZwcm90bzM", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); + fileDesc("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIuADCg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcxgJIAEoCzIPLmFwaS52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VmYXVsdFByaWNlcxItLmFwaS52MS5QYXltZW50U2VydmljZUdldERlZmF1bHRQcmljZXNSZXF1ZXN0Gi4uYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0RGVmYXVsdFByaWNlc1Jlc3BvbnNlIgjY8xgB6PMYAhKUAQoYR2V0U3Vic2NyaXB0aW9uRGlzY291bnRzEjUuYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0U3Vic2NyaXB0aW9uRGlzY291bnRzUmVxdWVzdBo2LmFwaS52MS5QYXltZW50U2VydmljZUdldFN1YnNjcmlwdGlvbkRpc2NvdW50c1Jlc3BvbnNlIgnC8xgBAejzGAJChQEKCmNvbS5hcGkudjFCDFBheW1lbnRQcm90b1ABWjBnaXRodWIuY29tL21ldGFsLXN0YWNrLWNsb3VkL2FwaS9nby9hcGkvdjE7YXBpdjGiAgNBWFiqAgZBcGkuVjHKAgZBcGlcVjHiAhJBcGlcVjFcR1BCTWV0YWRhdGHqAgdBcGk6OlYxYgZwcm90bzM", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); /** * PaymentCustomer is a customer at the payment processor @@ -105,6 +105,13 @@ export type PaymentCustomer = Message<"api.v1.PaymentCustomer"> & { * @generated from field: optional int64 balance = 13; */ balance?: bigint | undefined; + + /** + * Tier describes the state in which the customer is using the products. + * + * @generated from field: api.v1.ProductTier tier = 14; + */ + tier: ProductTier; }; /** @@ -444,13 +451,13 @@ export const InvoiceSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 6); /** - * PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request + * PaymentServiceCreateRequest is the request payload for providing payment data * - * @generated from message api.v1.PaymentServiceCreateOrUpdateCustomerRequest + * @generated from message api.v1.PaymentServiceCreateRequest */ -export type PaymentServiceCreateOrUpdateCustomerRequest = Message<"api.v1.PaymentServiceCreateOrUpdateCustomerRequest"> & { +export type PaymentServiceCreateRequest = Message<"api.v1.PaymentServiceCreateRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -459,68 +466,61 @@ export type PaymentServiceCreateOrUpdateCustomerRequest = Message<"api.v1.Paymen /** * Name of the customer to be billed * - * @generated from field: optional string name = 4; + * @generated from field: string name = 2; */ - name?: string | undefined; + name: string; /** * PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api * - * @generated from field: optional string payment_method_id = 5; + * @generated from field: string payment_method_id = 3; */ - paymentMethodId?: string | undefined; + paymentMethodId: string; /** * Email of the customer to be billed * - * @generated from field: optional string email = 6; + * @generated from field: string email = 4; */ - email?: string | undefined; - - /** - * Card the customer to be billed - * - * @generated from field: optional api.v1.Card card = 7; - */ - card?: Card | undefined; + email: string; /** * Address is the postal address of the customer to be billed * - * @generated from field: api.v1.Address address = 8; + * @generated from field: api.v1.Address address = 5; */ address?: Address | undefined; /** * Vat which applies to the customer to be billed * - * @generated from field: optional string vat = 9; + * @generated from field: string vat = 6; */ - vat?: string | undefined; + vat: string; /** * PhoneNumber of the customer to be billed * - * @generated from field: optional string phone_number = 10; + * @generated from field: optional string phone_number = 7; */ phoneNumber?: string | undefined; }; /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerRequest. - * Use `create(PaymentServiceCreateOrUpdateCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceCreateRequest. + * Use `create(PaymentServiceCreateRequestSchema)` to create a new message. */ -export const PaymentServiceCreateOrUpdateCustomerRequestSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceCreateRequestSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 7); /** - * PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request + * PaymentServiceCreateResponse is the response payload for a payment create request * - * @generated from message api.v1.PaymentServiceCreateOrUpdateCustomerResponse + * @generated from message api.v1.PaymentServiceCreateResponse */ -export type PaymentServiceCreateOrUpdateCustomerResponse = Message<"api.v1.PaymentServiceCreateOrUpdateCustomerResponse"> & { +export type PaymentServiceCreateResponse = Message<"api.v1.PaymentServiceCreateResponse"> & { /** - * Customer is the customer + * Customer is the created customer * * @generated from field: api.v1.PaymentCustomer customer = 1; */ @@ -528,48 +528,83 @@ export type PaymentServiceCreateOrUpdateCustomerResponse = Message<"api.v1.Payme }; /** - * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerResponse. - * Use `create(PaymentServiceCreateOrUpdateCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceCreateResponse. + * Use `create(PaymentServiceCreateResponseSchema)` to create a new message. */ -export const PaymentServiceCreateOrUpdateCustomerResponseSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceCreateResponseSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 8); /** - * PaymentServiceGetCustomerRequest is the request payload for a payment get customer request + * PaymentServiceUpdateRequest is the request payload for updating payment data * - * @generated from message api.v1.PaymentServiceGetCustomerRequest + * @generated from message api.v1.PaymentServiceUpdateRequest */ -export type PaymentServiceGetCustomerRequest = Message<"api.v1.PaymentServiceGetCustomerRequest"> & { +export type PaymentServiceUpdateRequest = Message<"api.v1.PaymentServiceUpdateRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ login: string; /** - * CustomerId of the customer + * Name of the customer to be billed * - * @generated from field: string customer_id = 2; + * @generated from field: optional string name = 2; */ - customerId: string; + name?: string | undefined; + + /** + * PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api + * + * @generated from field: optional string payment_method_id = 3; + */ + paymentMethodId?: string | undefined; + + /** + * Email of the customer to be billed + * + * @generated from field: optional string email = 4; + */ + email?: string | undefined; + + /** + * Address is the postal address of the customer to be billed + * + * @generated from field: api.v1.Address address = 5; + */ + address?: Address | undefined; + + /** + * Vat which applies to the customer to be billed + * + * @generated from field: optional string vat = 6; + */ + vat?: string | undefined; + + /** + * PhoneNumber of the customer to be billed + * + * @generated from field: optional string phone_number = 7; + */ + phoneNumber?: string | undefined; }; /** - * Describes the message api.v1.PaymentServiceGetCustomerRequest. - * Use `create(PaymentServiceGetCustomerRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateRequest. + * Use `create(PaymentServiceUpdateRequestSchema)` to create a new message. */ -export const PaymentServiceGetCustomerRequestSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceUpdateRequestSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 9); /** - * PaymentServiceGetCustomerResponse is the response payload for a payment get customer request + * PaymentServiceUpdateResponse is the response payload for a payment update request * - * @generated from message api.v1.PaymentServiceGetCustomerResponse + * @generated from message api.v1.PaymentServiceUpdateResponse */ -export type PaymentServiceGetCustomerResponse = Message<"api.v1.PaymentServiceGetCustomerResponse"> & { +export type PaymentServiceUpdateResponse = Message<"api.v1.PaymentServiceUpdateResponse"> & { /** - * Customer is the customer + * Customer is the updated customer * * @generated from field: api.v1.PaymentCustomer customer = 1; */ @@ -577,12 +612,54 @@ export type PaymentServiceGetCustomerResponse = Message<"api.v1.PaymentServiceGe }; /** - * Describes the message api.v1.PaymentServiceGetCustomerResponse. - * Use `create(PaymentServiceGetCustomerResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceUpdateResponse. + * Use `create(PaymentServiceUpdateResponseSchema)` to create a new message. */ -export const PaymentServiceGetCustomerResponseSchema: GenMessage = /*@__PURE__*/ +export const PaymentServiceUpdateResponseSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 10); +/** + * PaymentServiceGetRequest is the request payload for getting the payment data + * + * @generated from message api.v1.PaymentServiceGetRequest + */ +export type PaymentServiceGetRequest = Message<"api.v1.PaymentServiceGetRequest"> & { + /** + * Login of the tenant + * + * @generated from field: string login = 1; + */ + login: string; +}; + +/** + * Describes the message api.v1.PaymentServiceGetRequest. + * Use `create(PaymentServiceGetRequestSchema)` to create a new message. + */ +export const PaymentServiceGetRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_api_v1_payment, 11); + +/** + * PaymentServiceGetResponse is the response payload for a payment get request + * + * @generated from message api.v1.PaymentServiceGetResponse + */ +export type PaymentServiceGetResponse = Message<"api.v1.PaymentServiceGetResponse"> & { + /** + * Customer is the payment customer + * + * @generated from field: api.v1.PaymentCustomer customer = 1; + */ + customer?: PaymentCustomer | undefined; +}; + +/** + * Describes the message api.v1.PaymentServiceGetResponse. + * Use `create(PaymentServiceGetResponseSchema)` to create a new message. + */ +export const PaymentServiceGetResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_api_v1_payment, 12); + /** * PaymentServiceHasPaymentMethodRequest is the request payload for a has payment request * @@ -590,7 +667,7 @@ export const PaymentServiceGetCustomerResponseSchema: GenMessage & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -602,7 +679,7 @@ export type PaymentServiceHasPaymentMethodRequest = Message<"api.v1.PaymentServi * Use `create(PaymentServiceHasPaymentMethodRequestSchema)` to create a new message. */ export const PaymentServiceHasPaymentMethodRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 11); + messageDesc(file_api_v1_payment, 13); /** * PaymentServiceHasPaymentMethodResponse is the response payload for a has payment request @@ -630,16 +707,16 @@ export type PaymentServiceHasPaymentMethodResponse = Message<"api.v1.PaymentServ * Use `create(PaymentServiceHasPaymentMethodResponseSchema)` to create a new message. */ export const PaymentServiceHasPaymentMethodResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 12); + messageDesc(file_api_v1_payment, 14); /** - * PaymentServiceDeletePaymentMethodRequest is the request payload for a delete payment request + * PaymentServiceDeleteRequest is the request payload for a delete payment request * - * @generated from message api.v1.PaymentServiceDeletePaymentMethodRequest + * @generated from message api.v1.PaymentServiceDeleteRequest */ -export type PaymentServiceDeletePaymentMethodRequest = Message<"api.v1.PaymentServiceDeletePaymentMethodRequest"> & { +export type PaymentServiceDeleteRequest = Message<"api.v1.PaymentServiceDeleteRequest"> & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -647,26 +724,26 @@ export type PaymentServiceDeletePaymentMethodRequest = Message<"api.v1.PaymentSe }; /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodRequest. - * Use `create(PaymentServiceDeletePaymentMethodRequestSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteRequest. + * Use `create(PaymentServiceDeleteRequestSchema)` to create a new message. */ -export const PaymentServiceDeletePaymentMethodRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 13); +export const PaymentServiceDeleteRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_api_v1_payment, 15); /** - * PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request + * PaymentServiceDeleteResponse is the response payload for a delete payment request * - * @generated from message api.v1.PaymentServiceDeletePaymentMethodResponse + * @generated from message api.v1.PaymentServiceDeleteResponse */ -export type PaymentServiceDeletePaymentMethodResponse = Message<"api.v1.PaymentServiceDeletePaymentMethodResponse"> & { +export type PaymentServiceDeleteResponse = Message<"api.v1.PaymentServiceDeleteResponse"> & { }; /** - * Describes the message api.v1.PaymentServiceDeletePaymentMethodResponse. - * Use `create(PaymentServiceDeletePaymentMethodResponseSchema)` to create a new message. + * Describes the message api.v1.PaymentServiceDeleteResponse. + * Use `create(PaymentServiceDeleteResponseSchema)` to create a new message. */ -export const PaymentServiceDeletePaymentMethodResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 14); +export const PaymentServiceDeleteResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_api_v1_payment, 16); /** * PaymentServiceGetSubscriptionUsageRequest is the request payload for a get subscription usage request @@ -675,7 +752,7 @@ export const PaymentServiceDeletePaymentMethodResponseSchema: GenMessage & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -687,7 +764,7 @@ export type PaymentServiceGetSubscriptionUsageRequest = Message<"api.v1.PaymentS * Use `create(PaymentServiceGetSubscriptionUsageRequestSchema)` to create a new message. */ export const PaymentServiceGetSubscriptionUsageRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 15); + messageDesc(file_api_v1_payment, 17); /** * PaymentServiceGetSubscriptionUsageResponse is the response payload for a get subscription usage request @@ -708,7 +785,7 @@ export type PaymentServiceGetSubscriptionUsageResponse = Message<"api.v1.Payment * Use `create(PaymentServiceGetSubscriptionUsageResponseSchema)` to create a new message. */ export const PaymentServiceGetSubscriptionUsageResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 16); + messageDesc(file_api_v1_payment, 18); /** * PaymentServiceHasPaymentMethodRequest is the request payload for a get invoices request @@ -717,7 +794,7 @@ export const PaymentServiceGetSubscriptionUsageResponseSchema: GenMessage & { /** - * Login of the customer + * Login of the tenant * * @generated from field: string login = 1; */ @@ -736,7 +813,7 @@ export type PaymentServiceGetInvoicesRequest = Message<"api.v1.PaymentServiceGet * Use `create(PaymentServiceGetInvoicesRequestSchema)` to create a new message. */ export const PaymentServiceGetInvoicesRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 17); + messageDesc(file_api_v1_payment, 19); /** * PaymentServiceGetInvoicesResponse is the response payload for a get invoices request @@ -757,7 +834,7 @@ export type PaymentServiceGetInvoicesResponse = Message<"api.v1.PaymentServiceGe * Use `create(PaymentServiceGetInvoicesResponseSchema)` to create a new message. */ export const PaymentServiceGetInvoicesResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 18); + messageDesc(file_api_v1_payment, 20); /** * PaymentServiceGetDefaultPricesRequest is the request payload for a get default prices request @@ -772,7 +849,7 @@ export type PaymentServiceGetDefaultPricesRequest = Message<"api.v1.PaymentServi * Use `create(PaymentServiceGetDefaultPricesRequestSchema)` to create a new message. */ export const PaymentServiceGetDefaultPricesRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 19); + messageDesc(file_api_v1_payment, 21); /** * PaymentServiceGetDefaultPricesResponse is the response payload for a get default prices request @@ -793,7 +870,7 @@ export type PaymentServiceGetDefaultPricesResponse = Message<"api.v1.PaymentServ * Use `create(PaymentServiceGetDefaultPricesResponseSchema)` to create a new message. */ export const PaymentServiceGetDefaultPricesResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 20); + messageDesc(file_api_v1_payment, 22); /** * PaymentServiceGetSubscriptionDiscountsRequest is the request payload for a get subscription discounts request @@ -814,7 +891,7 @@ export type PaymentServiceGetSubscriptionDiscountsRequest = Message<"api.v1.Paym * Use `create(PaymentServiceGetSubscriptionDiscountsRequestSchema)` to create a new message. */ export const PaymentServiceGetSubscriptionDiscountsRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 21); + messageDesc(file_api_v1_payment, 23); /** * PaymentServiceGetSubscriptionUsageResponse is the response payload for a get subscription usage request @@ -835,7 +912,7 @@ export type PaymentServiceGetSubscriptionDiscountsResponse = Message<"api.v1.Pay * Use `create(PaymentServiceGetSubscriptionDiscountsResponseSchema)` to create a new message. */ export const PaymentServiceGetSubscriptionDiscountsResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 22); + messageDesc(file_api_v1_payment, 24); /** * ProductType defines for which type of product a price applies @@ -919,6 +996,40 @@ export enum UsageType { export const UsageTypeSchema: GenEnum = /*@__PURE__*/ enumDesc(file_api_v1_payment, 1); +/** + * ProductTier is an explicit indicator for the state in which the customer is using the products. + * + * @generated from enum api.v1.ProductTier + */ +export enum ProductTier { + /** + * PRODUCT_TIER_UNSPECIFIED is unspecified + * + * @generated from enum value: PRODUCT_TIER_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information. + * + * @generated from enum value: PRODUCT_TIER_TRIAL = 1; + */ + TRIAL = 1, + + /** + * PRODUCT_TIER_PAID indicates a customer that has provided payment information. + * + * @generated from enum value: PRODUCT_TIER_PAID = 2; + */ + PAID = 2, +} + +/** + * Describes the enum api.v1.ProductTier. + */ +export const ProductTierSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_api_v1_payment, 2); + /** * PaymentService serves payment related functions * @@ -926,44 +1037,54 @@ export const UsageTypeSchema: GenEnum = /*@__PURE__*/ */ export const PaymentService: GenService<{ /** - * CreateOrUpdateCustomer the payment data on the payment processor + * Create the payment data used for billing api resources * - * @generated from rpc api.v1.PaymentService.CreateOrUpdateCustomer + * @generated from rpc api.v1.PaymentService.Create */ - createOrUpdateCustomer: { + create: { methodKind: "unary"; - input: typeof PaymentServiceCreateOrUpdateCustomerRequestSchema; - output: typeof PaymentServiceCreateOrUpdateCustomerResponseSchema; + input: typeof PaymentServiceCreateRequestSchema; + output: typeof PaymentServiceCreateResponseSchema; }, /** - * GetCustomer from the payment processor + * Update the payment data * - * @generated from rpc api.v1.PaymentService.GetCustomer + * @generated from rpc api.v1.PaymentService.Update */ - getCustomer: { + update: { methodKind: "unary"; - input: typeof PaymentServiceGetCustomerRequestSchema; - output: typeof PaymentServiceGetCustomerResponseSchema; + input: typeof PaymentServiceUpdateRequestSchema; + output: typeof PaymentServiceUpdateResponseSchema; }, /** - * HasPaymentMethod check if the customer has a payment method provided + * Delete the payment data * - * @generated from rpc api.v1.PaymentService.HasPaymentMethod + * @generated from rpc api.v1.PaymentService.Delete */ - hasPaymentMethod: { + delete: { methodKind: "unary"; - input: typeof PaymentServiceHasPaymentMethodRequestSchema; - output: typeof PaymentServiceHasPaymentMethodResponseSchema; + input: typeof PaymentServiceDeleteRequestSchema; + output: typeof PaymentServiceDeleteResponseSchema; }, /** - * DeletePaymentMethod of the customer + * Get the payment data * - * @generated from rpc api.v1.PaymentService.DeletePaymentMethod + * @generated from rpc api.v1.PaymentService.Get */ - deletePaymentMethod: { + get: { methodKind: "unary"; - input: typeof PaymentServiceDeletePaymentMethodRequestSchema; - output: typeof PaymentServiceDeletePaymentMethodResponseSchema; + input: typeof PaymentServiceGetRequestSchema; + output: typeof PaymentServiceGetResponseSchema; + }, + /** + * HasPaymentMethod check if the customer has a payment method provided + * + * @generated from rpc api.v1.PaymentService.HasPaymentMethod + */ + hasPaymentMethod: { + methodKind: "unary"; + input: typeof PaymentServiceHasPaymentMethodRequestSchema; + output: typeof PaymentServiceHasPaymentMethodResponseSchema; }, /** * GetSubscriptionUsage of the customer diff --git a/js/permissions/servicepermissions.json b/js/permissions/servicepermissions.json index ac992069..e985eee4 100755 --- a/js/permissions/servicepermissions.json +++ b/js/permissions/servicepermissions.json @@ -51,10 +51,11 @@ "TENANT_ROLE_OWNER": [ "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/api.v1.AuditService/Get", "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/api.v1.AuditService/List", - "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/api.v1.PaymentService/CreateOrUpdateCustomer", - "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/api.v1.PaymentService/GetCustomer", + "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/api.v1.PaymentService/Create", + "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/api.v1.PaymentService/Update", + "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/api.v1.PaymentService/Delete", + "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/api.v1.PaymentService/Get", "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/api.v1.PaymentService/HasPaymentMethod", - "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/api.v1.PaymentService/DeletePaymentMethod", "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/api.v1.PaymentService/GetSubscriptionUsage", "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/api.v1.PaymentService/GetInvoices", "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/api.v1.PaymentService/GetSubscriptionDiscounts", @@ -188,14 +189,15 @@ "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/api.v1.IPService/Update": true, "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/api.v1.MethodService/List": true, "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/api.v1.MethodService/TokenScopedList": true, - "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/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "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/api.v1.PaymentService/DeletePaymentMethod": true, - "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/api.v1.PaymentService/GetCustomer": true, + "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/api.v1.PaymentService/Create": true, + "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/api.v1.PaymentService/Delete": true, + "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/api.v1.PaymentService/Get": true, "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/api.v1.PaymentService/GetDefaultPrices": true, "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/api.v1.PaymentService/GetInvoices": true, "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/api.v1.PaymentService/GetSubscriptionDiscounts": true, "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/api.v1.PaymentService/GetSubscriptionUsage": true, "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/api.v1.PaymentService/HasPaymentMethod": true, + "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/api.v1.PaymentService/Update": true, "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/api.v1.ProjectService/Create": true, "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/api.v1.ProjectService/Delete": true, "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/api.v1.ProjectService/Get": true, @@ -289,13 +291,14 @@ "tenant": { "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/api.v1.AuditService/Get": true, "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/api.v1.AuditService/List": true, - "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/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "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/api.v1.PaymentService/DeletePaymentMethod": true, - "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/api.v1.PaymentService/GetCustomer": true, + "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/api.v1.PaymentService/Create": true, + "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/api.v1.PaymentService/Delete": true, + "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/api.v1.PaymentService/Get": true, "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/api.v1.PaymentService/GetInvoices": true, "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/api.v1.PaymentService/GetSubscriptionDiscounts": true, "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/api.v1.PaymentService/GetSubscriptionUsage": true, "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/api.v1.PaymentService/HasPaymentMethod": true, + "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/api.v1.PaymentService/Update": true, "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/api.v1.ProjectService/Create": true, "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/api.v1.TenantService/Delete": true, "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/api.v1.TenantService/Get": true, @@ -386,14 +389,15 @@ "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/api.v1.IPService/Update": true, "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/api.v1.MethodService/List": true, "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/api.v1.MethodService/TokenScopedList": true, - "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/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "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/api.v1.PaymentService/DeletePaymentMethod": true, - "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/api.v1.PaymentService/GetCustomer": false, + "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/api.v1.PaymentService/Create": true, + "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/api.v1.PaymentService/Delete": true, + "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/api.v1.PaymentService/Get": false, "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/api.v1.PaymentService/GetDefaultPrices": false, "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/api.v1.PaymentService/GetInvoices": false, "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/api.v1.PaymentService/GetSubscriptionDiscounts": false, "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/api.v1.PaymentService/GetSubscriptionUsage": false, "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/api.v1.PaymentService/HasPaymentMethod": false, + "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/api.v1.PaymentService/Update": true, "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/api.v1.ProjectService/Create": true, "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/api.v1.ProjectService/Delete": true, "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/api.v1.ProjectService/Get": false, diff --git a/proto/api/v1/payment.proto b/proto/api/v1/payment.proto index 53ec41cd..72499aef 100644 --- a/proto/api/v1/payment.proto +++ b/proto/api/v1/payment.proto @@ -8,15 +8,24 @@ import "google/protobuf/timestamp.proto"; // PaymentService serves payment related functions service PaymentService { - // CreateOrUpdateCustomer the payment data on the payment processor - rpc CreateOrUpdateCustomer(PaymentServiceCreateOrUpdateCustomerRequest) returns (PaymentServiceCreateOrUpdateCustomerResponse) { + // Create the payment data used for billing api resources + rpc Create(PaymentServiceCreateRequest) returns (PaymentServiceCreateResponse) { option (tenant_roles) = TENANT_ROLE_OWNER; } - // GetCustomer from the payment processor - rpc GetCustomer(PaymentServiceGetCustomerRequest) returns (PaymentServiceGetCustomerResponse) { + // Update the payment data + rpc Update(PaymentServiceUpdateRequest) returns (PaymentServiceUpdateResponse) { + option (tenant_roles) = TENANT_ROLE_OWNER; + } + // Delete the payment data + rpc Delete(PaymentServiceDeleteRequest) returns (PaymentServiceDeleteResponse) { + option (tenant_roles) = TENANT_ROLE_OWNER; + } + // Get the payment data + rpc Get(PaymentServiceGetRequest) returns (PaymentServiceGetResponse) { option (tenant_roles) = TENANT_ROLE_OWNER; option (auditing) = AUDITING_EXCLUDED; } + // HasPaymentMethod check if the customer has a payment method provided rpc HasPaymentMethod(PaymentServiceHasPaymentMethodRequest) returns (PaymentServiceHasPaymentMethodResponse) { option (tenant_roles) = TENANT_ROLE_OWNER; @@ -25,10 +34,7 @@ service PaymentService { option (tenant_roles) = TENANT_ROLE_GUEST; option (auditing) = AUDITING_EXCLUDED; } - // DeletePaymentMethod of the customer - rpc DeletePaymentMethod(PaymentServiceDeletePaymentMethodRequest) returns (PaymentServiceDeletePaymentMethodResponse) { - option (tenant_roles) = TENANT_ROLE_OWNER; - } + // GetSubscriptionUsage of the customer rpc GetSubscriptionUsage(PaymentServiceGetSubscriptionUsageRequest) returns (PaymentServiceGetSubscriptionUsageResponse) { option (tenant_roles) = TENANT_ROLE_OWNER; @@ -80,6 +86,8 @@ message PaymentCustomer { optional string phone_number = 12; // Balance actual balance of the customer optional int64 balance = 13; + // Tier describes the state in which the customer is using the products. + ProductTier tier = 14; } // Card is the payment card the customer pays with @@ -141,6 +149,16 @@ enum UsageType { USAGE_TYPE_LICENSED = 2; } +// ProductTier is an explicit indicator for the state in which the customer is using the products. +enum ProductTier { + // PRODUCT_TIER_UNSPECIFIED is unspecified + PRODUCT_TIER_UNSPECIFIED = 0; + // PRODUCT_TIER_TRIAL indicates a customer that is in trial phase without having to provide payment information. + PRODUCT_TIER_TRIAL = 1; + // PRODUCT_TIER_PAID indicates a customer that has provided payment information. + PRODUCT_TIER_PAID = 2; +} + // Address postal address of a customer message Address { // Line1 the first address line @@ -203,61 +221,86 @@ message Invoice { google.protobuf.Timestamp period_end = 5; } -// PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request -message PaymentServiceCreateOrUpdateCustomerRequest { - reserved 2; - reserved "customer"; - reserved 3; - reserved "accepted_terms_and_conditions"; +// PaymentServiceCreateRequest is the request payload for providing payment data +message PaymentServiceCreateRequest { + // Login of the tenant + string login = 1 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; - // Login of the customer + // Name of the customer to be billed + string name = 2 [(buf.validate.field).required = true]; + // PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api + string payment_method_id = 3 [ + (buf.validate.field).string = {min_len: 3}, + (buf.validate.field).string.pattern = "pm_[a-zA-Z0-9]*$" + ]; + // Email of the customer to be billed + string email = 4 [(buf.validate.field).string.email = true]; + // Address is the postal address of the customer to be billed + Address address = 5; + // Vat which applies to the customer to be billed + string vat = 6 [(buf.validate.field).required = true]; + // PhoneNumber of the customer to be billed + optional string phone_number = 7 [(buf.validate.field).string = {min_len: 1}]; +} + +// PaymentServiceCreateResponse is the response payload for a payment create request +message PaymentServiceCreateResponse { + // Customer is the created customer + PaymentCustomer customer = 1; +} + +// PaymentServiceUpdateRequest is the request payload for updating payment data +message PaymentServiceUpdateRequest { + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; // Name of the customer to be billed - optional string name = 4; + optional string name = 2 [(buf.validate.field).string = {min_len: 1}]; // PaymentMethodId at the payment provider, the client receives this from the payment provider and passes it on to the api - optional string payment_method_id = 5; + optional string payment_method_id = 3 [ + (buf.validate.field).string = {min_len: 3}, + (buf.validate.field).string.pattern = "pm_[a-zA-Z0-9]*$" + ]; // Email of the customer to be billed - optional string email = 6 [(buf.validate.field).string.email = true]; - // Card the customer to be billed - optional Card card = 7; + optional string email = 4 [(buf.validate.field).string.email = true]; // Address is the postal address of the customer to be billed - Address address = 8; + Address address = 5; // Vat which applies to the customer to be billed - optional string vat = 9; + optional string vat = 6 [(buf.validate.field).string = {min_len: 1}]; // PhoneNumber of the customer to be billed - optional string phone_number = 10; + optional string phone_number = 7 [(buf.validate.field).string = {min_len: 1}]; } -// PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request -message PaymentServiceCreateOrUpdateCustomerResponse { - // Customer is the customer +// PaymentServiceUpdateResponse is the response payload for a payment update request +message PaymentServiceUpdateResponse { + // Customer is the updated customer PaymentCustomer customer = 1; } -// PaymentServiceGetCustomerRequest is the request payload for a payment get customer request -message PaymentServiceGetCustomerRequest { - // Login of the customer +// PaymentServiceGetRequest is the request payload for getting the payment data +message PaymentServiceGetRequest { + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; - // CustomerId of the customer - string customer_id = 2; } -// PaymentServiceGetCustomerResponse is the response payload for a payment get customer request -message PaymentServiceGetCustomerResponse { - // Customer is the customer +// PaymentServiceGetResponse is the response payload for a payment get request +message PaymentServiceGetResponse { + // Customer is the payment customer PaymentCustomer customer = 1; } // PaymentServiceHasPaymentMethodRequest is the request payload for a has payment request message PaymentServiceHasPaymentMethodRequest { - // Login of the customer + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 @@ -275,21 +318,21 @@ message PaymentServiceHasPaymentMethodResponse { bool positive_balance = 3; } -// PaymentServiceDeletePaymentMethodRequest is the request payload for a delete payment request -message PaymentServiceDeletePaymentMethodRequest { - // Login of the customer +// PaymentServiceDeleteRequest is the request payload for a delete payment request +message PaymentServiceDeleteRequest { + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; } -// PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request -message PaymentServiceDeletePaymentMethodResponse {} +// PaymentServiceDeleteResponse is the response payload for a delete payment request +message PaymentServiceDeleteResponse {} // PaymentServiceGetSubscriptionUsageRequest is the request payload for a get subscription usage request message PaymentServiceGetSubscriptionUsageRequest { - // Login of the customer + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 @@ -304,7 +347,7 @@ message PaymentServiceGetSubscriptionUsageResponse { // PaymentServiceHasPaymentMethodRequest is the request payload for a get invoices request message PaymentServiceGetInvoicesRequest { - // Login of the customer + // Login of the tenant string login = 1 [(buf.validate.field).string = { min_len: 2 max_len: 128 diff --git a/python/metalstackcloud/api/v1/payment_connecpy.py b/python/metalstackcloud/api/v1/payment_connecpy.py index 0f3e65de..1d05170e 100644 --- a/python/metalstackcloud/api/v1/payment_connecpy.py +++ b/python/metalstackcloud/api/v1/payment_connecpy.py @@ -15,10 +15,11 @@ class PaymentService(Protocol): - async def CreateOrUpdateCustomer(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse: ... - async def GetCustomer(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse: ... + async def Create(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse: ... + async def Update(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse: ... + async def Delete(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse: ... + async def Get(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse: ... async def HasPaymentMethod(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse: ... - async def DeletePaymentMethod(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse: ... async def GetSubscriptionUsage(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionUsageRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionUsageResponse: ... async def GetInvoices(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetInvoicesRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetInvoicesResponse: ... async def GetDefaultPrices(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetDefaultPricesRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetDefaultPricesResponse: ... @@ -30,20 +31,36 @@ def __init__(self, *, service: PaymentService, server_path_prefix=""): super().__init__() self._prefix = f"{server_path_prefix}/api.v1.PaymentService" self._endpoints = { - "CreateOrUpdateCustomer": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest, api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse]( + "Create": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest, api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse]( service_name="PaymentService", - name="CreateOrUpdateCustomer", - function=getattr(service, "CreateOrUpdateCustomer"), - input=api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest, - output=api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse, + name="Create", + function=getattr(service, "Create"), + input=api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest, + output=api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse, allowed_methods=("POST",), ), - "GetCustomer": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest, api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse]( + "Update": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest, api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse]( service_name="PaymentService", - name="GetCustomer", - function=getattr(service, "GetCustomer"), - input=api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest, - output=api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse, + name="Update", + function=getattr(service, "Update"), + input=api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest, + output=api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse, + allowed_methods=("POST",), + ), + "Delete": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest, api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse]( + service_name="PaymentService", + name="Delete", + function=getattr(service, "Delete"), + input=api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest, + output=api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse, + allowed_methods=("POST",), + ), + "Get": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest, api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse]( + service_name="PaymentService", + name="Get", + function=getattr(service, "Get"), + input=api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest, + output=api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse, allowed_methods=("POST",), ), "HasPaymentMethod": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest, api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse]( @@ -54,14 +71,6 @@ def __init__(self, *, service: PaymentService, server_path_prefix=""): output=api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse, allowed_methods=("POST",), ), - "DeletePaymentMethod": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest, api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse]( - service_name="PaymentService", - name="DeletePaymentMethod", - function=getattr(service, "DeletePaymentMethod"), - input=api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest, - output=api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse, - allowed_methods=("POST",), - ), "GetSubscriptionUsage": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionUsageRequest, api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionUsageResponse]( service_name="PaymentService", name="GetSubscriptionUsage", @@ -101,10 +110,11 @@ def serviceName(self): class PaymentServiceSync(Protocol): - def CreateOrUpdateCustomer(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse: ... - def GetCustomer(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse: ... + def Create(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse: ... + def Update(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse: ... + def Delete(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse: ... + def Get(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse: ... def HasPaymentMethod(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse: ... - def DeletePaymentMethod(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse: ... def GetSubscriptionUsage(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionUsageRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionUsageResponse: ... def GetInvoices(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetInvoicesRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetInvoicesResponse: ... def GetDefaultPrices(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetDefaultPricesRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetDefaultPricesResponse: ... @@ -116,20 +126,36 @@ def __init__(self, *, service: PaymentServiceSync, server_path_prefix=""): super().__init__() self._prefix = f"{server_path_prefix}/api.v1.PaymentService" self._endpoints = { - "CreateOrUpdateCustomer": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest, api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse]( + "Create": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest, api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse]( service_name="PaymentService", - name="CreateOrUpdateCustomer", - function=getattr(service, "CreateOrUpdateCustomer"), - input=api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest, - output=api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse, + name="Create", + function=getattr(service, "Create"), + input=api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest, + output=api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse, allowed_methods=("POST",), ), - "GetCustomer": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest, api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse]( + "Update": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest, api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse]( service_name="PaymentService", - name="GetCustomer", - function=getattr(service, "GetCustomer"), - input=api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest, - output=api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse, + name="Update", + function=getattr(service, "Update"), + input=api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest, + output=api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse, + allowed_methods=("POST",), + ), + "Delete": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest, api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse]( + service_name="PaymentService", + name="Delete", + function=getattr(service, "Delete"), + input=api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest, + output=api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse, + allowed_methods=("POST",), + ), + "Get": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest, api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse]( + service_name="PaymentService", + name="Get", + function=getattr(service, "Get"), + input=api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest, + output=api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse, allowed_methods=("POST",), ), "HasPaymentMethod": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest, api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse]( @@ -140,14 +166,6 @@ def __init__(self, *, service: PaymentServiceSync, server_path_prefix=""): output=api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse, allowed_methods=("POST",), ), - "DeletePaymentMethod": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest, api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse]( - service_name="PaymentService", - name="DeletePaymentMethod", - function=getattr(service, "DeletePaymentMethod"), - input=api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest, - output=api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse, - allowed_methods=("POST",), - ), "GetSubscriptionUsage": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionUsageRequest, api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionUsageResponse]( service_name="PaymentService", name="GetSubscriptionUsage", @@ -187,74 +205,92 @@ def serviceName(self): class PaymentServiceClient(ConnecpyClient): - def CreateOrUpdateCustomer( + def Create( self, - request: api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest, + request: api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest, *, ctx: Optional[ClientContext] = None, server_path_prefix: str = "", **kwargs, - ) -> api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse: + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse: method = "POST" return self._make_request( - url=f"{server_path_prefix}/api.v1.PaymentService/CreateOrUpdateCustomer", + url=f"{server_path_prefix}/api.v1.PaymentService/Create", ctx=ctx, request=request, - response_class=api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse, method=method, **kwargs, ) - def GetCustomer( + def Update( self, - request: api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest, + request: api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest, *, ctx: Optional[ClientContext] = None, server_path_prefix: str = "", **kwargs, - ) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse: + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse: method = "POST" return self._make_request( - url=f"{server_path_prefix}/api.v1.PaymentService/GetCustomer", + url=f"{server_path_prefix}/api.v1.PaymentService/Update", ctx=ctx, request=request, - response_class=api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse, method=method, **kwargs, ) - def HasPaymentMethod( + def Delete( self, - request: api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest, + request: api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest, *, ctx: Optional[ClientContext] = None, server_path_prefix: str = "", **kwargs, - ) -> api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse: + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse: method = "POST" return self._make_request( - url=f"{server_path_prefix}/api.v1.PaymentService/HasPaymentMethod", + url=f"{server_path_prefix}/api.v1.PaymentService/Delete", ctx=ctx, request=request, - response_class=api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse, + method=method, + **kwargs, + ) + + def Get( + self, + request: api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + **kwargs, + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse: + method = "POST" + return self._make_request( + url=f"{server_path_prefix}/api.v1.PaymentService/Get", + ctx=ctx, + request=request, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse, method=method, **kwargs, ) - def DeletePaymentMethod( + def HasPaymentMethod( self, - request: api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest, + request: api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest, *, ctx: Optional[ClientContext] = None, server_path_prefix: str = "", **kwargs, - ) -> api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse: + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse: method = "POST" return self._make_request( - url=f"{server_path_prefix}/api.v1.PaymentService/DeletePaymentMethod", + url=f"{server_path_prefix}/api.v1.PaymentService/HasPaymentMethod", ctx=ctx, request=request, - response_class=api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse, method=method, **kwargs, ) @@ -333,81 +369,101 @@ def GetSubscriptionDiscounts( class AsyncPaymentServiceClient(AsyncConnecpyClient): - async def CreateOrUpdateCustomer( + async def Create( self, - request: api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest, + request: api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest, *, ctx: Optional[ClientContext] = None, server_path_prefix: str = "", session: Union[httpx.AsyncClient, None] = None, **kwargs, - ) -> api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse: + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse: method = "POST" return await self._make_request( - url=f"{server_path_prefix}/api.v1.PaymentService/CreateOrUpdateCustomer", + url=f"{server_path_prefix}/api.v1.PaymentService/Create", ctx=ctx, request=request, - response_class=api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse, method=method, session=session, **kwargs, ) - async def GetCustomer( + async def Update( self, - request: api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest, + request: api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest, *, ctx: Optional[ClientContext] = None, server_path_prefix: str = "", session: Union[httpx.AsyncClient, None] = None, **kwargs, - ) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse: + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse: method = "POST" return await self._make_request( - url=f"{server_path_prefix}/api.v1.PaymentService/GetCustomer", + url=f"{server_path_prefix}/api.v1.PaymentService/Update", ctx=ctx, request=request, - response_class=api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse, method=method, session=session, **kwargs, ) - async def HasPaymentMethod( + async def Delete( self, - request: api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest, + request: api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest, *, ctx: Optional[ClientContext] = None, server_path_prefix: str = "", session: Union[httpx.AsyncClient, None] = None, **kwargs, - ) -> api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse: + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse: method = "POST" return await self._make_request( - url=f"{server_path_prefix}/api.v1.PaymentService/HasPaymentMethod", + url=f"{server_path_prefix}/api.v1.PaymentService/Delete", ctx=ctx, request=request, - response_class=api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse, method=method, session=session, **kwargs, ) - async def DeletePaymentMethod( + async def Get( self, - request: api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest, + request: api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest, *, ctx: Optional[ClientContext] = None, server_path_prefix: str = "", session: Union[httpx.AsyncClient, None] = None, **kwargs, - ) -> api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse: + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse: method = "POST" return await self._make_request( - url=f"{server_path_prefix}/api.v1.PaymentService/DeletePaymentMethod", + url=f"{server_path_prefix}/api.v1.PaymentService/Get", ctx=ctx, request=request, - response_class=api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse, + method=method, + session=session, + **kwargs, + ) + + async def HasPaymentMethod( + self, + request: api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + session: Union[httpx.AsyncClient, None] = None, + **kwargs, + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse: + method = "POST" + return await self._make_request( + url=f"{server_path_prefix}/api.v1.PaymentService/HasPaymentMethod", + ctx=ctx, + request=request, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse, method=method, session=session, **kwargs, diff --git a/python/metalstackcloud/api/v1/payment_pb2.py b/python/metalstackcloud/api/v1/payment_pb2.py index 61fef51b..918e3d31 100644 --- a/python/metalstackcloud/api/v1/payment_pb2.py +++ b/python/metalstackcloud/api/v1/payment_pb2.py @@ -27,7 +27,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x61pi/v1/payment.proto\x12\x06\x61pi.v1\x1a\x13\x61pi/v1/common.proto\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb0\x04\n\x0fPaymentCustomer\x12\x14\n\x05login\x18\x01 \x01(\tR\x05login\x12\x17\n\x04name\x18\x02 \x01(\tH\x00R\x04name\x88\x01\x01\x12$\n\x0b\x63ustomer_id\x18\x03 \x01(\tH\x01R\ncustomerId\x88\x01\x01\x12/\n\x11payment_method_id\x18\x04 \x01(\tH\x02R\x0fpaymentMethodId\x88\x01\x01\x12\'\n\x0fsubscription_id\x18\x05 \x01(\tR\x0esubscriptionId\x12\"\n\x05\x65mail\x18\x06 \x01(\tB\x07\xbaH\x04r\x02`\x01H\x03R\x05\x65mail\x88\x01\x01\x12%\n\x04\x63\x61rd\x18\x07 \x01(\x0b\x32\x0c.api.v1.CardH\x04R\x04\x63\x61rd\x88\x01\x01\x12%\n\x06prices\x18\x08 \x03(\x0b\x32\r.api.v1.PriceR\x06prices\x12)\n\x07\x61\x64\x64ress\x18\t \x01(\x0b\x32\x0f.api.v1.AddressR\x07\x61\x64\x64ress\x12\x15\n\x03vat\x18\x0b \x01(\tH\x05R\x03vat\x88\x01\x01\x12&\n\x0cphone_number\x18\x0c \x01(\tH\x06R\x0bphoneNumber\x88\x01\x01\x12\x1d\n\x07\x62\x61lance\x18\r \x01(\x03H\x07R\x07\x62\x61lance\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_customer_idB\x14\n\x12_payment_method_idB\x08\n\x06_emailB\x07\n\x05_cardB\x06\n\x04_vatB\x0f\n\r_phone_numberB\n\n\x08_balanceJ\x04\x08\n\x10\x0bR\x06\x63oupon\"\x85\x01\n\x04\x43\x61rd\x12\x14\n\x05\x62rand\x18\x01 \x01(\tR\x05\x62rand\x12\x18\n\x07\x63ountry\x18\x02 \x01(\tR\x07\x63ountry\x12\x1b\n\texp_month\x18\x03 \x01(\x03R\x08\x65xpMonth\x12\x19\n\x08\x65xp_year\x18\x04 \x01(\x03R\x07\x65xpYear\x12\x15\n\x06last_4\x18\x05 \x01(\tR\x05last4\"\xb3\x02\n\x05Price\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12.\n\x13unit_amount_decimal\x18\x02 \x01(\x01R\x11unitAmountDecimal\x12\x1a\n\x08\x63urrency\x18\x03 \x01(\tR\x08\x63urrency\x12\x1d\n\nunit_label\x18\x04 \x01(\tR\tunitLabel\x12\x36\n\x0cproduct_type\x18\x05 \x01(\x0e\x32\x13.api.v1.ProductTypeR\x0bproductType\x12\x31\n\x0b\x64\x65scription\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\xf4\x03H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\x30\n\nusage_type\x18\x07 \x01(\x0e\x32\x11.api.v1.UsageTypeR\tusageTypeB\x0e\n\x0c_description\"\x9a\x01\n\x07\x41\x64\x64ress\x12\x14\n\x05line1\x18\x01 \x01(\tR\x05line1\x12\x14\n\x05line2\x18\x02 \x01(\tR\x05line2\x12\x1f\n\x0bpostal_code\x18\x03 \x01(\tR\npostalCode\x12\x12\n\x04\x63ity\x18\x04 \x01(\tR\x04\x63ity\x12\x14\n\x05state\x18\x05 \x01(\tR\x05state\x12\x18\n\x07\x63ountry\x18\x06 \x01(\tR\x07\x63ountry\"\xf2\x02\n\x15SubscriptionUsageItem\x12\x30\n\x14subscription_item_id\x18\x01 \x01(\tR\x12subscriptionItemId\x12\x34\n\x16subscription_item_name\x18\x02 \x01(\tR\x14subscriptionItemName\x12\x1f\n\x0btotal_usage\x18\x03 \x01(\x03R\ntotalUsage\x12=\n\x0cperiod_start\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0bperiodStart\x12\x39\n\nperiod_end\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tperiodEnd\x12.\n\tdiscounts\x18\x06 \x03(\x0b\x32\x10.api.v1.DiscountR\tdiscounts\x12&\n\x0fproduct_item_id\x18\x07 \x01(\tR\rproductItemId\"\xba\x01\n\x08\x44iscount\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x1d\n\namount_off\x18\x03 \x01(\x03R\tamountOff\x12%\n\x0epercentage_off\x18\x04 \x01(\x01R\rpercentageOff\x12%\n\x0e\x64iscount_order\x18\x05 \x01(\x01R\rdiscountOrder\x12\x1d\n\napplies_to\x18\x06 \x03(\tR\tappliesTo\"\xbd\x01\n\x07Invoice\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12(\n\x10pdf_download_url\x18\x02 \x01(\tR\x0epdfDownloadUrl\x12=\n\x0cperiod_start\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0bperiodStart\x12\x39\n\nperiod_end\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tperiodEnd\"\xce\x03\n+PaymentServiceCreateOrUpdateCustomerRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\x12\x17\n\x04name\x18\x04 \x01(\tH\x00R\x04name\x88\x01\x01\x12/\n\x11payment_method_id\x18\x05 \x01(\tH\x01R\x0fpaymentMethodId\x88\x01\x01\x12\"\n\x05\x65mail\x18\x06 \x01(\tB\x07\xbaH\x04r\x02`\x01H\x02R\x05\x65mail\x88\x01\x01\x12%\n\x04\x63\x61rd\x18\x07 \x01(\x0b\x32\x0c.api.v1.CardH\x03R\x04\x63\x61rd\x88\x01\x01\x12)\n\x07\x61\x64\x64ress\x18\x08 \x01(\x0b\x32\x0f.api.v1.AddressR\x07\x61\x64\x64ress\x12\x15\n\x03vat\x18\t \x01(\tH\x04R\x03vat\x88\x01\x01\x12&\n\x0cphone_number\x18\n \x01(\tH\x05R\x0bphoneNumber\x88\x01\x01\x42\x07\n\x05_nameB\x14\n\x12_payment_method_idB\x08\n\x06_emailB\x07\n\x05_cardB\x06\n\x04_vatB\x0f\n\r_phone_numberJ\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04R\x08\x63ustomerR\x1d\x61\x63\x63\x65pted_terms_and_conditions\"c\n,PaymentServiceCreateOrUpdateCustomerResponse\x12\x33\n\x08\x63ustomer\x18\x01 \x01(\x0b\x32\x17.api.v1.PaymentCustomerR\x08\x63ustomer\"e\n PaymentServiceGetCustomerRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\x12\x1f\n\x0b\x63ustomer_id\x18\x02 \x01(\tR\ncustomerId\"X\n!PaymentServiceGetCustomerResponse\x12\x33\n\x08\x63ustomer\x18\x01 \x01(\x0b\x32\x17.api.v1.PaymentCustomerR\x08\x63ustomer\"I\n%PaymentServiceHasPaymentMethodRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\"~\n&PaymentServiceHasPaymentMethodResponse\x12\x16\n\x06\x65xists\x18\x01 \x01(\x08R\x06\x65xists\x12)\n\x10positive_balance\x18\x03 \x01(\x08R\x0fpositiveBalanceJ\x04\x08\x02\x10\x03R\x0b\x63oupon_left\"L\n(PaymentServiceDeletePaymentMethodRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\"+\n)PaymentServiceDeletePaymentMethodResponse\"M\n)PaymentServiceGetSubscriptionUsageRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\"\x85\x01\n*PaymentServiceGetSubscriptionUsageResponse\x12W\n\x18subscription_usage_items\x18\x01 \x03(\x0b\x32\x1d.api.v1.SubscriptionUsageItemR\x16subscriptionUsageItems\"o\n PaymentServiceGetInvoicesRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\x12)\n\x0b\x63ustomer_id\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x98\x01\x12R\ncustomerId\"P\n!PaymentServiceGetInvoicesResponse\x12+\n\x08invoices\x18\x01 \x03(\x0b\x32\x0f.api.v1.InvoiceR\x08invoices\"\'\n%PaymentServiceGetDefaultPricesRequest\"O\n&PaymentServiceGetDefaultPricesResponse\x12%\n\x06prices\x18\x01 \x03(\x0b\x32\r.api.v1.PriceR\x06prices\"Q\n-PaymentServiceGetSubscriptionDiscountsRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\"`\n.PaymentServiceGetSubscriptionDiscountsResponse\x12.\n\tdiscounts\x18\x01 \x03(\x0b\x32\x10.api.v1.DiscountR\tdiscounts*\x96\x01\n\x0bProductType\x12\x1c\n\x18PRODUCT_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14PRODUCT_TYPE_STORAGE\x10\x01\x12\x18\n\x14PRODUCT_TYPE_COMPUTE\x10\x02\x12\x18\n\x14PRODUCT_TYPE_NETWORK\x10\x03\x12\x1b\n\x17PRODUCT_TYPE_KUBERNETES\x10\x05*X\n\tUsageType\x12\x1a\n\x16USAGE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12USAGE_TYPE_METERED\x10\x01\x12\x17\n\x13USAGE_TYPE_LICENSED\x10\x02\x32\x9f\x08\n\x0ePaymentService\x12\x8a\x01\n\x16\x43reateOrUpdateCustomer\x12\x33.api.v1.PaymentServiceCreateOrUpdateCustomerRequest\x1a\x34.api.v1.PaymentServiceCreateOrUpdateCustomerResponse\"\x05\xc2\xf3\x18\x01\x01\x12m\n\x0bGetCustomer\x12(.api.v1.PaymentServiceGetCustomerRequest\x1a).api.v1.PaymentServiceGetCustomerResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12\x7f\n\x10HasPaymentMethod\x12-.api.v1.PaymentServiceHasPaymentMethodRequest\x1a..api.v1.PaymentServiceHasPaymentMethodResponse\"\x0c\xc2\xf3\x18\x04\x01\x02\x03\x04\xe8\xf3\x18\x02\x12\x81\x01\n\x13\x44\x65letePaymentMethod\x12\x30.api.v1.PaymentServiceDeletePaymentMethodRequest\x1a\x31.api.v1.PaymentServiceDeletePaymentMethodResponse\"\x05\xc2\xf3\x18\x01\x01\x12\x88\x01\n\x14GetSubscriptionUsage\x12\x31.api.v1.PaymentServiceGetSubscriptionUsageRequest\x1a\x32.api.v1.PaymentServiceGetSubscriptionUsageResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12m\n\x0bGetInvoices\x12(.api.v1.PaymentServiceGetInvoicesRequest\x1a).api.v1.PaymentServiceGetInvoicesResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12{\n\x10GetDefaultPrices\x12-.api.v1.PaymentServiceGetDefaultPricesRequest\x1a..api.v1.PaymentServiceGetDefaultPricesResponse\"\x08\xd8\xf3\x18\x01\xe8\xf3\x18\x02\x12\x94\x01\n\x18GetSubscriptionDiscounts\x12\x35.api.v1.PaymentServiceGetSubscriptionDiscountsRequest\x1a\x36.api.v1.PaymentServiceGetSubscriptionDiscountsResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x42\x85\x01\n\ncom.api.v1B\x0cPaymentProtoP\x01Z0github.com/metal-stack-cloud/api/go/api/v1;apiv1\xa2\x02\x03\x41XX\xaa\x02\x06\x41pi.V1\xca\x02\x06\x41pi\\V1\xe2\x02\x12\x41pi\\V1\\GPBMetadata\xea\x02\x07\x41pi::V1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x61pi/v1/payment.proto\x12\x06\x61pi.v1\x1a\x13\x61pi/v1/common.proto\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd9\x04\n\x0fPaymentCustomer\x12\x14\n\x05login\x18\x01 \x01(\tR\x05login\x12\x17\n\x04name\x18\x02 \x01(\tH\x00R\x04name\x88\x01\x01\x12$\n\x0b\x63ustomer_id\x18\x03 \x01(\tH\x01R\ncustomerId\x88\x01\x01\x12/\n\x11payment_method_id\x18\x04 \x01(\tH\x02R\x0fpaymentMethodId\x88\x01\x01\x12\'\n\x0fsubscription_id\x18\x05 \x01(\tR\x0esubscriptionId\x12\"\n\x05\x65mail\x18\x06 \x01(\tB\x07\xbaH\x04r\x02`\x01H\x03R\x05\x65mail\x88\x01\x01\x12%\n\x04\x63\x61rd\x18\x07 \x01(\x0b\x32\x0c.api.v1.CardH\x04R\x04\x63\x61rd\x88\x01\x01\x12%\n\x06prices\x18\x08 \x03(\x0b\x32\r.api.v1.PriceR\x06prices\x12)\n\x07\x61\x64\x64ress\x18\t \x01(\x0b\x32\x0f.api.v1.AddressR\x07\x61\x64\x64ress\x12\x15\n\x03vat\x18\x0b \x01(\tH\x05R\x03vat\x88\x01\x01\x12&\n\x0cphone_number\x18\x0c \x01(\tH\x06R\x0bphoneNumber\x88\x01\x01\x12\x1d\n\x07\x62\x61lance\x18\r \x01(\x03H\x07R\x07\x62\x61lance\x88\x01\x01\x12\'\n\x04tier\x18\x0e \x01(\x0e\x32\x13.api.v1.ProductTierR\x04tierB\x07\n\x05_nameB\x0e\n\x0c_customer_idB\x14\n\x12_payment_method_idB\x08\n\x06_emailB\x07\n\x05_cardB\x06\n\x04_vatB\x0f\n\r_phone_numberB\n\n\x08_balanceJ\x04\x08\n\x10\x0bR\x06\x63oupon\"\x85\x01\n\x04\x43\x61rd\x12\x14\n\x05\x62rand\x18\x01 \x01(\tR\x05\x62rand\x12\x18\n\x07\x63ountry\x18\x02 \x01(\tR\x07\x63ountry\x12\x1b\n\texp_month\x18\x03 \x01(\x03R\x08\x65xpMonth\x12\x19\n\x08\x65xp_year\x18\x04 \x01(\x03R\x07\x65xpYear\x12\x15\n\x06last_4\x18\x05 \x01(\tR\x05last4\"\xb3\x02\n\x05Price\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12.\n\x13unit_amount_decimal\x18\x02 \x01(\x01R\x11unitAmountDecimal\x12\x1a\n\x08\x63urrency\x18\x03 \x01(\tR\x08\x63urrency\x12\x1d\n\nunit_label\x18\x04 \x01(\tR\tunitLabel\x12\x36\n\x0cproduct_type\x18\x05 \x01(\x0e\x32\x13.api.v1.ProductTypeR\x0bproductType\x12\x31\n\x0b\x64\x65scription\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\xf4\x03H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\x30\n\nusage_type\x18\x07 \x01(\x0e\x32\x11.api.v1.UsageTypeR\tusageTypeB\x0e\n\x0c_description\"\x9a\x01\n\x07\x41\x64\x64ress\x12\x14\n\x05line1\x18\x01 \x01(\tR\x05line1\x12\x14\n\x05line2\x18\x02 \x01(\tR\x05line2\x12\x1f\n\x0bpostal_code\x18\x03 \x01(\tR\npostalCode\x12\x12\n\x04\x63ity\x18\x04 \x01(\tR\x04\x63ity\x12\x14\n\x05state\x18\x05 \x01(\tR\x05state\x12\x18\n\x07\x63ountry\x18\x06 \x01(\tR\x07\x63ountry\"\xf2\x02\n\x15SubscriptionUsageItem\x12\x30\n\x14subscription_item_id\x18\x01 \x01(\tR\x12subscriptionItemId\x12\x34\n\x16subscription_item_name\x18\x02 \x01(\tR\x14subscriptionItemName\x12\x1f\n\x0btotal_usage\x18\x03 \x01(\x03R\ntotalUsage\x12=\n\x0cperiod_start\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0bperiodStart\x12\x39\n\nperiod_end\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tperiodEnd\x12.\n\tdiscounts\x18\x06 \x03(\x0b\x32\x10.api.v1.DiscountR\tdiscounts\x12&\n\x0fproduct_item_id\x18\x07 \x01(\tR\rproductItemId\"\xba\x01\n\x08\x44iscount\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x1d\n\namount_off\x18\x03 \x01(\x03R\tamountOff\x12%\n\x0epercentage_off\x18\x04 \x01(\x01R\rpercentageOff\x12%\n\x0e\x64iscount_order\x18\x05 \x01(\x01R\rdiscountOrder\x12\x1d\n\napplies_to\x18\x06 \x03(\tR\tappliesTo\"\xbd\x01\n\x07Invoice\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12(\n\x10pdf_download_url\x18\x02 \x01(\tR\x0epdfDownloadUrl\x12=\n\x0cperiod_start\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0bperiodStart\x12\x39\n\nperiod_end\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tperiodEnd\"\xc8\x02\n\x1bPaymentServiceCreateRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\x12\x1a\n\x04name\x18\x02 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\x04name\x12\x45\n\x11payment_method_id\x18\x03 \x01(\tB\x19\xbaH\x16r\x14\x10\x03\x32\x10pm_[a-zA-Z0-9]*$R\x0fpaymentMethodId\x12\x1d\n\x05\x65mail\x18\x04 \x01(\tB\x07\xbaH\x04r\x02`\x01R\x05\x65mail\x12)\n\x07\x61\x64\x64ress\x18\x05 \x01(\x0b\x32\x0f.api.v1.AddressR\x07\x61\x64\x64ress\x12\x18\n\x03vat\x18\x06 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\x03vat\x12/\n\x0cphone_number\x18\x07 \x01(\tB\x07\xbaH\x04r\x02\x10\x01H\x00R\x0bphoneNumber\x88\x01\x01\x42\x0f\n\r_phone_number\"S\n\x1cPaymentServiceCreateResponse\x12\x33\n\x08\x63ustomer\x18\x01 \x01(\x0b\x32\x17.api.v1.PaymentCustomerR\x08\x63ustomer\"\x8f\x03\n\x1bPaymentServiceUpdateRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\x12 \n\x04name\x18\x02 \x01(\tB\x07\xbaH\x04r\x02\x10\x01H\x00R\x04name\x88\x01\x01\x12J\n\x11payment_method_id\x18\x03 \x01(\tB\x19\xbaH\x16r\x14\x10\x03\x32\x10pm_[a-zA-Z0-9]*$H\x01R\x0fpaymentMethodId\x88\x01\x01\x12\"\n\x05\x65mail\x18\x04 \x01(\tB\x07\xbaH\x04r\x02`\x01H\x02R\x05\x65mail\x88\x01\x01\x12)\n\x07\x61\x64\x64ress\x18\x05 \x01(\x0b\x32\x0f.api.v1.AddressR\x07\x61\x64\x64ress\x12\x1e\n\x03vat\x18\x06 \x01(\tB\x07\xbaH\x04r\x02\x10\x01H\x03R\x03vat\x88\x01\x01\x12/\n\x0cphone_number\x18\x07 \x01(\tB\x07\xbaH\x04r\x02\x10\x01H\x04R\x0bphoneNumber\x88\x01\x01\x42\x07\n\x05_nameB\x14\n\x12_payment_method_idB\x08\n\x06_emailB\x06\n\x04_vatB\x0f\n\r_phone_number\"S\n\x1cPaymentServiceUpdateResponse\x12\x33\n\x08\x63ustomer\x18\x01 \x01(\x0b\x32\x17.api.v1.PaymentCustomerR\x08\x63ustomer\"<\n\x18PaymentServiceGetRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\"P\n\x19PaymentServiceGetResponse\x12\x33\n\x08\x63ustomer\x18\x01 \x01(\x0b\x32\x17.api.v1.PaymentCustomerR\x08\x63ustomer\"I\n%PaymentServiceHasPaymentMethodRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\"~\n&PaymentServiceHasPaymentMethodResponse\x12\x16\n\x06\x65xists\x18\x01 \x01(\x08R\x06\x65xists\x12)\n\x10positive_balance\x18\x03 \x01(\x08R\x0fpositiveBalanceJ\x04\x08\x02\x10\x03R\x0b\x63oupon_left\"?\n\x1bPaymentServiceDeleteRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\"\x1e\n\x1cPaymentServiceDeleteResponse\"M\n)PaymentServiceGetSubscriptionUsageRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\"\x85\x01\n*PaymentServiceGetSubscriptionUsageResponse\x12W\n\x18subscription_usage_items\x18\x01 \x03(\x0b\x32\x1d.api.v1.SubscriptionUsageItemR\x16subscriptionUsageItems\"o\n PaymentServiceGetInvoicesRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\x12)\n\x0b\x63ustomer_id\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x98\x01\x12R\ncustomerId\"P\n!PaymentServiceGetInvoicesResponse\x12+\n\x08invoices\x18\x01 \x03(\x0b\x32\x0f.api.v1.InvoiceR\x08invoices\"\'\n%PaymentServiceGetDefaultPricesRequest\"O\n&PaymentServiceGetDefaultPricesResponse\x12%\n\x06prices\x18\x01 \x03(\x0b\x32\r.api.v1.PriceR\x06prices\"Q\n-PaymentServiceGetSubscriptionDiscountsRequest\x12 \n\x05login\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05login\"`\n.PaymentServiceGetSubscriptionDiscountsResponse\x12.\n\tdiscounts\x18\x01 \x03(\x0b\x32\x10.api.v1.DiscountR\tdiscounts*\x96\x01\n\x0bProductType\x12\x1c\n\x18PRODUCT_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14PRODUCT_TYPE_STORAGE\x10\x01\x12\x18\n\x14PRODUCT_TYPE_COMPUTE\x10\x02\x12\x18\n\x14PRODUCT_TYPE_NETWORK\x10\x03\x12\x1b\n\x17PRODUCT_TYPE_KUBERNETES\x10\x05*X\n\tUsageType\x12\x1a\n\x16USAGE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12USAGE_TYPE_METERED\x10\x01\x12\x17\n\x13USAGE_TYPE_LICENSED\x10\x02*Z\n\x0bProductTier\x12\x1c\n\x18PRODUCT_TIER_UNSPECIFIED\x10\x00\x12\x16\n\x12PRODUCT_TIER_TRIAL\x10\x01\x12\x15\n\x11PRODUCT_TIER_PAID\x10\x02\x32\x8a\x08\n\x0ePaymentService\x12Z\n\x06\x43reate\x12#.api.v1.PaymentServiceCreateRequest\x1a$.api.v1.PaymentServiceCreateResponse\"\x05\xc2\xf3\x18\x01\x01\x12Z\n\x06Update\x12#.api.v1.PaymentServiceUpdateRequest\x1a$.api.v1.PaymentServiceUpdateResponse\"\x05\xc2\xf3\x18\x01\x01\x12Z\n\x06\x44\x65lete\x12#.api.v1.PaymentServiceDeleteRequest\x1a$.api.v1.PaymentServiceDeleteResponse\"\x05\xc2\xf3\x18\x01\x01\x12U\n\x03Get\x12 .api.v1.PaymentServiceGetRequest\x1a!.api.v1.PaymentServiceGetResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12\x7f\n\x10HasPaymentMethod\x12-.api.v1.PaymentServiceHasPaymentMethodRequest\x1a..api.v1.PaymentServiceHasPaymentMethodResponse\"\x0c\xc2\xf3\x18\x04\x01\x02\x03\x04\xe8\xf3\x18\x02\x12\x88\x01\n\x14GetSubscriptionUsage\x12\x31.api.v1.PaymentServiceGetSubscriptionUsageRequest\x1a\x32.api.v1.PaymentServiceGetSubscriptionUsageResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12m\n\x0bGetInvoices\x12(.api.v1.PaymentServiceGetInvoicesRequest\x1a).api.v1.PaymentServiceGetInvoicesResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x12{\n\x10GetDefaultPrices\x12-.api.v1.PaymentServiceGetDefaultPricesRequest\x1a..api.v1.PaymentServiceGetDefaultPricesResponse\"\x08\xd8\xf3\x18\x01\xe8\xf3\x18\x02\x12\x94\x01\n\x18GetSubscriptionDiscounts\x12\x35.api.v1.PaymentServiceGetSubscriptionDiscountsRequest\x1a\x36.api.v1.PaymentServiceGetSubscriptionDiscountsResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02\x42\x85\x01\n\ncom.api.v1B\x0cPaymentProtoP\x01Z0github.com/metal-stack-cloud/api/go/api/v1;apiv1\xa2\x02\x03\x41XX\xaa\x02\x06\x41pi.V1\xca\x02\x06\x41pi\\V1\xe2\x02\x12\x41pi\\V1\\GPBMetadata\xea\x02\x07\x41pi::V1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -39,16 +39,36 @@ _globals['_PAYMENTCUSTOMER'].fields_by_name['email']._serialized_options = b'\272H\004r\002`\001' _globals['_PRICE'].fields_by_name['description']._loaded_options = None _globals['_PRICE'].fields_by_name['description']._serialized_options = b'\272H\007r\005\020\002\030\364\003' - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERREQUEST'].fields_by_name['email']._loaded_options = None - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERREQUEST'].fields_by_name['email']._serialized_options = b'\272H\004r\002`\001' - _globals['_PAYMENTSERVICEGETCUSTOMERREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_PAYMENTSERVICEGETCUSTOMERREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['login']._loaded_options = None + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\003\310\001\001' + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['payment_method_id']._loaded_options = None + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['payment_method_id']._serialized_options = b'\272H\026r\024\020\0032\020pm_[a-zA-Z0-9]*$' + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['email']._loaded_options = None + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['email']._serialized_options = b'\272H\004r\002`\001' + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['vat']._loaded_options = None + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['vat']._serialized_options = b'\272H\003\310\001\001' + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['phone_number']._loaded_options = None + _globals['_PAYMENTSERVICECREATEREQUEST'].fields_by_name['phone_number']._serialized_options = b'\272H\004r\002\020\001' + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['login']._loaded_options = None + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\004r\002\020\001' + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['payment_method_id']._loaded_options = None + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['payment_method_id']._serialized_options = b'\272H\026r\024\020\0032\020pm_[a-zA-Z0-9]*$' + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['email']._loaded_options = None + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['email']._serialized_options = b'\272H\004r\002`\001' + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['vat']._loaded_options = None + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['vat']._serialized_options = b'\272H\004r\002\020\001' + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['phone_number']._loaded_options = None + _globals['_PAYMENTSERVICEUPDATEREQUEST'].fields_by_name['phone_number']._serialized_options = b'\272H\004r\002\020\001' + _globals['_PAYMENTSERVICEGETREQUEST'].fields_by_name['login']._loaded_options = None + _globals['_PAYMENTSERVICEGETREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_PAYMENTSERVICEHASPAYMENTMETHODREQUEST'].fields_by_name['login']._loaded_options = None _globals['_PAYMENTSERVICEHASPAYMENTMETHODREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' - _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_PAYMENTSERVICEDELETEREQUEST'].fields_by_name['login']._loaded_options = None + _globals['_PAYMENTSERVICEDELETEREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGEREQUEST'].fields_by_name['login']._loaded_options = None _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGEREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_PAYMENTSERVICEGETINVOICESREQUEST'].fields_by_name['login']._loaded_options = None @@ -57,14 +77,16 @@ _globals['_PAYMENTSERVICEGETINVOICESREQUEST'].fields_by_name['customer_id']._serialized_options = b'\272H\005r\003\230\001\022' _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSREQUEST'].fields_by_name['login']._loaded_options = None _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' - _globals['_PAYMENTSERVICE'].methods_by_name['CreateOrUpdateCustomer']._loaded_options = None - _globals['_PAYMENTSERVICE'].methods_by_name['CreateOrUpdateCustomer']._serialized_options = b'\302\363\030\001\001' - _globals['_PAYMENTSERVICE'].methods_by_name['GetCustomer']._loaded_options = None - _globals['_PAYMENTSERVICE'].methods_by_name['GetCustomer']._serialized_options = b'\302\363\030\001\001\350\363\030\002' + _globals['_PAYMENTSERVICE'].methods_by_name['Create']._loaded_options = None + _globals['_PAYMENTSERVICE'].methods_by_name['Create']._serialized_options = b'\302\363\030\001\001' + _globals['_PAYMENTSERVICE'].methods_by_name['Update']._loaded_options = None + _globals['_PAYMENTSERVICE'].methods_by_name['Update']._serialized_options = b'\302\363\030\001\001' + _globals['_PAYMENTSERVICE'].methods_by_name['Delete']._loaded_options = None + _globals['_PAYMENTSERVICE'].methods_by_name['Delete']._serialized_options = b'\302\363\030\001\001' + _globals['_PAYMENTSERVICE'].methods_by_name['Get']._loaded_options = None + _globals['_PAYMENTSERVICE'].methods_by_name['Get']._serialized_options = b'\302\363\030\001\001\350\363\030\002' _globals['_PAYMENTSERVICE'].methods_by_name['HasPaymentMethod']._loaded_options = None _globals['_PAYMENTSERVICE'].methods_by_name['HasPaymentMethod']._serialized_options = b'\302\363\030\004\001\002\003\004\350\363\030\002' - _globals['_PAYMENTSERVICE'].methods_by_name['DeletePaymentMethod']._loaded_options = None - _globals['_PAYMENTSERVICE'].methods_by_name['DeletePaymentMethod']._serialized_options = b'\302\363\030\001\001' _globals['_PAYMENTSERVICE'].methods_by_name['GetSubscriptionUsage']._loaded_options = None _globals['_PAYMENTSERVICE'].methods_by_name['GetSubscriptionUsage']._serialized_options = b'\302\363\030\001\001\350\363\030\002' _globals['_PAYMENTSERVICE'].methods_by_name['GetInvoices']._loaded_options = None @@ -73,56 +95,62 @@ _globals['_PAYMENTSERVICE'].methods_by_name['GetDefaultPrices']._serialized_options = b'\330\363\030\001\350\363\030\002' _globals['_PAYMENTSERVICE'].methods_by_name['GetSubscriptionDiscounts']._loaded_options = None _globals['_PAYMENTSERVICE'].methods_by_name['GetSubscriptionDiscounts']._serialized_options = b'\302\363\030\001\001\350\363\030\002' - _globals['_PRODUCTTYPE']._serialized_start=3834 - _globals['_PRODUCTTYPE']._serialized_end=3984 - _globals['_USAGETYPE']._serialized_start=3986 - _globals['_USAGETYPE']._serialized_end=4074 + _globals['_PRODUCTTYPE']._serialized_start=4137 + _globals['_PRODUCTTYPE']._serialized_end=4287 + _globals['_USAGETYPE']._serialized_start=4289 + _globals['_USAGETYPE']._serialized_end=4377 + _globals['_PRODUCTTIER']._serialized_start=4379 + _globals['_PRODUCTTIER']._serialized_end=4469 _globals['_PAYMENTCUSTOMER']._serialized_start=116 - _globals['_PAYMENTCUSTOMER']._serialized_end=676 - _globals['_CARD']._serialized_start=679 - _globals['_CARD']._serialized_end=812 - _globals['_PRICE']._serialized_start=815 - _globals['_PRICE']._serialized_end=1122 - _globals['_ADDRESS']._serialized_start=1125 - _globals['_ADDRESS']._serialized_end=1279 - _globals['_SUBSCRIPTIONUSAGEITEM']._serialized_start=1282 - _globals['_SUBSCRIPTIONUSAGEITEM']._serialized_end=1652 - _globals['_DISCOUNT']._serialized_start=1655 - _globals['_DISCOUNT']._serialized_end=1841 - _globals['_INVOICE']._serialized_start=1844 - _globals['_INVOICE']._serialized_end=2033 - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERREQUEST']._serialized_start=2036 - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERREQUEST']._serialized_end=2498 - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERRESPONSE']._serialized_start=2500 - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERRESPONSE']._serialized_end=2599 - _globals['_PAYMENTSERVICEGETCUSTOMERREQUEST']._serialized_start=2601 - _globals['_PAYMENTSERVICEGETCUSTOMERREQUEST']._serialized_end=2702 - _globals['_PAYMENTSERVICEGETCUSTOMERRESPONSE']._serialized_start=2704 - _globals['_PAYMENTSERVICEGETCUSTOMERRESPONSE']._serialized_end=2792 - _globals['_PAYMENTSERVICEHASPAYMENTMETHODREQUEST']._serialized_start=2794 - _globals['_PAYMENTSERVICEHASPAYMENTMETHODREQUEST']._serialized_end=2867 - _globals['_PAYMENTSERVICEHASPAYMENTMETHODRESPONSE']._serialized_start=2869 - _globals['_PAYMENTSERVICEHASPAYMENTMETHODRESPONSE']._serialized_end=2995 - _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODREQUEST']._serialized_start=2997 - _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODREQUEST']._serialized_end=3073 - _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODRESPONSE']._serialized_start=3075 - _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODRESPONSE']._serialized_end=3118 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGEREQUEST']._serialized_start=3120 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGEREQUEST']._serialized_end=3197 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGERESPONSE']._serialized_start=3200 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGERESPONSE']._serialized_end=3333 - _globals['_PAYMENTSERVICEGETINVOICESREQUEST']._serialized_start=3335 - _globals['_PAYMENTSERVICEGETINVOICESREQUEST']._serialized_end=3446 - _globals['_PAYMENTSERVICEGETINVOICESRESPONSE']._serialized_start=3448 - _globals['_PAYMENTSERVICEGETINVOICESRESPONSE']._serialized_end=3528 - _globals['_PAYMENTSERVICEGETDEFAULTPRICESREQUEST']._serialized_start=3530 - _globals['_PAYMENTSERVICEGETDEFAULTPRICESREQUEST']._serialized_end=3569 - _globals['_PAYMENTSERVICEGETDEFAULTPRICESRESPONSE']._serialized_start=3571 - _globals['_PAYMENTSERVICEGETDEFAULTPRICESRESPONSE']._serialized_end=3650 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSREQUEST']._serialized_start=3652 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSREQUEST']._serialized_end=3733 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSRESPONSE']._serialized_start=3735 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSRESPONSE']._serialized_end=3831 - _globals['_PAYMENTSERVICE']._serialized_start=4077 - _globals['_PAYMENTSERVICE']._serialized_end=5132 + _globals['_PAYMENTCUSTOMER']._serialized_end=717 + _globals['_CARD']._serialized_start=720 + _globals['_CARD']._serialized_end=853 + _globals['_PRICE']._serialized_start=856 + _globals['_PRICE']._serialized_end=1163 + _globals['_ADDRESS']._serialized_start=1166 + _globals['_ADDRESS']._serialized_end=1320 + _globals['_SUBSCRIPTIONUSAGEITEM']._serialized_start=1323 + _globals['_SUBSCRIPTIONUSAGEITEM']._serialized_end=1693 + _globals['_DISCOUNT']._serialized_start=1696 + _globals['_DISCOUNT']._serialized_end=1882 + _globals['_INVOICE']._serialized_start=1885 + _globals['_INVOICE']._serialized_end=2074 + _globals['_PAYMENTSERVICECREATEREQUEST']._serialized_start=2077 + _globals['_PAYMENTSERVICECREATEREQUEST']._serialized_end=2405 + _globals['_PAYMENTSERVICECREATERESPONSE']._serialized_start=2407 + _globals['_PAYMENTSERVICECREATERESPONSE']._serialized_end=2490 + _globals['_PAYMENTSERVICEUPDATEREQUEST']._serialized_start=2493 + _globals['_PAYMENTSERVICEUPDATEREQUEST']._serialized_end=2892 + _globals['_PAYMENTSERVICEUPDATERESPONSE']._serialized_start=2894 + _globals['_PAYMENTSERVICEUPDATERESPONSE']._serialized_end=2977 + _globals['_PAYMENTSERVICEGETREQUEST']._serialized_start=2979 + _globals['_PAYMENTSERVICEGETREQUEST']._serialized_end=3039 + _globals['_PAYMENTSERVICEGETRESPONSE']._serialized_start=3041 + _globals['_PAYMENTSERVICEGETRESPONSE']._serialized_end=3121 + _globals['_PAYMENTSERVICEHASPAYMENTMETHODREQUEST']._serialized_start=3123 + _globals['_PAYMENTSERVICEHASPAYMENTMETHODREQUEST']._serialized_end=3196 + _globals['_PAYMENTSERVICEHASPAYMENTMETHODRESPONSE']._serialized_start=3198 + _globals['_PAYMENTSERVICEHASPAYMENTMETHODRESPONSE']._serialized_end=3324 + _globals['_PAYMENTSERVICEDELETEREQUEST']._serialized_start=3326 + _globals['_PAYMENTSERVICEDELETEREQUEST']._serialized_end=3389 + _globals['_PAYMENTSERVICEDELETERESPONSE']._serialized_start=3391 + _globals['_PAYMENTSERVICEDELETERESPONSE']._serialized_end=3421 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGEREQUEST']._serialized_start=3423 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGEREQUEST']._serialized_end=3500 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGERESPONSE']._serialized_start=3503 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGERESPONSE']._serialized_end=3636 + _globals['_PAYMENTSERVICEGETINVOICESREQUEST']._serialized_start=3638 + _globals['_PAYMENTSERVICEGETINVOICESREQUEST']._serialized_end=3749 + _globals['_PAYMENTSERVICEGETINVOICESRESPONSE']._serialized_start=3751 + _globals['_PAYMENTSERVICEGETINVOICESRESPONSE']._serialized_end=3831 + _globals['_PAYMENTSERVICEGETDEFAULTPRICESREQUEST']._serialized_start=3833 + _globals['_PAYMENTSERVICEGETDEFAULTPRICESREQUEST']._serialized_end=3872 + _globals['_PAYMENTSERVICEGETDEFAULTPRICESRESPONSE']._serialized_start=3874 + _globals['_PAYMENTSERVICEGETDEFAULTPRICESRESPONSE']._serialized_end=3953 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSREQUEST']._serialized_start=3955 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSREQUEST']._serialized_end=4036 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSRESPONSE']._serialized_start=4038 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSRESPONSE']._serialized_end=4134 + _globals['_PAYMENTSERVICE']._serialized_start=4472 + _globals['_PAYMENTSERVICE']._serialized_end=5506 # @@protoc_insertion_point(module_scope) diff --git a/python/metalstackcloud/api/v1/payment_pb2.pyi b/python/metalstackcloud/api/v1/payment_pb2.pyi index 40b3392f..9e5b2017 100644 --- a/python/metalstackcloud/api/v1/payment_pb2.pyi +++ b/python/metalstackcloud/api/v1/payment_pb2.pyi @@ -25,6 +25,12 @@ class UsageType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): USAGE_TYPE_UNSPECIFIED: _ClassVar[UsageType] USAGE_TYPE_METERED: _ClassVar[UsageType] USAGE_TYPE_LICENSED: _ClassVar[UsageType] + +class ProductTier(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + PRODUCT_TIER_UNSPECIFIED: _ClassVar[ProductTier] + PRODUCT_TIER_TRIAL: _ClassVar[ProductTier] + PRODUCT_TIER_PAID: _ClassVar[ProductTier] PRODUCT_TYPE_UNSPECIFIED: ProductType PRODUCT_TYPE_STORAGE: ProductType PRODUCT_TYPE_COMPUTE: ProductType @@ -33,9 +39,12 @@ PRODUCT_TYPE_KUBERNETES: ProductType USAGE_TYPE_UNSPECIFIED: UsageType USAGE_TYPE_METERED: UsageType USAGE_TYPE_LICENSED: UsageType +PRODUCT_TIER_UNSPECIFIED: ProductTier +PRODUCT_TIER_TRIAL: ProductTier +PRODUCT_TIER_PAID: ProductTier class PaymentCustomer(_message.Message): - __slots__ = ("login", "name", "customer_id", "payment_method_id", "subscription_id", "email", "card", "prices", "address", "vat", "phone_number", "balance") + __slots__ = ("login", "name", "customer_id", "payment_method_id", "subscription_id", "email", "card", "prices", "address", "vat", "phone_number", "balance", "tier") LOGIN_FIELD_NUMBER: _ClassVar[int] NAME_FIELD_NUMBER: _ClassVar[int] CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int] @@ -48,6 +57,7 @@ class PaymentCustomer(_message.Message): VAT_FIELD_NUMBER: _ClassVar[int] PHONE_NUMBER_FIELD_NUMBER: _ClassVar[int] BALANCE_FIELD_NUMBER: _ClassVar[int] + TIER_FIELD_NUMBER: _ClassVar[int] login: str name: str customer_id: str @@ -60,7 +70,8 @@ class PaymentCustomer(_message.Message): vat: str phone_number: str balance: int - def __init__(self, login: _Optional[str] = ..., name: _Optional[str] = ..., customer_id: _Optional[str] = ..., payment_method_id: _Optional[str] = ..., subscription_id: _Optional[str] = ..., email: _Optional[str] = ..., card: _Optional[_Union[Card, _Mapping]] = ..., prices: _Optional[_Iterable[_Union[Price, _Mapping]]] = ..., address: _Optional[_Union[Address, _Mapping]] = ..., vat: _Optional[str] = ..., phone_number: _Optional[str] = ..., balance: _Optional[int] = ...) -> None: ... + tier: ProductTier + def __init__(self, login: _Optional[str] = ..., name: _Optional[str] = ..., customer_id: _Optional[str] = ..., payment_method_id: _Optional[str] = ..., subscription_id: _Optional[str] = ..., email: _Optional[str] = ..., card: _Optional[_Union[Card, _Mapping]] = ..., prices: _Optional[_Iterable[_Union[Price, _Mapping]]] = ..., address: _Optional[_Union[Address, _Mapping]] = ..., vat: _Optional[str] = ..., phone_number: _Optional[str] = ..., balance: _Optional[int] = ..., tier: _Optional[_Union[ProductTier, str]] = ...) -> None: ... class Card(_message.Message): __slots__ = ("brand", "country", "exp_month", "exp_year", "last_4") @@ -156,13 +167,12 @@ class Invoice(_message.Message): period_end: _timestamp_pb2.Timestamp def __init__(self, id: _Optional[str] = ..., pdf_download_url: _Optional[str] = ..., period_start: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., period_end: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... -class PaymentServiceCreateOrUpdateCustomerRequest(_message.Message): - __slots__ = ("login", "name", "payment_method_id", "email", "card", "address", "vat", "phone_number") +class PaymentServiceCreateRequest(_message.Message): + __slots__ = ("login", "name", "payment_method_id", "email", "address", "vat", "phone_number") LOGIN_FIELD_NUMBER: _ClassVar[int] NAME_FIELD_NUMBER: _ClassVar[int] PAYMENT_METHOD_ID_FIELD_NUMBER: _ClassVar[int] EMAIL_FIELD_NUMBER: _ClassVar[int] - CARD_FIELD_NUMBER: _ClassVar[int] ADDRESS_FIELD_NUMBER: _ClassVar[int] VAT_FIELD_NUMBER: _ClassVar[int] PHONE_NUMBER_FIELD_NUMBER: _ClassVar[int] @@ -170,27 +180,48 @@ class PaymentServiceCreateOrUpdateCustomerRequest(_message.Message): name: str payment_method_id: str email: str - card: Card address: Address vat: str phone_number: str - def __init__(self, login: _Optional[str] = ..., name: _Optional[str] = ..., payment_method_id: _Optional[str] = ..., email: _Optional[str] = ..., card: _Optional[_Union[Card, _Mapping]] = ..., address: _Optional[_Union[Address, _Mapping]] = ..., vat: _Optional[str] = ..., phone_number: _Optional[str] = ...) -> None: ... + def __init__(self, login: _Optional[str] = ..., name: _Optional[str] = ..., payment_method_id: _Optional[str] = ..., email: _Optional[str] = ..., address: _Optional[_Union[Address, _Mapping]] = ..., vat: _Optional[str] = ..., phone_number: _Optional[str] = ...) -> None: ... -class PaymentServiceCreateOrUpdateCustomerResponse(_message.Message): +class PaymentServiceCreateResponse(_message.Message): __slots__ = ("customer",) CUSTOMER_FIELD_NUMBER: _ClassVar[int] customer: PaymentCustomer def __init__(self, customer: _Optional[_Union[PaymentCustomer, _Mapping]] = ...) -> None: ... -class PaymentServiceGetCustomerRequest(_message.Message): - __slots__ = ("login", "customer_id") +class PaymentServiceUpdateRequest(_message.Message): + __slots__ = ("login", "name", "payment_method_id", "email", "address", "vat", "phone_number") LOGIN_FIELD_NUMBER: _ClassVar[int] - CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + PAYMENT_METHOD_ID_FIELD_NUMBER: _ClassVar[int] + EMAIL_FIELD_NUMBER: _ClassVar[int] + ADDRESS_FIELD_NUMBER: _ClassVar[int] + VAT_FIELD_NUMBER: _ClassVar[int] + PHONE_NUMBER_FIELD_NUMBER: _ClassVar[int] login: str - customer_id: str - def __init__(self, login: _Optional[str] = ..., customer_id: _Optional[str] = ...) -> None: ... + name: str + payment_method_id: str + email: str + address: Address + vat: str + phone_number: str + def __init__(self, login: _Optional[str] = ..., name: _Optional[str] = ..., payment_method_id: _Optional[str] = ..., email: _Optional[str] = ..., address: _Optional[_Union[Address, _Mapping]] = ..., vat: _Optional[str] = ..., phone_number: _Optional[str] = ...) -> None: ... + +class PaymentServiceUpdateResponse(_message.Message): + __slots__ = ("customer",) + CUSTOMER_FIELD_NUMBER: _ClassVar[int] + customer: PaymentCustomer + def __init__(self, customer: _Optional[_Union[PaymentCustomer, _Mapping]] = ...) -> None: ... + +class PaymentServiceGetRequest(_message.Message): + __slots__ = ("login",) + LOGIN_FIELD_NUMBER: _ClassVar[int] + login: str + def __init__(self, login: _Optional[str] = ...) -> None: ... -class PaymentServiceGetCustomerResponse(_message.Message): +class PaymentServiceGetResponse(_message.Message): __slots__ = ("customer",) CUSTOMER_FIELD_NUMBER: _ClassVar[int] customer: PaymentCustomer @@ -210,13 +241,13 @@ class PaymentServiceHasPaymentMethodResponse(_message.Message): positive_balance: bool def __init__(self, exists: bool = ..., positive_balance: bool = ...) -> None: ... -class PaymentServiceDeletePaymentMethodRequest(_message.Message): +class PaymentServiceDeleteRequest(_message.Message): __slots__ = ("login",) LOGIN_FIELD_NUMBER: _ClassVar[int] login: str def __init__(self, login: _Optional[str] = ...) -> None: ... -class PaymentServiceDeletePaymentMethodResponse(_message.Message): +class PaymentServiceDeleteResponse(_message.Message): __slots__ = () def __init__(self) -> None: ... diff --git a/python/metalstackcloud/api/v1/payment_pb2_grpc.py b/python/metalstackcloud/api/v1/payment_pb2_grpc.py index f32e5ccb..23f9e59e 100644 --- a/python/metalstackcloud/api/v1/payment_pb2_grpc.py +++ b/python/metalstackcloud/api/v1/payment_pb2_grpc.py @@ -15,26 +15,31 @@ def __init__(self, channel): Args: channel: A grpc.Channel. """ - self.CreateOrUpdateCustomer = channel.unary_unary( - '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/api.v1.PaymentService/CreateOrUpdateCustomer', - request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest.SerializeToString, - response_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse.FromString, + self.Create = channel.unary_unary( + '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/api.v1.PaymentService/Create', + request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest.SerializeToString, + response_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse.FromString, _registered_method=True) - self.GetCustomer = channel.unary_unary( - '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/api.v1.PaymentService/GetCustomer', - request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest.SerializeToString, - response_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse.FromString, + self.Update = channel.unary_unary( + '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/api.v1.PaymentService/Update', + request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest.SerializeToString, + response_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse.FromString, + _registered_method=True) + self.Delete = channel.unary_unary( + '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/api.v1.PaymentService/Delete', + request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest.SerializeToString, + response_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse.FromString, + _registered_method=True) + self.Get = channel.unary_unary( + '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/api.v1.PaymentService/Get', + request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest.SerializeToString, + response_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse.FromString, _registered_method=True) self.HasPaymentMethod = channel.unary_unary( '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/api.v1.PaymentService/HasPaymentMethod', request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest.SerializeToString, response_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse.FromString, _registered_method=True) - self.DeletePaymentMethod = channel.unary_unary( - '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/api.v1.PaymentService/DeletePaymentMethod', - request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest.SerializeToString, - response_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse.FromString, - _registered_method=True) self.GetSubscriptionUsage = channel.unary_unary( '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/api.v1.PaymentService/GetSubscriptionUsage', request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionUsageRequest.SerializeToString, @@ -61,29 +66,36 @@ class PaymentServiceServicer(object): """PaymentService serves payment related functions """ - def CreateOrUpdateCustomer(self, request, context): - """CreateOrUpdateCustomer the payment data on the payment processor + def Create(self, request, context): + """Create the payment data used for billing api resources """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def GetCustomer(self, request, context): - """GetCustomer from the payment processor + def Update(self, request, context): + """Update the payment data """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def HasPaymentMethod(self, request, context): - """HasPaymentMethod check if the customer has a payment method provided + def Delete(self, request, context): + """Delete the payment data + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Get(self, request, context): + """Get the payment data """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def DeletePaymentMethod(self, request, context): - """DeletePaymentMethod of the customer + def HasPaymentMethod(self, request, context): + """HasPaymentMethod check if the customer has a payment method provided """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -120,26 +132,31 @@ def GetSubscriptionDiscounts(self, request, context): def add_PaymentServiceServicer_to_server(servicer, server): rpc_method_handlers = { - 'CreateOrUpdateCustomer': grpc.unary_unary_rpc_method_handler( - servicer.CreateOrUpdateCustomer, - request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest.FromString, - response_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse.SerializeToString, + 'Create': grpc.unary_unary_rpc_method_handler( + servicer.Create, + request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest.FromString, + response_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse.SerializeToString, ), - 'GetCustomer': grpc.unary_unary_rpc_method_handler( - servicer.GetCustomer, - request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest.FromString, - response_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse.SerializeToString, + 'Update': grpc.unary_unary_rpc_method_handler( + servicer.Update, + request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest.FromString, + response_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse.SerializeToString, + ), + 'Delete': grpc.unary_unary_rpc_method_handler( + servicer.Delete, + request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest.FromString, + response_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse.SerializeToString, + ), + 'Get': grpc.unary_unary_rpc_method_handler( + servicer.Get, + request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest.FromString, + response_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse.SerializeToString, ), 'HasPaymentMethod': grpc.unary_unary_rpc_method_handler( servicer.HasPaymentMethod, request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest.FromString, response_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse.SerializeToString, ), - 'DeletePaymentMethod': grpc.unary_unary_rpc_method_handler( - servicer.DeletePaymentMethod, - request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest.FromString, - response_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse.SerializeToString, - ), 'GetSubscriptionUsage': grpc.unary_unary_rpc_method_handler( servicer.GetSubscriptionUsage, request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionUsageRequest.FromString, @@ -173,7 +190,7 @@ class PaymentService(object): """ @staticmethod - def CreateOrUpdateCustomer(request, + def Create(request, target, options=(), channel_credentials=None, @@ -186,9 +203,9 @@ def CreateOrUpdateCustomer(request, return grpc.experimental.unary_unary( request, target, - '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/api.v1.PaymentService/CreateOrUpdateCustomer', - api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerRequest.SerializeToString, - api_dot_v1_dot_payment__pb2.PaymentServiceCreateOrUpdateCustomerResponse.FromString, + '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/api.v1.PaymentService/Create', + api_dot_v1_dot_payment__pb2.PaymentServiceCreateRequest.SerializeToString, + api_dot_v1_dot_payment__pb2.PaymentServiceCreateResponse.FromString, options, channel_credentials, insecure, @@ -200,7 +217,7 @@ def CreateOrUpdateCustomer(request, _registered_method=True) @staticmethod - def GetCustomer(request, + def Update(request, target, options=(), channel_credentials=None, @@ -213,9 +230,9 @@ def GetCustomer(request, return grpc.experimental.unary_unary( request, target, - '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/api.v1.PaymentService/GetCustomer', - api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerRequest.SerializeToString, - api_dot_v1_dot_payment__pb2.PaymentServiceGetCustomerResponse.FromString, + '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/api.v1.PaymentService/Update', + api_dot_v1_dot_payment__pb2.PaymentServiceUpdateRequest.SerializeToString, + api_dot_v1_dot_payment__pb2.PaymentServiceUpdateResponse.FromString, options, channel_credentials, insecure, @@ -227,7 +244,7 @@ def GetCustomer(request, _registered_method=True) @staticmethod - def HasPaymentMethod(request, + def Delete(request, target, options=(), channel_credentials=None, @@ -240,9 +257,36 @@ def HasPaymentMethod(request, return grpc.experimental.unary_unary( request, target, - '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/api.v1.PaymentService/HasPaymentMethod', - api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest.SerializeToString, - api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse.FromString, + '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/api.v1.PaymentService/Delete', + api_dot_v1_dot_payment__pb2.PaymentServiceDeleteRequest.SerializeToString, + api_dot_v1_dot_payment__pb2.PaymentServiceDeleteResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Get(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '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/api.v1.PaymentService/Get', + api_dot_v1_dot_payment__pb2.PaymentServiceGetRequest.SerializeToString, + api_dot_v1_dot_payment__pb2.PaymentServiceGetResponse.FromString, options, channel_credentials, insecure, @@ -254,7 +298,7 @@ def HasPaymentMethod(request, _registered_method=True) @staticmethod - def DeletePaymentMethod(request, + def HasPaymentMethod(request, target, options=(), channel_credentials=None, @@ -267,9 +311,9 @@ def DeletePaymentMethod(request, return grpc.experimental.unary_unary( request, target, - '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/api.v1.PaymentService/DeletePaymentMethod', - api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodRequest.SerializeToString, - api_dot_v1_dot_payment__pb2.PaymentServiceDeletePaymentMethodResponse.FromString, + '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/api.v1.PaymentService/HasPaymentMethod', + api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodRequest.SerializeToString, + api_dot_v1_dot_payment__pb2.PaymentServiceHasPaymentMethodResponse.FromString, options, channel_credentials, insecure,