google-ads-api-client
Version:
A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.
408 lines • 23.5 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OfflineUserDataJobService = exports.AddOfflineUserDataJobOperationsResponse = exports.OfflineUserDataJobOperation = exports.AddOfflineUserDataJobOperationsRequest = exports.RunOfflineUserDataJobRequest = exports.CreateOfflineUserDataJobResponse = exports.CreateOfflineUserDataJobRequest = void 0;
// @generated by protobuf-ts 2.8.1
// @generated from protobuf file "ads/services/offline_user_data_job_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 operations_1 = require("../../google/longrunning/operations");
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 status_1 = require("../../google/rpc/status");
const offline_user_data_1 = require("../common/offline_user_data");
const offline_user_data_job_1 = require("../resources/offline_user_data_job");
// @generated message type with reflection information, may provide speed optimized methods
class CreateOfflineUserDataJobRequest$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.CreateOfflineUserDataJobRequest", [
{ no: 1, name: "customer_id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 2, name: "job", kind: "message", T: () => offline_user_data_job_1.OfflineUserDataJob, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 3, name: "validate_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
{ no: 5, name: "enable_match_rate_range_preview", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
]);
}
create(value) {
const message = { customerId: "", validateOnly: false, enableMatchRateRangePreview: 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 /* google.ads.googleads.v11.resources.OfflineUserDataJob job */ 2:
message.job = offline_user_data_job_1.OfflineUserDataJob.internalBinaryRead(reader, reader.uint32(), options, message.job);
break;
case /* bool validate_only */ 3:
message.validateOnly = reader.bool();
break;
case /* bool enable_match_rate_range_preview */ 5:
message.enableMatchRateRangePreview = 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);
/* google.ads.googleads.v11.resources.OfflineUserDataJob job = 2; */
if (message.job)
offline_user_data_job_1.OfflineUserDataJob.internalBinaryWrite(message.job, 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);
/* bool enable_match_rate_range_preview = 5; */
if (message.enableMatchRateRangePreview !== false)
writer.tag(5, runtime_1.WireType.Varint).bool(message.enableMatchRateRangePreview);
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.CreateOfflineUserDataJobRequest
*/
exports.CreateOfflineUserDataJobRequest = new CreateOfflineUserDataJobRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateOfflineUserDataJobResponse$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.CreateOfflineUserDataJobResponse", [
{ no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.resource_reference": { type: "googleads.googleapis.com/OfflineUserDataJob" } } }
]);
}
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.CreateOfflineUserDataJobResponse
*/
exports.CreateOfflineUserDataJobResponse = new CreateOfflineUserDataJobResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RunOfflineUserDataJobRequest$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.RunOfflineUserDataJobRequest", [
{ no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"], "google.api.resource_reference": { type: "googleads.googleapis.com/OfflineUserDataJob" } } },
{ no: 2, name: "validate_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
]);
}
create(value) {
const message = { resourceName: "", 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 resource_name */ 1:
message.resourceName = reader.string();
break;
case /* bool validate_only */ 2:
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 resource_name = 1; */
if (message.resourceName !== "")
writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.resourceName);
/* bool validate_only = 2; */
if (message.validateOnly !== false)
writer.tag(2, 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.RunOfflineUserDataJobRequest
*/
exports.RunOfflineUserDataJobRequest = new RunOfflineUserDataJobRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AddOfflineUserDataJobOperationsRequest$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.AddOfflineUserDataJobOperationsRequest", [
{ no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"], "google.api.resource_reference": { type: "googleads.googleapis.com/OfflineUserDataJob" } } },
{ no: 4, name: "enable_partial_failure", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
{ no: 6, name: "enable_warnings", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
{ no: 3, name: "operations", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.OfflineUserDataJobOperation, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 5, name: "validate_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
]);
}
create(value) {
const message = { resourceName: "", 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 resource_name */ 1:
message.resourceName = reader.string();
break;
case /* optional bool enable_partial_failure */ 4:
message.enablePartialFailure = reader.bool();
break;
case /* optional bool enable_warnings */ 6:
message.enableWarnings = reader.bool();
break;
case /* repeated google.ads.googleads.v11.services.OfflineUserDataJobOperation operations */ 3:
message.operations.push(exports.OfflineUserDataJobOperation.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* bool validate_only */ 5:
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 resource_name = 1; */
if (message.resourceName !== "")
writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.resourceName);
/* optional bool enable_partial_failure = 4; */
if (message.enablePartialFailure !== undefined)
writer.tag(4, runtime_1.WireType.Varint).bool(message.enablePartialFailure);
/* optional bool enable_warnings = 6; */
if (message.enableWarnings !== undefined)
writer.tag(6, runtime_1.WireType.Varint).bool(message.enableWarnings);
/* repeated google.ads.googleads.v11.services.OfflineUserDataJobOperation operations = 3; */
for (let i = 0; i < message.operations.length; i++)
exports.OfflineUserDataJobOperation.internalBinaryWrite(message.operations[i], writer.tag(3, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* bool validate_only = 5; */
if (message.validateOnly !== false)
writer.tag(5, 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.AddOfflineUserDataJobOperationsRequest
*/
exports.AddOfflineUserDataJobOperationsRequest = new AddOfflineUserDataJobOperationsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class OfflineUserDataJobOperation$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.OfflineUserDataJobOperation", [
{ no: 1, name: "create", kind: "message", oneof: "operation", T: () => offline_user_data_1.UserData },
{ no: 2, name: "remove", kind: "message", oneof: "operation", T: () => offline_user_data_1.UserData },
{ no: 3, name: "remove_all", kind: "scalar", oneof: "operation", T: 8 /*ScalarType.BOOL*/ }
]);
}
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.ads.googleads.v11.common.UserData create */ 1:
message.operation = {
oneofKind: "create",
create: offline_user_data_1.UserData.internalBinaryRead(reader, reader.uint32(), options, message.operation.create)
};
break;
case /* google.ads.googleads.v11.common.UserData remove */ 2:
message.operation = {
oneofKind: "remove",
remove: offline_user_data_1.UserData.internalBinaryRead(reader, reader.uint32(), options, message.operation.remove)
};
break;
case /* bool remove_all */ 3:
message.operation = {
oneofKind: "removeAll",
removeAll: 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) {
/* google.ads.googleads.v11.common.UserData create = 1; */
if (message.operation.oneofKind === "create")
offline_user_data_1.UserData.internalBinaryWrite(message.operation.create, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.ads.googleads.v11.common.UserData remove = 2; */
if (message.operation.oneofKind === "remove")
offline_user_data_1.UserData.internalBinaryWrite(message.operation.remove, writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* bool remove_all = 3; */
if (message.operation.oneofKind === "removeAll")
writer.tag(3, runtime_1.WireType.Varint).bool(message.operation.removeAll);
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.OfflineUserDataJobOperation
*/
exports.OfflineUserDataJobOperation = new OfflineUserDataJobOperation$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AddOfflineUserDataJobOperationsResponse$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.AddOfflineUserDataJobOperationsResponse", [
{ no: 1, name: "partial_failure_error", kind: "message", T: () => status_1.Status },
{ no: 2, name: "warning", kind: "message", T: () => status_1.Status }
]);
}
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 /* google.rpc.Status partial_failure_error */ 1:
message.partialFailureError = status_1.Status.internalBinaryRead(reader, reader.uint32(), options, message.partialFailureError);
break;
case /* google.rpc.Status warning */ 2:
message.warning = status_1.Status.internalBinaryRead(reader, reader.uint32(), options, message.warning);
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.rpc.Status partial_failure_error = 1; */
if (message.partialFailureError)
status_1.Status.internalBinaryWrite(message.partialFailureError, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.rpc.Status warning = 2; */
if (message.warning)
status_1.Status.internalBinaryWrite(message.warning, 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.AddOfflineUserDataJobOperationsResponse
*/
exports.AddOfflineUserDataJobOperationsResponse = new AddOfflineUserDataJobOperationsResponse$Type();
/**
* @generated ServiceType for protobuf service google.ads.googleads.v11.services.OfflineUserDataJobService
*/
exports.OfflineUserDataJobService = new runtime_rpc_1.ServiceType("google.ads.googleads.v11.services.OfflineUserDataJobService", [
{ name: "CreateOfflineUserDataJob", options: { "google.api.http": { post: "/v11/customers/{customer_id=*}/offlineUserDataJobs:create", body: "*" }, "google.api.method_signature": ["customer_id,job"] }, I: exports.CreateOfflineUserDataJobRequest, O: exports.CreateOfflineUserDataJobResponse },
{ name: "AddOfflineUserDataJobOperations", options: { "google.api.http": { post: "/v11/{resource_name=customers/*/offlineUserDataJobs/*}:addOperations", body: "*" }, "google.api.method_signature": ["resource_name,operations"] }, I: exports.AddOfflineUserDataJobOperationsRequest, O: exports.AddOfflineUserDataJobOperationsResponse },
{ name: "RunOfflineUserDataJob", options: { "google.api.http": { post: "/v11/{resource_name=customers/*/offlineUserDataJobs/*}:run", body: "*" }, "google.api.method_signature": ["resource_name"], "google.longrunning.operation_info": { responseType: "google.protobuf.Empty", metadataType: "google.ads.googleads.v11.resources.OfflineUserDataJobMetadata" } }, I: exports.RunOfflineUserDataJobRequest, O: operations_1.Operation }
], { "google.api.default_host": "googleads.googleapis.com", "google.api.oauth_scopes": "https://www.googleapis.com/auth/adwords" });
//# sourceMappingURL=offline_user_data_job_service.js.map