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.

373 lines 19.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MapValue_Entry = exports.MapValue = exports.ListValue = exports.EnumValue = exports.Value = 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 any_1 = require("../../../protobuf/any"); const struct_1 = require("../../../protobuf/struct"); // @generated message type with reflection information, may provide speed optimized methods class Value$Type extends runtime_5.MessageType { constructor() { super("google.api.expr.v1alpha1.Value", [ { no: 1, name: "null_value", kind: "enum", oneof: "kind", T: () => ["google.protobuf.NullValue", struct_1.NullValue] }, { no: 2, name: "bool_value", kind: "scalar", oneof: "kind", T: 8 /*ScalarType.BOOL*/ }, { no: 3, name: "int64_value", kind: "scalar", oneof: "kind", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "uint64_value", kind: "scalar", oneof: "kind", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 5, name: "double_value", kind: "scalar", oneof: "kind", T: 1 /*ScalarType.DOUBLE*/ }, { no: 6, name: "string_value", kind: "scalar", oneof: "kind", T: 9 /*ScalarType.STRING*/ }, { no: 7, name: "bytes_value", kind: "scalar", oneof: "kind", T: 12 /*ScalarType.BYTES*/ }, { no: 9, name: "enum_value", kind: "message", oneof: "kind", T: () => exports.EnumValue }, { no: 10, name: "object_value", kind: "message", oneof: "kind", T: () => any_1.Any }, { no: 11, name: "map_value", kind: "message", oneof: "kind", T: () => exports.MapValue }, { no: 12, name: "list_value", kind: "message", oneof: "kind", T: () => exports.ListValue }, { no: 15, name: "type_value", kind: "scalar", oneof: "kind", T: 9 /*ScalarType.STRING*/ } ]); } create(value) { const message = { kind: { 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.protobuf.NullValue null_value */ 1: message.kind = { oneofKind: "nullValue", nullValue: reader.int32() }; break; case /* bool bool_value */ 2: message.kind = { oneofKind: "boolValue", boolValue: reader.bool() }; break; case /* int64 int64_value */ 3: message.kind = { oneofKind: "int64Value", int64Value: reader.int64().toBigInt() }; break; case /* uint64 uint64_value */ 4: message.kind = { oneofKind: "uint64Value", uint64Value: reader.uint64().toBigInt() }; break; case /* double double_value */ 5: message.kind = { oneofKind: "doubleValue", doubleValue: reader.double() }; break; case /* string string_value */ 6: message.kind = { oneofKind: "stringValue", stringValue: reader.string() }; break; case /* bytes bytes_value */ 7: message.kind = { oneofKind: "bytesValue", bytesValue: reader.bytes() }; break; case /* google.api.expr.v1alpha1.EnumValue enum_value */ 9: message.kind = { oneofKind: "enumValue", enumValue: exports.EnumValue.internalBinaryRead(reader, reader.uint32(), options, message.kind.enumValue) }; break; case /* google.protobuf.Any object_value */ 10: message.kind = { oneofKind: "objectValue", objectValue: any_1.Any.internalBinaryRead(reader, reader.uint32(), options, message.kind.objectValue) }; break; case /* google.api.expr.v1alpha1.MapValue map_value */ 11: message.kind = { oneofKind: "mapValue", mapValue: exports.MapValue.internalBinaryRead(reader, reader.uint32(), options, message.kind.mapValue) }; break; case /* google.api.expr.v1alpha1.ListValue list_value */ 12: message.kind = { oneofKind: "listValue", listValue: exports.ListValue.internalBinaryRead(reader, reader.uint32(), options, message.kind.listValue) }; break; case /* string type_value */ 15: message.kind = { oneofKind: "typeValue", typeValue: 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.protobuf.NullValue null_value = 1; */ if (message.kind.oneofKind === "nullValue") writer.tag(1, runtime_1.WireType.Varint).int32(message.kind.nullValue); /* bool bool_value = 2; */ if (message.kind.oneofKind === "boolValue") writer.tag(2, runtime_1.WireType.Varint).bool(message.kind.boolValue); /* int64 int64_value = 3; */ if (message.kind.oneofKind === "int64Value") writer.tag(3, runtime_1.WireType.Varint).int64(message.kind.int64Value); /* uint64 uint64_value = 4; */ if (message.kind.oneofKind === "uint64Value") writer.tag(4, runtime_1.WireType.Varint).uint64(message.kind.uint64Value); /* double double_value = 5; */ if (message.kind.oneofKind === "doubleValue") writer.tag(5, runtime_1.WireType.Bit64).double(message.kind.doubleValue); /* string string_value = 6; */ if (message.kind.oneofKind === "stringValue") writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.kind.stringValue); /* bytes bytes_value = 7; */ if (message.kind.oneofKind === "bytesValue") writer.tag(7, runtime_1.WireType.LengthDelimited).bytes(message.kind.bytesValue); /* google.api.expr.v1alpha1.EnumValue enum_value = 9; */ if (message.kind.oneofKind === "enumValue") exports.EnumValue.internalBinaryWrite(message.kind.enumValue, writer.tag(9, runtime_1.WireType.LengthDelimited).fork(), options).join(); /* google.protobuf.Any object_value = 10; */ if (message.kind.oneofKind === "objectValue") any_1.Any.internalBinaryWrite(message.kind.objectValue, writer.tag(10, runtime_1.WireType.LengthDelimited).fork(), options).join(); /* google.api.expr.v1alpha1.MapValue map_value = 11; */ if (message.kind.oneofKind === "mapValue") exports.MapValue.internalBinaryWrite(message.kind.mapValue, writer.tag(11, runtime_1.WireType.LengthDelimited).fork(), options).join(); /* google.api.expr.v1alpha1.ListValue list_value = 12; */ if (message.kind.oneofKind === "listValue") exports.ListValue.internalBinaryWrite(message.kind.listValue, writer.tag(12, runtime_1.WireType.LengthDelimited).fork(), options).join(); /* string type_value = 15; */ if (message.kind.oneofKind === "typeValue") writer.tag(15, runtime_1.WireType.LengthDelimited).string(message.kind.typeValue); 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.api.expr.v1alpha1.Value */ exports.Value = new Value$Type(); // @generated message type with reflection information, may provide speed optimized methods class EnumValue$Type extends runtime_5.MessageType { constructor() { super("google.api.expr.v1alpha1.EnumValue", [ { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "value", kind: "scalar", T: 5 /*ScalarType.INT32*/ } ]); } create(value) { const message = { type: "", value: 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 type */ 1: message.type = reader.string(); break; case /* int32 value */ 2: message.value = 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 type = 1; */ if (message.type !== "") writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.type); /* int32 value = 2; */ if (message.value !== 0) writer.tag(2, runtime_1.WireType.Varint).int32(message.value); 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.api.expr.v1alpha1.EnumValue */ exports.EnumValue = new EnumValue$Type(); // @generated message type with reflection information, may provide speed optimized methods class ListValue$Type extends runtime_5.MessageType { constructor() { super("google.api.expr.v1alpha1.ListValue", [ { no: 1, name: "values", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.Value } ]); } create(value) { const message = { values: [] }; 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.api.expr.v1alpha1.Value values */ 1: message.values.push(exports.Value.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.api.expr.v1alpha1.Value values = 1; */ for (let i = 0; i < message.values.length; i++) exports.Value.internalBinaryWrite(message.values[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.api.expr.v1alpha1.ListValue */ exports.ListValue = new ListValue$Type(); // @generated message type with reflection information, may provide speed optimized methods class MapValue$Type extends runtime_5.MessageType { constructor() { super("google.api.expr.v1alpha1.MapValue", [ { no: 1, name: "entries", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.MapValue_Entry } ]); } create(value) { const message = { entries: [] }; 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.api.expr.v1alpha1.MapValue.Entry entries */ 1: message.entries.push(exports.MapValue_Entry.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.api.expr.v1alpha1.MapValue.Entry entries = 1; */ for (let i = 0; i < message.entries.length; i++) exports.MapValue_Entry.internalBinaryWrite(message.entries[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.api.expr.v1alpha1.MapValue */ exports.MapValue = new MapValue$Type(); // @generated message type with reflection information, may provide speed optimized methods class MapValue_Entry$Type extends runtime_5.MessageType { constructor() { super("google.api.expr.v1alpha1.MapValue.Entry", [ { no: 1, name: "key", kind: "message", T: () => exports.Value }, { no: 2, name: "value", kind: "message", T: () => exports.Value } ]); } 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.api.expr.v1alpha1.Value key */ 1: message.key = exports.Value.internalBinaryRead(reader, reader.uint32(), options, message.key); break; case /* google.api.expr.v1alpha1.Value value */ 2: message.value = exports.Value.internalBinaryRead(reader, reader.uint32(), options, message.value); 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.api.expr.v1alpha1.Value key = 1; */ if (message.key) exports.Value.internalBinaryWrite(message.key, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); /* google.api.expr.v1alpha1.Value value = 2; */ if (message.value) exports.Value.internalBinaryWrite(message.value, 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.api.expr.v1alpha1.MapValue.Entry */ exports.MapValue_Entry = new MapValue_Entry$Type(); //# sourceMappingURL=value.js.map