google-ads-api-client
Version:
A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.
364 lines • 20.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomerManagerLinkService = exports.MutateCustomerManagerLinkResult = exports.MoveManagerLinkResponse = exports.MutateCustomerManagerLinkResponse = exports.CustomerManagerLinkOperation = exports.MoveManagerLinkRequest = exports.MutateCustomerManagerLinkRequest = void 0;
// @generated by protobuf-ts 2.8.1
// @generated from protobuf file "ads/services/customer_manager_link_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 customer_manager_link_1 = require("../resources/customer_manager_link");
const field_mask_1 = require("../../google/protobuf/field_mask");
// @generated message type with reflection information, may provide speed optimized methods
class MutateCustomerManagerLinkRequest$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.MutateCustomerManagerLinkRequest", [
{ no: 1, name: "customer_id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 2, name: "operations", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.CustomerManagerLinkOperation, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 3, name: "validate_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
]);
}
create(value) {
const message = { customerId: "", operations: [], validateOnly: false };
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 customer_id */ 1:
message.customerId = reader.string();
break;
case /* repeated google.ads.googleads.v11.services.CustomerManagerLinkOperation operations */ 2:
message.operations.push(exports.CustomerManagerLinkOperation.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* bool validate_only */ 3:
message.validateOnly = reader.bool();
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 customer_id = 1; */
if (message.customerId !== "")
writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.customerId);
/* repeated google.ads.googleads.v11.services.CustomerManagerLinkOperation operations = 2; */
for (let i = 0; i < message.operations.length; i++)
exports.CustomerManagerLinkOperation.internalBinaryWrite(message.operations[i], writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* bool validate_only = 3; */
if (message.validateOnly !== false)
writer.tag(3, runtime_1.WireType.Varint).bool(message.validateOnly);
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.MutateCustomerManagerLinkRequest
*/
exports.MutateCustomerManagerLinkRequest = new MutateCustomerManagerLinkRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MoveManagerLinkRequest$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.MoveManagerLinkRequest", [
{ no: 1, name: "customer_id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 2, name: "previous_customer_manager_link", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 3, name: "new_manager", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 4, name: "validate_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
]);
}
create(value) {
const message = { customerId: "", previousCustomerManagerLink: "", newManager: "", validateOnly: false };
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 customer_id */ 1:
message.customerId = reader.string();
break;
case /* string previous_customer_manager_link */ 2:
message.previousCustomerManagerLink = reader.string();
break;
case /* string new_manager */ 3:
message.newManager = reader.string();
break;
case /* bool validate_only */ 4:
message.validateOnly = reader.bool();
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 customer_id = 1; */
if (message.customerId !== "")
writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.customerId);
/* string previous_customer_manager_link = 2; */
if (message.previousCustomerManagerLink !== "")
writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.previousCustomerManagerLink);
/* string new_manager = 3; */
if (message.newManager !== "")
writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.newManager);
/* bool validate_only = 4; */
if (message.validateOnly !== false)
writer.tag(4, runtime_1.WireType.Varint).bool(message.validateOnly);
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.MoveManagerLinkRequest
*/
exports.MoveManagerLinkRequest = new MoveManagerLinkRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CustomerManagerLinkOperation$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.CustomerManagerLinkOperation", [
{ no: 4, name: "update_mask", kind: "message", T: () => field_mask_1.FieldMask },
{ no: 2, name: "update", kind: "message", oneof: "operation", T: () => customer_manager_link_1.CustomerManagerLink }
]);
}
create(value) {
const message = { operation: { 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 /* google.protobuf.FieldMask update_mask */ 4:
message.updateMask = field_mask_1.FieldMask.internalBinaryRead(reader, reader.uint32(), options, message.updateMask);
break;
case /* google.ads.googleads.v11.resources.CustomerManagerLink update */ 2:
message.operation = {
oneofKind: "update",
update: customer_manager_link_1.CustomerManagerLink.internalBinaryRead(reader, reader.uint32(), options, message.operation.update)
};
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) {
/* google.protobuf.FieldMask update_mask = 4; */
if (message.updateMask)
field_mask_1.FieldMask.internalBinaryWrite(message.updateMask, writer.tag(4, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.ads.googleads.v11.resources.CustomerManagerLink update = 2; */
if (message.operation.oneofKind === "update")
customer_manager_link_1.CustomerManagerLink.internalBinaryWrite(message.operation.update, 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.CustomerManagerLinkOperation
*/
exports.CustomerManagerLinkOperation = new CustomerManagerLinkOperation$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MutateCustomerManagerLinkResponse$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.MutateCustomerManagerLinkResponse", [
{ no: 1, name: "results", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.MutateCustomerManagerLinkResult }
]);
}
create(value) {
const message = { results: [] };
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.MutateCustomerManagerLinkResult results */ 1:
message.results.push(exports.MutateCustomerManagerLinkResult.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.MutateCustomerManagerLinkResult results = 1; */
for (let i = 0; i < message.results.length; i++)
exports.MutateCustomerManagerLinkResult.internalBinaryWrite(message.results[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.MutateCustomerManagerLinkResponse
*/
exports.MutateCustomerManagerLinkResponse = new MutateCustomerManagerLinkResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MoveManagerLinkResponse$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.MoveManagerLinkResponse", [
{ no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.resource_reference": { type: "googleads.googleapis.com/CustomerManagerLink" } } }
]);
}
create(value) {
const message = { resourceName: "" };
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;
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);
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.MoveManagerLinkResponse
*/
exports.MoveManagerLinkResponse = new MoveManagerLinkResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MutateCustomerManagerLinkResult$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.MutateCustomerManagerLinkResult", [
{ no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.resource_reference": { type: "googleads.googleapis.com/CustomerManagerLink" } } }
]);
}
create(value) {
const message = { resourceName: "" };
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;
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);
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.MutateCustomerManagerLinkResult
*/
exports.MutateCustomerManagerLinkResult = new MutateCustomerManagerLinkResult$Type();
/**
* @generated ServiceType for protobuf service google.ads.googleads.v11.services.CustomerManagerLinkService
*/
exports.CustomerManagerLinkService = new runtime_rpc_1.ServiceType("google.ads.googleads.v11.services.CustomerManagerLinkService", [
{ name: "MutateCustomerManagerLink", options: { "google.api.http": { post: "/v11/customers/{customer_id=*}/customerManagerLinks:mutate", body: "*" }, "google.api.method_signature": ["customer_id,operations"] }, I: exports.MutateCustomerManagerLinkRequest, O: exports.MutateCustomerManagerLinkResponse },
{ name: "MoveManagerLink", options: { "google.api.http": { post: "/v11/customers/{customer_id=*}/customerManagerLinks:moveManagerLink", body: "*" }, "google.api.method_signature": ["customer_id,previous_customer_manager_link,new_manager"] }, I: exports.MoveManagerLinkRequest, O: exports.MoveManagerLinkResponse }
], { "google.api.default_host": "googleads.googleapis.com", "google.api.oauth_scopes": "https://www.googleapis.com/auth/adwords" });
//# sourceMappingURL=customer_manager_link_service.js.map