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.

217 lines 10.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ResourceReference = exports.ResourceDescriptor = exports.ResourceDescriptor_Style = exports.ResourceDescriptor_History = 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"); /** * A description of the historical or future-looking state of the * resource pattern. * * @generated from protobuf enum google.api.ResourceDescriptor.History */ var ResourceDescriptor_History; (function (ResourceDescriptor_History) { /** * The "unset" value. * * @generated from protobuf enum value: HISTORY_UNSPECIFIED = 0; */ ResourceDescriptor_History[ResourceDescriptor_History["HISTORY_UNSPECIFIED"] = 0] = "HISTORY_UNSPECIFIED"; /** * The resource originally had one pattern and launched as such, and * additional patterns were added later. * * @generated from protobuf enum value: ORIGINALLY_SINGLE_PATTERN = 1; */ ResourceDescriptor_History[ResourceDescriptor_History["ORIGINALLY_SINGLE_PATTERN"] = 1] = "ORIGINALLY_SINGLE_PATTERN"; /** * The resource has one pattern, but the API owner expects to add more * later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents * that from being necessary once there are multiple patterns.) * * @generated from protobuf enum value: FUTURE_MULTI_PATTERN = 2; */ ResourceDescriptor_History[ResourceDescriptor_History["FUTURE_MULTI_PATTERN"] = 2] = "FUTURE_MULTI_PATTERN"; })(ResourceDescriptor_History = exports.ResourceDescriptor_History || (exports.ResourceDescriptor_History = {})); /** * A flag representing a specific style that a resource claims to conform to. * * @generated from protobuf enum google.api.ResourceDescriptor.Style */ var ResourceDescriptor_Style; (function (ResourceDescriptor_Style) { /** * The unspecified value. Do not use. * * @generated from protobuf enum value: STYLE_UNSPECIFIED = 0; */ ResourceDescriptor_Style[ResourceDescriptor_Style["STYLE_UNSPECIFIED"] = 0] = "STYLE_UNSPECIFIED"; /** * This resource is intended to be "declarative-friendly". * * Declarative-friendly resources must be more strictly consistent, and * setting this to true communicates to tools that this resource should * adhere to declarative-friendly expectations. * * Note: This is used by the API linter (linter.aip.dev) to enable * additional checks. * * @generated from protobuf enum value: DECLARATIVE_FRIENDLY = 1; */ ResourceDescriptor_Style[ResourceDescriptor_Style["DECLARATIVE_FRIENDLY"] = 1] = "DECLARATIVE_FRIENDLY"; })(ResourceDescriptor_Style = exports.ResourceDescriptor_Style || (exports.ResourceDescriptor_Style = {})); // @generated message type with reflection information, may provide speed optimized methods class ResourceDescriptor$Type extends runtime_5.MessageType { constructor() { super("google.api.ResourceDescriptor", [ { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "pattern", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "name_field", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "history", kind: "enum", T: () => ["google.api.ResourceDescriptor.History", ResourceDescriptor_History] }, { no: 5, name: "plural", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 6, name: "singular", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 10, name: "style", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["google.api.ResourceDescriptor.Style", ResourceDescriptor_Style] } ]); } create(value) { const message = { type: "", pattern: [], nameField: "", history: 0, plural: "", singular: "", style: [] }; 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 type */ 1: message.type = reader.string(); break; case /* repeated string pattern */ 2: message.pattern.push(reader.string()); break; case /* string name_field */ 3: message.nameField = reader.string(); break; case /* google.api.ResourceDescriptor.History history */ 4: message.history = reader.int32(); break; case /* string plural */ 5: message.plural = reader.string(); break; case /* string singular */ 6: message.singular = reader.string(); break; case /* repeated google.api.ResourceDescriptor.Style style */ 10: if (wireType === runtime_2.WireType.LengthDelimited) for (let e = reader.int32() + reader.pos; reader.pos < e;) message.style.push(reader.int32()); else message.style.push(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_1.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message, writer, options) { /* string type = 1; */ if (message.type !== "") writer.tag(1, runtime_2.WireType.LengthDelimited).string(message.type); /* repeated string pattern = 2; */ for (let i = 0; i < message.pattern.length; i++) writer.tag(2, runtime_2.WireType.LengthDelimited).string(message.pattern[i]); /* string name_field = 3; */ if (message.nameField !== "") writer.tag(3, runtime_2.WireType.LengthDelimited).string(message.nameField); /* google.api.ResourceDescriptor.History history = 4; */ if (message.history !== 0) writer.tag(4, runtime_2.WireType.Varint).int32(message.history); /* string plural = 5; */ if (message.plural !== "") writer.tag(5, runtime_2.WireType.LengthDelimited).string(message.plural); /* string singular = 6; */ if (message.singular !== "") writer.tag(6, runtime_2.WireType.LengthDelimited).string(message.singular); /* repeated google.api.ResourceDescriptor.Style style = 10; */ if (message.style.length) { writer.tag(10, runtime_2.WireType.LengthDelimited).fork(); for (let i = 0; i < message.style.length; i++) writer.int32(message.style[i]); writer.join(); } let u = options.writeUnknownFields; if (u !== false) (u == true ? runtime_1.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message google.api.ResourceDescriptor */ exports.ResourceDescriptor = new ResourceDescriptor$Type(); // @generated message type with reflection information, may provide speed optimized methods class ResourceReference$Type extends runtime_5.MessageType { constructor() { super("google.api.ResourceReference", [ { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "child_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } create(value) { const message = { type: "", childType: "" }; 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 type */ 1: message.type = reader.string(); break; case /* string child_type */ 2: message.childType = 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_1.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message, writer, options) { /* string type = 1; */ if (message.type !== "") writer.tag(1, runtime_2.WireType.LengthDelimited).string(message.type); /* string child_type = 2; */ if (message.childType !== "") writer.tag(2, runtime_2.WireType.LengthDelimited).string(message.childType); let u = options.writeUnknownFields; if (u !== false) (u == true ? runtime_1.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message google.api.ResourceReference */ exports.ResourceReference = new ResourceReference$Type(); //# sourceMappingURL=resource.js.map