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.

146 lines 9.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BiddingDataExclusion = 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 advertising_channel_type_1 = require("../enums/advertising_channel_type"); const device_1 = require("../enums/device"); const seasonality_event_status_1 = require("../enums/seasonality_event_status"); const seasonality_event_scope_1 = require("../enums/seasonality_event_scope"); // @generated message type with reflection information, may provide speed optimized methods class BiddingDataExclusion$Type extends runtime_5.MessageType { constructor() { super("google.ads.googleads.v11.resources.BiddingDataExclusion", [ { 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/BiddingDataExclusion" } } }, { no: 2, name: "data_exclusion_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 3, name: "scope", kind: "enum", T: () => ["google.ads.googleads.v11.enums.SeasonalityEventScopeEnum.SeasonalityEventScope", seasonality_event_scope_1.SeasonalityEventScopeEnum_SeasonalityEventScope] }, { no: 4, name: "status", kind: "enum", T: () => ["google.ads.googleads.v11.enums.SeasonalityEventStatusEnum.SeasonalityEventStatus", seasonality_event_status_1.SeasonalityEventStatusEnum_SeasonalityEventStatus], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 5, name: "start_date_time", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } }, { no: 6, name: "end_date_time", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } }, { no: 7, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 8, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 9, name: "devices", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["google.ads.googleads.v11.enums.DeviceEnum.Device", device_1.DeviceEnum_Device] }, { no: 10, name: "campaigns", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "google.api.resource_reference": { type: "googleads.googleapis.com/Campaign" } } }, { no: 11, name: "advertising_channel_types", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["google.ads.googleads.v11.enums.AdvertisingChannelTypeEnum.AdvertisingChannelType", advertising_channel_type_1.AdvertisingChannelTypeEnum_AdvertisingChannelType] } ], { "google.api.resource": { type: "googleads.googleapis.com/BiddingDataExclusion", pattern: ["customers/{customer_id}/biddingDataExclusions/{seasonality_event_id}"] } }); } create(value) { const message = { resourceName: "", dataExclusionId: 0n, scope: 0, status: 0, startDateTime: "", endDateTime: "", name: "", description: "", devices: [], campaigns: [], advertisingChannelTypes: [] }; 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 /* int64 data_exclusion_id */ 2: message.dataExclusionId = reader.int64().toBigInt(); break; case /* google.ads.googleads.v11.enums.SeasonalityEventScopeEnum.SeasonalityEventScope scope */ 3: message.scope = reader.int32(); break; case /* google.ads.googleads.v11.enums.SeasonalityEventStatusEnum.SeasonalityEventStatus status */ 4: message.status = reader.int32(); break; case /* string start_date_time */ 5: message.startDateTime = reader.string(); break; case /* string end_date_time */ 6: message.endDateTime = reader.string(); break; case /* string name */ 7: message.name = reader.string(); break; case /* string description */ 8: message.description = reader.string(); break; case /* repeated google.ads.googleads.v11.enums.DeviceEnum.Device devices */ 9: if (wireType === runtime_2.WireType.LengthDelimited) for (let e = reader.int32() + reader.pos; reader.pos < e;) message.devices.push(reader.int32()); else message.devices.push(reader.int32()); break; case /* repeated string campaigns */ 10: message.campaigns.push(reader.string()); break; case /* repeated google.ads.googleads.v11.enums.AdvertisingChannelTypeEnum.AdvertisingChannelType advertising_channel_types */ 11: if (wireType === runtime_2.WireType.LengthDelimited) for (let e = reader.int32() + reader.pos; reader.pos < e;) message.advertisingChannelTypes.push(reader.int32()); else message.advertisingChannelTypes.push(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_1.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_2.WireType.LengthDelimited).string(message.resourceName); /* int64 data_exclusion_id = 2; */ if (message.dataExclusionId !== 0n) writer.tag(2, runtime_2.WireType.Varint).int64(message.dataExclusionId); /* google.ads.googleads.v11.enums.SeasonalityEventScopeEnum.SeasonalityEventScope scope = 3; */ if (message.scope !== 0) writer.tag(3, runtime_2.WireType.Varint).int32(message.scope); /* google.ads.googleads.v11.enums.SeasonalityEventStatusEnum.SeasonalityEventStatus status = 4; */ if (message.status !== 0) writer.tag(4, runtime_2.WireType.Varint).int32(message.status); /* string start_date_time = 5; */ if (message.startDateTime !== "") writer.tag(5, runtime_2.WireType.LengthDelimited).string(message.startDateTime); /* string end_date_time = 6; */ if (message.endDateTime !== "") writer.tag(6, runtime_2.WireType.LengthDelimited).string(message.endDateTime); /* string name = 7; */ if (message.name !== "") writer.tag(7, runtime_2.WireType.LengthDelimited).string(message.name); /* string description = 8; */ if (message.description !== "") writer.tag(8, runtime_2.WireType.LengthDelimited).string(message.description); /* repeated google.ads.googleads.v11.enums.DeviceEnum.Device devices = 9; */ if (message.devices.length) { writer.tag(9, runtime_2.WireType.LengthDelimited).fork(); for (let i = 0; i < message.devices.length; i++) writer.int32(message.devices[i]); writer.join(); } /* repeated string campaigns = 10; */ for (let i = 0; i < message.campaigns.length; i++) writer.tag(10, runtime_2.WireType.LengthDelimited).string(message.campaigns[i]); /* repeated google.ads.googleads.v11.enums.AdvertisingChannelTypeEnum.AdvertisingChannelType advertising_channel_types = 11; */ if (message.advertisingChannelTypes.length) { writer.tag(11, runtime_2.WireType.LengthDelimited).fork(); for (let i = 0; i < message.advertisingChannelTypes.length; i++) writer.int32(message.advertisingChannelTypes[i]); writer.join(); } let u = options.writeUnknownFields; if (u !== false) (u == true ? runtime_1.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message google.ads.googleads.v11.resources.BiddingDataExclusion */ exports.BiddingDataExclusion = new BiddingDataExclusion$Type(); //# sourceMappingURL=bidding_data_exclusion.js.map