Skip to content

[usage] Usage ledger API protos #12618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
542 changes: 342 additions & 200 deletions components/usage-api/go/v1/usage.pb.go

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions components/usage-api/go/v1/usage_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions components/usage-api/typescript/src/usage/v1/usage_grpc_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface IUsageServiceService extends grpc.ServiceDefinition<grpc.UntypedServic
listBilledUsage: IUsageServiceService_IListBilledUsage;
reconcileUsage: IUsageServiceService_IReconcileUsage;
getCostCenter: IUsageServiceService_IGetCostCenter;
reconcileUsageWithLedger: IUsageServiceService_IReconcileUsageWithLedger;
}

interface IUsageServiceService_IListBilledUsage extends grpc.MethodDefinition<usage_v1_usage_pb.ListBilledUsageRequest, usage_v1_usage_pb.ListBilledUsageResponse> {
Expand Down Expand Up @@ -47,13 +48,23 @@ interface IUsageServiceService_IGetCostCenter extends grpc.MethodDefinition<usag
responseSerialize: grpc.serialize<usage_v1_usage_pb.GetCostCenterResponse>;
responseDeserialize: grpc.deserialize<usage_v1_usage_pb.GetCostCenterResponse>;
}
interface IUsageServiceService_IReconcileUsageWithLedger extends grpc.MethodDefinition<usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, usage_v1_usage_pb.ReconcileUsageWithLedgerResponse> {
path: "/usage.v1.UsageService/ReconcileUsageWithLedger";
requestStream: false;
responseStream: false;
requestSerialize: grpc.serialize<usage_v1_usage_pb.ReconcileUsageWithLedgerRequest>;
requestDeserialize: grpc.deserialize<usage_v1_usage_pb.ReconcileUsageWithLedgerRequest>;
responseSerialize: grpc.serialize<usage_v1_usage_pb.ReconcileUsageWithLedgerResponse>;
responseDeserialize: grpc.deserialize<usage_v1_usage_pb.ReconcileUsageWithLedgerResponse>;
}

export const UsageServiceService: IUsageServiceService;

export interface IUsageServiceServer extends grpc.UntypedServiceImplementation {
listBilledUsage: grpc.handleUnaryCall<usage_v1_usage_pb.ListBilledUsageRequest, usage_v1_usage_pb.ListBilledUsageResponse>;
reconcileUsage: grpc.handleUnaryCall<usage_v1_usage_pb.ReconcileUsageRequest, usage_v1_usage_pb.ReconcileUsageResponse>;
getCostCenter: grpc.handleUnaryCall<usage_v1_usage_pb.GetCostCenterRequest, usage_v1_usage_pb.GetCostCenterResponse>;
reconcileUsageWithLedger: grpc.handleUnaryCall<usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, usage_v1_usage_pb.ReconcileUsageWithLedgerResponse>;
}

export interface IUsageServiceClient {
Expand All @@ -66,6 +77,9 @@ export interface IUsageServiceClient {
getCostCenter(request: usage_v1_usage_pb.GetCostCenterRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.GetCostCenterResponse) => void): grpc.ClientUnaryCall;
getCostCenter(request: usage_v1_usage_pb.GetCostCenterRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.GetCostCenterResponse) => void): grpc.ClientUnaryCall;
getCostCenter(request: usage_v1_usage_pb.GetCostCenterRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.GetCostCenterResponse) => void): grpc.ClientUnaryCall;
reconcileUsageWithLedger(request: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse) => void): grpc.ClientUnaryCall;
reconcileUsageWithLedger(request: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse) => void): grpc.ClientUnaryCall;
reconcileUsageWithLedger(request: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse) => void): grpc.ClientUnaryCall;
}

export class UsageServiceClient extends grpc.Client implements IUsageServiceClient {
Expand All @@ -79,4 +93,7 @@ export class UsageServiceClient extends grpc.Client implements IUsageServiceClie
public getCostCenter(request: usage_v1_usage_pb.GetCostCenterRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.GetCostCenterResponse) => void): grpc.ClientUnaryCall;
public getCostCenter(request: usage_v1_usage_pb.GetCostCenterRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.GetCostCenterResponse) => void): grpc.ClientUnaryCall;
public getCostCenter(request: usage_v1_usage_pb.GetCostCenterRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.GetCostCenterResponse) => void): grpc.ClientUnaryCall;
public reconcileUsageWithLedger(request: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse) => void): grpc.ClientUnaryCall;
public reconcileUsageWithLedger(request: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse) => void): grpc.ClientUnaryCall;
public reconcileUsageWithLedger(request: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse) => void): grpc.ClientUnaryCall;
}
34 changes: 34 additions & 0 deletions components/usage-api/typescript/src/usage/v1/usage_grpc_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,28 @@ function deserialize_usage_v1_ReconcileUsageResponse(buffer_arg) {
return usage_v1_usage_pb.ReconcileUsageResponse.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_usage_v1_ReconcileUsageWithLedgerRequest(arg) {
if (!(arg instanceof usage_v1_usage_pb.ReconcileUsageWithLedgerRequest)) {
throw new Error('Expected argument of type usage.v1.ReconcileUsageWithLedgerRequest');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_usage_v1_ReconcileUsageWithLedgerRequest(buffer_arg) {
return usage_v1_usage_pb.ReconcileUsageWithLedgerRequest.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_usage_v1_ReconcileUsageWithLedgerResponse(arg) {
if (!(arg instanceof usage_v1_usage_pb.ReconcileUsageWithLedgerResponse)) {
throw new Error('Expected argument of type usage.v1.ReconcileUsageWithLedgerResponse');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_usage_v1_ReconcileUsageWithLedgerResponse(buffer_arg) {
return usage_v1_usage_pb.ReconcileUsageWithLedgerResponse.deserializeBinary(new Uint8Array(buffer_arg));
}


var UsageServiceService = exports.UsageServiceService = {
// ListBilledUsage retrieves all usage for the specified attributionId
Expand Down Expand Up @@ -115,6 +137,18 @@ getCostCenter: {
responseSerialize: serialize_usage_v1_GetCostCenterResponse,
responseDeserialize: deserialize_usage_v1_GetCostCenterResponse,
},
// Triggers reconciliation of usage with ledger implementation.
reconcileUsageWithLedger: {
path: '/usage.v1.UsageService/ReconcileUsageWithLedger',
requestStream: false,
responseStream: false,
requestType: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest,
responseType: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse,
requestSerialize: serialize_usage_v1_ReconcileUsageWithLedgerRequest,
requestDeserialize: deserialize_usage_v1_ReconcileUsageWithLedgerRequest,
responseSerialize: serialize_usage_v1_ReconcileUsageWithLedgerResponse,
responseDeserialize: deserialize_usage_v1_ReconcileUsageWithLedgerResponse,
},
};

exports.UsageServiceClient = grpc.makeGenericClientConstructor(UsageServiceService);
46 changes: 46 additions & 0 deletions components/usage-api/typescript/src/usage/v1/usage_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,52 @@
import * as jspb from "google-protobuf";
import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb";

export class ReconcileUsageWithLedgerRequest extends jspb.Message {

hasFrom(): boolean;
clearFrom(): void;
getFrom(): google_protobuf_timestamp_pb.Timestamp | undefined;
setFrom(value?: google_protobuf_timestamp_pb.Timestamp): ReconcileUsageWithLedgerRequest;

hasTo(): boolean;
clearTo(): void;
getTo(): google_protobuf_timestamp_pb.Timestamp | undefined;
setTo(value?: google_protobuf_timestamp_pb.Timestamp): ReconcileUsageWithLedgerRequest;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ReconcileUsageWithLedgerRequest.AsObject;
static toObject(includeInstance: boolean, msg: ReconcileUsageWithLedgerRequest): ReconcileUsageWithLedgerRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: ReconcileUsageWithLedgerRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): ReconcileUsageWithLedgerRequest;
static deserializeBinaryFromReader(message: ReconcileUsageWithLedgerRequest, reader: jspb.BinaryReader): ReconcileUsageWithLedgerRequest;
}

export namespace ReconcileUsageWithLedgerRequest {
export type AsObject = {
from?: google_protobuf_timestamp_pb.Timestamp.AsObject,
to?: google_protobuf_timestamp_pb.Timestamp.AsObject,
}
}

export class ReconcileUsageWithLedgerResponse extends jspb.Message {

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ReconcileUsageWithLedgerResponse.AsObject;
static toObject(includeInstance: boolean, msg: ReconcileUsageWithLedgerResponse): ReconcileUsageWithLedgerResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: ReconcileUsageWithLedgerResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): ReconcileUsageWithLedgerResponse;
static deserializeBinaryFromReader(message: ReconcileUsageWithLedgerResponse, reader: jspb.BinaryReader): ReconcileUsageWithLedgerResponse;
}

export namespace ReconcileUsageWithLedgerResponse {
export type AsObject = {
}
}

export class ListBilledUsageRequest extends jspb.Message {
getAttributionId(): string;
setAttributionId(value: string): ListBilledUsageRequest;
Expand Down
Loading