UNPKG

google-ads-api-client

Version:

A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.

201 lines 13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BillingSetup_PaymentsAccountInfo = exports.BillingSetup = void 0; const runtime_1 = require("@protobuf-ts/runtime"); const runtime_2 = require("@protobuf-ts/runtime"); const runtime_3 = require("@protobuf-ts/runtime"); const runtime_4 = require("@protobuf-ts/runtime"); const runtime_5 = require("@protobuf-ts/runtime"); const time_type_1 = require("../enums/time_type"); const billing_setup_status_1 = require("../enums/billing_setup_status"); // @generated message type with reflection information, may provide speed optimized methods class BillingSetup$Type extends runtime_5.MessageType { constructor() { super("google.ads.googleads.v11.resources.BillingSetup", [ { no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"], "google.api.resource_reference": { type: "googleads.googleapis.com/BillingSetup" } } }, { no: 15, name: "id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 3, name: "status", kind: "enum", T: () => ["google.ads.googleads.v11.enums.BillingSetupStatusEnum.BillingSetupStatus", billing_setup_status_1.BillingSetupStatusEnum_BillingSetupStatus], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 18, name: "payments_account", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"], "google.api.resource_reference": { type: "googleads.googleapis.com/PaymentsAccount" } } }, { no: 12, name: "payments_account_info", kind: "message", T: () => exports.BillingSetup_PaymentsAccountInfo, options: { "google.api.field_behavior": ["IMMUTABLE"] } }, { no: 16, name: "start_date_time", kind: "scalar", oneof: "startTime", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"] } }, { no: 10, name: "start_time_type", kind: "enum", oneof: "startTime", T: () => ["google.ads.googleads.v11.enums.TimeTypeEnum.TimeType", time_type_1.TimeTypeEnum_TimeType], options: { "google.api.field_behavior": ["IMMUTABLE"] } }, { no: 17, name: "end_date_time", kind: "scalar", oneof: "endTime", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 14, name: "end_time_type", kind: "enum", oneof: "endTime", T: () => ["google.ads.googleads.v11.enums.TimeTypeEnum.TimeType", time_type_1.TimeTypeEnum_TimeType], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } } ], { "google.api.resource": { type: "googleads.googleapis.com/BillingSetup", pattern: ["customers/{customer_id}/billingSetups/{billing_setup_id}"] } }); } create(value) { const message = { resourceName: "", status: 0, startTime: { oneofKind: undefined }, endTime: { oneofKind: undefined } }; globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) (0, runtime_3.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string resource_name */ 1: message.resourceName = reader.string(); break; case /* optional int64 id */ 15: message.id = reader.int64().toBigInt(); break; case /* google.ads.googleads.v11.enums.BillingSetupStatusEnum.BillingSetupStatus status */ 3: message.status = reader.int32(); break; case /* optional string payments_account */ 18: message.paymentsAccount = reader.string(); break; case /* google.ads.googleads.v11.resources.BillingSetup.PaymentsAccountInfo payments_account_info */ 12: message.paymentsAccountInfo = exports.BillingSetup_PaymentsAccountInfo.internalBinaryRead(reader, reader.uint32(), options, message.paymentsAccountInfo); break; case /* string start_date_time */ 16: message.startTime = { oneofKind: "startDateTime", startDateTime: reader.string() }; break; case /* google.ads.googleads.v11.enums.TimeTypeEnum.TimeType start_time_type */ 10: message.startTime = { oneofKind: "startTimeType", startTimeType: reader.int32() }; break; case /* string end_date_time */ 17: message.endTime = { oneofKind: "endDateTime", endDateTime: reader.string() }; break; case /* google.ads.googleads.v11.enums.TimeTypeEnum.TimeType end_time_type */ 14: message.endTime = { oneofKind: "endTimeType", endTimeType: 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 ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message, writer, options) { /* string resource_name = 1; */ if (message.resourceName !== "") writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.resourceName); /* optional int64 id = 15; */ if (message.id !== undefined) writer.tag(15, runtime_1.WireType.Varint).int64(message.id); /* google.ads.googleads.v11.enums.BillingSetupStatusEnum.BillingSetupStatus status = 3; */ if (message.status !== 0) writer.tag(3, runtime_1.WireType.Varint).int32(message.status); /* optional string payments_account = 18; */ if (message.paymentsAccount !== undefined) writer.tag(18, runtime_1.WireType.LengthDelimited).string(message.paymentsAccount); /* google.ads.googleads.v11.resources.BillingSetup.PaymentsAccountInfo payments_account_info = 12; */ if (message.paymentsAccountInfo) exports.BillingSetup_PaymentsAccountInfo.internalBinaryWrite(message.paymentsAccountInfo, writer.tag(12, runtime_1.WireType.LengthDelimited).fork(), options).join(); /* string start_date_time = 16; */ if (message.startTime.oneofKind === "startDateTime") writer.tag(16, runtime_1.WireType.LengthDelimited).string(message.startTime.startDateTime); /* google.ads.googleads.v11.enums.TimeTypeEnum.TimeType start_time_type = 10; */ if (message.startTime.oneofKind === "startTimeType") writer.tag(10, runtime_1.WireType.Varint).int32(message.startTime.startTimeType); /* string end_date_time = 17; */ if (message.endTime.oneofKind === "endDateTime") writer.tag(17, runtime_1.WireType.LengthDelimited).string(message.endTime.endDateTime); /* google.ads.googleads.v11.enums.TimeTypeEnum.TimeType end_time_type = 14; */ if (message.endTime.oneofKind === "endTimeType") writer.tag(14, runtime_1.WireType.Varint).int32(message.endTime.endTimeType); let u = options.writeUnknownFields; if (u !== false) (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message google.ads.googleads.v11.resources.BillingSetup */ exports.BillingSetup = new BillingSetup$Type(); // @generated message type with reflection information, may provide speed optimized methods class BillingSetup_PaymentsAccountInfo$Type extends runtime_5.MessageType { constructor() { super("google.ads.googleads.v11.resources.BillingSetup.PaymentsAccountInfo", [ { no: 6, name: "payments_account_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 7, name: "payments_account_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"] } }, { no: 8, name: "payments_profile_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"] } }, { no: 9, name: "payments_profile_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 10, name: "secondary_payments_profile_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } } ]); } create(value) { const message = {}; globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) (0, runtime_3.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* optional string payments_account_id */ 6: message.paymentsAccountId = reader.string(); break; case /* optional string payments_account_name */ 7: message.paymentsAccountName = reader.string(); break; case /* optional string payments_profile_id */ 8: message.paymentsProfileId = reader.string(); break; case /* optional string payments_profile_name */ 9: message.paymentsProfileName = reader.string(); break; case /* optional string secondary_payments_profile_id */ 10: message.secondaryPaymentsProfileId = 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 ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message, writer, options) { /* optional string payments_account_id = 6; */ if (message.paymentsAccountId !== undefined) writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.paymentsAccountId); /* optional string payments_account_name = 7; */ if (message.paymentsAccountName !== undefined) writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.paymentsAccountName); /* optional string payments_profile_id = 8; */ if (message.paymentsProfileId !== undefined) writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.paymentsProfileId); /* optional string payments_profile_name = 9; */ if (message.paymentsProfileName !== undefined) writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.paymentsProfileName); /* optional string secondary_payments_profile_id = 10; */ if (message.secondaryPaymentsProfileId !== undefined) writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.secondaryPaymentsProfileId); let u = options.writeUnknownFields; if (u !== false) (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message google.ads.googleads.v11.resources.BillingSetup.PaymentsAccountInfo */ exports.BillingSetup_PaymentsAccountInfo = new BillingSetup_PaymentsAccountInfo$Type(); //# sourceMappingURL=billing_setup.js.map