UNPKG

google-ads-api-client

Version:

A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.

174 lines 10.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchJob_BatchJobMetadata = exports.BatchJob = 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 batch_job_status_1 = require("../enums/batch_job_status"); // @generated message type with reflection information, may provide speed optimized methods class BatchJob$Type extends runtime_5.MessageType { constructor() { super("google.ads.googleads.v11.resources.BatchJob", [ { no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"], "google.api.resource_reference": { type: "googleads.googleapis.com/BatchJob" } } }, { no: 7, name: "id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 8, name: "next_add_sequence_token", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 4, name: "metadata", kind: "message", T: () => exports.BatchJob_BatchJobMetadata, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 5, name: "status", kind: "enum", T: () => ["google.ads.googleads.v11.enums.BatchJobStatusEnum.BatchJobStatus", batch_job_status_1.BatchJobStatusEnum_BatchJobStatus], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 9, name: "long_running_operation", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } } ], { "google.api.resource": { type: "googleads.googleapis.com/BatchJob", pattern: ["customers/{customer_id}/batchJobs/{batch_job_id}"] } }); } create(value) { const message = { resourceName: "", 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 int64 id */ 7: message.id = reader.int64().toBigInt(); break; case /* optional string next_add_sequence_token */ 8: message.nextAddSequenceToken = reader.string(); break; case /* google.ads.googleads.v11.resources.BatchJob.BatchJobMetadata metadata */ 4: message.metadata = exports.BatchJob_BatchJobMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); break; case /* google.ads.googleads.v11.enums.BatchJobStatusEnum.BatchJobStatus status */ 5: message.status = reader.int32(); break; case /* optional string long_running_operation */ 9: message.longRunningOperation = 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); /* optional int64 id = 7; */ if (message.id !== undefined) writer.tag(7, runtime_1.WireType.Varint).int64(message.id); /* optional string next_add_sequence_token = 8; */ if (message.nextAddSequenceToken !== undefined) writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.nextAddSequenceToken); /* google.ads.googleads.v11.resources.BatchJob.BatchJobMetadata metadata = 4; */ if (message.metadata) exports.BatchJob_BatchJobMetadata.internalBinaryWrite(message.metadata, writer.tag(4, runtime_1.WireType.LengthDelimited).fork(), options).join(); /* google.ads.googleads.v11.enums.BatchJobStatusEnum.BatchJobStatus status = 5; */ if (message.status !== 0) writer.tag(5, runtime_1.WireType.Varint).int32(message.status); /* optional string long_running_operation = 9; */ if (message.longRunningOperation !== undefined) writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.longRunningOperation); 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.BatchJob */ exports.BatchJob = new BatchJob$Type(); // @generated message type with reflection information, may provide speed optimized methods class BatchJob_BatchJobMetadata$Type extends runtime_5.MessageType { constructor() { super("google.ads.googleads.v11.resources.BatchJob.BatchJobMetadata", [ { no: 8, name: "creation_date_time", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 7, name: "start_date_time", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 9, name: "completion_date_time", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 10, name: "estimated_completion_ratio", kind: "scalar", opt: true, T: 1 /*ScalarType.DOUBLE*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 11, name: "operation_count", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 12, name: "executed_operation_count", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } } ]); } create(value) { const message = {}; 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 creation_date_time */ 8: message.creationDateTime = reader.string(); break; case /* optional string start_date_time */ 7: message.startDateTime = reader.string(); break; case /* optional string completion_date_time */ 9: message.completionDateTime = reader.string(); break; case /* optional double estimated_completion_ratio */ 10: message.estimatedCompletionRatio = reader.double(); break; case /* optional int64 operation_count */ 11: message.operationCount = reader.int64().toBigInt(); break; case /* optional int64 executed_operation_count */ 12: message.executedOperationCount = reader.int64().toBigInt(); 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 creation_date_time = 8; */ if (message.creationDateTime !== undefined) writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.creationDateTime); /* optional string start_date_time = 7; */ if (message.startDateTime !== undefined) writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.startDateTime); /* optional string completion_date_time = 9; */ if (message.completionDateTime !== undefined) writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.completionDateTime); /* optional double estimated_completion_ratio = 10; */ if (message.estimatedCompletionRatio !== undefined) writer.tag(10, runtime_1.WireType.Bit64).double(message.estimatedCompletionRatio); /* optional int64 operation_count = 11; */ if (message.operationCount !== undefined) writer.tag(11, runtime_1.WireType.Varint).int64(message.operationCount); /* optional int64 executed_operation_count = 12; */ if (message.executedOperationCount !== undefined) writer.tag(12, runtime_1.WireType.Varint).int64(message.executedOperationCount); 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.BatchJob.BatchJobMetadata */ exports.BatchJob_BatchJobMetadata = new BatchJob_BatchJobMetadata$Type(); //# sourceMappingURL=batch_job.js.map