google-ads-api-client
Version:
A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.
245 lines • 16.5 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Service = 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 wrappers_1 = require("../protobuf/wrappers");
const source_info_1 = require("./source_info");
const system_parameter_1 = require("./system_parameter");
const monitoring_1 = require("./monitoring");
const logging_1 = require("./logging");
const billing_1 = require("./billing");
const monitored_resource_1 = require("./monitored_resource");
const metric_1 = require("./metric");
const log_1 = require("./log");
const control_1 = require("./control");
const endpoint_1 = require("./endpoint");
const usage_1 = require("./usage");
const context_1 = require("./context");
const auth_1 = require("./auth");
const quota_1 = require("./quota");
const http_1 = require("./http");
const backend_1 = require("./backend");
const documentation_1 = require("./documentation");
const type_1 = require("../protobuf/type");
const type_2 = require("../protobuf/type");
const api_1 = require("../protobuf/api");
// @generated message type with reflection information, may provide speed optimized methods
class Service$Type extends runtime_5.MessageType {
constructor() {
super("google.api.Service", [
{ no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 22, name: "producer_project_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 33, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 3, name: "apis", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => api_1.Api },
{ no: 4, name: "types", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => type_2.Type },
{ no: 5, name: "enums", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => type_1.Enum },
{ no: 6, name: "documentation", kind: "message", T: () => documentation_1.Documentation },
{ no: 8, name: "backend", kind: "message", T: () => backend_1.Backend },
{ no: 9, name: "http", kind: "message", T: () => http_1.Http },
{ no: 10, name: "quota", kind: "message", T: () => quota_1.Quota },
{ no: 11, name: "authentication", kind: "message", T: () => auth_1.Authentication },
{ no: 12, name: "context", kind: "message", T: () => context_1.Context },
{ no: 15, name: "usage", kind: "message", T: () => usage_1.Usage },
{ no: 18, name: "endpoints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => endpoint_1.Endpoint },
{ no: 21, name: "control", kind: "message", T: () => control_1.Control },
{ no: 23, name: "logs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => log_1.LogDescriptor },
{ no: 24, name: "metrics", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => metric_1.MetricDescriptor },
{ no: 25, name: "monitored_resources", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => monitored_resource_1.MonitoredResourceDescriptor },
{ no: 26, name: "billing", kind: "message", T: () => billing_1.Billing },
{ no: 27, name: "logging", kind: "message", T: () => logging_1.Logging },
{ no: 28, name: "monitoring", kind: "message", T: () => monitoring_1.Monitoring },
{ no: 29, name: "system_parameters", kind: "message", T: () => system_parameter_1.SystemParameters },
{ no: 37, name: "source_info", kind: "message", T: () => source_info_1.SourceInfo },
{ no: 20, name: "config_version", kind: "message", T: () => wrappers_1.UInt32Value }
]);
}
create(value) {
const message = { name: "", title: "", producerProjectId: "", id: "", apis: [], types: [], enums: [], endpoints: [], logs: [], metrics: [], monitoredResources: [] };
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 name */ 1:
message.name = reader.string();
break;
case /* string title */ 2:
message.title = reader.string();
break;
case /* string producer_project_id */ 22:
message.producerProjectId = reader.string();
break;
case /* string id */ 33:
message.id = reader.string();
break;
case /* repeated google.protobuf.Api apis */ 3:
message.apis.push(api_1.Api.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated google.protobuf.Type types */ 4:
message.types.push(type_2.Type.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated google.protobuf.Enum enums */ 5:
message.enums.push(type_1.Enum.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* google.api.Documentation documentation */ 6:
message.documentation = documentation_1.Documentation.internalBinaryRead(reader, reader.uint32(), options, message.documentation);
break;
case /* google.api.Backend backend */ 8:
message.backend = backend_1.Backend.internalBinaryRead(reader, reader.uint32(), options, message.backend);
break;
case /* google.api.Http http */ 9:
message.http = http_1.Http.internalBinaryRead(reader, reader.uint32(), options, message.http);
break;
case /* google.api.Quota quota */ 10:
message.quota = quota_1.Quota.internalBinaryRead(reader, reader.uint32(), options, message.quota);
break;
case /* google.api.Authentication authentication */ 11:
message.authentication = auth_1.Authentication.internalBinaryRead(reader, reader.uint32(), options, message.authentication);
break;
case /* google.api.Context context */ 12:
message.context = context_1.Context.internalBinaryRead(reader, reader.uint32(), options, message.context);
break;
case /* google.api.Usage usage */ 15:
message.usage = usage_1.Usage.internalBinaryRead(reader, reader.uint32(), options, message.usage);
break;
case /* repeated google.api.Endpoint endpoints */ 18:
message.endpoints.push(endpoint_1.Endpoint.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* google.api.Control control */ 21:
message.control = control_1.Control.internalBinaryRead(reader, reader.uint32(), options, message.control);
break;
case /* repeated google.api.LogDescriptor logs */ 23:
message.logs.push(log_1.LogDescriptor.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated google.api.MetricDescriptor metrics */ 24:
message.metrics.push(metric_1.MetricDescriptor.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated google.api.MonitoredResourceDescriptor monitored_resources */ 25:
message.monitoredResources.push(monitored_resource_1.MonitoredResourceDescriptor.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* google.api.Billing billing */ 26:
message.billing = billing_1.Billing.internalBinaryRead(reader, reader.uint32(), options, message.billing);
break;
case /* google.api.Logging logging */ 27:
message.logging = logging_1.Logging.internalBinaryRead(reader, reader.uint32(), options, message.logging);
break;
case /* google.api.Monitoring monitoring */ 28:
message.monitoring = monitoring_1.Monitoring.internalBinaryRead(reader, reader.uint32(), options, message.monitoring);
break;
case /* google.api.SystemParameters system_parameters */ 29:
message.systemParameters = system_parameter_1.SystemParameters.internalBinaryRead(reader, reader.uint32(), options, message.systemParameters);
break;
case /* google.api.SourceInfo source_info */ 37:
message.sourceInfo = source_info_1.SourceInfo.internalBinaryRead(reader, reader.uint32(), options, message.sourceInfo);
break;
case /* google.protobuf.UInt32Value config_version = 20 [deprecated = true];*/ 20:
message.configVersion = wrappers_1.UInt32Value.internalBinaryRead(reader, reader.uint32(), options, message.configVersion);
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 name = 1; */
if (message.name !== "")
writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.name);
/* string title = 2; */
if (message.title !== "")
writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.title);
/* string producer_project_id = 22; */
if (message.producerProjectId !== "")
writer.tag(22, runtime_1.WireType.LengthDelimited).string(message.producerProjectId);
/* string id = 33; */
if (message.id !== "")
writer.tag(33, runtime_1.WireType.LengthDelimited).string(message.id);
/* repeated google.protobuf.Api apis = 3; */
for (let i = 0; i < message.apis.length; i++)
api_1.Api.internalBinaryWrite(message.apis[i], writer.tag(3, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* repeated google.protobuf.Type types = 4; */
for (let i = 0; i < message.types.length; i++)
type_2.Type.internalBinaryWrite(message.types[i], writer.tag(4, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* repeated google.protobuf.Enum enums = 5; */
for (let i = 0; i < message.enums.length; i++)
type_1.Enum.internalBinaryWrite(message.enums[i], writer.tag(5, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Documentation documentation = 6; */
if (message.documentation)
documentation_1.Documentation.internalBinaryWrite(message.documentation, writer.tag(6, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Backend backend = 8; */
if (message.backend)
backend_1.Backend.internalBinaryWrite(message.backend, writer.tag(8, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Http http = 9; */
if (message.http)
http_1.Http.internalBinaryWrite(message.http, writer.tag(9, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Quota quota = 10; */
if (message.quota)
quota_1.Quota.internalBinaryWrite(message.quota, writer.tag(10, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Authentication authentication = 11; */
if (message.authentication)
auth_1.Authentication.internalBinaryWrite(message.authentication, writer.tag(11, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Context context = 12; */
if (message.context)
context_1.Context.internalBinaryWrite(message.context, writer.tag(12, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Usage usage = 15; */
if (message.usage)
usage_1.Usage.internalBinaryWrite(message.usage, writer.tag(15, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* repeated google.api.Endpoint endpoints = 18; */
for (let i = 0; i < message.endpoints.length; i++)
endpoint_1.Endpoint.internalBinaryWrite(message.endpoints[i], writer.tag(18, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Control control = 21; */
if (message.control)
control_1.Control.internalBinaryWrite(message.control, writer.tag(21, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* repeated google.api.LogDescriptor logs = 23; */
for (let i = 0; i < message.logs.length; i++)
log_1.LogDescriptor.internalBinaryWrite(message.logs[i], writer.tag(23, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* repeated google.api.MetricDescriptor metrics = 24; */
for (let i = 0; i < message.metrics.length; i++)
metric_1.MetricDescriptor.internalBinaryWrite(message.metrics[i], writer.tag(24, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* repeated google.api.MonitoredResourceDescriptor monitored_resources = 25; */
for (let i = 0; i < message.monitoredResources.length; i++)
monitored_resource_1.MonitoredResourceDescriptor.internalBinaryWrite(message.monitoredResources[i], writer.tag(25, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Billing billing = 26; */
if (message.billing)
billing_1.Billing.internalBinaryWrite(message.billing, writer.tag(26, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Logging logging = 27; */
if (message.logging)
logging_1.Logging.internalBinaryWrite(message.logging, writer.tag(27, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.Monitoring monitoring = 28; */
if (message.monitoring)
monitoring_1.Monitoring.internalBinaryWrite(message.monitoring, writer.tag(28, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.SystemParameters system_parameters = 29; */
if (message.systemParameters)
system_parameter_1.SystemParameters.internalBinaryWrite(message.systemParameters, writer.tag(29, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.api.SourceInfo source_info = 37; */
if (message.sourceInfo)
source_info_1.SourceInfo.internalBinaryWrite(message.sourceInfo, writer.tag(37, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.protobuf.UInt32Value config_version = 20 [deprecated = true]; */
if (message.configVersion)
wrappers_1.UInt32Value.internalBinaryWrite(message.configVersion, writer.tag(20, 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.Service
*/
exports.Service = new Service$Type();
//# sourceMappingURL=service.js.map