Skip to content

Commit f0f159e

Browse files
easyCZroboquat
authored andcommitted
[usage] Usage ledger API protos
1 parent c75d066 commit f0f159e

File tree

7 files changed

+838
-200
lines changed

7 files changed

+838
-200
lines changed

components/usage-api/go/v1/usage.pb.go

+342-200
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/usage-api/go/v1/usage_grpc.pb.go

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/usage-api/typescript/src/usage/v1/usage_grpc_pb.d.ts

+17
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ interface IUsageServiceService extends grpc.ServiceDefinition<grpc.UntypedServic
1818
listBilledUsage: IUsageServiceService_IListBilledUsage;
1919
reconcileUsage: IUsageServiceService_IReconcileUsage;
2020
getCostCenter: IUsageServiceService_IGetCostCenter;
21+
reconcileUsageWithLedger: IUsageServiceService_IReconcileUsageWithLedger;
2122
}
2223

2324
interface IUsageServiceService_IListBilledUsage extends grpc.MethodDefinition<usage_v1_usage_pb.ListBilledUsageRequest, usage_v1_usage_pb.ListBilledUsageResponse> {
@@ -47,13 +48,23 @@ interface IUsageServiceService_IGetCostCenter extends grpc.MethodDefinition<usag
4748
responseSerialize: grpc.serialize<usage_v1_usage_pb.GetCostCenterResponse>;
4849
responseDeserialize: grpc.deserialize<usage_v1_usage_pb.GetCostCenterResponse>;
4950
}
51+
interface IUsageServiceService_IReconcileUsageWithLedger extends grpc.MethodDefinition<usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, usage_v1_usage_pb.ReconcileUsageWithLedgerResponse> {
52+
path: "/usage.v1.UsageService/ReconcileUsageWithLedger";
53+
requestStream: false;
54+
responseStream: false;
55+
requestSerialize: grpc.serialize<usage_v1_usage_pb.ReconcileUsageWithLedgerRequest>;
56+
requestDeserialize: grpc.deserialize<usage_v1_usage_pb.ReconcileUsageWithLedgerRequest>;
57+
responseSerialize: grpc.serialize<usage_v1_usage_pb.ReconcileUsageWithLedgerResponse>;
58+
responseDeserialize: grpc.deserialize<usage_v1_usage_pb.ReconcileUsageWithLedgerResponse>;
59+
}
5060

5161
export const UsageServiceService: IUsageServiceService;
5262

5363
export interface IUsageServiceServer extends grpc.UntypedServiceImplementation {
5464
listBilledUsage: grpc.handleUnaryCall<usage_v1_usage_pb.ListBilledUsageRequest, usage_v1_usage_pb.ListBilledUsageResponse>;
5565
reconcileUsage: grpc.handleUnaryCall<usage_v1_usage_pb.ReconcileUsageRequest, usage_v1_usage_pb.ReconcileUsageResponse>;
5666
getCostCenter: grpc.handleUnaryCall<usage_v1_usage_pb.GetCostCenterRequest, usage_v1_usage_pb.GetCostCenterResponse>;
67+
reconcileUsageWithLedger: grpc.handleUnaryCall<usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, usage_v1_usage_pb.ReconcileUsageWithLedgerResponse>;
5768
}
5869

5970
export interface IUsageServiceClient {
@@ -66,6 +77,9 @@ export interface IUsageServiceClient {
6677
getCostCenter(request: usage_v1_usage_pb.GetCostCenterRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.GetCostCenterResponse) => void): grpc.ClientUnaryCall;
6778
getCostCenter(request: usage_v1_usage_pb.GetCostCenterRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.GetCostCenterResponse) => void): grpc.ClientUnaryCall;
6879
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;
80+
reconcileUsageWithLedger(request: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse) => void): grpc.ClientUnaryCall;
81+
reconcileUsageWithLedger(request: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse) => void): grpc.ClientUnaryCall;
82+
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;
6983
}
7084

7185
export class UsageServiceClient extends grpc.Client implements IUsageServiceClient {
@@ -79,4 +93,7 @@ export class UsageServiceClient extends grpc.Client implements IUsageServiceClie
7993
public getCostCenter(request: usage_v1_usage_pb.GetCostCenterRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.GetCostCenterResponse) => void): grpc.ClientUnaryCall;
8094
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;
8195
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;
96+
public reconcileUsageWithLedger(request: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse) => void): grpc.ClientUnaryCall;
97+
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;
98+
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;
8299
}

components/usage-api/typescript/src/usage/v1/usage_grpc_pb.js

+34
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,28 @@ function deserialize_usage_v1_ReconcileUsageResponse(buffer_arg) {
7777
return usage_v1_usage_pb.ReconcileUsageResponse.deserializeBinary(new Uint8Array(buffer_arg));
7878
}
7979

80+
function serialize_usage_v1_ReconcileUsageWithLedgerRequest(arg) {
81+
if (!(arg instanceof usage_v1_usage_pb.ReconcileUsageWithLedgerRequest)) {
82+
throw new Error('Expected argument of type usage.v1.ReconcileUsageWithLedgerRequest');
83+
}
84+
return Buffer.from(arg.serializeBinary());
85+
}
86+
87+
function deserialize_usage_v1_ReconcileUsageWithLedgerRequest(buffer_arg) {
88+
return usage_v1_usage_pb.ReconcileUsageWithLedgerRequest.deserializeBinary(new Uint8Array(buffer_arg));
89+
}
90+
91+
function serialize_usage_v1_ReconcileUsageWithLedgerResponse(arg) {
92+
if (!(arg instanceof usage_v1_usage_pb.ReconcileUsageWithLedgerResponse)) {
93+
throw new Error('Expected argument of type usage.v1.ReconcileUsageWithLedgerResponse');
94+
}
95+
return Buffer.from(arg.serializeBinary());
96+
}
97+
98+
function deserialize_usage_v1_ReconcileUsageWithLedgerResponse(buffer_arg) {
99+
return usage_v1_usage_pb.ReconcileUsageWithLedgerResponse.deserializeBinary(new Uint8Array(buffer_arg));
100+
}
101+
80102

81103
var UsageServiceService = exports.UsageServiceService = {
82104
// ListBilledUsage retrieves all usage for the specified attributionId
@@ -115,6 +137,18 @@ getCostCenter: {
115137
responseSerialize: serialize_usage_v1_GetCostCenterResponse,
116138
responseDeserialize: deserialize_usage_v1_GetCostCenterResponse,
117139
},
140+
// Triggers reconciliation of usage with ledger implementation.
141+
reconcileUsageWithLedger: {
142+
path: '/usage.v1.UsageService/ReconcileUsageWithLedger',
143+
requestStream: false,
144+
responseStream: false,
145+
requestType: usage_v1_usage_pb.ReconcileUsageWithLedgerRequest,
146+
responseType: usage_v1_usage_pb.ReconcileUsageWithLedgerResponse,
147+
requestSerialize: serialize_usage_v1_ReconcileUsageWithLedgerRequest,
148+
requestDeserialize: deserialize_usage_v1_ReconcileUsageWithLedgerRequest,
149+
responseSerialize: serialize_usage_v1_ReconcileUsageWithLedgerResponse,
150+
responseDeserialize: deserialize_usage_v1_ReconcileUsageWithLedgerResponse,
151+
},
118152
};
119153

120154
exports.UsageServiceClient = grpc.makeGenericClientConstructor(UsageServiceService);

components/usage-api/typescript/src/usage/v1/usage_pb.d.ts

+46
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,52 @@
1313
import * as jspb from "google-protobuf";
1414
import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb";
1515

16+
export class ReconcileUsageWithLedgerRequest extends jspb.Message {
17+
18+
hasFrom(): boolean;
19+
clearFrom(): void;
20+
getFrom(): google_protobuf_timestamp_pb.Timestamp | undefined;
21+
setFrom(value?: google_protobuf_timestamp_pb.Timestamp): ReconcileUsageWithLedgerRequest;
22+
23+
hasTo(): boolean;
24+
clearTo(): void;
25+
getTo(): google_protobuf_timestamp_pb.Timestamp | undefined;
26+
setTo(value?: google_protobuf_timestamp_pb.Timestamp): ReconcileUsageWithLedgerRequest;
27+
28+
serializeBinary(): Uint8Array;
29+
toObject(includeInstance?: boolean): ReconcileUsageWithLedgerRequest.AsObject;
30+
static toObject(includeInstance: boolean, msg: ReconcileUsageWithLedgerRequest): ReconcileUsageWithLedgerRequest.AsObject;
31+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
32+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
33+
static serializeBinaryToWriter(message: ReconcileUsageWithLedgerRequest, writer: jspb.BinaryWriter): void;
34+
static deserializeBinary(bytes: Uint8Array): ReconcileUsageWithLedgerRequest;
35+
static deserializeBinaryFromReader(message: ReconcileUsageWithLedgerRequest, reader: jspb.BinaryReader): ReconcileUsageWithLedgerRequest;
36+
}
37+
38+
export namespace ReconcileUsageWithLedgerRequest {
39+
export type AsObject = {
40+
from?: google_protobuf_timestamp_pb.Timestamp.AsObject,
41+
to?: google_protobuf_timestamp_pb.Timestamp.AsObject,
42+
}
43+
}
44+
45+
export class ReconcileUsageWithLedgerResponse extends jspb.Message {
46+
47+
serializeBinary(): Uint8Array;
48+
toObject(includeInstance?: boolean): ReconcileUsageWithLedgerResponse.AsObject;
49+
static toObject(includeInstance: boolean, msg: ReconcileUsageWithLedgerResponse): ReconcileUsageWithLedgerResponse.AsObject;
50+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
51+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
52+
static serializeBinaryToWriter(message: ReconcileUsageWithLedgerResponse, writer: jspb.BinaryWriter): void;
53+
static deserializeBinary(bytes: Uint8Array): ReconcileUsageWithLedgerResponse;
54+
static deserializeBinaryFromReader(message: ReconcileUsageWithLedgerResponse, reader: jspb.BinaryReader): ReconcileUsageWithLedgerResponse;
55+
}
56+
57+
export namespace ReconcileUsageWithLedgerResponse {
58+
export type AsObject = {
59+
}
60+
}
61+
1662
export class ListBilledUsageRequest extends jspb.Message {
1763
getAttributionId(): string;
1864
setAttributionId(value: string): ListBilledUsageRequest;

0 commit comments

Comments
 (0)