@htdangkhoa/google-ads
Version:
Google Ads API client for Node.js
841 lines (840 loc) • 38.9 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/resources/conversion_action.proto
/* eslint-disable */
import Long from "long";
import _m0 from "protobufjs/minimal.js";
import { TagSnippet } from "../common/tag_snippet.js";
import { attributionModelEnum_AttributionModelFromJSON, attributionModelEnum_AttributionModelToJSON, } from "../enums/attribution_model.js";
import { conversionActionCategoryEnum_ConversionActionCategoryFromJSON, conversionActionCategoryEnum_ConversionActionCategoryToJSON, } from "../enums/conversion_action_category.js";
import { conversionActionCountingTypeEnum_ConversionActionCountingTypeFromJSON, conversionActionCountingTypeEnum_ConversionActionCountingTypeToJSON, } from "../enums/conversion_action_counting_type.js";
import { conversionActionStatusEnum_ConversionActionStatusFromJSON, conversionActionStatusEnum_ConversionActionStatusToJSON, } from "../enums/conversion_action_status.js";
import { conversionActionTypeEnum_ConversionActionTypeFromJSON, conversionActionTypeEnum_ConversionActionTypeToJSON, } from "../enums/conversion_action_type.js";
import { conversionOriginEnum_ConversionOriginFromJSON, conversionOriginEnum_ConversionOriginToJSON, } from "../enums/conversion_origin.js";
import { dataDrivenModelStatusEnum_DataDrivenModelStatusFromJSON, dataDrivenModelStatusEnum_DataDrivenModelStatusToJSON, } from "../enums/data_driven_model_status.js";
import { mobileAppVendorEnum_MobileAppVendorFromJSON, mobileAppVendorEnum_MobileAppVendorToJSON, } from "../enums/mobile_app_vendor.js";
function createBaseConversionAction() {
return {
resource_name: "",
id: undefined,
name: undefined,
status: 0,
type: 0,
origin: 0,
primary_for_goal: undefined,
category: 0,
owner_customer: undefined,
include_in_conversions_metric: undefined,
click_through_lookback_window_days: undefined,
view_through_lookback_window_days: undefined,
value_settings: undefined,
counting_type: 0,
attribution_model_settings: undefined,
tag_snippets: [],
phone_call_duration_seconds: undefined,
app_id: undefined,
mobile_app_vendor: 0,
firebase_settings: undefined,
third_party_app_analytics_settings: undefined,
google_analytics_4_settings: undefined,
};
}
export const ConversionAction = {
encode(message, writer = _m0.Writer.create()) {
if (message.resource_name !== undefined && message.resource_name !== "") {
writer.uint32(10).string(message.resource_name);
}
if (message.id !== undefined) {
writer.uint32(168).int64(message.id);
}
if (message.name !== undefined) {
writer.uint32(178).string(message.name);
}
if (message.status !== undefined && message.status !== 0) {
writer.uint32(32).int32(message.status);
}
if (message.type !== undefined && message.type !== 0) {
writer.uint32(40).int32(message.type);
}
if (message.origin !== undefined && message.origin !== 0) {
writer.uint32(240).int32(message.origin);
}
if (message.primary_for_goal !== undefined) {
writer.uint32(248).bool(message.primary_for_goal);
}
if (message.category !== undefined && message.category !== 0) {
writer.uint32(48).int32(message.category);
}
if (message.owner_customer !== undefined) {
writer.uint32(186).string(message.owner_customer);
}
if (message.include_in_conversions_metric !== undefined) {
writer.uint32(192).bool(message.include_in_conversions_metric);
}
if (message.click_through_lookback_window_days !== undefined) {
writer.uint32(200).int64(message.click_through_lookback_window_days);
}
if (message.view_through_lookback_window_days !== undefined) {
writer.uint32(208).int64(message.view_through_lookback_window_days);
}
if (message.value_settings !== undefined) {
ConversionAction_ValueSettings.encode(message.value_settings, writer.uint32(90).fork()).ldelim();
}
if (message.counting_type !== undefined && message.counting_type !== 0) {
writer.uint32(96).int32(message.counting_type);
}
if (message.attribution_model_settings !== undefined) {
ConversionAction_AttributionModelSettings.encode(message.attribution_model_settings, writer.uint32(106).fork())
.ldelim();
}
if (message.tag_snippets !== undefined && message.tag_snippets.length !== 0) {
for (const v of message.tag_snippets) {
TagSnippet.encode(v, writer.uint32(114).fork()).ldelim();
}
}
if (message.phone_call_duration_seconds !== undefined) {
writer.uint32(216).int64(message.phone_call_duration_seconds);
}
if (message.app_id !== undefined) {
writer.uint32(226).string(message.app_id);
}
if (message.mobile_app_vendor !== undefined && message.mobile_app_vendor !== 0) {
writer.uint32(136).int32(message.mobile_app_vendor);
}
if (message.firebase_settings !== undefined) {
ConversionAction_FirebaseSettings.encode(message.firebase_settings, writer.uint32(146).fork()).ldelim();
}
if (message.third_party_app_analytics_settings !== undefined) {
ConversionAction_ThirdPartyAppAnalyticsSettings.encode(message.third_party_app_analytics_settings, writer.uint32(154).fork()).ldelim();
}
if (message.google_analytics_4_settings !== undefined) {
ConversionAction_GoogleAnalytics4Settings.encode(message.google_analytics_4_settings, writer.uint32(274).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 = createBaseConversionAction();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.resource_name = reader.string();
continue;
case 21:
if (tag !== 168) {
break;
}
message.id = longToString(reader.int64());
continue;
case 22:
if (tag !== 178) {
break;
}
message.name = reader.string();
continue;
case 4:
if (tag !== 32) {
break;
}
message.status = reader.int32();
continue;
case 5:
if (tag !== 40) {
break;
}
message.type = reader.int32();
continue;
case 30:
if (tag !== 240) {
break;
}
message.origin = reader.int32();
continue;
case 31:
if (tag !== 248) {
break;
}
message.primary_for_goal = reader.bool();
continue;
case 6:
if (tag !== 48) {
break;
}
message.category = reader.int32();
continue;
case 23:
if (tag !== 186) {
break;
}
message.owner_customer = reader.string();
continue;
case 24:
if (tag !== 192) {
break;
}
message.include_in_conversions_metric = reader.bool();
continue;
case 25:
if (tag !== 200) {
break;
}
message.click_through_lookback_window_days = longToString(reader.int64());
continue;
case 26:
if (tag !== 208) {
break;
}
message.view_through_lookback_window_days = longToString(reader.int64());
continue;
case 11:
if (tag !== 90) {
break;
}
message.value_settings = ConversionAction_ValueSettings.decode(reader, reader.uint32());
continue;
case 12:
if (tag !== 96) {
break;
}
message.counting_type = reader.int32();
continue;
case 13:
if (tag !== 106) {
break;
}
message.attribution_model_settings = ConversionAction_AttributionModelSettings.decode(reader, reader.uint32());
continue;
case 14:
if (tag !== 114) {
break;
}
message.tag_snippets.push(TagSnippet.decode(reader, reader.uint32()));
continue;
case 27:
if (tag !== 216) {
break;
}
message.phone_call_duration_seconds = longToString(reader.int64());
continue;
case 28:
if (tag !== 226) {
break;
}
message.app_id = reader.string();
continue;
case 17:
if (tag !== 136) {
break;
}
message.mobile_app_vendor = reader.int32();
continue;
case 18:
if (tag !== 146) {
break;
}
message.firebase_settings = ConversionAction_FirebaseSettings.decode(reader, reader.uint32());
continue;
case 19:
if (tag !== 154) {
break;
}
message.third_party_app_analytics_settings = ConversionAction_ThirdPartyAppAnalyticsSettings.decode(reader, reader.uint32());
continue;
case 34:
if (tag !== 274) {
break;
}
message.google_analytics_4_settings = ConversionAction_GoogleAnalytics4Settings.decode(reader, reader.uint32());
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) : "",
id: isSet(object.id) ? globalThis.String(object.id) : undefined,
name: isSet(object.name) ? globalThis.String(object.name) : undefined,
status: isSet(object.status) ? conversionActionStatusEnum_ConversionActionStatusFromJSON(object.status) : 0,
type: isSet(object.type) ? conversionActionTypeEnum_ConversionActionTypeFromJSON(object.type) : 0,
origin: isSet(object.origin) ? conversionOriginEnum_ConversionOriginFromJSON(object.origin) : 0,
primary_for_goal: isSet(object.primary_for_goal) ? globalThis.Boolean(object.primary_for_goal) : undefined,
category: isSet(object.category)
? conversionActionCategoryEnum_ConversionActionCategoryFromJSON(object.category)
: 0,
owner_customer: isSet(object.owner_customer) ? globalThis.String(object.owner_customer) : undefined,
include_in_conversions_metric: isSet(object.include_in_conversions_metric)
? globalThis.Boolean(object.include_in_conversions_metric)
: undefined,
click_through_lookback_window_days: isSet(object.click_through_lookback_window_days)
? globalThis.String(object.click_through_lookback_window_days)
: undefined,
view_through_lookback_window_days: isSet(object.view_through_lookback_window_days)
? globalThis.String(object.view_through_lookback_window_days)
: undefined,
value_settings: isSet(object.value_settings)
? ConversionAction_ValueSettings.fromJSON(object.value_settings)
: undefined,
counting_type: isSet(object.counting_type)
? conversionActionCountingTypeEnum_ConversionActionCountingTypeFromJSON(object.counting_type)
: 0,
attribution_model_settings: isSet(object.attribution_model_settings)
? ConversionAction_AttributionModelSettings.fromJSON(object.attribution_model_settings)
: undefined,
tag_snippets: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.tag_snippets)
? object.tag_snippets.map((e) => TagSnippet.fromJSON(e))
: [],
phone_call_duration_seconds: isSet(object.phone_call_duration_seconds)
? globalThis.String(object.phone_call_duration_seconds)
: undefined,
app_id: isSet(object.app_id) ? globalThis.String(object.app_id) : undefined,
mobile_app_vendor: isSet(object.mobile_app_vendor)
? mobileAppVendorEnum_MobileAppVendorFromJSON(object.mobile_app_vendor)
: 0,
firebase_settings: isSet(object.firebase_settings)
? ConversionAction_FirebaseSettings.fromJSON(object.firebase_settings)
: undefined,
third_party_app_analytics_settings: isSet(object.third_party_app_analytics_settings)
? ConversionAction_ThirdPartyAppAnalyticsSettings.fromJSON(object.third_party_app_analytics_settings)
: undefined,
google_analytics_4_settings: isSet(object.google_analytics_4_settings)
? ConversionAction_GoogleAnalytics4Settings.fromJSON(object.google_analytics_4_settings)
: undefined,
};
},
toJSON(message) {
var _a;
const obj = {};
if (message.resource_name !== undefined && message.resource_name !== "") {
obj.resource_name = message.resource_name;
}
if (message.id !== undefined) {
obj.id = message.id;
}
if (message.name !== undefined) {
obj.name = message.name;
}
if (message.status !== undefined && message.status !== 0) {
obj.status = conversionActionStatusEnum_ConversionActionStatusToJSON(message.status);
}
if (message.type !== undefined && message.type !== 0) {
obj.type = conversionActionTypeEnum_ConversionActionTypeToJSON(message.type);
}
if (message.origin !== undefined && message.origin !== 0) {
obj.origin = conversionOriginEnum_ConversionOriginToJSON(message.origin);
}
if (message.primary_for_goal !== undefined) {
obj.primary_for_goal = message.primary_for_goal;
}
if (message.category !== undefined && message.category !== 0) {
obj.category = conversionActionCategoryEnum_ConversionActionCategoryToJSON(message.category);
}
if (message.owner_customer !== undefined) {
obj.owner_customer = message.owner_customer;
}
if (message.include_in_conversions_metric !== undefined) {
obj.include_in_conversions_metric = message.include_in_conversions_metric;
}
if (message.click_through_lookback_window_days !== undefined) {
obj.click_through_lookback_window_days = message.click_through_lookback_window_days;
}
if (message.view_through_lookback_window_days !== undefined) {
obj.view_through_lookback_window_days = message.view_through_lookback_window_days;
}
if (message.value_settings !== undefined) {
obj.value_settings = ConversionAction_ValueSettings.toJSON(message.value_settings);
}
if (message.counting_type !== undefined && message.counting_type !== 0) {
obj.counting_type = conversionActionCountingTypeEnum_ConversionActionCountingTypeToJSON(message.counting_type);
}
if (message.attribution_model_settings !== undefined) {
obj.attribution_model_settings = ConversionAction_AttributionModelSettings.toJSON(message.attribution_model_settings);
}
if ((_a = message.tag_snippets) === null || _a === void 0 ? void 0 : _a.length) {
obj.tag_snippets = message.tag_snippets.map((e) => TagSnippet.toJSON(e));
}
if (message.phone_call_duration_seconds !== undefined) {
obj.phone_call_duration_seconds = message.phone_call_duration_seconds;
}
if (message.app_id !== undefined) {
obj.app_id = message.app_id;
}
if (message.mobile_app_vendor !== undefined && message.mobile_app_vendor !== 0) {
obj.mobile_app_vendor = mobileAppVendorEnum_MobileAppVendorToJSON(message.mobile_app_vendor);
}
if (message.firebase_settings !== undefined) {
obj.firebase_settings = ConversionAction_FirebaseSettings.toJSON(message.firebase_settings);
}
if (message.third_party_app_analytics_settings !== undefined) {
obj.third_party_app_analytics_settings = ConversionAction_ThirdPartyAppAnalyticsSettings.toJSON(message.third_party_app_analytics_settings);
}
if (message.google_analytics_4_settings !== undefined) {
obj.google_analytics_4_settings = ConversionAction_GoogleAnalytics4Settings.toJSON(message.google_analytics_4_settings);
}
return obj;
},
create(base) {
return ConversionAction.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
const message = createBaseConversionAction();
message.resource_name = (_a = object.resource_name) !== null && _a !== void 0 ? _a : "";
message.id = (_b = object.id) !== null && _b !== void 0 ? _b : undefined;
message.name = (_c = object.name) !== null && _c !== void 0 ? _c : undefined;
message.status = (_d = object.status) !== null && _d !== void 0 ? _d : 0;
message.type = (_e = object.type) !== null && _e !== void 0 ? _e : 0;
message.origin = (_f = object.origin) !== null && _f !== void 0 ? _f : 0;
message.primary_for_goal = (_g = object.primary_for_goal) !== null && _g !== void 0 ? _g : undefined;
message.category = (_h = object.category) !== null && _h !== void 0 ? _h : 0;
message.owner_customer = (_j = object.owner_customer) !== null && _j !== void 0 ? _j : undefined;
message.include_in_conversions_metric = (_k = object.include_in_conversions_metric) !== null && _k !== void 0 ? _k : undefined;
message.click_through_lookback_window_days = (_l = object.click_through_lookback_window_days) !== null && _l !== void 0 ? _l : undefined;
message.view_through_lookback_window_days = (_m = object.view_through_lookback_window_days) !== null && _m !== void 0 ? _m : undefined;
message.value_settings = (object.value_settings !== undefined && object.value_settings !== null)
? ConversionAction_ValueSettings.fromPartial(object.value_settings)
: undefined;
message.counting_type = (_o = object.counting_type) !== null && _o !== void 0 ? _o : 0;
message.attribution_model_settings =
(object.attribution_model_settings !== undefined && object.attribution_model_settings !== null)
? ConversionAction_AttributionModelSettings.fromPartial(object.attribution_model_settings)
: undefined;
message.tag_snippets = ((_p = object.tag_snippets) === null || _p === void 0 ? void 0 : _p.map((e) => TagSnippet.fromPartial(e))) || [];
message.phone_call_duration_seconds = (_q = object.phone_call_duration_seconds) !== null && _q !== void 0 ? _q : undefined;
message.app_id = (_r = object.app_id) !== null && _r !== void 0 ? _r : undefined;
message.mobile_app_vendor = (_s = object.mobile_app_vendor) !== null && _s !== void 0 ? _s : 0;
message.firebase_settings = (object.firebase_settings !== undefined && object.firebase_settings !== null)
? ConversionAction_FirebaseSettings.fromPartial(object.firebase_settings)
: undefined;
message.third_party_app_analytics_settings =
(object.third_party_app_analytics_settings !== undefined && object.third_party_app_analytics_settings !== null)
? ConversionAction_ThirdPartyAppAnalyticsSettings.fromPartial(object.third_party_app_analytics_settings)
: undefined;
message.google_analytics_4_settings =
(object.google_analytics_4_settings !== undefined && object.google_analytics_4_settings !== null)
? ConversionAction_GoogleAnalytics4Settings.fromPartial(object.google_analytics_4_settings)
: undefined;
return message;
},
};
function createBaseConversionAction_AttributionModelSettings() {
return { attribution_model: 0, data_driven_model_status: 0 };
}
export const ConversionAction_AttributionModelSettings = {
encode(message, writer = _m0.Writer.create()) {
if (message.attribution_model !== undefined && message.attribution_model !== 0) {
writer.uint32(8).int32(message.attribution_model);
}
if (message.data_driven_model_status !== undefined && message.data_driven_model_status !== 0) {
writer.uint32(16).int32(message.data_driven_model_status);
}
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 = createBaseConversionAction_AttributionModelSettings();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.attribution_model = reader.int32();
continue;
case 2:
if (tag !== 16) {
break;
}
message.data_driven_model_status = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
attribution_model: isSet(object.attribution_model)
? attributionModelEnum_AttributionModelFromJSON(object.attribution_model)
: 0,
data_driven_model_status: isSet(object.data_driven_model_status)
? dataDrivenModelStatusEnum_DataDrivenModelStatusFromJSON(object.data_driven_model_status)
: 0,
};
},
toJSON(message) {
const obj = {};
if (message.attribution_model !== undefined && message.attribution_model !== 0) {
obj.attribution_model = attributionModelEnum_AttributionModelToJSON(message.attribution_model);
}
if (message.data_driven_model_status !== undefined && message.data_driven_model_status !== 0) {
obj.data_driven_model_status = dataDrivenModelStatusEnum_DataDrivenModelStatusToJSON(message.data_driven_model_status);
}
return obj;
},
create(base) {
return ConversionAction_AttributionModelSettings.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseConversionAction_AttributionModelSettings();
message.attribution_model = (_a = object.attribution_model) !== null && _a !== void 0 ? _a : 0;
message.data_driven_model_status = (_b = object.data_driven_model_status) !== null && _b !== void 0 ? _b : 0;
return message;
},
};
function createBaseConversionAction_ValueSettings() {
return { default_value: undefined, default_currency_code: undefined, always_use_default_value: undefined };
}
export const ConversionAction_ValueSettings = {
encode(message, writer = _m0.Writer.create()) {
if (message.default_value !== undefined) {
writer.uint32(33).double(message.default_value);
}
if (message.default_currency_code !== undefined) {
writer.uint32(42).string(message.default_currency_code);
}
if (message.always_use_default_value !== undefined) {
writer.uint32(48).bool(message.always_use_default_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 = createBaseConversionAction_ValueSettings();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 4:
if (tag !== 33) {
break;
}
message.default_value = reader.double();
continue;
case 5:
if (tag !== 42) {
break;
}
message.default_currency_code = reader.string();
continue;
case 6:
if (tag !== 48) {
break;
}
message.always_use_default_value = reader.bool();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
default_value: isSet(object.default_value) ? globalThis.Number(object.default_value) : undefined,
default_currency_code: isSet(object.default_currency_code)
? globalThis.String(object.default_currency_code)
: undefined,
always_use_default_value: isSet(object.always_use_default_value)
? globalThis.Boolean(object.always_use_default_value)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.default_value !== undefined) {
obj.default_value = message.default_value;
}
if (message.default_currency_code !== undefined) {
obj.default_currency_code = message.default_currency_code;
}
if (message.always_use_default_value !== undefined) {
obj.always_use_default_value = message.always_use_default_value;
}
return obj;
},
create(base) {
return ConversionAction_ValueSettings.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c;
const message = createBaseConversionAction_ValueSettings();
message.default_value = (_a = object.default_value) !== null && _a !== void 0 ? _a : undefined;
message.default_currency_code = (_b = object.default_currency_code) !== null && _b !== void 0 ? _b : undefined;
message.always_use_default_value = (_c = object.always_use_default_value) !== null && _c !== void 0 ? _c : undefined;
return message;
},
};
function createBaseConversionAction_ThirdPartyAppAnalyticsSettings() {
return { event_name: undefined, provider_name: "" };
}
export const ConversionAction_ThirdPartyAppAnalyticsSettings = {
encode(message, writer = _m0.Writer.create()) {
if (message.event_name !== undefined) {
writer.uint32(18).string(message.event_name);
}
if (message.provider_name !== undefined && message.provider_name !== "") {
writer.uint32(26).string(message.provider_name);
}
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 = createBaseConversionAction_ThirdPartyAppAnalyticsSettings();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2:
if (tag !== 18) {
break;
}
message.event_name = reader.string();
continue;
case 3:
if (tag !== 26) {
break;
}
message.provider_name = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
event_name: isSet(object.event_name) ? globalThis.String(object.event_name) : undefined,
provider_name: isSet(object.provider_name) ? globalThis.String(object.provider_name) : "",
};
},
toJSON(message) {
const obj = {};
if (message.event_name !== undefined) {
obj.event_name = message.event_name;
}
if (message.provider_name !== undefined && message.provider_name !== "") {
obj.provider_name = message.provider_name;
}
return obj;
},
create(base) {
return ConversionAction_ThirdPartyAppAnalyticsSettings.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseConversionAction_ThirdPartyAppAnalyticsSettings();
message.event_name = (_a = object.event_name) !== null && _a !== void 0 ? _a : undefined;
message.provider_name = (_b = object.provider_name) !== null && _b !== void 0 ? _b : "";
return message;
},
};
function createBaseConversionAction_FirebaseSettings() {
return { event_name: undefined, project_id: undefined, property_id: "0", property_name: "" };
}
export const ConversionAction_FirebaseSettings = {
encode(message, writer = _m0.Writer.create()) {
if (message.event_name !== undefined) {
writer.uint32(26).string(message.event_name);
}
if (message.project_id !== undefined) {
writer.uint32(34).string(message.project_id);
}
if (message.property_id !== undefined && message.property_id !== "0") {
writer.uint32(40).int64(message.property_id);
}
if (message.property_name !== undefined && message.property_name !== "") {
writer.uint32(50).string(message.property_name);
}
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 = createBaseConversionAction_FirebaseSettings();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 3:
if (tag !== 26) {
break;
}
message.event_name = reader.string();
continue;
case 4:
if (tag !== 34) {
break;
}
message.project_id = reader.string();
continue;
case 5:
if (tag !== 40) {
break;
}
message.property_id = longToString(reader.int64());
continue;
case 6:
if (tag !== 50) {
break;
}
message.property_name = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
event_name: isSet(object.event_name) ? globalThis.String(object.event_name) : undefined,
project_id: isSet(object.project_id) ? globalThis.String(object.project_id) : undefined,
property_id: isSet(object.property_id) ? globalThis.String(object.property_id) : "0",
property_name: isSet(object.property_name) ? globalThis.String(object.property_name) : "",
};
},
toJSON(message) {
const obj = {};
if (message.event_name !== undefined) {
obj.event_name = message.event_name;
}
if (message.project_id !== undefined) {
obj.project_id = message.project_id;
}
if (message.property_id !== undefined && message.property_id !== "0") {
obj.property_id = message.property_id;
}
if (message.property_name !== undefined && message.property_name !== "") {
obj.property_name = message.property_name;
}
return obj;
},
create(base) {
return ConversionAction_FirebaseSettings.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c, _d;
const message = createBaseConversionAction_FirebaseSettings();
message.event_name = (_a = object.event_name) !== null && _a !== void 0 ? _a : undefined;
message.project_id = (_b = object.project_id) !== null && _b !== void 0 ? _b : undefined;
message.property_id = (_c = object.property_id) !== null && _c !== void 0 ? _c : "0";
message.property_name = (_d = object.property_name) !== null && _d !== void 0 ? _d : "";
return message;
},
};
function createBaseConversionAction_GoogleAnalytics4Settings() {
return { event_name: "", property_name: "", property_id: "0" };
}
export const ConversionAction_GoogleAnalytics4Settings = {
encode(message, writer = _m0.Writer.create()) {
if (message.event_name !== undefined && message.event_name !== "") {
writer.uint32(10).string(message.event_name);
}
if (message.property_name !== undefined && message.property_name !== "") {
writer.uint32(18).string(message.property_name);
}
if (message.property_id !== undefined && message.property_id !== "0") {
writer.uint32(24).int64(message.property_id);
}
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 = createBaseConversionAction_GoogleAnalytics4Settings();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.event_name = reader.string();
continue;
case 2:
if (tag !== 18) {
break;
}
message.property_name = reader.string();
continue;
case 3:
if (tag !== 24) {
break;
}
message.property_id = longToString(reader.int64());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
event_name: isSet(object.event_name) ? globalThis.String(object.event_name) : "",
property_name: isSet(object.property_name) ? globalThis.String(object.property_name) : "",
property_id: isSet(object.property_id) ? globalThis.String(object.property_id) : "0",
};
},
toJSON(message) {
const obj = {};
if (message.event_name !== undefined && message.event_name !== "") {
obj.event_name = message.event_name;
}
if (message.property_name !== undefined && message.property_name !== "") {
obj.property_name = message.property_name;
}
if (message.property_id !== undefined && message.property_id !== "0") {
obj.property_id = message.property_id;
}
return obj;
},
create(base) {
return ConversionAction_GoogleAnalytics4Settings.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c;
const message = createBaseConversionAction_GoogleAnalytics4Settings();
message.event_name = (_a = object.event_name) !== null && _a !== void 0 ? _a : "";
message.property_name = (_b = object.property_name) !== null && _b !== void 0 ? _b : "";
message.property_id = (_c = object.property_id) !== null && _c !== void 0 ? _c : "0";
return message;
},
};
function longToString(long) {
return long.toString();
}
if (_m0.util.Long !== Long) {
_m0.util.Long = Long;
_m0.configure();
}
function isSet(value) {
return value !== null && value !== undefined;
}