google-ads-api-client
Version:
A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.
325 lines • 18.8 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GeoTargetConstantService = exports.GeoTargetConstantSuggestion = exports.SuggestGeoTargetConstantsResponse = exports.SuggestGeoTargetConstantsRequest_GeoTargets = exports.SuggestGeoTargetConstantsRequest_LocationNames = exports.SuggestGeoTargetConstantsRequest = void 0;
// @generated by protobuf-ts 2.8.1
// @generated from protobuf file "ads/services/geo_target_constant_service.proto" (package "google.ads.googleads.v11.services", syntax proto3)
// tslint:disable
//
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc");
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 geo_target_constant_1 = require("../resources/geo_target_constant");
// @generated message type with reflection information, may provide speed optimized methods
class SuggestGeoTargetConstantsRequest$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.SuggestGeoTargetConstantsRequest", [
{ no: 6, name: "locale", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 7, name: "country_code", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 1, name: "location_names", kind: "message", oneof: "query", T: () => exports.SuggestGeoTargetConstantsRequest_LocationNames },
{ no: 2, name: "geo_targets", kind: "message", oneof: "query", T: () => exports.SuggestGeoTargetConstantsRequest_GeoTargets }
]);
}
create(value) {
const message = { query: { 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 /* optional string locale */ 6:
message.locale = reader.string();
break;
case /* optional string country_code */ 7:
message.countryCode = reader.string();
break;
case /* google.ads.googleads.v11.services.SuggestGeoTargetConstantsRequest.LocationNames location_names */ 1:
message.query = {
oneofKind: "locationNames",
locationNames: exports.SuggestGeoTargetConstantsRequest_LocationNames.internalBinaryRead(reader, reader.uint32(), options, message.query.locationNames)
};
break;
case /* google.ads.googleads.v11.services.SuggestGeoTargetConstantsRequest.GeoTargets geo_targets */ 2:
message.query = {
oneofKind: "geoTargets",
geoTargets: exports.SuggestGeoTargetConstantsRequest_GeoTargets.internalBinaryRead(reader, reader.uint32(), options, message.query.geoTargets)
};
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 locale = 6; */
if (message.locale !== undefined)
writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.locale);
/* optional string country_code = 7; */
if (message.countryCode !== undefined)
writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.countryCode);
/* google.ads.googleads.v11.services.SuggestGeoTargetConstantsRequest.LocationNames location_names = 1; */
if (message.query.oneofKind === "locationNames")
exports.SuggestGeoTargetConstantsRequest_LocationNames.internalBinaryWrite(message.query.locationNames, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.ads.googleads.v11.services.SuggestGeoTargetConstantsRequest.GeoTargets geo_targets = 2; */
if (message.query.oneofKind === "geoTargets")
exports.SuggestGeoTargetConstantsRequest_GeoTargets.internalBinaryWrite(message.query.geoTargets, writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join();
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.services.SuggestGeoTargetConstantsRequest
*/
exports.SuggestGeoTargetConstantsRequest = new SuggestGeoTargetConstantsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SuggestGeoTargetConstantsRequest_LocationNames$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.SuggestGeoTargetConstantsRequest.LocationNames", [
{ no: 2, name: "names", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
]);
}
create(value) {
const message = { names: [] };
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 /* repeated string names */ 2:
message.names.push(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) {
/* repeated string names = 2; */
for (let i = 0; i < message.names.length; i++)
writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.names[i]);
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.services.SuggestGeoTargetConstantsRequest.LocationNames
*/
exports.SuggestGeoTargetConstantsRequest_LocationNames = new SuggestGeoTargetConstantsRequest_LocationNames$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SuggestGeoTargetConstantsRequest_GeoTargets$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.SuggestGeoTargetConstantsRequest.GeoTargets", [
{ no: 2, name: "geo_target_constants", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
]);
}
create(value) {
const message = { geoTargetConstants: [] };
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 /* repeated string geo_target_constants */ 2:
message.geoTargetConstants.push(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) {
/* repeated string geo_target_constants = 2; */
for (let i = 0; i < message.geoTargetConstants.length; i++)
writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.geoTargetConstants[i]);
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.services.SuggestGeoTargetConstantsRequest.GeoTargets
*/
exports.SuggestGeoTargetConstantsRequest_GeoTargets = new SuggestGeoTargetConstantsRequest_GeoTargets$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SuggestGeoTargetConstantsResponse$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.SuggestGeoTargetConstantsResponse", [
{ no: 1, name: "geo_target_constant_suggestions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.GeoTargetConstantSuggestion }
]);
}
create(value) {
const message = { geoTargetConstantSuggestions: [] };
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 /* repeated google.ads.googleads.v11.services.GeoTargetConstantSuggestion geo_target_constant_suggestions */ 1:
message.geoTargetConstantSuggestions.push(exports.GeoTargetConstantSuggestion.internalBinaryRead(reader, reader.uint32(), options));
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) {
/* repeated google.ads.googleads.v11.services.GeoTargetConstantSuggestion geo_target_constant_suggestions = 1; */
for (let i = 0; i < message.geoTargetConstantSuggestions.length; i++)
exports.GeoTargetConstantSuggestion.internalBinaryWrite(message.geoTargetConstantSuggestions[i], writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join();
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.services.SuggestGeoTargetConstantsResponse
*/
exports.SuggestGeoTargetConstantsResponse = new SuggestGeoTargetConstantsResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GeoTargetConstantSuggestion$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.GeoTargetConstantSuggestion", [
{ no: 6, name: "locale", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 7, name: "reach", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 8, name: "search_term", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 4, name: "geo_target_constant", kind: "message", T: () => geo_target_constant_1.GeoTargetConstant },
{ no: 5, name: "geo_target_constant_parents", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => geo_target_constant_1.GeoTargetConstant }
]);
}
create(value) {
const message = { geoTargetConstantParents: [] };
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 locale */ 6:
message.locale = reader.string();
break;
case /* optional int64 reach */ 7:
message.reach = reader.int64().toBigInt();
break;
case /* optional string search_term */ 8:
message.searchTerm = reader.string();
break;
case /* google.ads.googleads.v11.resources.GeoTargetConstant geo_target_constant */ 4:
message.geoTargetConstant = geo_target_constant_1.GeoTargetConstant.internalBinaryRead(reader, reader.uint32(), options, message.geoTargetConstant);
break;
case /* repeated google.ads.googleads.v11.resources.GeoTargetConstant geo_target_constant_parents */ 5:
message.geoTargetConstantParents.push(geo_target_constant_1.GeoTargetConstant.internalBinaryRead(reader, reader.uint32(), options));
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 locale = 6; */
if (message.locale !== undefined)
writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.locale);
/* optional int64 reach = 7; */
if (message.reach !== undefined)
writer.tag(7, runtime_1.WireType.Varint).int64(message.reach);
/* optional string search_term = 8; */
if (message.searchTerm !== undefined)
writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.searchTerm);
/* google.ads.googleads.v11.resources.GeoTargetConstant geo_target_constant = 4; */
if (message.geoTargetConstant)
geo_target_constant_1.GeoTargetConstant.internalBinaryWrite(message.geoTargetConstant, writer.tag(4, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* repeated google.ads.googleads.v11.resources.GeoTargetConstant geo_target_constant_parents = 5; */
for (let i = 0; i < message.geoTargetConstantParents.length; i++)
geo_target_constant_1.GeoTargetConstant.internalBinaryWrite(message.geoTargetConstantParents[i], writer.tag(5, runtime_1.WireType.LengthDelimited).fork(), options).join();
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.services.GeoTargetConstantSuggestion
*/
exports.GeoTargetConstantSuggestion = new GeoTargetConstantSuggestion$Type();
/**
* @generated ServiceType for protobuf service google.ads.googleads.v11.services.GeoTargetConstantService
*/
exports.GeoTargetConstantService = new runtime_rpc_1.ServiceType("google.ads.googleads.v11.services.GeoTargetConstantService", [
{ name: "SuggestGeoTargetConstants", options: { "google.api.http": { post: "/v11/geoTargetConstants:suggest", body: "*" } }, I: exports.SuggestGeoTargetConstantsRequest, O: exports.SuggestGeoTargetConstantsResponse }
], { "google.api.default_host": "googleads.googleapis.com", "google.api.oauth_scopes": "https://www.googleapis.com/auth/adwords" });
//# sourceMappingURL=geo_target_constant_service.js.map