@htdangkhoa/google-ads
Version:
Google Ads API client for Node.js
80 lines (79 loc) • 2.85 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/v21/common/lifecycle_goals.proto
/* eslint-disable */
import _m0 from "protobufjs/minimal.js";
function createBaseLifecycleGoalValueSettings() {
return { value: undefined, high_lifetime_value: undefined };
}
export const LifecycleGoalValueSettings = {
encode(message, writer = _m0.Writer.create()) {
if (message.value !== undefined) {
writer.uint32(9).double(message.value);
}
if (message.high_lifetime_value !== undefined) {
writer.uint32(17).double(message.high_lifetime_value);
}
return writer;
},
decode(input, length) {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseLifecycleGoalValueSettings();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 9) {
break;
}
message.value = reader.double();
continue;
case 2:
if (tag !== 17) {
break;
}
message.high_lifetime_value = reader.double();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
value: isSet(object.value) ? globalThis.Number(object.value) : undefined,
high_lifetime_value: isSet(object.high_lifetime_value)
? globalThis.Number(object.high_lifetime_value)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.value !== undefined) {
obj.value = message.value;
}
if (message.high_lifetime_value !== undefined) {
obj.high_lifetime_value = message.high_lifetime_value;
}
return obj;
},
create(base) {
return LifecycleGoalValueSettings.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseLifecycleGoalValueSettings();
message.value = (_a = object.value) !== null && _a !== void 0 ? _a : undefined;
message.high_lifetime_value = (_b = object.high_lifetime_value) !== null && _b !== void 0 ? _b : undefined;
return message;
},
};
function isSet(value) {
return value !== null && value !== undefined;
}