UNPKG

@htdangkhoa/google-ads

Version:
136 lines (135 loc) 5.33 kB
"use strict"; // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.181.2 // protoc v3.21.12 // source: google/ads/googleads/v21/resources/currency_constant.proto var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CurrencyConstant = void 0; /* eslint-disable */ const long_1 = __importDefault(require("long")); const minimal_js_1 = __importDefault(require("protobufjs/minimal.js")); function createBaseCurrencyConstant() { return { resource_name: "", code: undefined, name: undefined, symbol: undefined, billable_unit_micros: undefined }; } exports.CurrencyConstant = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.resource_name !== undefined && message.resource_name !== "") { writer.uint32(10).string(message.resource_name); } if (message.code !== undefined) { writer.uint32(50).string(message.code); } if (message.name !== undefined) { writer.uint32(58).string(message.name); } if (message.symbol !== undefined) { writer.uint32(66).string(message.symbol); } if (message.billable_unit_micros !== undefined) { writer.uint32(72).int64(message.billable_unit_micros); } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCurrencyConstant(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.resource_name = reader.string(); continue; case 6: if (tag !== 50) { break; } message.code = reader.string(); continue; case 7: if (tag !== 58) { break; } message.name = reader.string(); continue; case 8: if (tag !== 66) { break; } message.symbol = reader.string(); continue; case 9: if (tag !== 72) { break; } message.billable_unit_micros = longToString(reader.int64()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { resource_name: isSet(object.resource_name) ? globalThis.String(object.resource_name) : "", code: isSet(object.code) ? globalThis.String(object.code) : undefined, name: isSet(object.name) ? globalThis.String(object.name) : undefined, symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : undefined, billable_unit_micros: isSet(object.billable_unit_micros) ? globalThis.String(object.billable_unit_micros) : undefined, }; }, toJSON(message) { const obj = {}; if (message.resource_name !== undefined && message.resource_name !== "") { obj.resource_name = message.resource_name; } if (message.code !== undefined) { obj.code = message.code; } if (message.name !== undefined) { obj.name = message.name; } if (message.symbol !== undefined) { obj.symbol = message.symbol; } if (message.billable_unit_micros !== undefined) { obj.billable_unit_micros = message.billable_unit_micros; } return obj; }, create(base) { return exports.CurrencyConstant.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b, _c, _d, _e; const message = createBaseCurrencyConstant(); message.resource_name = (_a = object.resource_name) !== null && _a !== void 0 ? _a : ""; message.code = (_b = object.code) !== null && _b !== void 0 ? _b : undefined; message.name = (_c = object.name) !== null && _c !== void 0 ? _c : undefined; message.symbol = (_d = object.symbol) !== null && _d !== void 0 ? _d : undefined; message.billable_unit_micros = (_e = object.billable_unit_micros) !== null && _e !== void 0 ? _e : undefined; return message; }, }; function longToString(long) { return long.toString(); } if (minimal_js_1.default.util.Long !== long_1.default) { minimal_js_1.default.util.Long = long_1.default; minimal_js_1.default.configure(); } function isSet(value) { return value !== null && value !== undefined; }