@htdangkhoa/google-ads
Version:
Google Ads API client for Node.js
105 lines (104 loc) • 3.59 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/v24/common/goal_setting.proto
/* eslint-disable */
import _m0 from "protobufjs/minimal.js";
import { CustomerLifecycleOptimizationValueSettings } from "./goal_common.js";
function createBaseGoalSetting() {
return {};
}
export const GoalSetting = {
encode(_, writer = _m0.Writer.create()) {
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 = createBaseGoalSetting();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return GoalSetting.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(_) {
const message = createBaseGoalSetting();
return message;
},
};
function createBaseGoalSetting_RetentionGoal() {
return { value_settings: undefined };
}
export const GoalSetting_RetentionGoal = {
encode(message, writer = _m0.Writer.create()) {
if (message.value_settings !== undefined) {
CustomerLifecycleOptimizationValueSettings.encode(message.value_settings, writer.uint32(10).fork()).ldelim();
}
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 = createBaseGoalSetting_RetentionGoal();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.value_settings = CustomerLifecycleOptimizationValueSettings.decode(reader, reader.uint32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
value_settings: isSet(object.value_settings)
? CustomerLifecycleOptimizationValueSettings.fromJSON(object.value_settings)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.value_settings !== undefined) {
obj.value_settings = CustomerLifecycleOptimizationValueSettings.toJSON(message.value_settings);
}
return obj;
},
create(base) {
return GoalSetting_RetentionGoal.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
const message = createBaseGoalSetting_RetentionGoal();
message.value_settings = (object.value_settings !== undefined && object.value_settings !== null)
? CustomerLifecycleOptimizationValueSettings.fromPartial(object.value_settings)
: undefined;
return message;
},
};
function isSet(value) {
return value !== null && value !== undefined;
}