@htdangkhoa/google-ads
Version:
Google Ads API client for Node.js
126 lines (125 loc) • 4.82 kB
JavaScript
;
// 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/v19/common/click_location.proto
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClickLocation = void 0;
/* eslint-disable */
const minimal_js_1 = __importDefault(require("protobufjs/minimal.js"));
function createBaseClickLocation() {
return { city: undefined, country: undefined, metro: undefined, most_specific: undefined, region: undefined };
}
exports.ClickLocation = {
encode(message, writer = minimal_js_1.default.Writer.create()) {
if (message.city !== undefined) {
writer.uint32(50).string(message.city);
}
if (message.country !== undefined) {
writer.uint32(58).string(message.country);
}
if (message.metro !== undefined) {
writer.uint32(66).string(message.metro);
}
if (message.most_specific !== undefined) {
writer.uint32(74).string(message.most_specific);
}
if (message.region !== undefined) {
writer.uint32(82).string(message.region);
}
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 = createBaseClickLocation();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 6:
if (tag !== 50) {
break;
}
message.city = reader.string();
continue;
case 7:
if (tag !== 58) {
break;
}
message.country = reader.string();
continue;
case 8:
if (tag !== 66) {
break;
}
message.metro = reader.string();
continue;
case 9:
if (tag !== 74) {
break;
}
message.most_specific = reader.string();
continue;
case 10:
if (tag !== 82) {
break;
}
message.region = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
city: isSet(object.city) ? globalThis.String(object.city) : undefined,
country: isSet(object.country) ? globalThis.String(object.country) : undefined,
metro: isSet(object.metro) ? globalThis.String(object.metro) : undefined,
most_specific: isSet(object.most_specific) ? globalThis.String(object.most_specific) : undefined,
region: isSet(object.region) ? globalThis.String(object.region) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.city !== undefined) {
obj.city = message.city;
}
if (message.country !== undefined) {
obj.country = message.country;
}
if (message.metro !== undefined) {
obj.metro = message.metro;
}
if (message.most_specific !== undefined) {
obj.most_specific = message.most_specific;
}
if (message.region !== undefined) {
obj.region = message.region;
}
return obj;
},
create(base) {
return exports.ClickLocation.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c, _d, _e;
const message = createBaseClickLocation();
message.city = (_a = object.city) !== null && _a !== void 0 ? _a : undefined;
message.country = (_b = object.country) !== null && _b !== void 0 ? _b : undefined;
message.metro = (_c = object.metro) !== null && _c !== void 0 ? _c : undefined;
message.most_specific = (_d = object.most_specific) !== null && _d !== void 0 ? _d : undefined;
message.region = (_e = object.region) !== null && _e !== void 0 ? _e : undefined;
return message;
},
};
function isSet(value) {
return value !== null && value !== undefined;
}