Path: blob/main/components/usage-api/go/v1/billing_grpc.pb.go
2499 views
// Copyright (c) 2024 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34// Code generated by protoc-gen-go-grpc. DO NOT EDIT.5// versions:6// - protoc-gen-go-grpc v1.2.07// - protoc (unknown)8// source: usage/v1/billing.proto910package v11112import (13context "context"14grpc "google.golang.org/grpc"15codes "google.golang.org/grpc/codes"16status "google.golang.org/grpc/status"17)1819// This is a compile-time assertion to ensure that this generated file20// is compatible with the grpc package it is being compiled against.21// Requires gRPC-Go v1.32.0 or later.22const _ = grpc.SupportPackageIsVersion72324// BillingServiceClient is the client API for BillingService service.25//26// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.27type BillingServiceClient interface {28// ReconcileInvoices retrieves current credit balance and reflects it in29// billing system. Internal RPC, not intended for general consumption.30ReconcileInvoices(ctx context.Context, in *ReconcileInvoicesRequest, opts ...grpc.CallOption) (*ReconcileInvoicesResponse, error)31// FinalizeInvoice marks all sessions occurring in the given Stripe invoice as32// having been invoiced.33FinalizeInvoice(ctx context.Context, in *FinalizeInvoiceRequest, opts ...grpc.CallOption) (*FinalizeInvoiceResponse, error)34// CancelSubscription cancels a stripe subscription in our system35// Called by a stripe webhook36CancelSubscription(ctx context.Context, in *CancelSubscriptionRequest, opts ...grpc.CallOption) (*CancelSubscriptionResponse, error)37// GetStripeCustomer retrieves a Stripe Customer38GetStripeCustomer(ctx context.Context, in *GetStripeCustomerRequest, opts ...grpc.CallOption) (*GetStripeCustomerResponse, error)39CreateStripeCustomer(ctx context.Context, in *CreateStripeCustomerRequest, opts ...grpc.CallOption) (*CreateStripeCustomerResponse, error)40// CreateHoldPaymentIntent is meant to create a PaymentIntent for the given41// customer, that is meant as measure to verify the payment42// method/creditability of this user on first signup, before we create the43// subscription44CreateHoldPaymentIntent(ctx context.Context, in *CreateHoldPaymentIntentRequest, opts ...grpc.CallOption) (*CreateHoldPaymentIntentResponse, error)45CreateStripeSubscription(ctx context.Context, in *CreateStripeSubscriptionRequest, opts ...grpc.CallOption) (*CreateStripeSubscriptionResponse, error)46UpdateCustomerSubscriptionsTaxState(ctx context.Context, in *UpdateCustomerSubscriptionsTaxStateRequest, opts ...grpc.CallOption) (*UpdateCustomerSubscriptionsTaxStateResponse, error)47// GetPriceInformation returns the price information for a given attribtion id48GetPriceInformation(ctx context.Context, in *GetPriceInformationRequest, opts ...grpc.CallOption) (*GetPriceInformationResponse, error)49// OnChargeDispute handles charge disputes created with the underlying payment50// provider.51OnChargeDispute(ctx context.Context, in *OnChargeDisputeRequest, opts ...grpc.CallOption) (*OnChargeDisputeResponse, error)52}5354type billingServiceClient struct {55cc grpc.ClientConnInterface56}5758func NewBillingServiceClient(cc grpc.ClientConnInterface) BillingServiceClient {59return &billingServiceClient{cc}60}6162func (c *billingServiceClient) ReconcileInvoices(ctx context.Context, in *ReconcileInvoicesRequest, opts ...grpc.CallOption) (*ReconcileInvoicesResponse, error) {63out := new(ReconcileInvoicesResponse)64err := c.cc.Invoke(ctx, "/usage.v1.BillingService/ReconcileInvoices", in, out, opts...)65if err != nil {66return nil, err67}68return out, nil69}7071func (c *billingServiceClient) FinalizeInvoice(ctx context.Context, in *FinalizeInvoiceRequest, opts ...grpc.CallOption) (*FinalizeInvoiceResponse, error) {72out := new(FinalizeInvoiceResponse)73err := c.cc.Invoke(ctx, "/usage.v1.BillingService/FinalizeInvoice", in, out, opts...)74if err != nil {75return nil, err76}77return out, nil78}7980func (c *billingServiceClient) CancelSubscription(ctx context.Context, in *CancelSubscriptionRequest, opts ...grpc.CallOption) (*CancelSubscriptionResponse, error) {81out := new(CancelSubscriptionResponse)82err := c.cc.Invoke(ctx, "/usage.v1.BillingService/CancelSubscription", in, out, opts...)83if err != nil {84return nil, err85}86return out, nil87}8889func (c *billingServiceClient) GetStripeCustomer(ctx context.Context, in *GetStripeCustomerRequest, opts ...grpc.CallOption) (*GetStripeCustomerResponse, error) {90out := new(GetStripeCustomerResponse)91err := c.cc.Invoke(ctx, "/usage.v1.BillingService/GetStripeCustomer", in, out, opts...)92if err != nil {93return nil, err94}95return out, nil96}9798func (c *billingServiceClient) CreateStripeCustomer(ctx context.Context, in *CreateStripeCustomerRequest, opts ...grpc.CallOption) (*CreateStripeCustomerResponse, error) {99out := new(CreateStripeCustomerResponse)100err := c.cc.Invoke(ctx, "/usage.v1.BillingService/CreateStripeCustomer", in, out, opts...)101if err != nil {102return nil, err103}104return out, nil105}106107func (c *billingServiceClient) CreateHoldPaymentIntent(ctx context.Context, in *CreateHoldPaymentIntentRequest, opts ...grpc.CallOption) (*CreateHoldPaymentIntentResponse, error) {108out := new(CreateHoldPaymentIntentResponse)109err := c.cc.Invoke(ctx, "/usage.v1.BillingService/CreateHoldPaymentIntent", in, out, opts...)110if err != nil {111return nil, err112}113return out, nil114}115116func (c *billingServiceClient) CreateStripeSubscription(ctx context.Context, in *CreateStripeSubscriptionRequest, opts ...grpc.CallOption) (*CreateStripeSubscriptionResponse, error) {117out := new(CreateStripeSubscriptionResponse)118err := c.cc.Invoke(ctx, "/usage.v1.BillingService/CreateStripeSubscription", in, out, opts...)119if err != nil {120return nil, err121}122return out, nil123}124125func (c *billingServiceClient) UpdateCustomerSubscriptionsTaxState(ctx context.Context, in *UpdateCustomerSubscriptionsTaxStateRequest, opts ...grpc.CallOption) (*UpdateCustomerSubscriptionsTaxStateResponse, error) {126out := new(UpdateCustomerSubscriptionsTaxStateResponse)127err := c.cc.Invoke(ctx, "/usage.v1.BillingService/UpdateCustomerSubscriptionsTaxState", in, out, opts...)128if err != nil {129return nil, err130}131return out, nil132}133134func (c *billingServiceClient) GetPriceInformation(ctx context.Context, in *GetPriceInformationRequest, opts ...grpc.CallOption) (*GetPriceInformationResponse, error) {135out := new(GetPriceInformationResponse)136err := c.cc.Invoke(ctx, "/usage.v1.BillingService/GetPriceInformation", in, out, opts...)137if err != nil {138return nil, err139}140return out, nil141}142143func (c *billingServiceClient) OnChargeDispute(ctx context.Context, in *OnChargeDisputeRequest, opts ...grpc.CallOption) (*OnChargeDisputeResponse, error) {144out := new(OnChargeDisputeResponse)145err := c.cc.Invoke(ctx, "/usage.v1.BillingService/OnChargeDispute", in, out, opts...)146if err != nil {147return nil, err148}149return out, nil150}151152// BillingServiceServer is the server API for BillingService service.153// All implementations must embed UnimplementedBillingServiceServer154// for forward compatibility155type BillingServiceServer interface {156// ReconcileInvoices retrieves current credit balance and reflects it in157// billing system. Internal RPC, not intended for general consumption.158ReconcileInvoices(context.Context, *ReconcileInvoicesRequest) (*ReconcileInvoicesResponse, error)159// FinalizeInvoice marks all sessions occurring in the given Stripe invoice as160// having been invoiced.161FinalizeInvoice(context.Context, *FinalizeInvoiceRequest) (*FinalizeInvoiceResponse, error)162// CancelSubscription cancels a stripe subscription in our system163// Called by a stripe webhook164CancelSubscription(context.Context, *CancelSubscriptionRequest) (*CancelSubscriptionResponse, error)165// GetStripeCustomer retrieves a Stripe Customer166GetStripeCustomer(context.Context, *GetStripeCustomerRequest) (*GetStripeCustomerResponse, error)167CreateStripeCustomer(context.Context, *CreateStripeCustomerRequest) (*CreateStripeCustomerResponse, error)168// CreateHoldPaymentIntent is meant to create a PaymentIntent for the given169// customer, that is meant as measure to verify the payment170// method/creditability of this user on first signup, before we create the171// subscription172CreateHoldPaymentIntent(context.Context, *CreateHoldPaymentIntentRequest) (*CreateHoldPaymentIntentResponse, error)173CreateStripeSubscription(context.Context, *CreateStripeSubscriptionRequest) (*CreateStripeSubscriptionResponse, error)174UpdateCustomerSubscriptionsTaxState(context.Context, *UpdateCustomerSubscriptionsTaxStateRequest) (*UpdateCustomerSubscriptionsTaxStateResponse, error)175// GetPriceInformation returns the price information for a given attribtion id176GetPriceInformation(context.Context, *GetPriceInformationRequest) (*GetPriceInformationResponse, error)177// OnChargeDispute handles charge disputes created with the underlying payment178// provider.179OnChargeDispute(context.Context, *OnChargeDisputeRequest) (*OnChargeDisputeResponse, error)180mustEmbedUnimplementedBillingServiceServer()181}182183// UnimplementedBillingServiceServer must be embedded to have forward compatible implementations.184type UnimplementedBillingServiceServer struct {185}186187func (UnimplementedBillingServiceServer) ReconcileInvoices(context.Context, *ReconcileInvoicesRequest) (*ReconcileInvoicesResponse, error) {188return nil, status.Errorf(codes.Unimplemented, "method ReconcileInvoices not implemented")189}190func (UnimplementedBillingServiceServer) FinalizeInvoice(context.Context, *FinalizeInvoiceRequest) (*FinalizeInvoiceResponse, error) {191return nil, status.Errorf(codes.Unimplemented, "method FinalizeInvoice not implemented")192}193func (UnimplementedBillingServiceServer) CancelSubscription(context.Context, *CancelSubscriptionRequest) (*CancelSubscriptionResponse, error) {194return nil, status.Errorf(codes.Unimplemented, "method CancelSubscription not implemented")195}196func (UnimplementedBillingServiceServer) GetStripeCustomer(context.Context, *GetStripeCustomerRequest) (*GetStripeCustomerResponse, error) {197return nil, status.Errorf(codes.Unimplemented, "method GetStripeCustomer not implemented")198}199func (UnimplementedBillingServiceServer) CreateStripeCustomer(context.Context, *CreateStripeCustomerRequest) (*CreateStripeCustomerResponse, error) {200return nil, status.Errorf(codes.Unimplemented, "method CreateStripeCustomer not implemented")201}202func (UnimplementedBillingServiceServer) CreateHoldPaymentIntent(context.Context, *CreateHoldPaymentIntentRequest) (*CreateHoldPaymentIntentResponse, error) {203return nil, status.Errorf(codes.Unimplemented, "method CreateHoldPaymentIntent not implemented")204}205func (UnimplementedBillingServiceServer) CreateStripeSubscription(context.Context, *CreateStripeSubscriptionRequest) (*CreateStripeSubscriptionResponse, error) {206return nil, status.Errorf(codes.Unimplemented, "method CreateStripeSubscription not implemented")207}208func (UnimplementedBillingServiceServer) UpdateCustomerSubscriptionsTaxState(context.Context, *UpdateCustomerSubscriptionsTaxStateRequest) (*UpdateCustomerSubscriptionsTaxStateResponse, error) {209return nil, status.Errorf(codes.Unimplemented, "method UpdateCustomerSubscriptionsTaxState not implemented")210}211func (UnimplementedBillingServiceServer) GetPriceInformation(context.Context, *GetPriceInformationRequest) (*GetPriceInformationResponse, error) {212return nil, status.Errorf(codes.Unimplemented, "method GetPriceInformation not implemented")213}214func (UnimplementedBillingServiceServer) OnChargeDispute(context.Context, *OnChargeDisputeRequest) (*OnChargeDisputeResponse, error) {215return nil, status.Errorf(codes.Unimplemented, "method OnChargeDispute not implemented")216}217func (UnimplementedBillingServiceServer) mustEmbedUnimplementedBillingServiceServer() {}218219// UnsafeBillingServiceServer may be embedded to opt out of forward compatibility for this service.220// Use of this interface is not recommended, as added methods to BillingServiceServer will221// result in compilation errors.222type UnsafeBillingServiceServer interface {223mustEmbedUnimplementedBillingServiceServer()224}225226func RegisterBillingServiceServer(s grpc.ServiceRegistrar, srv BillingServiceServer) {227s.RegisterService(&BillingService_ServiceDesc, srv)228}229230func _BillingService_ReconcileInvoices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {231in := new(ReconcileInvoicesRequest)232if err := dec(in); err != nil {233return nil, err234}235if interceptor == nil {236return srv.(BillingServiceServer).ReconcileInvoices(ctx, in)237}238info := &grpc.UnaryServerInfo{239Server: srv,240FullMethod: "/usage.v1.BillingService/ReconcileInvoices",241}242handler := func(ctx context.Context, req interface{}) (interface{}, error) {243return srv.(BillingServiceServer).ReconcileInvoices(ctx, req.(*ReconcileInvoicesRequest))244}245return interceptor(ctx, in, info, handler)246}247248func _BillingService_FinalizeInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {249in := new(FinalizeInvoiceRequest)250if err := dec(in); err != nil {251return nil, err252}253if interceptor == nil {254return srv.(BillingServiceServer).FinalizeInvoice(ctx, in)255}256info := &grpc.UnaryServerInfo{257Server: srv,258FullMethod: "/usage.v1.BillingService/FinalizeInvoice",259}260handler := func(ctx context.Context, req interface{}) (interface{}, error) {261return srv.(BillingServiceServer).FinalizeInvoice(ctx, req.(*FinalizeInvoiceRequest))262}263return interceptor(ctx, in, info, handler)264}265266func _BillingService_CancelSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {267in := new(CancelSubscriptionRequest)268if err := dec(in); err != nil {269return nil, err270}271if interceptor == nil {272return srv.(BillingServiceServer).CancelSubscription(ctx, in)273}274info := &grpc.UnaryServerInfo{275Server: srv,276FullMethod: "/usage.v1.BillingService/CancelSubscription",277}278handler := func(ctx context.Context, req interface{}) (interface{}, error) {279return srv.(BillingServiceServer).CancelSubscription(ctx, req.(*CancelSubscriptionRequest))280}281return interceptor(ctx, in, info, handler)282}283284func _BillingService_GetStripeCustomer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {285in := new(GetStripeCustomerRequest)286if err := dec(in); err != nil {287return nil, err288}289if interceptor == nil {290return srv.(BillingServiceServer).GetStripeCustomer(ctx, in)291}292info := &grpc.UnaryServerInfo{293Server: srv,294FullMethod: "/usage.v1.BillingService/GetStripeCustomer",295}296handler := func(ctx context.Context, req interface{}) (interface{}, error) {297return srv.(BillingServiceServer).GetStripeCustomer(ctx, req.(*GetStripeCustomerRequest))298}299return interceptor(ctx, in, info, handler)300}301302func _BillingService_CreateStripeCustomer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {303in := new(CreateStripeCustomerRequest)304if err := dec(in); err != nil {305return nil, err306}307if interceptor == nil {308return srv.(BillingServiceServer).CreateStripeCustomer(ctx, in)309}310info := &grpc.UnaryServerInfo{311Server: srv,312FullMethod: "/usage.v1.BillingService/CreateStripeCustomer",313}314handler := func(ctx context.Context, req interface{}) (interface{}, error) {315return srv.(BillingServiceServer).CreateStripeCustomer(ctx, req.(*CreateStripeCustomerRequest))316}317return interceptor(ctx, in, info, handler)318}319320func _BillingService_CreateHoldPaymentIntent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {321in := new(CreateHoldPaymentIntentRequest)322if err := dec(in); err != nil {323return nil, err324}325if interceptor == nil {326return srv.(BillingServiceServer).CreateHoldPaymentIntent(ctx, in)327}328info := &grpc.UnaryServerInfo{329Server: srv,330FullMethod: "/usage.v1.BillingService/CreateHoldPaymentIntent",331}332handler := func(ctx context.Context, req interface{}) (interface{}, error) {333return srv.(BillingServiceServer).CreateHoldPaymentIntent(ctx, req.(*CreateHoldPaymentIntentRequest))334}335return interceptor(ctx, in, info, handler)336}337338func _BillingService_CreateStripeSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {339in := new(CreateStripeSubscriptionRequest)340if err := dec(in); err != nil {341return nil, err342}343if interceptor == nil {344return srv.(BillingServiceServer).CreateStripeSubscription(ctx, in)345}346info := &grpc.UnaryServerInfo{347Server: srv,348FullMethod: "/usage.v1.BillingService/CreateStripeSubscription",349}350handler := func(ctx context.Context, req interface{}) (interface{}, error) {351return srv.(BillingServiceServer).CreateStripeSubscription(ctx, req.(*CreateStripeSubscriptionRequest))352}353return interceptor(ctx, in, info, handler)354}355356func _BillingService_UpdateCustomerSubscriptionsTaxState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {357in := new(UpdateCustomerSubscriptionsTaxStateRequest)358if err := dec(in); err != nil {359return nil, err360}361if interceptor == nil {362return srv.(BillingServiceServer).UpdateCustomerSubscriptionsTaxState(ctx, in)363}364info := &grpc.UnaryServerInfo{365Server: srv,366FullMethod: "/usage.v1.BillingService/UpdateCustomerSubscriptionsTaxState",367}368handler := func(ctx context.Context, req interface{}) (interface{}, error) {369return srv.(BillingServiceServer).UpdateCustomerSubscriptionsTaxState(ctx, req.(*UpdateCustomerSubscriptionsTaxStateRequest))370}371return interceptor(ctx, in, info, handler)372}373374func _BillingService_GetPriceInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {375in := new(GetPriceInformationRequest)376if err := dec(in); err != nil {377return nil, err378}379if interceptor == nil {380return srv.(BillingServiceServer).GetPriceInformation(ctx, in)381}382info := &grpc.UnaryServerInfo{383Server: srv,384FullMethod: "/usage.v1.BillingService/GetPriceInformation",385}386handler := func(ctx context.Context, req interface{}) (interface{}, error) {387return srv.(BillingServiceServer).GetPriceInformation(ctx, req.(*GetPriceInformationRequest))388}389return interceptor(ctx, in, info, handler)390}391392func _BillingService_OnChargeDispute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {393in := new(OnChargeDisputeRequest)394if err := dec(in); err != nil {395return nil, err396}397if interceptor == nil {398return srv.(BillingServiceServer).OnChargeDispute(ctx, in)399}400info := &grpc.UnaryServerInfo{401Server: srv,402FullMethod: "/usage.v1.BillingService/OnChargeDispute",403}404handler := func(ctx context.Context, req interface{}) (interface{}, error) {405return srv.(BillingServiceServer).OnChargeDispute(ctx, req.(*OnChargeDisputeRequest))406}407return interceptor(ctx, in, info, handler)408}409410// BillingService_ServiceDesc is the grpc.ServiceDesc for BillingService service.411// It's only intended for direct use with grpc.RegisterService,412// and not to be introspected or modified (even as a copy)413var BillingService_ServiceDesc = grpc.ServiceDesc{414ServiceName: "usage.v1.BillingService",415HandlerType: (*BillingServiceServer)(nil),416Methods: []grpc.MethodDesc{417{418MethodName: "ReconcileInvoices",419Handler: _BillingService_ReconcileInvoices_Handler,420},421{422MethodName: "FinalizeInvoice",423Handler: _BillingService_FinalizeInvoice_Handler,424},425{426MethodName: "CancelSubscription",427Handler: _BillingService_CancelSubscription_Handler,428},429{430MethodName: "GetStripeCustomer",431Handler: _BillingService_GetStripeCustomer_Handler,432},433{434MethodName: "CreateStripeCustomer",435Handler: _BillingService_CreateStripeCustomer_Handler,436},437{438MethodName: "CreateHoldPaymentIntent",439Handler: _BillingService_CreateHoldPaymentIntent_Handler,440},441{442MethodName: "CreateStripeSubscription",443Handler: _BillingService_CreateStripeSubscription_Handler,444},445{446MethodName: "UpdateCustomerSubscriptionsTaxState",447Handler: _BillingService_UpdateCustomerSubscriptionsTaxState_Handler,448},449{450MethodName: "GetPriceInformation",451Handler: _BillingService_GetPriceInformation_Handler,452},453{454MethodName: "OnChargeDispute",455Handler: _BillingService_OnChargeDispute_Handler,456},457},458Streams: []grpc.StreamDesc{},459Metadata: "usage/v1/billing.proto",460}461462463