diff --git a/docs/docs.json b/docs/docs.json index 87e71fc9..96dd6865 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -7008,6 +7008,78 @@ } ] }, + { + "name": "Discount", + "longName": "Discount", + "fullName": "api.v1.Discount", + "description": "Discount details that can be applied to subscriptions or SubscriptionUsageItems", + "hasExtensions": false, + "hasFields": true, + "hasOneofs": false, + "extensions": [], + "fields": [ + { + "name": "id", + "description": "DiscountId is the id of the discount", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + }, + { + "name": "name", + "description": "DiscountName is the name of the discount", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + }, + { + "name": "amount_off", + "description": "The discounts amount in a given currency", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + }, + { + "name": "percentage_off", + "description": "The discount amount in percent", + "label": "", + "type": "double", + "longType": "double", + "fullType": "double", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + }, + { + "name": "discount_order", + "description": "Order the discounts need to be applied in", + "label": "", + "type": "double", + "longType": "double", + "fullType": "double", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + } + ] + }, { "name": "Invoice", "longName": "Invoice", @@ -7065,6 +7137,18 @@ "isoneof": false, "oneofdecl": "", "defaultValue": "" + }, + { + "name": "discounts", + "description": "Invoice discounts", + "label": "repeated", + "type": "Discount", + "longType": "Discount", + "fullType": "api.v1.Discount", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" } ] }, @@ -7546,6 +7630,54 @@ } ] }, + { + "name": "PaymentServiceGetSubscriptionDiscountsRequest", + "longName": "PaymentServiceGetSubscriptionDiscountsRequest", + "fullName": "api.v1.PaymentServiceGetSubscriptionDiscountsRequest", + "description": "PaymentServiceGetSubscriptionDiscountsRequest is the request payload for a get subscription discounts 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": "PaymentServiceGetSubscriptionDiscountsResponse", + "longName": "PaymentServiceGetSubscriptionDiscountsResponse", + "fullName": "api.v1.PaymentServiceGetSubscriptionDiscountsResponse", + "description": "PaymentServiceGetSubscriptionUsageResponse is the response payload for a get subscription usage request", + "hasExtensions": false, + "hasFields": true, + "hasOneofs": false, + "extensions": [], + "fields": [ + { + "name": "discounts", + "description": "Discounts is a list with all discounts for one subscription", + "label": "repeated", + "type": "Discount", + "longType": "Discount", + "fullType": "api.v1.Discount", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + } + ] + }, { "name": "PaymentServiceGetSubscriptionUsageRequest", "longName": "PaymentServiceGetSubscriptionUsageRequest", @@ -7819,6 +7951,18 @@ "isoneof": false, "oneofdecl": "", "defaultValue": "" + }, + { + "name": "discounts", + "description": "A subscription discounts", + "label": "repeated", + "type": "Discount", + "longType": "Discount", + "fullType": "api.v1.Discount", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" } ] } @@ -7913,6 +8057,18 @@ "responseLongType": "PaymentServiceGetDefaultPricesResponse", "responseFullType": "api.v1.PaymentServiceGetDefaultPricesResponse", "responseStreaming": false + }, + { + "name": "GetSubscriptionDiscounts", + "description": "GetSubscriptionDiscounts gets all discounts for a subscription", + "requestType": "PaymentServiceGetSubscriptionDiscountsRequest", + "requestLongType": "PaymentServiceGetSubscriptionDiscountsRequest", + "requestFullType": "api.v1.PaymentServiceGetSubscriptionDiscountsRequest", + "requestStreaming": false, + "responseType": "PaymentServiceGetSubscriptionDiscountsResponse", + "responseLongType": "PaymentServiceGetSubscriptionDiscountsResponse", + "responseFullType": "api.v1.PaymentServiceGetSubscriptionDiscountsResponse", + "responseStreaming": false } ] } diff --git a/go/api/v1/apiv1connect/payment.connect.go b/go/api/v1/apiv1connect/payment.connect.go index 88d85954..f870b4db 100644 --- a/go/api/v1/apiv1connect/payment.connect.go +++ b/go/api/v1/apiv1connect/payment.connect.go @@ -54,6 +54,9 @@ const ( // PaymentServiceGetDefaultPricesProcedure is the fully-qualified name of the PaymentService's // GetDefaultPrices RPC. PaymentServiceGetDefaultPricesProcedure = "/api.v1.PaymentService/GetDefaultPrices" + // PaymentServiceGetSubscriptionDiscountsProcedure is the fully-qualified name of the + // PaymentService's GetSubscriptionDiscounts RPC. + PaymentServiceGetSubscriptionDiscountsProcedure = "/api.v1.PaymentService/GetSubscriptionDiscounts" ) // PaymentServiceClient is a client for the api.v1.PaymentService service. @@ -72,6 +75,8 @@ type PaymentServiceClient interface { GetInvoices(context.Context, *connect.Request[v1.PaymentServiceGetInvoicesRequest]) (*connect.Response[v1.PaymentServiceGetInvoicesResponse], error) // GetDefaultPrices of the products on the platform GetDefaultPrices(context.Context, *connect.Request[v1.PaymentServiceGetDefaultPricesRequest]) (*connect.Response[v1.PaymentServiceGetDefaultPricesResponse], error) + // GetSubscriptionDiscounts gets all discounts for a subscription + GetSubscriptionDiscounts(context.Context, *connect.Request[v1.PaymentServiceGetSubscriptionDiscountsRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionDiscountsResponse], error) } // NewPaymentServiceClient constructs a client for the api.v1.PaymentService service. By default, it @@ -127,18 +132,25 @@ func NewPaymentServiceClient(httpClient connect.HTTPClient, baseURL string, opts connect.WithSchema(paymentServiceMethods.ByName("GetDefaultPrices")), connect.WithClientOptions(opts...), ), + getSubscriptionDiscounts: connect.NewClient[v1.PaymentServiceGetSubscriptionDiscountsRequest, v1.PaymentServiceGetSubscriptionDiscountsResponse]( + httpClient, + baseURL+PaymentServiceGetSubscriptionDiscountsProcedure, + connect.WithSchema(paymentServiceMethods.ByName("GetSubscriptionDiscounts")), + connect.WithClientOptions(opts...), + ), } } // paymentServiceClient implements PaymentServiceClient. type paymentServiceClient struct { - createOrUpdateCustomer *connect.Client[v1.PaymentServiceCreateOrUpdateCustomerRequest, v1.PaymentServiceCreateOrUpdateCustomerResponse] - getCustomer *connect.Client[v1.PaymentServiceGetCustomerRequest, v1.PaymentServiceGetCustomerResponse] - 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] + createOrUpdateCustomer *connect.Client[v1.PaymentServiceCreateOrUpdateCustomerRequest, v1.PaymentServiceCreateOrUpdateCustomerResponse] + getCustomer *connect.Client[v1.PaymentServiceGetCustomerRequest, v1.PaymentServiceGetCustomerResponse] + 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. @@ -176,6 +188,11 @@ func (c *paymentServiceClient) GetDefaultPrices(ctx context.Context, req *connec return c.getDefaultPrices.CallUnary(ctx, req) } +// GetSubscriptionDiscounts calls api.v1.PaymentService.GetSubscriptionDiscounts. +func (c *paymentServiceClient) GetSubscriptionDiscounts(ctx context.Context, req *connect.Request[v1.PaymentServiceGetSubscriptionDiscountsRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionDiscountsResponse], error) { + return c.getSubscriptionDiscounts.CallUnary(ctx, req) +} + // PaymentServiceHandler is an implementation of the api.v1.PaymentService service. type PaymentServiceHandler interface { // CreateOrUpdateCustomer the payment data on the payment processor @@ -192,6 +209,8 @@ type PaymentServiceHandler interface { GetInvoices(context.Context, *connect.Request[v1.PaymentServiceGetInvoicesRequest]) (*connect.Response[v1.PaymentServiceGetInvoicesResponse], error) // GetDefaultPrices of the products on the platform GetDefaultPrices(context.Context, *connect.Request[v1.PaymentServiceGetDefaultPricesRequest]) (*connect.Response[v1.PaymentServiceGetDefaultPricesResponse], error) + // GetSubscriptionDiscounts gets all discounts for a subscription + GetSubscriptionDiscounts(context.Context, *connect.Request[v1.PaymentServiceGetSubscriptionDiscountsRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionDiscountsResponse], error) } // NewPaymentServiceHandler builds an HTTP handler from the service implementation. It returns the @@ -243,6 +262,12 @@ func NewPaymentServiceHandler(svc PaymentServiceHandler, opts ...connect.Handler connect.WithSchema(paymentServiceMethods.ByName("GetDefaultPrices")), connect.WithHandlerOptions(opts...), ) + paymentServiceGetSubscriptionDiscountsHandler := connect.NewUnaryHandler( + PaymentServiceGetSubscriptionDiscountsProcedure, + svc.GetSubscriptionDiscounts, + connect.WithSchema(paymentServiceMethods.ByName("GetSubscriptionDiscounts")), + connect.WithHandlerOptions(opts...), + ) return "/api.v1.PaymentService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case PaymentServiceCreateOrUpdateCustomerProcedure: @@ -259,6 +284,8 @@ func NewPaymentServiceHandler(svc PaymentServiceHandler, opts ...connect.Handler paymentServiceGetInvoicesHandler.ServeHTTP(w, r) case PaymentServiceGetDefaultPricesProcedure: paymentServiceGetDefaultPricesHandler.ServeHTTP(w, r) + case PaymentServiceGetSubscriptionDiscountsProcedure: + paymentServiceGetSubscriptionDiscountsHandler.ServeHTTP(w, r) default: http.NotFound(w, r) } @@ -295,3 +322,7 @@ func (UnimplementedPaymentServiceHandler) GetInvoices(context.Context, *connect. func (UnimplementedPaymentServiceHandler) GetDefaultPrices(context.Context, *connect.Request[v1.PaymentServiceGetDefaultPricesRequest]) (*connect.Response[v1.PaymentServiceGetDefaultPricesResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.GetDefaultPrices is not implemented")) } + +func (UnimplementedPaymentServiceHandler) GetSubscriptionDiscounts(context.Context, *connect.Request[v1.PaymentServiceGetSubscriptionDiscountsRequest]) (*connect.Response[v1.PaymentServiceGetSubscriptionDiscountsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.PaymentService.GetSubscriptionDiscounts is not implemented")) +} diff --git a/go/api/v1/payment.pb.go b/go/api/v1/payment.pb.go index d2741b77..2d2ff10f 100644 --- a/go/api/v1/payment.pb.go +++ b/go/api/v1/payment.pb.go @@ -567,7 +567,9 @@ type SubscriptionUsageItem struct { // PeriodStart is the start date of this subscription PeriodStart *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=period_start,json=periodStart,proto3" json:"period_start,omitempty"` // PeriodEnd is the end date of this subscription - PeriodEnd *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=period_end,json=periodEnd,proto3" json:"period_end,omitempty"` + PeriodEnd *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=period_end,json=periodEnd,proto3" json:"period_end,omitempty"` + // A subscription discounts + Discounts []*Discount `protobuf:"bytes,6,rep,name=discounts,proto3" json:"discounts,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -637,6 +639,95 @@ func (x *SubscriptionUsageItem) GetPeriodEnd() *timestamppb.Timestamp { return nil } +func (x *SubscriptionUsageItem) GetDiscounts() []*Discount { + if x != nil { + return x.Discounts + } + return nil +} + +// Discount details that can be applied to subscriptions or SubscriptionUsageItems +type Discount struct { + state protoimpl.MessageState `protogen:"open.v1"` + // DiscountId is the id of the discount + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // DiscountName is the name of the discount + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // The discounts amount in a given currency + AmountOff int64 `protobuf:"varint,3,opt,name=amount_off,json=amountOff,proto3" json:"amount_off,omitempty"` + // The discount amount in percent + PercentageOff float64 `protobuf:"fixed64,4,opt,name=percentage_off,json=percentageOff,proto3" json:"percentage_off,omitempty"` + // Order the discounts need to be applied in + DiscountOrder float64 `protobuf:"fixed64,5,opt,name=discount_order,json=discountOrder,proto3" json:"discount_order,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Discount) Reset() { + *x = Discount{} + mi := &file_api_v1_payment_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Discount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Discount) ProtoMessage() {} + +func (x *Discount) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_payment_proto_msgTypes[5] + 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 Discount.ProtoReflect.Descriptor instead. +func (*Discount) Descriptor() ([]byte, []int) { + return file_api_v1_payment_proto_rawDescGZIP(), []int{5} +} + +func (x *Discount) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Discount) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Discount) GetAmountOff() int64 { + if x != nil { + return x.AmountOff + } + return 0 +} + +func (x *Discount) GetPercentageOff() float64 { + if x != nil { + return x.PercentageOff + } + return 0 +} + +func (x *Discount) GetDiscountOrder() float64 { + if x != nil { + return x.DiscountOrder + } + return 0 +} + // Invoice a customer has to pay for subscription usage type Invoice struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -647,14 +738,16 @@ type Invoice struct { // PeriodStart is the start date of the time frame covered by this invoice PeriodStart *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=period_start,json=periodStart,proto3" json:"period_start,omitempty"` // PeriodEnd is the end date of the time frame covered by this invoice - PeriodEnd *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=period_end,json=periodEnd,proto3" json:"period_end,omitempty"` + PeriodEnd *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=period_end,json=periodEnd,proto3" json:"period_end,omitempty"` + // Invoice discounts + Discounts []*Discount `protobuf:"bytes,6,rep,name=discounts,proto3" json:"discounts,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Invoice) Reset() { *x = Invoice{} - mi := &file_api_v1_payment_proto_msgTypes[5] + mi := &file_api_v1_payment_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -666,7 +759,7 @@ func (x *Invoice) String() string { func (*Invoice) ProtoMessage() {} func (x *Invoice) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[5] + mi := &file_api_v1_payment_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -679,7 +772,7 @@ func (x *Invoice) ProtoReflect() protoreflect.Message { // Deprecated: Use Invoice.ProtoReflect.Descriptor instead. func (*Invoice) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{5} + return file_api_v1_payment_proto_rawDescGZIP(), []int{6} } func (x *Invoice) GetId() string { @@ -710,6 +803,13 @@ func (x *Invoice) GetPeriodEnd() *timestamppb.Timestamp { return nil } +func (x *Invoice) GetDiscounts() []*Discount { + if x != nil { + return x.Discounts + } + return nil +} + // PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request type PaymentServiceCreateOrUpdateCustomerRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -735,7 +835,7 @@ type PaymentServiceCreateOrUpdateCustomerRequest struct { func (x *PaymentServiceCreateOrUpdateCustomerRequest) Reset() { *x = PaymentServiceCreateOrUpdateCustomerRequest{} - mi := &file_api_v1_payment_proto_msgTypes[6] + mi := &file_api_v1_payment_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -747,7 +847,7 @@ func (x *PaymentServiceCreateOrUpdateCustomerRequest) String() string { func (*PaymentServiceCreateOrUpdateCustomerRequest) ProtoMessage() {} func (x *PaymentServiceCreateOrUpdateCustomerRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[6] + mi := &file_api_v1_payment_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -760,7 +860,7 @@ func (x *PaymentServiceCreateOrUpdateCustomerRequest) ProtoReflect() protoreflec // Deprecated: Use PaymentServiceCreateOrUpdateCustomerRequest.ProtoReflect.Descriptor instead. func (*PaymentServiceCreateOrUpdateCustomerRequest) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{6} + return file_api_v1_payment_proto_rawDescGZIP(), []int{7} } func (x *PaymentServiceCreateOrUpdateCustomerRequest) GetLogin() string { @@ -830,7 +930,7 @@ type PaymentServiceCreateOrUpdateCustomerResponse struct { func (x *PaymentServiceCreateOrUpdateCustomerResponse) Reset() { *x = PaymentServiceCreateOrUpdateCustomerResponse{} - mi := &file_api_v1_payment_proto_msgTypes[7] + mi := &file_api_v1_payment_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -842,7 +942,7 @@ func (x *PaymentServiceCreateOrUpdateCustomerResponse) String() string { func (*PaymentServiceCreateOrUpdateCustomerResponse) ProtoMessage() {} func (x *PaymentServiceCreateOrUpdateCustomerResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[7] + mi := &file_api_v1_payment_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -855,7 +955,7 @@ func (x *PaymentServiceCreateOrUpdateCustomerResponse) ProtoReflect() protorefle // Deprecated: Use PaymentServiceCreateOrUpdateCustomerResponse.ProtoReflect.Descriptor instead. func (*PaymentServiceCreateOrUpdateCustomerResponse) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{7} + return file_api_v1_payment_proto_rawDescGZIP(), []int{8} } func (x *PaymentServiceCreateOrUpdateCustomerResponse) GetCustomer() *PaymentCustomer { @@ -878,7 +978,7 @@ type PaymentServiceGetCustomerRequest struct { func (x *PaymentServiceGetCustomerRequest) Reset() { *x = PaymentServiceGetCustomerRequest{} - mi := &file_api_v1_payment_proto_msgTypes[8] + mi := &file_api_v1_payment_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -890,7 +990,7 @@ func (x *PaymentServiceGetCustomerRequest) String() string { func (*PaymentServiceGetCustomerRequest) ProtoMessage() {} func (x *PaymentServiceGetCustomerRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[8] + mi := &file_api_v1_payment_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -903,7 +1003,7 @@ func (x *PaymentServiceGetCustomerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentServiceGetCustomerRequest.ProtoReflect.Descriptor instead. func (*PaymentServiceGetCustomerRequest) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{8} + return file_api_v1_payment_proto_rawDescGZIP(), []int{9} } func (x *PaymentServiceGetCustomerRequest) GetLogin() string { @@ -931,7 +1031,7 @@ type PaymentServiceGetCustomerResponse struct { func (x *PaymentServiceGetCustomerResponse) Reset() { *x = PaymentServiceGetCustomerResponse{} - mi := &file_api_v1_payment_proto_msgTypes[9] + mi := &file_api_v1_payment_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -943,7 +1043,7 @@ func (x *PaymentServiceGetCustomerResponse) String() string { func (*PaymentServiceGetCustomerResponse) ProtoMessage() {} func (x *PaymentServiceGetCustomerResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[9] + mi := &file_api_v1_payment_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -956,7 +1056,7 @@ func (x *PaymentServiceGetCustomerResponse) ProtoReflect() protoreflect.Message // Deprecated: Use PaymentServiceGetCustomerResponse.ProtoReflect.Descriptor instead. func (*PaymentServiceGetCustomerResponse) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{9} + return file_api_v1_payment_proto_rawDescGZIP(), []int{10} } func (x *PaymentServiceGetCustomerResponse) GetCustomer() *PaymentCustomer { @@ -977,7 +1077,7 @@ type PaymentServiceHasPaymentMethodRequest struct { func (x *PaymentServiceHasPaymentMethodRequest) Reset() { *x = PaymentServiceHasPaymentMethodRequest{} - mi := &file_api_v1_payment_proto_msgTypes[10] + mi := &file_api_v1_payment_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -989,7 +1089,7 @@ func (x *PaymentServiceHasPaymentMethodRequest) String() string { func (*PaymentServiceHasPaymentMethodRequest) ProtoMessage() {} func (x *PaymentServiceHasPaymentMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[10] + mi := &file_api_v1_payment_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1002,7 +1102,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{10} + return file_api_v1_payment_proto_rawDescGZIP(), []int{11} } func (x *PaymentServiceHasPaymentMethodRequest) GetLogin() string { @@ -1025,7 +1125,7 @@ type PaymentServiceHasPaymentMethodResponse struct { func (x *PaymentServiceHasPaymentMethodResponse) Reset() { *x = PaymentServiceHasPaymentMethodResponse{} - mi := &file_api_v1_payment_proto_msgTypes[11] + mi := &file_api_v1_payment_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1037,7 +1137,7 @@ func (x *PaymentServiceHasPaymentMethodResponse) String() string { func (*PaymentServiceHasPaymentMethodResponse) ProtoMessage() {} func (x *PaymentServiceHasPaymentMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[11] + mi := &file_api_v1_payment_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1050,7 +1150,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{11} + return file_api_v1_payment_proto_rawDescGZIP(), []int{12} } func (x *PaymentServiceHasPaymentMethodResponse) GetExists() bool { @@ -1078,7 +1178,7 @@ type PaymentServiceDeletePaymentMethodRequest struct { func (x *PaymentServiceDeletePaymentMethodRequest) Reset() { *x = PaymentServiceDeletePaymentMethodRequest{} - mi := &file_api_v1_payment_proto_msgTypes[12] + mi := &file_api_v1_payment_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1090,7 +1190,7 @@ func (x *PaymentServiceDeletePaymentMethodRequest) String() string { func (*PaymentServiceDeletePaymentMethodRequest) ProtoMessage() {} func (x *PaymentServiceDeletePaymentMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[12] + mi := &file_api_v1_payment_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1103,7 +1203,7 @@ func (x *PaymentServiceDeletePaymentMethodRequest) ProtoReflect() protoreflect.M // Deprecated: Use PaymentServiceDeletePaymentMethodRequest.ProtoReflect.Descriptor instead. func (*PaymentServiceDeletePaymentMethodRequest) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{12} + return file_api_v1_payment_proto_rawDescGZIP(), []int{13} } func (x *PaymentServiceDeletePaymentMethodRequest) GetLogin() string { @@ -1122,7 +1222,7 @@ type PaymentServiceDeletePaymentMethodResponse struct { func (x *PaymentServiceDeletePaymentMethodResponse) Reset() { *x = PaymentServiceDeletePaymentMethodResponse{} - mi := &file_api_v1_payment_proto_msgTypes[13] + mi := &file_api_v1_payment_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1134,7 +1234,7 @@ func (x *PaymentServiceDeletePaymentMethodResponse) String() string { func (*PaymentServiceDeletePaymentMethodResponse) ProtoMessage() {} func (x *PaymentServiceDeletePaymentMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[13] + mi := &file_api_v1_payment_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1147,7 +1247,7 @@ func (x *PaymentServiceDeletePaymentMethodResponse) ProtoReflect() protoreflect. // Deprecated: Use PaymentServiceDeletePaymentMethodResponse.ProtoReflect.Descriptor instead. func (*PaymentServiceDeletePaymentMethodResponse) Descriptor() ([]byte, []int) { - return file_api_v1_payment_proto_rawDescGZIP(), []int{13} + return file_api_v1_payment_proto_rawDescGZIP(), []int{14} } // PaymentServiceGetSubscriptionUsageRequest is the request payload for a get subscription usage request @@ -1161,7 +1261,7 @@ type PaymentServiceGetSubscriptionUsageRequest struct { func (x *PaymentServiceGetSubscriptionUsageRequest) Reset() { *x = PaymentServiceGetSubscriptionUsageRequest{} - mi := &file_api_v1_payment_proto_msgTypes[14] + mi := &file_api_v1_payment_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1173,7 +1273,7 @@ func (x *PaymentServiceGetSubscriptionUsageRequest) String() string { func (*PaymentServiceGetSubscriptionUsageRequest) ProtoMessage() {} func (x *PaymentServiceGetSubscriptionUsageRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[14] + mi := &file_api_v1_payment_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1186,7 +1286,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{14} + return file_api_v1_payment_proto_rawDescGZIP(), []int{15} } func (x *PaymentServiceGetSubscriptionUsageRequest) GetLogin() string { @@ -1207,7 +1307,7 @@ type PaymentServiceGetSubscriptionUsageResponse struct { func (x *PaymentServiceGetSubscriptionUsageResponse) Reset() { *x = PaymentServiceGetSubscriptionUsageResponse{} - mi := &file_api_v1_payment_proto_msgTypes[15] + mi := &file_api_v1_payment_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1219,7 +1319,7 @@ func (x *PaymentServiceGetSubscriptionUsageResponse) String() string { func (*PaymentServiceGetSubscriptionUsageResponse) ProtoMessage() {} func (x *PaymentServiceGetSubscriptionUsageResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[15] + mi := &file_api_v1_payment_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1232,7 +1332,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{15} + return file_api_v1_payment_proto_rawDescGZIP(), []int{16} } func (x *PaymentServiceGetSubscriptionUsageResponse) GetSubscriptionUsageItems() []*SubscriptionUsageItem { @@ -1255,7 +1355,7 @@ type PaymentServiceGetInvoicesRequest struct { func (x *PaymentServiceGetInvoicesRequest) Reset() { *x = PaymentServiceGetInvoicesRequest{} - mi := &file_api_v1_payment_proto_msgTypes[16] + mi := &file_api_v1_payment_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1267,7 +1367,7 @@ func (x *PaymentServiceGetInvoicesRequest) String() string { func (*PaymentServiceGetInvoicesRequest) ProtoMessage() {} func (x *PaymentServiceGetInvoicesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[16] + mi := &file_api_v1_payment_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1280,7 +1380,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{16} + return file_api_v1_payment_proto_rawDescGZIP(), []int{17} } func (x *PaymentServiceGetInvoicesRequest) GetLogin() string { @@ -1308,7 +1408,7 @@ type PaymentServiceGetInvoicesResponse struct { func (x *PaymentServiceGetInvoicesResponse) Reset() { *x = PaymentServiceGetInvoicesResponse{} - mi := &file_api_v1_payment_proto_msgTypes[17] + mi := &file_api_v1_payment_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1320,7 +1420,7 @@ func (x *PaymentServiceGetInvoicesResponse) String() string { func (*PaymentServiceGetInvoicesResponse) ProtoMessage() {} func (x *PaymentServiceGetInvoicesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[17] + mi := &file_api_v1_payment_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1333,7 +1433,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{17} + return file_api_v1_payment_proto_rawDescGZIP(), []int{18} } func (x *PaymentServiceGetInvoicesResponse) GetInvoices() []*Invoice { @@ -1352,7 +1452,7 @@ type PaymentServiceGetDefaultPricesRequest struct { func (x *PaymentServiceGetDefaultPricesRequest) Reset() { *x = PaymentServiceGetDefaultPricesRequest{} - mi := &file_api_v1_payment_proto_msgTypes[18] + mi := &file_api_v1_payment_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1364,7 +1464,7 @@ func (x *PaymentServiceGetDefaultPricesRequest) String() string { func (*PaymentServiceGetDefaultPricesRequest) ProtoMessage() {} func (x *PaymentServiceGetDefaultPricesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[18] + mi := &file_api_v1_payment_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1377,7 +1477,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{18} + return file_api_v1_payment_proto_rawDescGZIP(), []int{19} } // PaymentServiceGetDefaultPricesResponse is the response payload for a get default prices request @@ -1391,7 +1491,7 @@ type PaymentServiceGetDefaultPricesResponse struct { func (x *PaymentServiceGetDefaultPricesResponse) Reset() { *x = PaymentServiceGetDefaultPricesResponse{} - mi := &file_api_v1_payment_proto_msgTypes[19] + mi := &file_api_v1_payment_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1403,7 +1503,7 @@ func (x *PaymentServiceGetDefaultPricesResponse) String() string { func (*PaymentServiceGetDefaultPricesResponse) ProtoMessage() {} func (x *PaymentServiceGetDefaultPricesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_payment_proto_msgTypes[19] + mi := &file_api_v1_payment_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1416,7 +1516,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{19} + return file_api_v1_payment_proto_rawDescGZIP(), []int{20} } func (x *PaymentServiceGetDefaultPricesResponse) GetPrices() []*Price { @@ -1426,6 +1526,98 @@ func (x *PaymentServiceGetDefaultPricesResponse) GetPrices() []*Price { return nil } +// PaymentServiceGetSubscriptionDiscountsRequest is the request payload for a get subscription discounts request +type PaymentServiceGetSubscriptionDiscountsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Login of the customer + Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PaymentServiceGetSubscriptionDiscountsRequest) Reset() { + *x = PaymentServiceGetSubscriptionDiscountsRequest{} + mi := &file_api_v1_payment_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PaymentServiceGetSubscriptionDiscountsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaymentServiceGetSubscriptionDiscountsRequest) ProtoMessage() {} + +func (x *PaymentServiceGetSubscriptionDiscountsRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_payment_proto_msgTypes[21] + 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 PaymentServiceGetSubscriptionDiscountsRequest.ProtoReflect.Descriptor instead. +func (*PaymentServiceGetSubscriptionDiscountsRequest) Descriptor() ([]byte, []int) { + return file_api_v1_payment_proto_rawDescGZIP(), []int{21} +} + +func (x *PaymentServiceGetSubscriptionDiscountsRequest) GetLogin() string { + if x != nil { + return x.Login + } + return "" +} + +// PaymentServiceGetSubscriptionUsageResponse is the response payload for a get subscription usage request +type PaymentServiceGetSubscriptionDiscountsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Discounts is a list with all discounts for one subscription + Discounts []*Discount `protobuf:"bytes,1,rep,name=discounts,proto3" json:"discounts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PaymentServiceGetSubscriptionDiscountsResponse) Reset() { + *x = PaymentServiceGetSubscriptionDiscountsResponse{} + mi := &file_api_v1_payment_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PaymentServiceGetSubscriptionDiscountsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaymentServiceGetSubscriptionDiscountsResponse) ProtoMessage() {} + +func (x *PaymentServiceGetSubscriptionDiscountsResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_payment_proto_msgTypes[22] + 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 PaymentServiceGetSubscriptionDiscountsResponse.ProtoReflect.Descriptor instead. +func (*PaymentServiceGetSubscriptionDiscountsResponse) Descriptor() ([]byte, []int) { + return file_api_v1_payment_proto_rawDescGZIP(), []int{22} +} + +func (x *PaymentServiceGetSubscriptionDiscountsResponse) GetDiscounts() []*Discount { + if x != nil { + return x.Discounts + } + return nil +} + var File_api_v1_payment_proto protoreflect.FileDescriptor const file_api_v1_payment_proto_rawDesc = "" + @@ -1480,7 +1672,7 @@ const file_api_v1_payment_proto_rawDesc = "" + "postalCode\x12\x12\n" + "\x04city\x18\x04 \x01(\tR\x04city\x12\x14\n" + "\x05state\x18\x05 \x01(\tR\x05state\x12\x18\n" + - "\acountry\x18\x06 \x01(\tR\acountry\"\x9a\x02\n" + + "\acountry\x18\x06 \x01(\tR\acountry\"\xca\x02\n" + "\x15SubscriptionUsageItem\x120\n" + "\x14subscription_item_id\x18\x01 \x01(\tR\x12subscriptionItemId\x124\n" + "\x16subscription_item_name\x18\x02 \x01(\tR\x14subscriptionItemName\x12\x1f\n" + @@ -1488,13 +1680,22 @@ const file_api_v1_payment_proto_rawDesc = "" + "totalUsage\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\"\xbd\x01\n" + + "period_end\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tperiodEnd\x12.\n" + + "\tdiscounts\x18\x06 \x03(\v2\x10.api.v1.DiscountR\tdiscounts\"\x9b\x01\n" + + "\bDiscount\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1d\n" + + "\n" + + "amount_off\x18\x03 \x01(\x03R\tamountOff\x12%\n" + + "\x0epercentage_off\x18\x04 \x01(\x01R\rpercentageOff\x12%\n" + + "\x0ediscount_order\x18\x05 \x01(\x01R\rdiscountOrder\"\xed\x01\n" + "\aInvoice\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12(\n" + "\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" + + "period_end\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tperiodEnd\x12.\n" + + "\tdiscounts\x18\x06 \x03(\v2\x10.api.v1.DiscountR\tdiscounts\"\xce\x03\n" + "+PaymentServiceCreateOrUpdateCustomerRequest\x12 \n" + "\x05login\x18\x01 \x01(\tB\n" + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\x12\x17\n" + @@ -1545,7 +1746,12 @@ const file_api_v1_payment_proto_rawDesc = "" + "\binvoices\x18\x01 \x03(\v2\x0f.api.v1.InvoiceR\binvoices\"'\n" + "%PaymentServiceGetDefaultPricesRequest\"O\n" + "&PaymentServiceGetDefaultPricesResponse\x12%\n" + - "\x06prices\x18\x01 \x03(\v2\r.api.v1.PriceR\x06prices*\x96\x01\n" + + "\x06prices\x18\x01 \x03(\v2\r.api.v1.PriceR\x06prices\"Q\n" + + "-PaymentServiceGetSubscriptionDiscountsRequest\x12 \n" + + "\x05login\x18\x01 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05login\"`\n" + + ".PaymentServiceGetSubscriptionDiscountsResponse\x12.\n" + + "\tdiscounts\x18\x01 \x03(\v2\x10.api.v1.DiscountR\tdiscounts*\x96\x01\n" + "\vProductType\x12\x1c\n" + "\x18PRODUCT_TYPE_UNSPECIFIED\x10\x00\x12\x18\n" + "\x14PRODUCT_TYPE_STORAGE\x10\x01\x12\x18\n" + @@ -1555,7 +1761,7 @@ 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\x88\a\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" + @@ -1563,7 +1769,8 @@ const file_api_v1_payment_proto_rawDesc = "" + "\x13DeletePaymentMethod\x120.api.v1.PaymentServiceDeletePaymentMethodRequest\x1a1.api.v1.PaymentServiceDeletePaymentMethodResponse\"\x05\xc2\xf3\x18\x01\x01\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\x02B\x85\x01\n" + + "\x10GetDefaultPrices\x12-.api.v1.PaymentServiceGetDefaultPricesRequest\x1a..api.v1.PaymentServiceGetDefaultPricesResponse\"\b\xd8\xf3\x18\x01\xe8\xf3\x18\x02\x12\x94\x01\n" + + "\x18GetSubscriptionDiscounts\x125.api.v1.PaymentServiceGetSubscriptionDiscountsRequest\x1a6.api.v1.PaymentServiceGetSubscriptionDiscountsResponse\"\t\xc2\xf3\x18\x01\x01\xe8\xf3\x18\x02B\x85\x01\n" + "\n" + "com.api.v1B\fPaymentProtoP\x01Z0github.com/metal-stack-cloud/api/go/api/v1;apiv1\xa2\x02\x03AXX\xaa\x02\x06Api.V1\xca\x02\x06Api\\V1\xe2\x02\x12Api\\V1\\GPBMetadata\xea\x02\aApi::V1b\x06proto3" @@ -1580,7 +1787,7 @@ func file_api_v1_payment_proto_rawDescGZIP() []byte { } var file_api_v1_payment_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_api_v1_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_api_v1_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 23) var file_api_v1_payment_proto_goTypes = []any{ (ProductType)(0), // 0: api.v1.ProductType (UsageType)(0), // 1: api.v1.UsageType @@ -1589,22 +1796,25 @@ var file_api_v1_payment_proto_goTypes = []any{ (*Price)(nil), // 4: api.v1.Price (*Address)(nil), // 5: api.v1.Address (*SubscriptionUsageItem)(nil), // 6: api.v1.SubscriptionUsageItem - (*Invoice)(nil), // 7: api.v1.Invoice - (*PaymentServiceCreateOrUpdateCustomerRequest)(nil), // 8: api.v1.PaymentServiceCreateOrUpdateCustomerRequest - (*PaymentServiceCreateOrUpdateCustomerResponse)(nil), // 9: api.v1.PaymentServiceCreateOrUpdateCustomerResponse - (*PaymentServiceGetCustomerRequest)(nil), // 10: api.v1.PaymentServiceGetCustomerRequest - (*PaymentServiceGetCustomerResponse)(nil), // 11: api.v1.PaymentServiceGetCustomerResponse - (*PaymentServiceHasPaymentMethodRequest)(nil), // 12: api.v1.PaymentServiceHasPaymentMethodRequest - (*PaymentServiceHasPaymentMethodResponse)(nil), // 13: api.v1.PaymentServiceHasPaymentMethodResponse - (*PaymentServiceDeletePaymentMethodRequest)(nil), // 14: api.v1.PaymentServiceDeletePaymentMethodRequest - (*PaymentServiceDeletePaymentMethodResponse)(nil), // 15: api.v1.PaymentServiceDeletePaymentMethodResponse - (*PaymentServiceGetSubscriptionUsageRequest)(nil), // 16: api.v1.PaymentServiceGetSubscriptionUsageRequest - (*PaymentServiceGetSubscriptionUsageResponse)(nil), // 17: api.v1.PaymentServiceGetSubscriptionUsageResponse - (*PaymentServiceGetInvoicesRequest)(nil), // 18: api.v1.PaymentServiceGetInvoicesRequest - (*PaymentServiceGetInvoicesResponse)(nil), // 19: api.v1.PaymentServiceGetInvoicesResponse - (*PaymentServiceGetDefaultPricesRequest)(nil), // 20: api.v1.PaymentServiceGetDefaultPricesRequest - (*PaymentServiceGetDefaultPricesResponse)(nil), // 21: api.v1.PaymentServiceGetDefaultPricesResponse - (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp + (*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 } var file_api_v1_payment_proto_depIdxs = []int32{ 3, // 0: api.v1.PaymentCustomer.card:type_name -> api.v1.Card @@ -1612,36 +1822,41 @@ var file_api_v1_payment_proto_depIdxs = []int32{ 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 - 22, // 5: api.v1.SubscriptionUsageItem.period_start:type_name -> google.protobuf.Timestamp - 22, // 6: api.v1.SubscriptionUsageItem.period_end:type_name -> google.protobuf.Timestamp - 22, // 7: api.v1.Invoice.period_start:type_name -> google.protobuf.Timestamp - 22, // 8: api.v1.Invoice.period_end:type_name -> google.protobuf.Timestamp - 3, // 9: api.v1.PaymentServiceCreateOrUpdateCustomerRequest.card:type_name -> api.v1.Card - 5, // 10: api.v1.PaymentServiceCreateOrUpdateCustomerRequest.address:type_name -> api.v1.Address - 2, // 11: api.v1.PaymentServiceCreateOrUpdateCustomerResponse.customer:type_name -> api.v1.PaymentCustomer - 2, // 12: api.v1.PaymentServiceGetCustomerResponse.customer:type_name -> api.v1.PaymentCustomer - 6, // 13: api.v1.PaymentServiceGetSubscriptionUsageResponse.subscription_usage_items:type_name -> api.v1.SubscriptionUsageItem - 7, // 14: api.v1.PaymentServiceGetInvoicesResponse.invoices:type_name -> api.v1.Invoice - 4, // 15: api.v1.PaymentServiceGetDefaultPricesResponse.prices:type_name -> api.v1.Price - 8, // 16: api.v1.PaymentService.CreateOrUpdateCustomer:input_type -> api.v1.PaymentServiceCreateOrUpdateCustomerRequest - 10, // 17: api.v1.PaymentService.GetCustomer:input_type -> api.v1.PaymentServiceGetCustomerRequest - 12, // 18: api.v1.PaymentService.HasPaymentMethod:input_type -> api.v1.PaymentServiceHasPaymentMethodRequest - 14, // 19: api.v1.PaymentService.DeletePaymentMethod:input_type -> api.v1.PaymentServiceDeletePaymentMethodRequest - 16, // 20: api.v1.PaymentService.GetSubscriptionUsage:input_type -> api.v1.PaymentServiceGetSubscriptionUsageRequest - 18, // 21: api.v1.PaymentService.GetInvoices:input_type -> api.v1.PaymentServiceGetInvoicesRequest - 20, // 22: api.v1.PaymentService.GetDefaultPrices:input_type -> api.v1.PaymentServiceGetDefaultPricesRequest - 9, // 23: api.v1.PaymentService.CreateOrUpdateCustomer:output_type -> api.v1.PaymentServiceCreateOrUpdateCustomerResponse - 11, // 24: api.v1.PaymentService.GetCustomer:output_type -> api.v1.PaymentServiceGetCustomerResponse - 13, // 25: api.v1.PaymentService.HasPaymentMethod:output_type -> api.v1.PaymentServiceHasPaymentMethodResponse - 15, // 26: api.v1.PaymentService.DeletePaymentMethod:output_type -> api.v1.PaymentServiceDeletePaymentMethodResponse - 17, // 27: api.v1.PaymentService.GetSubscriptionUsage:output_type -> api.v1.PaymentServiceGetSubscriptionUsageResponse - 19, // 28: api.v1.PaymentService.GetInvoices:output_type -> api.v1.PaymentServiceGetInvoicesResponse - 21, // 29: api.v1.PaymentService.GetDefaultPrices:output_type -> api.v1.PaymentServiceGetDefaultPricesResponse - 23, // [23:30] is the sub-list for method output_type - 16, // [16:23] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 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 + 7, // 10: api.v1.Invoice.discounts:type_name -> api.v1.Discount + 3, // 11: api.v1.PaymentServiceCreateOrUpdateCustomerRequest.card:type_name -> api.v1.Card + 5, // 12: api.v1.PaymentServiceCreateOrUpdateCustomerRequest.address:type_name -> api.v1.Address + 2, // 13: api.v1.PaymentServiceCreateOrUpdateCustomerResponse.customer:type_name -> api.v1.PaymentCustomer + 2, // 14: api.v1.PaymentServiceGetCustomerResponse.customer:type_name -> api.v1.PaymentCustomer + 6, // 15: api.v1.PaymentServiceGetSubscriptionUsageResponse.subscription_usage_items:type_name -> api.v1.SubscriptionUsageItem + 8, // 16: api.v1.PaymentServiceGetInvoicesResponse.invoices:type_name -> api.v1.Invoice + 4, // 17: api.v1.PaymentServiceGetDefaultPricesResponse.prices:type_name -> api.v1.Price + 7, // 18: api.v1.PaymentServiceGetSubscriptionDiscountsResponse.discounts:type_name -> api.v1.Discount + 9, // 19: api.v1.PaymentService.CreateOrUpdateCustomer:input_type -> api.v1.PaymentServiceCreateOrUpdateCustomerRequest + 11, // 20: api.v1.PaymentService.GetCustomer:input_type -> api.v1.PaymentServiceGetCustomerRequest + 13, // 21: api.v1.PaymentService.HasPaymentMethod:input_type -> api.v1.PaymentServiceHasPaymentMethodRequest + 15, // 22: api.v1.PaymentService.DeletePaymentMethod:input_type -> api.v1.PaymentServiceDeletePaymentMethodRequest + 17, // 23: api.v1.PaymentService.GetSubscriptionUsage:input_type -> api.v1.PaymentServiceGetSubscriptionUsageRequest + 19, // 24: api.v1.PaymentService.GetInvoices:input_type -> api.v1.PaymentServiceGetInvoicesRequest + 21, // 25: api.v1.PaymentService.GetDefaultPrices:input_type -> api.v1.PaymentServiceGetDefaultPricesRequest + 23, // 26: api.v1.PaymentService.GetSubscriptionDiscounts:input_type -> api.v1.PaymentServiceGetSubscriptionDiscountsRequest + 10, // 27: api.v1.PaymentService.CreateOrUpdateCustomer:output_type -> api.v1.PaymentServiceCreateOrUpdateCustomerResponse + 12, // 28: api.v1.PaymentService.GetCustomer:output_type -> api.v1.PaymentServiceGetCustomerResponse + 14, // 29: api.v1.PaymentService.HasPaymentMethod:output_type -> api.v1.PaymentServiceHasPaymentMethodResponse + 16, // 30: api.v1.PaymentService.DeletePaymentMethod:output_type -> api.v1.PaymentServiceDeletePaymentMethodResponse + 18, // 31: api.v1.PaymentService.GetSubscriptionUsage:output_type -> api.v1.PaymentServiceGetSubscriptionUsageResponse + 20, // 32: api.v1.PaymentService.GetInvoices:output_type -> api.v1.PaymentServiceGetInvoicesResponse + 22, // 33: api.v1.PaymentService.GetDefaultPrices:output_type -> api.v1.PaymentServiceGetDefaultPricesResponse + 24, // 34: api.v1.PaymentService.GetSubscriptionDiscounts:output_type -> api.v1.PaymentServiceGetSubscriptionDiscountsResponse + 27, // [27:35] is the sub-list for method output_type + 19, // [19:27] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_api_v1_payment_proto_init() } @@ -1652,14 +1867,14 @@ func file_api_v1_payment_proto_init() { file_api_v1_common_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[6].OneofWrappers = []any{} + file_api_v1_payment_proto_msgTypes[7].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: 20, + NumMessages: 23, NumExtensions: 0, NumServices: 1, }, diff --git a/go/permissions/servicepermissions.go b/go/permissions/servicepermissions.go index 551b2a4d..1aae97df 100755 --- a/go/permissions/servicepermissions.go +++ b/go/permissions/servicepermissions.go @@ -90,6 +90,7 @@ func GetServicePermissions() *ServicePermissions { "/api.v1.PaymentService/DeletePaymentMethod", "/api.v1.PaymentService/GetSubscriptionUsage", "/api.v1.PaymentService/GetInvoices", + "/api.v1.PaymentService/GetSubscriptionDiscounts", "/api.v1.ProjectService/Create", "/api.v1.TenantService/Get", "/api.v1.TenantService/Update", @@ -176,89 +177,90 @@ func GetServicePermissions() *ServicePermissions { }, }, Methods: map[string]bool{ - "/admin.v1.AuditService/Get": true, - "/admin.v1.AuditService/List": true, - "/admin.v1.ClusterService/Credentials": true, - "/admin.v1.ClusterService/Get": true, - "/admin.v1.ClusterService/List": true, - "/admin.v1.PaymentService/AddBalanceToCustomer": true, - "/admin.v1.ProjectService/List": true, - "/admin.v1.StorageService/ClusterInfo": true, - "/admin.v1.StorageService/ListSnapshots": true, - "/admin.v1.StorageService/ListVolumes": true, - "/admin.v1.TenantService/AddMember": true, - "/admin.v1.TenantService/Admit": true, - "/admin.v1.TenantService/List": true, - "/admin.v1.TenantService/Revoke": true, - "/admin.v1.TokenService/List": true, - "/admin.v1.TokenService/Revoke": true, - "/api.v1.AssetService/List": true, - "/api.v1.AuditService/Get": true, - "/api.v1.AuditService/List": true, - "/api.v1.ClusterService/Create": true, - "/api.v1.ClusterService/Delete": true, - "/api.v1.ClusterService/Get": true, - "/api.v1.ClusterService/GetCredentials": true, - "/api.v1.ClusterService/List": true, - "/api.v1.ClusterService/Operate": true, - "/api.v1.ClusterService/Update": true, - "/api.v1.ClusterService/WatchStatus": true, - "/api.v1.HealthService/Get": true, - "/api.v1.IPService/Allocate": true, - "/api.v1.IPService/Delete": true, - "/api.v1.IPService/Get": true, - "/api.v1.IPService/List": true, - "/api.v1.IPService/Update": true, - "/api.v1.MethodService/List": true, - "/api.v1.MethodService/TokenScopedList": true, - "/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "/api.v1.PaymentService/DeletePaymentMethod": true, - "/api.v1.PaymentService/GetCustomer": true, - "/api.v1.PaymentService/GetDefaultPrices": true, - "/api.v1.PaymentService/GetInvoices": true, - "/api.v1.PaymentService/GetSubscriptionUsage": true, - "/api.v1.PaymentService/HasPaymentMethod": true, - "/api.v1.ProjectService/Create": true, - "/api.v1.ProjectService/Delete": true, - "/api.v1.ProjectService/Get": true, - "/api.v1.ProjectService/Invite": true, - "/api.v1.ProjectService/InviteAccept": true, - "/api.v1.ProjectService/InviteDelete": true, - "/api.v1.ProjectService/InviteGet": true, - "/api.v1.ProjectService/InvitesList": true, - "/api.v1.ProjectService/List": true, - "/api.v1.ProjectService/RemoveMember": true, - "/api.v1.ProjectService/Update": true, - "/api.v1.ProjectService/UpdateMember": true, - "/api.v1.SnapshotService/Delete": true, - "/api.v1.SnapshotService/Get": true, - "/api.v1.SnapshotService/List": true, - "/api.v1.TenantService/Create": true, - "/api.v1.TenantService/Delete": true, - "/api.v1.TenantService/Get": true, - "/api.v1.TenantService/Invite": true, - "/api.v1.TenantService/InviteAccept": true, - "/api.v1.TenantService/InviteDelete": true, - "/api.v1.TenantService/InviteGet": true, - "/api.v1.TenantService/InvitesList": true, - "/api.v1.TenantService/List": true, - "/api.v1.TenantService/RemoveMember": true, - "/api.v1.TenantService/RequestAdmission": true, - "/api.v1.TenantService/Update": true, - "/api.v1.TenantService/UpdateMember": true, - "/api.v1.TokenService/Create": true, - "/api.v1.TokenService/Get": true, - "/api.v1.TokenService/List": true, - "/api.v1.TokenService/Revoke": true, - "/api.v1.TokenService/Update": true, - "/api.v1.UserService/Get": true, - "/api.v1.VersionService/Get": true, - "/api.v1.VolumeService/Delete": true, - "/api.v1.VolumeService/Get": true, - "/api.v1.VolumeService/List": true, - "/api.v1.VolumeService/Update": true, - "/status.v1.MessageService/Watch": true, - "/status.v1.StatusService/Watch": true, + "/admin.v1.AuditService/Get": true, + "/admin.v1.AuditService/List": true, + "/admin.v1.ClusterService/Credentials": true, + "/admin.v1.ClusterService/Get": true, + "/admin.v1.ClusterService/List": true, + "/admin.v1.PaymentService/AddBalanceToCustomer": true, + "/admin.v1.ProjectService/List": true, + "/admin.v1.StorageService/ClusterInfo": true, + "/admin.v1.StorageService/ListSnapshots": true, + "/admin.v1.StorageService/ListVolumes": true, + "/admin.v1.TenantService/AddMember": true, + "/admin.v1.TenantService/Admit": true, + "/admin.v1.TenantService/List": true, + "/admin.v1.TenantService/Revoke": true, + "/admin.v1.TokenService/List": true, + "/admin.v1.TokenService/Revoke": true, + "/api.v1.AssetService/List": true, + "/api.v1.AuditService/Get": true, + "/api.v1.AuditService/List": true, + "/api.v1.ClusterService/Create": true, + "/api.v1.ClusterService/Delete": true, + "/api.v1.ClusterService/Get": true, + "/api.v1.ClusterService/GetCredentials": true, + "/api.v1.ClusterService/List": true, + "/api.v1.ClusterService/Operate": true, + "/api.v1.ClusterService/Update": true, + "/api.v1.ClusterService/WatchStatus": true, + "/api.v1.HealthService/Get": true, + "/api.v1.IPService/Allocate": true, + "/api.v1.IPService/Delete": true, + "/api.v1.IPService/Get": true, + "/api.v1.IPService/List": true, + "/api.v1.IPService/Update": true, + "/api.v1.MethodService/List": true, + "/api.v1.MethodService/TokenScopedList": true, + "/api.v1.PaymentService/CreateOrUpdateCustomer": true, + "/api.v1.PaymentService/DeletePaymentMethod": true, + "/api.v1.PaymentService/GetCustomer": true, + "/api.v1.PaymentService/GetDefaultPrices": true, + "/api.v1.PaymentService/GetInvoices": true, + "/api.v1.PaymentService/GetSubscriptionDiscounts": true, + "/api.v1.PaymentService/GetSubscriptionUsage": true, + "/api.v1.PaymentService/HasPaymentMethod": true, + "/api.v1.ProjectService/Create": true, + "/api.v1.ProjectService/Delete": true, + "/api.v1.ProjectService/Get": true, + "/api.v1.ProjectService/Invite": true, + "/api.v1.ProjectService/InviteAccept": true, + "/api.v1.ProjectService/InviteDelete": true, + "/api.v1.ProjectService/InviteGet": true, + "/api.v1.ProjectService/InvitesList": true, + "/api.v1.ProjectService/List": true, + "/api.v1.ProjectService/RemoveMember": true, + "/api.v1.ProjectService/Update": true, + "/api.v1.ProjectService/UpdateMember": true, + "/api.v1.SnapshotService/Delete": true, + "/api.v1.SnapshotService/Get": true, + "/api.v1.SnapshotService/List": true, + "/api.v1.TenantService/Create": true, + "/api.v1.TenantService/Delete": true, + "/api.v1.TenantService/Get": true, + "/api.v1.TenantService/Invite": true, + "/api.v1.TenantService/InviteAccept": true, + "/api.v1.TenantService/InviteDelete": true, + "/api.v1.TenantService/InviteGet": true, + "/api.v1.TenantService/InvitesList": true, + "/api.v1.TenantService/List": true, + "/api.v1.TenantService/RemoveMember": true, + "/api.v1.TenantService/RequestAdmission": true, + "/api.v1.TenantService/Update": true, + "/api.v1.TenantService/UpdateMember": true, + "/api.v1.TokenService/Create": true, + "/api.v1.TokenService/Get": true, + "/api.v1.TokenService/List": true, + "/api.v1.TokenService/Revoke": true, + "/api.v1.TokenService/Update": true, + "/api.v1.UserService/Get": true, + "/api.v1.VersionService/Get": true, + "/api.v1.VolumeService/Delete": true, + "/api.v1.VolumeService/Get": true, + "/api.v1.VolumeService/List": true, + "/api.v1.VolumeService/Update": true, + "/status.v1.MessageService/Watch": true, + "/status.v1.StatusService/Watch": true, }, Visibility: Visibility{ Public: map[string]bool{ @@ -307,24 +309,25 @@ func GetServicePermissions() *ServicePermissions { "/admin.v1.TokenService/Revoke": true, }, Tenant: map[string]bool{ - "/api.v1.AuditService/Get": true, - "/api.v1.AuditService/List": true, - "/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "/api.v1.PaymentService/DeletePaymentMethod": true, - "/api.v1.PaymentService/GetCustomer": true, - "/api.v1.PaymentService/GetInvoices": true, - "/api.v1.PaymentService/GetSubscriptionUsage": true, - "/api.v1.PaymentService/HasPaymentMethod": true, - "/api.v1.ProjectService/Create": true, - "/api.v1.TenantService/Delete": true, - "/api.v1.TenantService/Get": true, - "/api.v1.TenantService/Invite": true, - "/api.v1.TenantService/InviteDelete": true, - "/api.v1.TenantService/InvitesList": true, - "/api.v1.TenantService/RemoveMember": true, - "/api.v1.TenantService/RequestAdmission": true, - "/api.v1.TenantService/Update": true, - "/api.v1.TenantService/UpdateMember": true, + "/api.v1.AuditService/Get": true, + "/api.v1.AuditService/List": true, + "/api.v1.PaymentService/CreateOrUpdateCustomer": true, + "/api.v1.PaymentService/DeletePaymentMethod": true, + "/api.v1.PaymentService/GetCustomer": true, + "/api.v1.PaymentService/GetInvoices": true, + "/api.v1.PaymentService/GetSubscriptionDiscounts": true, + "/api.v1.PaymentService/GetSubscriptionUsage": true, + "/api.v1.PaymentService/HasPaymentMethod": true, + "/api.v1.ProjectService/Create": true, + "/api.v1.TenantService/Delete": true, + "/api.v1.TenantService/Get": true, + "/api.v1.TenantService/Invite": true, + "/api.v1.TenantService/InviteDelete": true, + "/api.v1.TenantService/InvitesList": true, + "/api.v1.TenantService/RemoveMember": true, + "/api.v1.TenantService/RequestAdmission": true, + "/api.v1.TenantService/Update": true, + "/api.v1.TenantService/UpdateMember": true, }, Project: map[string]bool{ "/api.v1.ClusterService/Create": true, @@ -364,89 +367,90 @@ func GetServicePermissions() *ServicePermissions { "/api.v1.IPService/Update": true, }, Auditable: map[string]bool{ - "/admin.v1.AuditService/Get": true, - "/admin.v1.AuditService/List": true, - "/admin.v1.ClusterService/Credentials": true, - "/admin.v1.ClusterService/Get": false, - "/admin.v1.ClusterService/List": false, - "/admin.v1.PaymentService/AddBalanceToCustomer": true, - "/admin.v1.ProjectService/List": false, - "/admin.v1.StorageService/ClusterInfo": false, - "/admin.v1.StorageService/ListSnapshots": false, - "/admin.v1.StorageService/ListVolumes": false, - "/admin.v1.TenantService/AddMember": true, - "/admin.v1.TenantService/Admit": true, - "/admin.v1.TenantService/List": false, - "/admin.v1.TenantService/Revoke": true, - "/admin.v1.TokenService/List": true, - "/admin.v1.TokenService/Revoke": true, - "/api.v1.AssetService/List": false, - "/api.v1.AuditService/Get": false, - "/api.v1.AuditService/List": false, - "/api.v1.ClusterService/Create": true, - "/api.v1.ClusterService/Delete": true, - "/api.v1.ClusterService/Get": false, - "/api.v1.ClusterService/GetCredentials": true, - "/api.v1.ClusterService/List": false, - "/api.v1.ClusterService/Operate": true, - "/api.v1.ClusterService/Update": true, - "/api.v1.ClusterService/WatchStatus": false, - "/api.v1.HealthService/Get": false, - "/api.v1.IPService/Allocate": true, - "/api.v1.IPService/Delete": true, - "/api.v1.IPService/Get": false, - "/api.v1.IPService/List": false, - "/api.v1.IPService/Update": true, - "/api.v1.MethodService/List": true, - "/api.v1.MethodService/TokenScopedList": true, - "/api.v1.PaymentService/CreateOrUpdateCustomer": true, - "/api.v1.PaymentService/DeletePaymentMethod": true, - "/api.v1.PaymentService/GetCustomer": false, - "/api.v1.PaymentService/GetDefaultPrices": false, - "/api.v1.PaymentService/GetInvoices": false, - "/api.v1.PaymentService/GetSubscriptionUsage": false, - "/api.v1.PaymentService/HasPaymentMethod": false, - "/api.v1.ProjectService/Create": true, - "/api.v1.ProjectService/Delete": true, - "/api.v1.ProjectService/Get": false, - "/api.v1.ProjectService/Invite": true, - "/api.v1.ProjectService/InviteAccept": true, - "/api.v1.ProjectService/InviteDelete": true, - "/api.v1.ProjectService/InviteGet": false, - "/api.v1.ProjectService/InvitesList": false, - "/api.v1.ProjectService/List": false, - "/api.v1.ProjectService/RemoveMember": true, - "/api.v1.ProjectService/Update": true, - "/api.v1.ProjectService/UpdateMember": true, - "/api.v1.SnapshotService/Delete": true, - "/api.v1.SnapshotService/Get": false, - "/api.v1.SnapshotService/List": false, - "/api.v1.TenantService/Create": true, - "/api.v1.TenantService/Delete": true, - "/api.v1.TenantService/Get": false, - "/api.v1.TenantService/Invite": true, - "/api.v1.TenantService/InviteAccept": true, - "/api.v1.TenantService/InviteDelete": true, - "/api.v1.TenantService/InviteGet": false, - "/api.v1.TenantService/InvitesList": false, - "/api.v1.TenantService/List": false, - "/api.v1.TenantService/RemoveMember": true, - "/api.v1.TenantService/RequestAdmission": false, - "/api.v1.TenantService/Update": true, - "/api.v1.TenantService/UpdateMember": true, - "/api.v1.TokenService/Create": true, - "/api.v1.TokenService/Get": true, - "/api.v1.TokenService/List": true, - "/api.v1.TokenService/Revoke": true, - "/api.v1.TokenService/Update": true, - "/api.v1.UserService/Get": true, - "/api.v1.VersionService/Get": false, - "/api.v1.VolumeService/Delete": true, - "/api.v1.VolumeService/Get": false, - "/api.v1.VolumeService/List": false, - "/api.v1.VolumeService/Update": true, - "/status.v1.MessageService/Watch": true, - "/status.v1.StatusService/Watch": true, + "/admin.v1.AuditService/Get": true, + "/admin.v1.AuditService/List": true, + "/admin.v1.ClusterService/Credentials": true, + "/admin.v1.ClusterService/Get": false, + "/admin.v1.ClusterService/List": false, + "/admin.v1.PaymentService/AddBalanceToCustomer": true, + "/admin.v1.ProjectService/List": false, + "/admin.v1.StorageService/ClusterInfo": false, + "/admin.v1.StorageService/ListSnapshots": false, + "/admin.v1.StorageService/ListVolumes": false, + "/admin.v1.TenantService/AddMember": true, + "/admin.v1.TenantService/Admit": true, + "/admin.v1.TenantService/List": false, + "/admin.v1.TenantService/Revoke": true, + "/admin.v1.TokenService/List": true, + "/admin.v1.TokenService/Revoke": true, + "/api.v1.AssetService/List": false, + "/api.v1.AuditService/Get": false, + "/api.v1.AuditService/List": false, + "/api.v1.ClusterService/Create": true, + "/api.v1.ClusterService/Delete": true, + "/api.v1.ClusterService/Get": false, + "/api.v1.ClusterService/GetCredentials": true, + "/api.v1.ClusterService/List": false, + "/api.v1.ClusterService/Operate": true, + "/api.v1.ClusterService/Update": true, + "/api.v1.ClusterService/WatchStatus": false, + "/api.v1.HealthService/Get": false, + "/api.v1.IPService/Allocate": true, + "/api.v1.IPService/Delete": true, + "/api.v1.IPService/Get": false, + "/api.v1.IPService/List": false, + "/api.v1.IPService/Update": true, + "/api.v1.MethodService/List": true, + "/api.v1.MethodService/TokenScopedList": true, + "/api.v1.PaymentService/CreateOrUpdateCustomer": true, + "/api.v1.PaymentService/DeletePaymentMethod": true, + "/api.v1.PaymentService/GetCustomer": false, + "/api.v1.PaymentService/GetDefaultPrices": false, + "/api.v1.PaymentService/GetInvoices": false, + "/api.v1.PaymentService/GetSubscriptionDiscounts": false, + "/api.v1.PaymentService/GetSubscriptionUsage": false, + "/api.v1.PaymentService/HasPaymentMethod": false, + "/api.v1.ProjectService/Create": true, + "/api.v1.ProjectService/Delete": true, + "/api.v1.ProjectService/Get": false, + "/api.v1.ProjectService/Invite": true, + "/api.v1.ProjectService/InviteAccept": true, + "/api.v1.ProjectService/InviteDelete": true, + "/api.v1.ProjectService/InviteGet": false, + "/api.v1.ProjectService/InvitesList": false, + "/api.v1.ProjectService/List": false, + "/api.v1.ProjectService/RemoveMember": true, + "/api.v1.ProjectService/Update": true, + "/api.v1.ProjectService/UpdateMember": true, + "/api.v1.SnapshotService/Delete": true, + "/api.v1.SnapshotService/Get": false, + "/api.v1.SnapshotService/List": false, + "/api.v1.TenantService/Create": true, + "/api.v1.TenantService/Delete": true, + "/api.v1.TenantService/Get": false, + "/api.v1.TenantService/Invite": true, + "/api.v1.TenantService/InviteAccept": true, + "/api.v1.TenantService/InviteDelete": true, + "/api.v1.TenantService/InviteGet": false, + "/api.v1.TenantService/InvitesList": false, + "/api.v1.TenantService/List": false, + "/api.v1.TenantService/RemoveMember": true, + "/api.v1.TenantService/RequestAdmission": false, + "/api.v1.TenantService/Update": true, + "/api.v1.TenantService/UpdateMember": true, + "/api.v1.TokenService/Create": true, + "/api.v1.TokenService/Get": true, + "/api.v1.TokenService/List": true, + "/api.v1.TokenService/Revoke": true, + "/api.v1.TokenService/Update": true, + "/api.v1.UserService/Get": true, + "/api.v1.VersionService/Get": false, + "/api.v1.VolumeService/Delete": true, + "/api.v1.VolumeService/Get": false, + "/api.v1.VolumeService/List": false, + "/api.v1.VolumeService/Update": true, + "/status.v1.MessageService/Watch": true, + "/status.v1.StatusService/Watch": true, }, } } diff --git a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go index 44614880..f4daefc8 100644 --- a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go +++ b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceClient.go @@ -379,6 +379,74 @@ func (_c *PaymentServiceClient_GetInvoices_Call) RunAndReturn(run func(context1 return _c } +// GetSubscriptionDiscounts provides a mock function for the type PaymentServiceClient +func (_mock *PaymentServiceClient) GetSubscriptionDiscounts(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) (*connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse], error) { + ret := _mock.Called(context1, request) + + if len(ret) == 0 { + panic("no return value specified for GetSubscriptionDiscounts") + } + + var r0 *connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse] + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) (*connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse], error)); ok { + return returnFunc(context1, request) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) *connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse]); ok { + r0 = returnFunc(context1, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse]) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) error); ok { + r1 = returnFunc(context1, request) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// PaymentServiceClient_GetSubscriptionDiscounts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubscriptionDiscounts' +type PaymentServiceClient_GetSubscriptionDiscounts_Call struct { + *mock.Call +} + +// GetSubscriptionDiscounts is a helper method to define mock.On call +// - context1 context.Context +// - request *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest] +func (_e *PaymentServiceClient_Expecter) GetSubscriptionDiscounts(context1 interface{}, request interface{}) *PaymentServiceClient_GetSubscriptionDiscounts_Call { + return &PaymentServiceClient_GetSubscriptionDiscounts_Call{Call: _e.mock.On("GetSubscriptionDiscounts", context1, request)} +} + +func (_c *PaymentServiceClient_GetSubscriptionDiscounts_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest])) *PaymentServiceClient_GetSubscriptionDiscounts_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.PaymentServiceGetSubscriptionDiscountsRequest] + if args[1] != nil { + arg1 = args[1].(*connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *PaymentServiceClient_GetSubscriptionDiscounts_Call) Return(response *connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse], err error) *PaymentServiceClient_GetSubscriptionDiscounts_Call { + _c.Call.Return(response, err) + return _c +} + +func (_c *PaymentServiceClient_GetSubscriptionDiscounts_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) (*connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse], error)) *PaymentServiceClient_GetSubscriptionDiscounts_Call { + _c.Call.Return(run) + return _c +} + // GetSubscriptionUsage provides a mock function for the type PaymentServiceClient func (_mock *PaymentServiceClient) GetSubscriptionUsage(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetSubscriptionUsageRequest]) (*connect.Response[apiv1.PaymentServiceGetSubscriptionUsageResponse], error) { ret := _mock.Called(context1, request) diff --git a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go index 610382ed..2ec1075f 100644 --- a/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go +++ b/go/tests/mocks/api/v1/apiv1connect/PaymentServiceHandler.go @@ -379,6 +379,74 @@ func (_c *PaymentServiceHandler_GetInvoices_Call) RunAndReturn(run func(context1 return _c } +// GetSubscriptionDiscounts provides a mock function for the type PaymentServiceHandler +func (_mock *PaymentServiceHandler) GetSubscriptionDiscounts(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) (*connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse], error) { + ret := _mock.Called(context1, request) + + if len(ret) == 0 { + panic("no return value specified for GetSubscriptionDiscounts") + } + + var r0 *connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse] + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) (*connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse], error)); ok { + return returnFunc(context1, request) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) *connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse]); ok { + r0 = returnFunc(context1, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse]) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) error); ok { + r1 = returnFunc(context1, request) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// PaymentServiceHandler_GetSubscriptionDiscounts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubscriptionDiscounts' +type PaymentServiceHandler_GetSubscriptionDiscounts_Call struct { + *mock.Call +} + +// GetSubscriptionDiscounts is a helper method to define mock.On call +// - context1 context.Context +// - request *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest] +func (_e *PaymentServiceHandler_Expecter) GetSubscriptionDiscounts(context1 interface{}, request interface{}) *PaymentServiceHandler_GetSubscriptionDiscounts_Call { + return &PaymentServiceHandler_GetSubscriptionDiscounts_Call{Call: _e.mock.On("GetSubscriptionDiscounts", context1, request)} +} + +func (_c *PaymentServiceHandler_GetSubscriptionDiscounts_Call) Run(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest])) *PaymentServiceHandler_GetSubscriptionDiscounts_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.PaymentServiceGetSubscriptionDiscountsRequest] + if args[1] != nil { + arg1 = args[1].(*connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *PaymentServiceHandler_GetSubscriptionDiscounts_Call) Return(response *connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse], err error) *PaymentServiceHandler_GetSubscriptionDiscounts_Call { + _c.Call.Return(response, err) + return _c +} + +func (_c *PaymentServiceHandler_GetSubscriptionDiscounts_Call) RunAndReturn(run func(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetSubscriptionDiscountsRequest]) (*connect.Response[apiv1.PaymentServiceGetSubscriptionDiscountsResponse], error)) *PaymentServiceHandler_GetSubscriptionDiscounts_Call { + _c.Call.Return(run) + return _c +} + // GetSubscriptionUsage provides a mock function for the type PaymentServiceHandler func (_mock *PaymentServiceHandler) GetSubscriptionUsage(context1 context.Context, request *connect.Request[apiv1.PaymentServiceGetSubscriptionUsageRequest]) (*connect.Response[apiv1.PaymentServiceGetSubscriptionUsageResponse], error) { ret := _mock.Called(context1, request) diff --git a/js/api/v1/payment_pb.d.ts b/js/api/v1/payment_pb.d.ts index d50126f3..f83c9c2e 100644 --- a/js/api/v1/payment_pb.d.ts +++ b/js/api/v1/payment_pb.d.ts @@ -269,12 +269,60 @@ export type SubscriptionUsageItem = Message<"api.v1.SubscriptionUsageItem"> & { * @generated from field: google.protobuf.Timestamp period_end = 5; */ periodEnd?: Timestamp; + /** + * A subscription discounts + * + * @generated from field: repeated api.v1.Discount discounts = 6; + */ + discounts: Discount[]; }; /** * Describes the message api.v1.SubscriptionUsageItem. * Use `create(SubscriptionUsageItemSchema)` to create a new message. */ export declare const SubscriptionUsageItemSchema: GenMessage; +/** + * Discount details that can be applied to subscriptions or SubscriptionUsageItems + * + * @generated from message api.v1.Discount + */ +export type Discount = Message<"api.v1.Discount"> & { + /** + * DiscountId is the id of the discount + * + * @generated from field: string id = 1; + */ + id: string; + /** + * DiscountName is the name of the discount + * + * @generated from field: string name = 2; + */ + name: string; + /** + * The discounts amount in a given currency + * + * @generated from field: int64 amount_off = 3; + */ + amountOff: bigint; + /** + * The discount amount in percent + * + * @generated from field: double percentage_off = 4; + */ + percentageOff: number; + /** + * Order the discounts need to be applied in + * + * @generated from field: double discount_order = 5; + */ + discountOrder: number; +}; +/** + * Describes the message api.v1.Discount. + * Use `create(DiscountSchema)` to create a new message. + */ +export declare const DiscountSchema: GenMessage; /** * Invoice a customer has to pay for subscription usage * @@ -305,6 +353,12 @@ export type Invoice = Message<"api.v1.Invoice"> & { * @generated from field: google.protobuf.Timestamp period_end = 5; */ periodEnd?: Timestamp; + /** + * Invoice discounts + * + * @generated from field: repeated api.v1.Discount discounts = 6; + */ + discounts: Discount[]; }; /** * Describes the message api.v1.Invoice. @@ -609,6 +663,42 @@ export type PaymentServiceGetDefaultPricesResponse = Message<"api.v1.PaymentServ * Use `create(PaymentServiceGetDefaultPricesResponseSchema)` to create a new message. */ export declare const PaymentServiceGetDefaultPricesResponseSchema: GenMessage; +/** + * PaymentServiceGetSubscriptionDiscountsRequest is the request payload for a get subscription discounts request + * + * @generated from message api.v1.PaymentServiceGetSubscriptionDiscountsRequest + */ +export type PaymentServiceGetSubscriptionDiscountsRequest = Message<"api.v1.PaymentServiceGetSubscriptionDiscountsRequest"> & { + /** + * Login of the customer + * + * @generated from field: string login = 1; + */ + login: string; +}; +/** + * Describes the message api.v1.PaymentServiceGetSubscriptionDiscountsRequest. + * Use `create(PaymentServiceGetSubscriptionDiscountsRequestSchema)` to create a new message. + */ +export declare const PaymentServiceGetSubscriptionDiscountsRequestSchema: GenMessage; +/** + * PaymentServiceGetSubscriptionUsageResponse is the response payload for a get subscription usage request + * + * @generated from message api.v1.PaymentServiceGetSubscriptionDiscountsResponse + */ +export type PaymentServiceGetSubscriptionDiscountsResponse = Message<"api.v1.PaymentServiceGetSubscriptionDiscountsResponse"> & { + /** + * Discounts is a list with all discounts for one subscription + * + * @generated from field: repeated api.v1.Discount discounts = 1; + */ + discounts: Discount[]; +}; +/** + * Describes the message api.v1.PaymentServiceGetSubscriptionDiscountsResponse. + * Use `create(PaymentServiceGetSubscriptionDiscountsResponseSchema)` to create a new message. + */ +export declare const PaymentServiceGetSubscriptionDiscountsResponseSchema: GenMessage; /** * ProductType defines for which type of product a price applies * @@ -755,4 +845,14 @@ export declare const PaymentService: GenService<{ input: typeof PaymentServiceGetDefaultPricesRequestSchema; output: typeof PaymentServiceGetDefaultPricesResponseSchema; }; + /** + * GetSubscriptionDiscounts gets all discounts for a subscription + * + * @generated from rpc api.v1.PaymentService.GetSubscriptionDiscounts + */ + getSubscriptionDiscounts: { + methodKind: "unary"; + input: typeof PaymentServiceGetSubscriptionDiscountsRequestSchema; + output: typeof PaymentServiceGetSubscriptionDiscountsResponseSchema; + }; }>; diff --git a/js/api/v1/payment_pb.js b/js/api/v1/payment_pb.js index 3f48c6dc..f6dcc443 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("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIr0DCg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcx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ZVJlcXVlc3QaMi5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRTdWJzY3JpcHRpb25Vc2FnZVJlc3BvbnNlIgnC8xgBAejzGAISbQoLR2V0SW52b2ljZXMSKC5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRJbnZvaWNlc1JlcXVlc3QaKS5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRJbnZvaWNlc1Jlc3BvbnNlIgnC8xgBAejzGAISewoQR2V0RGVmYXVsdFByaWNlcxItLmFwaS52MS5QYXltZW50U2VydmljZUdldERlZmF1bHRQcmljZXNSZXF1ZXN0Gi4uYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0RGVmYXVsdFByaWNlc1Jlc3BvbnNlIgjY8xgB6PMYAkKFAQoKY29tLmFwaS52MUIMUGF5bWVudFByb3RvUAFaMGdpdGh1Yi5jb20vbWV0YWwtc3RhY2stY2xvdWQvYXBpL2dvL2FwaS92MTthcGl2MaICA0FYWKoCBkFwaS5WMcoCBkFwaVxWMeICEkFwaVxWMVxHUEJNZXRhZGF0YeoCB0FwaTo6VjFiBnByb3RvMw", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); +export const file_api_v1_payment = /*@__PURE__*/ fileDesc("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIr0DCg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcxgJIAEoCzIPLmFwaS52MS5BZGRyZXNzEhAKA3ZhdBgLIAEoCUg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cGkvZ28vYXBpL3YxO2FwaXYxogIDQVhYqgIGQXBpLlYxygIGQXBpXFYx4gISQXBpXFYxXEdQQk1ldGFkYXRh6gIHQXBpOjpWMWIGcHJvdG8z", [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. @@ -34,81 +34,96 @@ export const AddressSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 3); * Use `create(SubscriptionUsageItemSchema)` to create a new message. */ export const SubscriptionUsageItemSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 4); +/** + * Describes the message api.v1.Discount. + * Use `create(DiscountSchema)` to create a new message. + */ +export const DiscountSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 5); /** * Describes the message api.v1.Invoice. * Use `create(InvoiceSchema)` to create a new message. */ -export const InvoiceSchema = /*@__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. */ -export const PaymentServiceCreateOrUpdateCustomerRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 6); +export const PaymentServiceCreateOrUpdateCustomerRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 7); /** * Describes the message api.v1.PaymentServiceCreateOrUpdateCustomerResponse. * Use `create(PaymentServiceCreateOrUpdateCustomerResponseSchema)` to create a new message. */ -export const PaymentServiceCreateOrUpdateCustomerResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 7); +export const PaymentServiceCreateOrUpdateCustomerResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 8); /** * Describes the message api.v1.PaymentServiceGetCustomerRequest. * Use `create(PaymentServiceGetCustomerRequestSchema)` to create a new message. */ -export const PaymentServiceGetCustomerRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 8); +export const PaymentServiceGetCustomerRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 9); /** * Describes the message api.v1.PaymentServiceGetCustomerResponse. * Use `create(PaymentServiceGetCustomerResponseSchema)` to create a new message. */ -export const PaymentServiceGetCustomerResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 9); +export const PaymentServiceGetCustomerResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 10); /** * Describes the message api.v1.PaymentServiceHasPaymentMethodRequest. * Use `create(PaymentServiceHasPaymentMethodRequestSchema)` to create a new message. */ -export const PaymentServiceHasPaymentMethodRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 10); +export const PaymentServiceHasPaymentMethodRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 11); /** * Describes the message api.v1.PaymentServiceHasPaymentMethodResponse. * Use `create(PaymentServiceHasPaymentMethodResponseSchema)` to create a new message. */ -export const PaymentServiceHasPaymentMethodResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 11); +export const PaymentServiceHasPaymentMethodResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 12); /** * Describes the message api.v1.PaymentServiceDeletePaymentMethodRequest. * Use `create(PaymentServiceDeletePaymentMethodRequestSchema)` to create a new message. */ -export const PaymentServiceDeletePaymentMethodRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 12); +export const PaymentServiceDeletePaymentMethodRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 13); /** * Describes the message api.v1.PaymentServiceDeletePaymentMethodResponse. * Use `create(PaymentServiceDeletePaymentMethodResponseSchema)` to create a new message. */ -export const PaymentServiceDeletePaymentMethodResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 13); +export const PaymentServiceDeletePaymentMethodResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 14); /** * Describes the message api.v1.PaymentServiceGetSubscriptionUsageRequest. * Use `create(PaymentServiceGetSubscriptionUsageRequestSchema)` to create a new message. */ -export const PaymentServiceGetSubscriptionUsageRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 14); +export const PaymentServiceGetSubscriptionUsageRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 15); /** * Describes the message api.v1.PaymentServiceGetSubscriptionUsageResponse. * Use `create(PaymentServiceGetSubscriptionUsageResponseSchema)` to create a new message. */ -export const PaymentServiceGetSubscriptionUsageResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 15); +export const PaymentServiceGetSubscriptionUsageResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 16); /** * Describes the message api.v1.PaymentServiceGetInvoicesRequest. * Use `create(PaymentServiceGetInvoicesRequestSchema)` to create a new message. */ -export const PaymentServiceGetInvoicesRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 16); +export const PaymentServiceGetInvoicesRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 17); /** * Describes the message api.v1.PaymentServiceGetInvoicesResponse. * Use `create(PaymentServiceGetInvoicesResponseSchema)` to create a new message. */ -export const PaymentServiceGetInvoicesResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 17); +export const PaymentServiceGetInvoicesResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 18); /** * Describes the message api.v1.PaymentServiceGetDefaultPricesRequest. * Use `create(PaymentServiceGetDefaultPricesRequestSchema)` to create a new message. */ -export const PaymentServiceGetDefaultPricesRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 18); +export const PaymentServiceGetDefaultPricesRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 19); /** * Describes the message api.v1.PaymentServiceGetDefaultPricesResponse. * Use `create(PaymentServiceGetDefaultPricesResponseSchema)` to create a new message. */ -export const PaymentServiceGetDefaultPricesResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 19); +export const PaymentServiceGetDefaultPricesResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 20); +/** + * Describes the message api.v1.PaymentServiceGetSubscriptionDiscountsRequest. + * Use `create(PaymentServiceGetSubscriptionDiscountsRequestSchema)` to create a new message. + */ +export const PaymentServiceGetSubscriptionDiscountsRequestSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 21); +/** + * Describes the message api.v1.PaymentServiceGetSubscriptionDiscountsResponse. + * Use `create(PaymentServiceGetSubscriptionDiscountsResponseSchema)` to create a new message. + */ +export const PaymentServiceGetSubscriptionDiscountsResponseSchema = /*@__PURE__*/ messageDesc(file_api_v1_payment, 22); /** * ProductType defines for which type of product a price applies * diff --git a/js/api/v1/payment_pb.ts b/js/api/v1/payment_pb.ts index b104ddda..27dc679e 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("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIr0DCg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcxgJIAEoCzIPLmFwaS52MS5BZGRyZXNzEhAKA3ZhdBgLIAEoCUgFiAEBEhkKDHBob25lX251bWJlchgMIAEoCUgGiAEBEhQKB2JhbGFuY2UYDSABKANIB4gBAUIHCgVfbmFtZUIOCgxfY3VzdG9tZXJfaWRCFAoSX3BheW1lbnRf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3QaKS5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRJbnZvaWNlc1Jlc3BvbnNlIgnC8xgBAejzGAISewoQR2V0RGVmYXVsdFByaWNlcxItLmFwaS52MS5QYXltZW50U2VydmljZUdldERlZmF1bHRQcmljZXNSZXF1ZXN0Gi4uYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0RGVmYXVsdFByaWNlc1Jlc3BvbnNlIgjY8xgB6PMYAkKFAQoKY29tLmFwaS52MUIMUGF5bWVudFByb3RvUAFaMGdpdGh1Yi5jb20vbWV0YWwtc3RhY2stY2xvdWQvYXBpL2dvL2FwaS92MTthcGl2MaICA0FYWKoCBkFwaS5WMcoCBkFwaVxWMeICEkFwaVxWMVxHUEJNZXRhZGF0YeoCB0FwaTo6VjFiBnByb3RvMw", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); + fileDesc("ChRhcGkvdjEvcGF5bWVudC5wcm90bxIGYXBpLnYxIr0DCg9QYXltZW50Q3VzdG9tZXISDQoFbG9naW4YASABKAkSEQoEbmFtZRgCIAEoCUgAiAEBEhgKC2N1c3RvbWVyX2lkGAMgASgJSAGIAQESHgoRcGF5bWVudF9tZXRob2RfaWQYBCABKAlIAogBARIXCg9zdWJzY3JpcHRpb25faWQYBSABKAkSGwoFZW1haWwYBiABKAlCB7pIBHICYAFIA4gBARIfCgRjYXJkGAcgASgLMgwuYXBpLnYxLkNhcmRIBIgBARIdCgZwcmljZXMYCCADKAsyDS5hcGkudjEuUHJpY2USIAoHYWRkcmVzcxgJIAEoCzIPLmFwaS52MS5BZGRyZXNzEhAKA3ZhdBgLIAEoCUgFiAEBEhkKDHBob25lX251bWJlchgMIAEoCUgGiAEBEhQKB2JhbGFuY2UYDSABKANIB4gBAUIHCgVfbmFtZUIOCgxfY3VzdG9tZXJfaWRCFAoSX3BheW1lbnRfbWV0aG9kX2lkQggKBl9lbWFpbEIHCgVfY2FyZEIGCgRfdmF0Qg8KDV9waG9uZV9udW1iZXJCCg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ZWxldGVQYXltZW50TWV0aG9kUmVxdWVzdBoxLmFwaS52MS5QYXltZW50U2VydmljZURlbGV0ZVBheW1lbnRNZXRob2RSZXNwb25zZSIFwvMYAQESiAEKFEdldFN1YnNjcmlwdGlvblVzYWdlEjEuYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0U3Vic2NyaXB0aW9uVXNhZ2VSZXF1ZXN0GjIuYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0U3Vic2NyaXB0aW9uVXNhZ2VSZXNwb25zZSIJwvMYAQHo8xgCEm0KC0dldEludm9pY2VzEiguYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0SW52b2ljZXNSZXF1ZXN0GikuYXBpLnYxLlBheW1lbnRTZXJ2aWNlR2V0SW52b2ljZXNSZXNwb25zZSIJwvMYAQHo8xgCEnsKEEdldERlZmF1bHRQcmljZXMSLS5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXREZWZhdWx0UHJpY2VzUmVxdWVzdBouLmFwaS52MS5QYXltZW50U2VydmljZUdldERlZmF1bHRQcmljZXNSZXNwb25zZSII2PMYAejzGAISlAEKGEdldFN1YnNjcmlwdGlvbkRpc2NvdW50cxI1LmFwaS52MS5QYXltZW50U2VydmljZUdldFN1YnNjcmlwdGlvbkRpc2NvdW50c1JlcXVlc3QaNi5hcGkudjEuUGF5bWVudFNlcnZpY2VHZXRTdWJzY3JpcHRpb25EaXNjb3VudHNSZXNwb25zZSIJwvMYAQHo8xgCQoUBCgpjb20uYXBpLnYxQgxQYXltZW50UHJvdG9QAVowZ2l0aHViLmNvbS9tZXRhbC1zdGFjay1jbG91ZC9hcGkvZ28vYXBpL3YxO2FwaXYxogIDQVhYqgIGQXBpLlYxygIGQXBpXFYx4gISQXBpXFYxXEdQQk1ldGFkYXRh6gIHQXBpOjpWMWIGcHJvdG8z", [file_api_v1_common, file_buf_validate_validate, file_google_protobuf_timestamp]); /** * PaymentCustomer is a customer at the payment processor @@ -322,6 +322,13 @@ export type SubscriptionUsageItem = Message<"api.v1.SubscriptionUsageItem"> & { * @generated from field: google.protobuf.Timestamp period_end = 5; */ periodEnd?: Timestamp; + + /** + * A subscription discounts + * + * @generated from field: repeated api.v1.Discount discounts = 6; + */ + discounts: Discount[]; }; /** @@ -331,6 +338,55 @@ export type SubscriptionUsageItem = Message<"api.v1.SubscriptionUsageItem"> & { export const SubscriptionUsageItemSchema: GenMessage = /*@__PURE__*/ messageDesc(file_api_v1_payment, 4); +/** + * Discount details that can be applied to subscriptions or SubscriptionUsageItems + * + * @generated from message api.v1.Discount + */ +export type Discount = Message<"api.v1.Discount"> & { + /** + * DiscountId is the id of the discount + * + * @generated from field: string id = 1; + */ + id: string; + + /** + * DiscountName is the name of the discount + * + * @generated from field: string name = 2; + */ + name: string; + + /** + * The discounts amount in a given currency + * + * @generated from field: int64 amount_off = 3; + */ + amountOff: bigint; + + /** + * The discount amount in percent + * + * @generated from field: double percentage_off = 4; + */ + percentageOff: number; + + /** + * Order the discounts need to be applied in + * + * @generated from field: double discount_order = 5; + */ + discountOrder: number; +}; + +/** + * Describes the message api.v1.Discount. + * Use `create(DiscountSchema)` to create a new message. + */ +export const DiscountSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_api_v1_payment, 5); + /** * Invoice a customer has to pay for subscription usage * @@ -364,6 +420,13 @@ export type Invoice = Message<"api.v1.Invoice"> & { * @generated from field: google.protobuf.Timestamp period_end = 5; */ periodEnd?: Timestamp; + + /** + * Invoice discounts + * + * @generated from field: repeated api.v1.Discount discounts = 6; + */ + discounts: Discount[]; }; /** @@ -371,7 +434,7 @@ export type Invoice = Message<"api.v1.Invoice"> & { * Use `create(InvoiceSchema)` to create a new message. */ export const InvoiceSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 5); + messageDesc(file_api_v1_payment, 6); /** * PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request @@ -441,7 +504,7 @@ export type PaymentServiceCreateOrUpdateCustomerRequest = Message<"api.v1.Paymen * Use `create(PaymentServiceCreateOrUpdateCustomerRequestSchema)` to create a new message. */ export const PaymentServiceCreateOrUpdateCustomerRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 6); + messageDesc(file_api_v1_payment, 7); /** * PaymentServiceCreateOrUpdateCustomerResponse is the response payload for a payment create or update customer request @@ -462,7 +525,7 @@ export type PaymentServiceCreateOrUpdateCustomerResponse = Message<"api.v1.Payme * Use `create(PaymentServiceCreateOrUpdateCustomerResponseSchema)` to create a new message. */ export const PaymentServiceCreateOrUpdateCustomerResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 7); + messageDesc(file_api_v1_payment, 8); /** * PaymentServiceGetCustomerRequest is the request payload for a payment get customer request @@ -490,7 +553,7 @@ export type PaymentServiceGetCustomerRequest = Message<"api.v1.PaymentServiceGet * Use `create(PaymentServiceGetCustomerRequestSchema)` to create a new message. */ export const PaymentServiceGetCustomerRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 8); + messageDesc(file_api_v1_payment, 9); /** * PaymentServiceGetCustomerResponse is the response payload for a payment get customer request @@ -511,7 +574,7 @@ export type PaymentServiceGetCustomerResponse = Message<"api.v1.PaymentServiceGe * Use `create(PaymentServiceGetCustomerResponseSchema)` to create a new message. */ export const PaymentServiceGetCustomerResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 9); + messageDesc(file_api_v1_payment, 10); /** * PaymentServiceHasPaymentMethodRequest is the request payload for a has payment request @@ -532,7 +595,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, 10); + messageDesc(file_api_v1_payment, 11); /** * PaymentServiceHasPaymentMethodResponse is the response payload for a has payment request @@ -560,7 +623,7 @@ 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, 11); + messageDesc(file_api_v1_payment, 12); /** * PaymentServiceDeletePaymentMethodRequest is the request payload for a delete payment request @@ -581,7 +644,7 @@ export type PaymentServiceDeletePaymentMethodRequest = Message<"api.v1.PaymentSe * Use `create(PaymentServiceDeletePaymentMethodRequestSchema)` to create a new message. */ export const PaymentServiceDeletePaymentMethodRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 12); + messageDesc(file_api_v1_payment, 13); /** * PaymentServiceDeletePaymentMethodResponse is the response payload for a delete payment request @@ -596,7 +659,7 @@ export type PaymentServiceDeletePaymentMethodResponse = Message<"api.v1.PaymentS * Use `create(PaymentServiceDeletePaymentMethodResponseSchema)` to create a new message. */ export const PaymentServiceDeletePaymentMethodResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_api_v1_payment, 13); + messageDesc(file_api_v1_payment, 14); /** * PaymentServiceGetSubscriptionUsageRequest is the request payload for a get subscription usage request @@ -617,7 +680,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, 14); + messageDesc(file_api_v1_payment, 15); /** * PaymentServiceGetSubscriptionUsageResponse is the response payload for a get subscription usage request @@ -638,7 +701,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, 15); + messageDesc(file_api_v1_payment, 16); /** * PaymentServiceHasPaymentMethodRequest is the request payload for a get invoices request @@ -666,7 +729,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, 16); + messageDesc(file_api_v1_payment, 17); /** * PaymentServiceGetInvoicesResponse is the response payload for a get invoices request @@ -687,7 +750,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, 17); + messageDesc(file_api_v1_payment, 18); /** * PaymentServiceGetDefaultPricesRequest is the request payload for a get default prices request @@ -702,7 +765,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, 18); + messageDesc(file_api_v1_payment, 19); /** * PaymentServiceGetDefaultPricesResponse is the response payload for a get default prices request @@ -723,7 +786,49 @@ 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, 19); + messageDesc(file_api_v1_payment, 20); + +/** + * PaymentServiceGetSubscriptionDiscountsRequest is the request payload for a get subscription discounts request + * + * @generated from message api.v1.PaymentServiceGetSubscriptionDiscountsRequest + */ +export type PaymentServiceGetSubscriptionDiscountsRequest = Message<"api.v1.PaymentServiceGetSubscriptionDiscountsRequest"> & { + /** + * Login of the customer + * + * @generated from field: string login = 1; + */ + login: string; +}; + +/** + * Describes the message api.v1.PaymentServiceGetSubscriptionDiscountsRequest. + * Use `create(PaymentServiceGetSubscriptionDiscountsRequestSchema)` to create a new message. + */ +export const PaymentServiceGetSubscriptionDiscountsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_api_v1_payment, 21); + +/** + * PaymentServiceGetSubscriptionUsageResponse is the response payload for a get subscription usage request + * + * @generated from message api.v1.PaymentServiceGetSubscriptionDiscountsResponse + */ +export type PaymentServiceGetSubscriptionDiscountsResponse = Message<"api.v1.PaymentServiceGetSubscriptionDiscountsResponse"> & { + /** + * Discounts is a list with all discounts for one subscription + * + * @generated from field: repeated api.v1.Discount discounts = 1; + */ + discounts: Discount[]; +}; + +/** + * Describes the message api.v1.PaymentServiceGetSubscriptionDiscountsResponse. + * Use `create(PaymentServiceGetSubscriptionDiscountsResponseSchema)` to create a new message. + */ +export const PaymentServiceGetSubscriptionDiscountsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_api_v1_payment, 22); /** * ProductType defines for which type of product a price applies @@ -883,6 +988,16 @@ export const PaymentService: GenService<{ input: typeof PaymentServiceGetDefaultPricesRequestSchema; output: typeof PaymentServiceGetDefaultPricesResponseSchema; }, + /** + * GetSubscriptionDiscounts gets all discounts for a subscription + * + * @generated from rpc api.v1.PaymentService.GetSubscriptionDiscounts + */ + getSubscriptionDiscounts: { + methodKind: "unary"; + input: typeof PaymentServiceGetSubscriptionDiscountsRequestSchema; + output: typeof PaymentServiceGetSubscriptionDiscountsResponseSchema; + }, }> = /*@__PURE__*/ serviceDesc(file_api_v1_payment, 0); diff --git a/js/permissions/servicepermissions.json b/js/permissions/servicepermissions.json index f8795018..b6cb8d40 100755 --- a/js/permissions/servicepermissions.json +++ b/js/permissions/servicepermissions.json @@ -54,6 +54,7 @@ "/api.v1.PaymentService/DeletePaymentMethod", "/api.v1.PaymentService/GetSubscriptionUsage", "/api.v1.PaymentService/GetInvoices", + "/api.v1.PaymentService/GetSubscriptionDiscounts", "/api.v1.ProjectService/Create", "/api.v1.TenantService/Get", "/api.v1.TenantService/Update", @@ -180,6 +181,7 @@ "/api.v1.PaymentService/GetCustomer": true, "/api.v1.PaymentService/GetDefaultPrices": true, "/api.v1.PaymentService/GetInvoices": true, + "/api.v1.PaymentService/GetSubscriptionDiscounts": true, "/api.v1.PaymentService/GetSubscriptionUsage": true, "/api.v1.PaymentService/HasPaymentMethod": true, "/api.v1.ProjectService/Create": true, @@ -277,6 +279,7 @@ "/api.v1.PaymentService/DeletePaymentMethod": true, "/api.v1.PaymentService/GetCustomer": true, "/api.v1.PaymentService/GetInvoices": true, + "/api.v1.PaymentService/GetSubscriptionDiscounts": true, "/api.v1.PaymentService/GetSubscriptionUsage": true, "/api.v1.PaymentService/HasPaymentMethod": true, "/api.v1.ProjectService/Create": true, @@ -368,6 +371,7 @@ "/api.v1.PaymentService/GetCustomer": false, "/api.v1.PaymentService/GetDefaultPrices": false, "/api.v1.PaymentService/GetInvoices": false, + "/api.v1.PaymentService/GetSubscriptionDiscounts": false, "/api.v1.PaymentService/GetSubscriptionUsage": false, "/api.v1.PaymentService/HasPaymentMethod": false, "/api.v1.ProjectService/Create": true, diff --git a/proto/api/v1/payment.proto b/proto/api/v1/payment.proto index d791e929..60268fbd 100644 --- a/proto/api/v1/payment.proto +++ b/proto/api/v1/payment.proto @@ -44,6 +44,11 @@ service PaymentService { option (visibility) = VISIBILITY_PUBLIC; option (auditing) = AUDITING_EXCLUDED; } + // GetSubscriptionDiscounts gets all discounts for a subscription + rpc GetSubscriptionDiscounts(PaymentServiceGetSubscriptionDiscountsRequest) returns (PaymentServiceGetSubscriptionDiscountsResponse) { + option (tenant_roles) = TENANT_ROLE_OWNER; + option (auditing) = AUDITING_EXCLUDED; + } } // PaymentCustomer is a customer at the payment processor @@ -164,6 +169,22 @@ message SubscriptionUsageItem { google.protobuf.Timestamp period_start = 4; // PeriodEnd is the end date of this subscription google.protobuf.Timestamp period_end = 5; + // A subscription discounts + repeated Discount discounts = 6; +} + +// Discount details that can be applied to subscriptions or SubscriptionUsageItems +message Discount { + // DiscountId is the id of the discount + string id = 1; + // DiscountName is the name of the discount + string name = 2; + // The discounts amount in a given currency + int64 amount_off = 3; + // The discount amount in percent + double percentage_off = 4; + // Order the discounts need to be applied in + double discount_order = 5; } // Invoice a customer has to pay for subscription usage @@ -176,6 +197,8 @@ message Invoice { google.protobuf.Timestamp period_start = 4; // PeriodEnd is the end date of the time frame covered by this invoice google.protobuf.Timestamp period_end = 5; + // Invoice discounts + repeated Discount discounts = 6; } // PaymentServiceCreateOrUpdateCustomerRequest is the request payload for a payment create or update customer request @@ -302,3 +325,18 @@ message PaymentServiceGetDefaultPricesResponse { // Prices is the list of default prices repeated Price prices = 1; } + +// PaymentServiceGetSubscriptionDiscountsRequest is the request payload for a get subscription discounts request +message PaymentServiceGetSubscriptionDiscountsRequest { + // Login of the customer + string login = 1 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; +} + +// PaymentServiceGetSubscriptionUsageResponse is the response payload for a get subscription usage request +message PaymentServiceGetSubscriptionDiscountsResponse { + // Discounts is a list with all discounts for one subscription + repeated Discount discounts = 1; +} diff --git a/python/metalstackcloud/api/v1/payment_connecpy.py b/python/metalstackcloud/api/v1/payment_connecpy.py index 274b6e47..0f3e65de 100644 --- a/python/metalstackcloud/api/v1/payment_connecpy.py +++ b/python/metalstackcloud/api/v1/payment_connecpy.py @@ -22,6 +22,7 @@ async def DeletePaymentMethod(self, req: api_dot_v1_dot_payment__pb2.PaymentServ 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: ... + async def GetSubscriptionDiscounts(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse: ... class PaymentServiceServer(ConnecpyServer): @@ -85,6 +86,14 @@ def __init__(self, *, service: PaymentService, server_path_prefix=""): output=api_dot_v1_dot_payment__pb2.PaymentServiceGetDefaultPricesResponse, allowed_methods=("POST",), ), + "GetSubscriptionDiscounts": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest, api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse]( + service_name="PaymentService", + name="GetSubscriptionDiscounts", + function=getattr(service, "GetSubscriptionDiscounts"), + input=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest, + output=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse, + allowed_methods=("POST",), + ), } def serviceName(self): @@ -99,6 +108,7 @@ def DeletePaymentMethod(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceDel 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: ... + def GetSubscriptionDiscounts(self, req: api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest, ctx: ServiceContext) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse: ... class PaymentServiceServerSync(ConnecpyServer): @@ -162,6 +172,14 @@ def __init__(self, *, service: PaymentServiceSync, server_path_prefix=""): output=api_dot_v1_dot_payment__pb2.PaymentServiceGetDefaultPricesResponse, allowed_methods=("POST",), ), + "GetSubscriptionDiscounts": Endpoint[api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest, api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse]( + service_name="PaymentService", + name="GetSubscriptionDiscounts", + function=getattr(service, "GetSubscriptionDiscounts"), + input=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest, + output=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse, + allowed_methods=("POST",), + ), } def serviceName(self): @@ -295,6 +313,24 @@ def GetDefaultPrices( **kwargs, ) + def GetSubscriptionDiscounts( + self, + request: api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + **kwargs, + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse: + method = "POST" + return self._make_request( + url=f"{server_path_prefix}/api.v1.PaymentService/GetSubscriptionDiscounts", + ctx=ctx, + request=request, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse, + method=method, + **kwargs, + ) + class AsyncPaymentServiceClient(AsyncConnecpyClient): async def CreateOrUpdateCustomer( @@ -436,3 +472,23 @@ async def GetDefaultPrices( session=session, **kwargs, ) + + async def GetSubscriptionDiscounts( + self, + request: api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + session: Union[httpx.AsyncClient, None] = None, + **kwargs, + ) -> api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse: + method = "POST" + return await self._make_request( + url=f"{server_path_prefix}/api.v1.PaymentService/GetSubscriptionDiscounts", + ctx=ctx, + request=request, + response_class=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse, + method=method, + session=session, + **kwargs, + ) diff --git a/python/metalstackcloud/api/v1/payment_pb2.py b/python/metalstackcloud/api/v1/payment_pb2.py index c1d38d94..28a409eb 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\"\x9a\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\"\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*\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\x88\x07\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\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\"\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\"\xca\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\"\x9b\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\"\xed\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\x12.\n\tdiscounts\x18\x06 \x03(\x0b\x32\x10.api.v1.DiscountR\tdiscounts\"\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') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -55,6 +55,8 @@ _globals['_PAYMENTSERVICEGETINVOICESREQUEST'].fields_by_name['login']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_PAYMENTSERVICEGETINVOICESREQUEST'].fields_by_name['customer_id']._loaded_options = None _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 @@ -69,10 +71,12 @@ _globals['_PAYMENTSERVICE'].methods_by_name['GetInvoices']._serialized_options = b'\302\363\030\001\001\350\363\030\002' _globals['_PAYMENTSERVICE'].methods_by_name['GetDefaultPrices']._loaded_options = None _globals['_PAYMENTSERVICE'].methods_by_name['GetDefaultPrices']._serialized_options = b'\330\363\030\001\350\363\030\002' - _globals['_PRODUCTTYPE']._serialized_start=3376 - _globals['_PRODUCTTYPE']._serialized_end=3526 - _globals['_USAGETYPE']._serialized_start=3528 - _globals['_USAGETYPE']._serialized_end=3616 + _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=3811 + _globals['_PRODUCTTYPE']._serialized_end=3961 + _globals['_USAGETYPE']._serialized_start=3963 + _globals['_USAGETYPE']._serialized_end=4051 _globals['_PAYMENTCUSTOMER']._serialized_start=116 _globals['_PAYMENTCUSTOMER']._serialized_end=676 _globals['_CARD']._serialized_start=679 @@ -82,37 +86,43 @@ _globals['_ADDRESS']._serialized_start=1125 _globals['_ADDRESS']._serialized_end=1279 _globals['_SUBSCRIPTIONUSAGEITEM']._serialized_start=1282 - _globals['_SUBSCRIPTIONUSAGEITEM']._serialized_end=1564 - _globals['_INVOICE']._serialized_start=1567 - _globals['_INVOICE']._serialized_end=1756 - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERREQUEST']._serialized_start=1759 - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERREQUEST']._serialized_end=2221 - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERRESPONSE']._serialized_start=2223 - _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERRESPONSE']._serialized_end=2322 - _globals['_PAYMENTSERVICEGETCUSTOMERREQUEST']._serialized_start=2324 - _globals['_PAYMENTSERVICEGETCUSTOMERREQUEST']._serialized_end=2425 - _globals['_PAYMENTSERVICEGETCUSTOMERRESPONSE']._serialized_start=2427 - _globals['_PAYMENTSERVICEGETCUSTOMERRESPONSE']._serialized_end=2515 - _globals['_PAYMENTSERVICEHASPAYMENTMETHODREQUEST']._serialized_start=2517 - _globals['_PAYMENTSERVICEHASPAYMENTMETHODREQUEST']._serialized_end=2590 - _globals['_PAYMENTSERVICEHASPAYMENTMETHODRESPONSE']._serialized_start=2592 - _globals['_PAYMENTSERVICEHASPAYMENTMETHODRESPONSE']._serialized_end=2718 - _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODREQUEST']._serialized_start=2720 - _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODREQUEST']._serialized_end=2796 - _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODRESPONSE']._serialized_start=2798 - _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODRESPONSE']._serialized_end=2841 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGEREQUEST']._serialized_start=2843 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGEREQUEST']._serialized_end=2920 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGERESPONSE']._serialized_start=2923 - _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGERESPONSE']._serialized_end=3056 - _globals['_PAYMENTSERVICEGETINVOICESREQUEST']._serialized_start=3058 - _globals['_PAYMENTSERVICEGETINVOICESREQUEST']._serialized_end=3169 - _globals['_PAYMENTSERVICEGETINVOICESRESPONSE']._serialized_start=3171 - _globals['_PAYMENTSERVICEGETINVOICESRESPONSE']._serialized_end=3251 - _globals['_PAYMENTSERVICEGETDEFAULTPRICESREQUEST']._serialized_start=3253 - _globals['_PAYMENTSERVICEGETDEFAULTPRICESREQUEST']._serialized_end=3292 - _globals['_PAYMENTSERVICEGETDEFAULTPRICESRESPONSE']._serialized_start=3294 - _globals['_PAYMENTSERVICEGETDEFAULTPRICESRESPONSE']._serialized_end=3373 - _globals['_PAYMENTSERVICE']._serialized_start=3619 - _globals['_PAYMENTSERVICE']._serialized_end=4523 + _globals['_SUBSCRIPTIONUSAGEITEM']._serialized_end=1612 + _globals['_DISCOUNT']._serialized_start=1615 + _globals['_DISCOUNT']._serialized_end=1770 + _globals['_INVOICE']._serialized_start=1773 + _globals['_INVOICE']._serialized_end=2010 + _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERREQUEST']._serialized_start=2013 + _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERREQUEST']._serialized_end=2475 + _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERRESPONSE']._serialized_start=2477 + _globals['_PAYMENTSERVICECREATEORUPDATECUSTOMERRESPONSE']._serialized_end=2576 + _globals['_PAYMENTSERVICEGETCUSTOMERREQUEST']._serialized_start=2578 + _globals['_PAYMENTSERVICEGETCUSTOMERREQUEST']._serialized_end=2679 + _globals['_PAYMENTSERVICEGETCUSTOMERRESPONSE']._serialized_start=2681 + _globals['_PAYMENTSERVICEGETCUSTOMERRESPONSE']._serialized_end=2769 + _globals['_PAYMENTSERVICEHASPAYMENTMETHODREQUEST']._serialized_start=2771 + _globals['_PAYMENTSERVICEHASPAYMENTMETHODREQUEST']._serialized_end=2844 + _globals['_PAYMENTSERVICEHASPAYMENTMETHODRESPONSE']._serialized_start=2846 + _globals['_PAYMENTSERVICEHASPAYMENTMETHODRESPONSE']._serialized_end=2972 + _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODREQUEST']._serialized_start=2974 + _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODREQUEST']._serialized_end=3050 + _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODRESPONSE']._serialized_start=3052 + _globals['_PAYMENTSERVICEDELETEPAYMENTMETHODRESPONSE']._serialized_end=3095 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGEREQUEST']._serialized_start=3097 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGEREQUEST']._serialized_end=3174 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGERESPONSE']._serialized_start=3177 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONUSAGERESPONSE']._serialized_end=3310 + _globals['_PAYMENTSERVICEGETINVOICESREQUEST']._serialized_start=3312 + _globals['_PAYMENTSERVICEGETINVOICESREQUEST']._serialized_end=3423 + _globals['_PAYMENTSERVICEGETINVOICESRESPONSE']._serialized_start=3425 + _globals['_PAYMENTSERVICEGETINVOICESRESPONSE']._serialized_end=3505 + _globals['_PAYMENTSERVICEGETDEFAULTPRICESREQUEST']._serialized_start=3507 + _globals['_PAYMENTSERVICEGETDEFAULTPRICESREQUEST']._serialized_end=3546 + _globals['_PAYMENTSERVICEGETDEFAULTPRICESRESPONSE']._serialized_start=3548 + _globals['_PAYMENTSERVICEGETDEFAULTPRICESRESPONSE']._serialized_end=3627 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSREQUEST']._serialized_start=3629 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSREQUEST']._serialized_end=3710 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSRESPONSE']._serialized_start=3712 + _globals['_PAYMENTSERVICEGETSUBSCRIPTIONDISCOUNTSRESPONSE']._serialized_end=3808 + _globals['_PAYMENTSERVICE']._serialized_start=4054 + _globals['_PAYMENTSERVICE']._serialized_end=5109 # @@protoc_insertion_point(module_scope) diff --git a/python/metalstackcloud/api/v1/payment_pb2.pyi b/python/metalstackcloud/api/v1/payment_pb2.pyi index 48e4c137..b3f69640 100644 --- a/python/metalstackcloud/api/v1/payment_pb2.pyi +++ b/python/metalstackcloud/api/v1/payment_pb2.pyi @@ -111,30 +111,48 @@ class Address(_message.Message): def __init__(self, line1: _Optional[str] = ..., line2: _Optional[str] = ..., postal_code: _Optional[str] = ..., city: _Optional[str] = ..., state: _Optional[str] = ..., country: _Optional[str] = ...) -> None: ... class SubscriptionUsageItem(_message.Message): - __slots__ = ("subscription_item_id", "subscription_item_name", "total_usage", "period_start", "period_end") + __slots__ = ("subscription_item_id", "subscription_item_name", "total_usage", "period_start", "period_end", "discounts") SUBSCRIPTION_ITEM_ID_FIELD_NUMBER: _ClassVar[int] SUBSCRIPTION_ITEM_NAME_FIELD_NUMBER: _ClassVar[int] TOTAL_USAGE_FIELD_NUMBER: _ClassVar[int] PERIOD_START_FIELD_NUMBER: _ClassVar[int] PERIOD_END_FIELD_NUMBER: _ClassVar[int] + DISCOUNTS_FIELD_NUMBER: _ClassVar[int] subscription_item_id: str subscription_item_name: str total_usage: int period_start: _timestamp_pb2.Timestamp period_end: _timestamp_pb2.Timestamp - def __init__(self, subscription_item_id: _Optional[str] = ..., subscription_item_name: _Optional[str] = ..., total_usage: _Optional[int] = ..., period_start: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., period_end: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... + discounts: _containers.RepeatedCompositeFieldContainer[Discount] + def __init__(self, subscription_item_id: _Optional[str] = ..., subscription_item_name: _Optional[str] = ..., total_usage: _Optional[int] = ..., period_start: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., period_end: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., discounts: _Optional[_Iterable[_Union[Discount, _Mapping]]] = ...) -> None: ... + +class Discount(_message.Message): + __slots__ = ("id", "name", "amount_off", "percentage_off", "discount_order") + ID_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + AMOUNT_OFF_FIELD_NUMBER: _ClassVar[int] + PERCENTAGE_OFF_FIELD_NUMBER: _ClassVar[int] + DISCOUNT_ORDER_FIELD_NUMBER: _ClassVar[int] + id: str + name: str + amount_off: int + percentage_off: float + discount_order: float + def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., amount_off: _Optional[int] = ..., percentage_off: _Optional[float] = ..., discount_order: _Optional[float] = ...) -> None: ... class Invoice(_message.Message): - __slots__ = ("id", "pdf_download_url", "period_start", "period_end") + __slots__ = ("id", "pdf_download_url", "period_start", "period_end", "discounts") ID_FIELD_NUMBER: _ClassVar[int] PDF_DOWNLOAD_URL_FIELD_NUMBER: _ClassVar[int] PERIOD_START_FIELD_NUMBER: _ClassVar[int] PERIOD_END_FIELD_NUMBER: _ClassVar[int] + DISCOUNTS_FIELD_NUMBER: _ClassVar[int] id: str pdf_download_url: str period_start: _timestamp_pb2.Timestamp 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: ... + discounts: _containers.RepeatedCompositeFieldContainer[Discount] + 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]] = ..., discounts: _Optional[_Iterable[_Union[Discount, _Mapping]]] = ...) -> None: ... class PaymentServiceCreateOrUpdateCustomerRequest(_message.Message): __slots__ = ("login", "name", "payment_method_id", "email", "card", "address", "vat", "phone_number") @@ -235,3 +253,15 @@ class PaymentServiceGetDefaultPricesResponse(_message.Message): PRICES_FIELD_NUMBER: _ClassVar[int] prices: _containers.RepeatedCompositeFieldContainer[Price] def __init__(self, prices: _Optional[_Iterable[_Union[Price, _Mapping]]] = ...) -> None: ... + +class PaymentServiceGetSubscriptionDiscountsRequest(_message.Message): + __slots__ = ("login",) + LOGIN_FIELD_NUMBER: _ClassVar[int] + login: str + def __init__(self, login: _Optional[str] = ...) -> None: ... + +class PaymentServiceGetSubscriptionDiscountsResponse(_message.Message): + __slots__ = ("discounts",) + DISCOUNTS_FIELD_NUMBER: _ClassVar[int] + discounts: _containers.RepeatedCompositeFieldContainer[Discount] + def __init__(self, discounts: _Optional[_Iterable[_Union[Discount, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstackcloud/api/v1/payment_pb2_grpc.py b/python/metalstackcloud/api/v1/payment_pb2_grpc.py index 46394f2d..f32e5ccb 100644 --- a/python/metalstackcloud/api/v1/payment_pb2_grpc.py +++ b/python/metalstackcloud/api/v1/payment_pb2_grpc.py @@ -50,6 +50,11 @@ def __init__(self, channel): request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetDefaultPricesRequest.SerializeToString, response_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetDefaultPricesResponse.FromString, _registered_method=True) + self.GetSubscriptionDiscounts = channel.unary_unary( + '/api.v1.PaymentService/GetSubscriptionDiscounts', + request_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest.SerializeToString, + response_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse.FromString, + _registered_method=True) class PaymentServiceServicer(object): @@ -105,6 +110,13 @@ def GetDefaultPrices(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetSubscriptionDiscounts(self, request, context): + """GetSubscriptionDiscounts gets all discounts for a subscription + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_PaymentServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -143,6 +155,11 @@ def add_PaymentServiceServicer_to_server(servicer, server): request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetDefaultPricesRequest.FromString, response_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetDefaultPricesResponse.SerializeToString, ), + 'GetSubscriptionDiscounts': grpc.unary_unary_rpc_method_handler( + servicer.GetSubscriptionDiscounts, + request_deserializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest.FromString, + response_serializer=api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'api.v1.PaymentService', rpc_method_handlers) @@ -343,3 +360,30 @@ def GetDefaultPrices(request, timeout, metadata, _registered_method=True) + + @staticmethod + def GetSubscriptionDiscounts(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, + '/api.v1.PaymentService/GetSubscriptionDiscounts', + api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsRequest.SerializeToString, + api_dot_v1_dot_payment__pb2.PaymentServiceGetSubscriptionDiscountsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True)