// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix // @generated from protobuf file "billing.proto" (package "api", syntax proto3) // tslint:disable import { ServiceType } from "@protobuf-ts/runtime-rpc"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime"; import { WireType } from "@protobuf-ts/runtime"; import type { BinaryReadOptions } from "@protobuf-ts/runtime"; import type { IBinaryReader } from "@protobuf-ts/runtime"; import { UnknownFieldHandler } from "@protobuf-ts/runtime"; import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; // ===================== // ===== Requests ====== // ===================== /** * @generated from protobuf message api.GenerateRequest */ export interface GenerateRequest { /** * @generated from protobuf field: string OrganisationID = 1 */ OrganisationID: string; /** * @generated from protobuf field: string Comment = 2 */ Comment: string; /** * UTC date/time in ISO 8601 format * * @generated from protobuf field: string FromDate = 3 */ FromDate: string; /** * UTC date/time in ISO 8601 format * * @generated from protobuf field: string ToDate = 4 */ ToDate: string; /** * @generated from protobuf field: api.GenerateBillingFormat OutputFormat = 5 */ OutputFormat: GenerateBillingFormat; } // ===================== // ===== Responses ===== // ===================== /** * @generated from protobuf message api.GenerateResult */ export interface GenerateResult { /** * @generated from protobuf field: string Output = 1 */ Output: string; } /** * @generated from protobuf enum api.GenerateBillingFormat */ export enum GenerateBillingFormat { /** * @generated from protobuf enum value: BILLING_FORMAT_PDF = 0; */ BILLING_FORMAT_PDF = 0, /** * @generated from protobuf enum value: BILLING_FORMAT_CSV = 1; */ BILLING_FORMAT_CSV = 1, /** * @generated from protobuf enum value: BILLING_FORMAT_JSON = 2; */ BILLING_FORMAT_JSON = 2 } // @generated message type with reflection information, may provide speed optimized methods class GenerateRequest$Type extends MessageType { constructor() { super("api.GenerateRequest", [ { no: 1, name: "OrganisationID", kind: "scalar", localName: "OrganisationID", jsonName: "OrganisationID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 2, name: "Comment", kind: "scalar", localName: "Comment", jsonName: "Comment", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "FromDate", kind: "scalar", localName: "FromDate", jsonName: "FromDate", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "UTC date/time in ISO 8601 format" }, "validate.rules": { string: { dateIso8601: true } } } }, { no: 4, name: "ToDate", kind: "scalar", localName: "ToDate", jsonName: "ToDate", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "UTC date/time in ISO 8601 format" }, "validate.rules": { string: { dateIso8601: true } } } }, { no: 5, name: "OutputFormat", kind: "enum", localName: "OutputFormat", jsonName: "OutputFormat", T: () => ["api.GenerateBillingFormat", GenerateBillingFormat], options: { "validate.rules": { enum: { definedOnly: true } } } } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["OrganisationID", "FromDate", "ToDate"] } } }); } create(value?: PartialMessage): GenerateRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.OrganisationID = ""; message.Comment = ""; message.FromDate = ""; message.ToDate = ""; message.OutputFormat = 0; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GenerateRequest): GenerateRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string OrganisationID */ 1: message.OrganisationID = reader.string(); break; case /* string Comment */ 2: message.Comment = reader.string(); break; case /* string FromDate */ 3: message.FromDate = reader.string(); break; case /* string ToDate */ 4: message.ToDate = reader.string(); break; case /* api.GenerateBillingFormat OutputFormat */ 5: message.OutputFormat = reader.int32(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: GenerateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string OrganisationID = 1; */ if (message.OrganisationID !== "") writer.tag(1, WireType.LengthDelimited).string(message.OrganisationID); /* string Comment = 2; */ if (message.Comment !== "") writer.tag(2, WireType.LengthDelimited).string(message.Comment); /* string FromDate = 3; */ if (message.FromDate !== "") writer.tag(3, WireType.LengthDelimited).string(message.FromDate); /* string ToDate = 4; */ if (message.ToDate !== "") writer.tag(4, WireType.LengthDelimited).string(message.ToDate); /* api.GenerateBillingFormat OutputFormat = 5; */ if (message.OutputFormat !== 0) writer.tag(5, WireType.Varint).int32(message.OutputFormat); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.GenerateRequest */ export const GenerateRequest = new GenerateRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class GenerateResult$Type extends MessageType { constructor() { super("api.GenerateResult", [ { no: 1, name: "Output", kind: "scalar", localName: "Output", jsonName: "Output", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): GenerateResult { const message = globalThis.Object.create((this.messagePrototype!)); message.Output = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GenerateResult): GenerateResult { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string Output */ 1: message.Output = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: GenerateResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Output = 1; */ if (message.Output !== "") writer.tag(1, WireType.LengthDelimited).string(message.Output); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.GenerateResult */ export const GenerateResult = new GenerateResult$Type(); /** * @generated ServiceType for protobuf service api.BillingService */ export const BillingService = new ServiceType("api.BillingService", [ { name: "Generate", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Billing"], description: "Generates billing report (pdf & csv) for a given organization during a given period" }, "api.rscType": "Platform", "api.roles": "Platform.Billing", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: GenerateRequest, O: GenerateResult } ], { "api.k8sService": "billing-server" });