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.

243 lines 12.9 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BillingSetupService = exports.MutateBillingSetupResult = exports.MutateBillingSetupResponse = exports.BillingSetupOperation = exports.MutateBillingSetupRequest = void 0; // @generated by protobuf-ts 2.8.1 // @generated from protobuf file "ads/services/billing_setup_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 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 billing_setup_1 = require("../resources/billing_setup"); // @generated message type with reflection information, may provide speed optimized methods class MutateBillingSetupRequest$Type extends runtime_5.MessageType { constructor() { super("google.ads.googleads.v11.services.MutateBillingSetupRequest", [ { no: 1, name: "customer_id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } }, { no: 2, name: "operation", kind: "message", T: () => exports.BillingSetupOperation, options: { "google.api.field_behavior": ["REQUIRED"] } } ]); } create(value) { const message = { customerId: "" }; 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.services.BillingSetupOperation operation */ 2: message.operation = exports.BillingSetupOperation.internalBinaryRead(reader, reader.uint32(), options, message.operation); 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.services.BillingSetupOperation operation = 2; */ if (message.operation) exports.BillingSetupOperation.internalBinaryWrite(message.operation, 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.MutateBillingSetupRequest */ exports.MutateBillingSetupRequest = new MutateBillingSetupRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class BillingSetupOperation$Type extends runtime_5.MessageType { constructor() { super("google.ads.googleads.v11.services.BillingSetupOperation", [ { no: 2, name: "create", kind: "message", oneof: "operation", T: () => billing_setup_1.BillingSetup }, { no: 1, name: "remove", kind: "scalar", oneof: "operation", T: 9 /*ScalarType.STRING*/, options: { "google.api.resource_reference": { type: "googleads.googleapis.com/BillingSetup" } } } ]); } 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.resources.BillingSetup create */ 2: message.operation = { oneofKind: "create", create: billing_setup_1.BillingSetup.internalBinaryRead(reader, reader.uint32(), options, message.operation.create) }; break; case /* string remove */ 1: message.operation = { oneofKind: "remove", remove: 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) { /* google.ads.googleads.v11.resources.BillingSetup create = 2; */ if (message.operation.oneofKind === "create") billing_setup_1.BillingSetup.internalBinaryWrite(message.operation.create, writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join(); /* string remove = 1; */ if (message.operation.oneofKind === "remove") writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.operation.remove); 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.BillingSetupOperation */ exports.BillingSetupOperation = new BillingSetupOperation$Type(); // @generated message type with reflection information, may provide speed optimized methods class MutateBillingSetupResponse$Type extends runtime_5.MessageType { constructor() { super("google.ads.googleads.v11.services.MutateBillingSetupResponse", [ { no: 1, name: "result", kind: "message", T: () => exports.MutateBillingSetupResult } ]); } 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.ads.googleads.v11.services.MutateBillingSetupResult result */ 1: message.result = exports.MutateBillingSetupResult.internalBinaryRead(reader, reader.uint32(), options, message.result); 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.services.MutateBillingSetupResult result = 1; */ if (message.result) exports.MutateBillingSetupResult.internalBinaryWrite(message.result, writer.tag(1, 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.MutateBillingSetupResponse */ exports.MutateBillingSetupResponse = new MutateBillingSetupResponse$Type(); // @generated message type with reflection information, may provide speed optimized methods class MutateBillingSetupResult$Type extends runtime_5.MessageType { constructor() { super("google.ads.googleads.v11.services.MutateBillingSetupResult", [ { no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.resource_reference": { type: "googleads.googleapis.com/BillingSetup" } } } ]); } 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.MutateBillingSetupResult */ exports.MutateBillingSetupResult = new MutateBillingSetupResult$Type(); /** * @generated ServiceType for protobuf service google.ads.googleads.v11.services.BillingSetupService */ exports.BillingSetupService = new runtime_rpc_1.ServiceType("google.ads.googleads.v11.services.BillingSetupService", [ { name: "MutateBillingSetup", options: { "google.api.http": { post: "/v11/customers/{customer_id=*}/billingSetups:mutate", body: "*" }, "google.api.method_signature": ["customer_id,operation"] }, I: exports.MutateBillingSetupRequest, O: exports.MutateBillingSetupResponse } ], { "google.api.default_host": "googleads.googleapis.com", "google.api.oauth_scopes": "https://www.googleapis.com/auth/adwords" }); //# sourceMappingURL=billing_setup_service.js.map