2024-02-21 13:28:44 -05:00
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
2025-05-23 09:42:26 -07:00
// - protoc-gen-go-grpc v1.5.1
2024-02-21 13:28:44 -05:00
// - protoc (unknown)
// source: controller/api/services/v1/billing_service.proto
package services
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
2025-05-23 09:42:26 -07:00
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc . SupportPackageIsVersion9
2024-02-21 13:28:44 -05:00
const (
BillingService_MonthlyActiveUsers_FullMethodName = "/controller.api.services.v1.BillingService/MonthlyActiveUsers"
)
// BillingServiceClient is the client API for BillingService service.
//
// 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.
type BillingServiceClient interface {
// MonthlyActiveUsers returns the monthly active users for the given time period.
// If no time period is provided, the current and previous months are returned.
// If the provided request contains a start time but no end time, it will return
// up to the current month. If the provided request contains an end time and no start time,
// or if the end time is prior to the start time, an error will be returned.
MonthlyActiveUsers ( ctx context . Context , in * MonthlyActiveUsersRequest , opts ... grpc . CallOption ) ( * MonthlyActiveUsersResponse , error )
}
type billingServiceClient struct {
cc grpc . ClientConnInterface
}
func NewBillingServiceClient ( cc grpc . ClientConnInterface ) BillingServiceClient {
return & billingServiceClient { cc }
}
func ( c * billingServiceClient ) MonthlyActiveUsers ( ctx context . Context , in * MonthlyActiveUsersRequest , opts ... grpc . CallOption ) ( * MonthlyActiveUsersResponse , error ) {
2025-05-23 09:42:26 -07:00
cOpts := append ([] grpc . CallOption { grpc . StaticMethod ()}, opts ... )
2024-02-21 13:28:44 -05:00
out := new ( MonthlyActiveUsersResponse )
2025-05-23 09:42:26 -07:00
err := c . cc . Invoke ( ctx , BillingService_MonthlyActiveUsers_FullMethodName , in , out , cOpts ... )
2024-02-21 13:28:44 -05:00
if err != nil {
return nil , err
}
return out , nil
}
// BillingServiceServer is the server API for BillingService service.
// All implementations must embed UnimplementedBillingServiceServer
2025-05-23 09:42:26 -07:00
// for forward compatibility.
2024-02-21 13:28:44 -05:00
type BillingServiceServer interface {
// MonthlyActiveUsers returns the monthly active users for the given time period.
// If no time period is provided, the current and previous months are returned.
// If the provided request contains a start time but no end time, it will return
// up to the current month. If the provided request contains an end time and no start time,
// or if the end time is prior to the start time, an error will be returned.
MonthlyActiveUsers ( context . Context , * MonthlyActiveUsersRequest ) ( * MonthlyActiveUsersResponse , error )
mustEmbedUnimplementedBillingServiceServer ()
}
2025-05-23 09:42:26 -07:00
// UnimplementedBillingServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedBillingServiceServer struct {}
2024-02-21 13:28:44 -05:00
func ( UnimplementedBillingServiceServer ) MonthlyActiveUsers ( context . Context , * MonthlyActiveUsersRequest ) ( * MonthlyActiveUsersResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method MonthlyActiveUsers not implemented" )
}
func ( UnimplementedBillingServiceServer ) mustEmbedUnimplementedBillingServiceServer () {}
2025-05-23 09:42:26 -07:00
func ( UnimplementedBillingServiceServer ) testEmbeddedByValue () {}
2024-02-21 13:28:44 -05:00
// UnsafeBillingServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BillingServiceServer will
// result in compilation errors.
type UnsafeBillingServiceServer interface {
mustEmbedUnimplementedBillingServiceServer ()
}
func RegisterBillingServiceServer ( s grpc . ServiceRegistrar , srv BillingServiceServer ) {
2025-05-23 09:42:26 -07:00
// If the following call pancis, it indicates UnimplementedBillingServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t , ok := srv .( interface { testEmbeddedByValue () }); ok {
t . testEmbeddedByValue ()
}
2024-02-21 13:28:44 -05:00
s . RegisterService ( & BillingService_ServiceDesc , srv )
}
func _BillingService_MonthlyActiveUsers_Handler ( srv interface {}, ctx context . Context , dec func ( interface {}) error , interceptor grpc . UnaryServerInterceptor ) ( interface {}, error ) {
in := new ( MonthlyActiveUsersRequest )
if err := dec ( in ); err != nil {
return nil , err
}
if interceptor == nil {
return srv .( BillingServiceServer ). MonthlyActiveUsers ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : BillingService_MonthlyActiveUsers_FullMethodName ,
}
handler := func ( ctx context . Context , req interface {}) ( interface {}, error ) {
return srv .( BillingServiceServer ). MonthlyActiveUsers ( ctx , req .( * MonthlyActiveUsersRequest ))
}
return interceptor ( ctx , in , info , handler )
}
// BillingService_ServiceDesc is the grpc.ServiceDesc for BillingService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BillingService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "controller.api.services.v1.BillingService" ,
HandlerType : ( * BillingServiceServer )( nil ),
Methods : [] grpc . MethodDesc {
{
MethodName : "MonthlyActiveUsers" ,
Handler : _BillingService_MonthlyActiveUsers_Handler ,
},
},
Streams : [] grpc . StreamDesc {},
Metadata : "controller/api/services/v1/billing_service.proto" ,
}