@htdangkhoa/google-ads
Version:
Google Ads API client for Node.js
122 lines (121 loc) • 4.91 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/resources/qualifying_question.proto
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.QualifyingQuestion = void 0;
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const minimal_js_1 = __importDefault(require("protobufjs/minimal.js"));
function createBaseQualifyingQuestion() {
return { resource_name: "", qualifying_question_id: "0", locale: "", text: "" };
}
exports.QualifyingQuestion = {
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.qualifying_question_id !== undefined && message.qualifying_question_id !== "0") {
writer.uint32(16).int64(message.qualifying_question_id);
}
if (message.locale !== undefined && message.locale !== "") {
writer.uint32(26).string(message.locale);
}
if (message.text !== undefined && message.text !== "") {
writer.uint32(34).string(message.text);
}
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 = createBaseQualifyingQuestion();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.resource_name = reader.string();
continue;
case 2:
if (tag !== 16) {
break;
}
message.qualifying_question_id = longToString(reader.int64());
continue;
case 3:
if (tag !== 26) {
break;
}
message.locale = reader.string();
continue;
case 4:
if (tag !== 34) {
break;
}
message.text = reader.string();
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) : "",
qualifying_question_id: isSet(object.qualifying_question_id)
? globalThis.String(object.qualifying_question_id)
: "0",
locale: isSet(object.locale) ? globalThis.String(object.locale) : "",
text: isSet(object.text) ? globalThis.String(object.text) : "",
};
},
toJSON(message) {
const obj = {};
if (message.resource_name !== undefined && message.resource_name !== "") {
obj.resource_name = message.resource_name;
}
if (message.qualifying_question_id !== undefined && message.qualifying_question_id !== "0") {
obj.qualifying_question_id = message.qualifying_question_id;
}
if (message.locale !== undefined && message.locale !== "") {
obj.locale = message.locale;
}
if (message.text !== undefined && message.text !== "") {
obj.text = message.text;
}
return obj;
},
create(base) {
return exports.QualifyingQuestion.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c, _d;
const message = createBaseQualifyingQuestion();
message.resource_name = (_a = object.resource_name) !== null && _a !== void 0 ? _a : "";
message.qualifying_question_id = (_b = object.qualifying_question_id) !== null && _b !== void 0 ? _b : "0";
message.locale = (_c = object.locale) !== null && _c !== void 0 ? _c : "";
message.text = (_d = object.text) !== null && _d !== void 0 ? _d : "";
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;
}