google-ads-api-client
Version:
A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.
110 lines • 5.5 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Billing_BillingDestination = exports.Billing = 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");
// @generated message type with reflection information, may provide speed optimized methods
class Billing$Type extends runtime_5.MessageType {
constructor() {
super("google.api.Billing", [
{ no: 8, name: "consumer_destinations", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.Billing_BillingDestination }
]);
}
create(value) {
const message = { consumerDestinations: [] };
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.api.Billing.BillingDestination consumer_destinations */ 8:
message.consumerDestinations.push(exports.Billing_BillingDestination.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.api.Billing.BillingDestination consumer_destinations = 8; */
for (let i = 0; i < message.consumerDestinations.length; i++)
exports.Billing_BillingDestination.internalBinaryWrite(message.consumerDestinations[i], writer.tag(8, 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.api.Billing
*/
exports.Billing = new Billing$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Billing_BillingDestination$Type extends runtime_5.MessageType {
constructor() {
super("google.api.Billing.BillingDestination", [
{ no: 1, name: "monitored_resource", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "metrics", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
]);
}
create(value) {
const message = { monitoredResource: "", metrics: [] };
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 monitored_resource */ 1:
message.monitoredResource = reader.string();
break;
case /* repeated string metrics */ 2:
message.metrics.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) {
/* string monitored_resource = 1; */
if (message.monitoredResource !== "")
writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.monitoredResource);
/* repeated string metrics = 2; */
for (let i = 0; i < message.metrics.length; i++)
writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.metrics[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.api.Billing.BillingDestination
*/
exports.Billing_BillingDestination = new Billing_BillingDestination$Type();
//# sourceMappingURL=billing.js.map