google-ads-api-client
Version:
A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.
134 lines • 8.59 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomerClient = 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 customer_status_1 = require("../enums/customer_status");
// @generated message type with reflection information, may provide speed optimized methods
class CustomerClient$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.resources.CustomerClient", [
{ no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"], "google.api.resource_reference": { type: "googleads.googleapis.com/CustomerClient" } } },
{ no: 12, name: "client_customer", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"], "google.api.resource_reference": { type: "googleads.googleapis.com/Customer" } } },
{ no: 13, name: "hidden", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 14, name: "level", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 15, name: "time_zone", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 16, name: "test_account", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 17, name: "manager", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 18, name: "descriptive_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 19, name: "currency_code", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 20, name: "id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 21, name: "applied_labels", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"], "google.api.resource_reference": { type: "googleads.googleapis.com/Label" } } },
{ no: 22, name: "status", kind: "enum", T: () => ["google.ads.googleads.v11.enums.CustomerStatusEnum.CustomerStatus", customer_status_1.CustomerStatusEnum_CustomerStatus], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }
], { "google.api.resource": { type: "googleads.googleapis.com/CustomerClient", pattern: ["customers/{customer_id}/customerClients/{client_customer_id}"] } });
}
create(value) {
const message = { resourceName: "", appliedLabels: [], status: 0 };
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 string client_customer */ 12:
message.clientCustomer = reader.string();
break;
case /* optional bool hidden */ 13:
message.hidden = reader.bool();
break;
case /* optional int64 level */ 14:
message.level = reader.int64().toBigInt();
break;
case /* optional string time_zone */ 15:
message.timeZone = reader.string();
break;
case /* optional bool test_account */ 16:
message.testAccount = reader.bool();
break;
case /* optional bool manager */ 17:
message.manager = reader.bool();
break;
case /* optional string descriptive_name */ 18:
message.descriptiveName = reader.string();
break;
case /* optional string currency_code */ 19:
message.currencyCode = reader.string();
break;
case /* optional int64 id */ 20:
message.id = reader.int64().toBigInt();
break;
case /* repeated string applied_labels */ 21:
message.appliedLabels.push(reader.string());
break;
case /* google.ads.googleads.v11.enums.CustomerStatusEnum.CustomerStatus status */ 22:
message.status = 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 string client_customer = 12; */
if (message.clientCustomer !== undefined)
writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.clientCustomer);
/* optional bool hidden = 13; */
if (message.hidden !== undefined)
writer.tag(13, runtime_1.WireType.Varint).bool(message.hidden);
/* optional int64 level = 14; */
if (message.level !== undefined)
writer.tag(14, runtime_1.WireType.Varint).int64(message.level);
/* optional string time_zone = 15; */
if (message.timeZone !== undefined)
writer.tag(15, runtime_1.WireType.LengthDelimited).string(message.timeZone);
/* optional bool test_account = 16; */
if (message.testAccount !== undefined)
writer.tag(16, runtime_1.WireType.Varint).bool(message.testAccount);
/* optional bool manager = 17; */
if (message.manager !== undefined)
writer.tag(17, runtime_1.WireType.Varint).bool(message.manager);
/* optional string descriptive_name = 18; */
if (message.descriptiveName !== undefined)
writer.tag(18, runtime_1.WireType.LengthDelimited).string(message.descriptiveName);
/* optional string currency_code = 19; */
if (message.currencyCode !== undefined)
writer.tag(19, runtime_1.WireType.LengthDelimited).string(message.currencyCode);
/* optional int64 id = 20; */
if (message.id !== undefined)
writer.tag(20, runtime_1.WireType.Varint).int64(message.id);
/* repeated string applied_labels = 21; */
for (let i = 0; i < message.appliedLabels.length; i++)
writer.tag(21, runtime_1.WireType.LengthDelimited).string(message.appliedLabels[i]);
/* google.ads.googleads.v11.enums.CustomerStatusEnum.CustomerStatus status = 22; */
if (message.status !== 0)
writer.tag(22, runtime_1.WireType.Varint).int32(message.status);
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.CustomerClient
*/
exports.CustomerClient = new CustomerClient$Type();
//# sourceMappingURL=customer_client.js.map