google-ads-api-client
Version:
A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.
151 lines • 8.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvoiceService = exports.ListInvoicesResponse = exports.ListInvoicesRequest = void 0;
// @generated by protobuf-ts 2.8.1
// @generated from protobuf file "ads/services/invoice_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 invoice_1 = require("../resources/invoice");
const month_of_year_1 = require("../enums/month_of_year");
// @generated message type with reflection information, may provide speed optimized methods
class ListInvoicesRequest$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.ListInvoicesRequest", [
{ no: 1, name: "customer_id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 2, name: "billing_setup", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 3, name: "issue_year", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["REQUIRED"] } },
{ no: 4, name: "issue_month", kind: "enum", T: () => ["google.ads.googleads.v11.enums.MonthOfYearEnum.MonthOfYear", month_of_year_1.MonthOfYearEnum_MonthOfYear], options: { "google.api.field_behavior": ["REQUIRED"] } }
]);
}
create(value) {
const message = { customerId: "", billingSetup: "", issueYear: "", issueMonth: 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 customer_id */ 1:
message.customerId = reader.string();
break;
case /* string billing_setup */ 2:
message.billingSetup = reader.string();
break;
case /* string issue_year */ 3:
message.issueYear = reader.string();
break;
case /* google.ads.googleads.v11.enums.MonthOfYearEnum.MonthOfYear issue_month */ 4:
message.issueMonth = reader.int32();
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);
/* string billing_setup = 2; */
if (message.billingSetup !== "")
writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.billingSetup);
/* string issue_year = 3; */
if (message.issueYear !== "")
writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.issueYear);
/* google.ads.googleads.v11.enums.MonthOfYearEnum.MonthOfYear issue_month = 4; */
if (message.issueMonth !== 0)
writer.tag(4, runtime_1.WireType.Varint).int32(message.issueMonth);
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.ListInvoicesRequest
*/
exports.ListInvoicesRequest = new ListInvoicesRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListInvoicesResponse$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.services.ListInvoicesResponse", [
{ no: 1, name: "invoices", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => invoice_1.Invoice }
]);
}
create(value) {
const message = { invoices: [] };
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.ads.googleads.v11.resources.Invoice invoices */ 1:
message.invoices.push(invoice_1.Invoice.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.ads.googleads.v11.resources.Invoice invoices = 1; */
for (let i = 0; i < message.invoices.length; i++)
invoice_1.Invoice.internalBinaryWrite(message.invoices[i], 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.ListInvoicesResponse
*/
exports.ListInvoicesResponse = new ListInvoicesResponse$Type();
/**
* @generated ServiceType for protobuf service google.ads.googleads.v11.services.InvoiceService
*/
exports.InvoiceService = new runtime_rpc_1.ServiceType("google.ads.googleads.v11.services.InvoiceService", [
{ name: "ListInvoices", options: { "google.api.http": { get: "/v11/customers/{customer_id=*}/invoices" }, "google.api.method_signature": ["customer_id,billing_setup,issue_year,issue_month"] }, I: exports.ListInvoicesRequest, O: exports.ListInvoicesResponse }
], { "google.api.default_host": "googleads.googleapis.com", "google.api.oauth_scopes": "https://www.googleapis.com/auth/adwords" });
//# sourceMappingURL=invoice_service.js.map