@htdangkhoa/google-ads
Version:
Google Ads API client for Node.js
1,129 lines (1,128 loc) • 196 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/criteria.proto
/* eslint-disable */
import Long from "long";
import _m0 from "protobufjs/minimal.js";
import { ageRangeTypeEnum_AgeRangeTypeFromJSON, ageRangeTypeEnum_AgeRangeTypeToJSON, } from "../enums/age_range_type.js";
import { appPaymentModelTypeEnum_AppPaymentModelTypeFromJSON, appPaymentModelTypeEnum_AppPaymentModelTypeToJSON, } from "../enums/app_payment_model_type.js";
import { brandRequestRejectionReasonEnum_BrandRequestRejectionReasonFromJSON, brandRequestRejectionReasonEnum_BrandRequestRejectionReasonToJSON, } from "../enums/brand_request_rejection_reason.js";
import { brandStateEnum_BrandStateFromJSON, brandStateEnum_BrandStateToJSON, } from "../enums/brand_state.js";
import { contentLabelTypeEnum_ContentLabelTypeFromJSON, contentLabelTypeEnum_ContentLabelTypeToJSON, } from "../enums/content_label_type.js";
import { dayOfWeekEnum_DayOfWeekFromJSON, dayOfWeekEnum_DayOfWeekToJSON, } from "../enums/day_of_week.js";
import { deviceEnum_DeviceFromJSON, deviceEnum_DeviceToJSON } from "../enums/device.js";
import { genderTypeEnum_GenderTypeFromJSON, genderTypeEnum_GenderTypeToJSON, } from "../enums/gender_type.js";
import { hotelDateSelectionTypeEnum_HotelDateSelectionTypeFromJSON, hotelDateSelectionTypeEnum_HotelDateSelectionTypeToJSON, } from "../enums/hotel_date_selection_type.js";
import { incomeRangeTypeEnum_IncomeRangeTypeFromJSON, incomeRangeTypeEnum_IncomeRangeTypeToJSON, } from "../enums/income_range_type.js";
import { interactionTypeEnum_InteractionTypeFromJSON, interactionTypeEnum_InteractionTypeToJSON, } from "../enums/interaction_type.js";
import { keywordMatchTypeEnum_KeywordMatchTypeFromJSON, keywordMatchTypeEnum_KeywordMatchTypeToJSON, } from "../enums/keyword_match_type.js";
import { listingGroupTypeEnum_ListingGroupTypeFromJSON, listingGroupTypeEnum_ListingGroupTypeToJSON, } from "../enums/listing_group_type.js";
import { locationGroupRadiusUnitsEnum_LocationGroupRadiusUnitsFromJSON, locationGroupRadiusUnitsEnum_LocationGroupRadiusUnitsToJSON, } from "../enums/location_group_radius_units.js";
import { minuteOfHourEnum_MinuteOfHourFromJSON, minuteOfHourEnum_MinuteOfHourToJSON, } from "../enums/minute_of_hour.js";
import { parentalStatusTypeEnum_ParentalStatusTypeFromJSON, parentalStatusTypeEnum_ParentalStatusTypeToJSON, } from "../enums/parental_status_type.js";
import { productCategoryLevelEnum_ProductCategoryLevelFromJSON, productCategoryLevelEnum_ProductCategoryLevelToJSON, } from "../enums/product_category_level.js";
import { productChannelEnum_ProductChannelFromJSON, productChannelEnum_ProductChannelToJSON, } from "../enums/product_channel.js";
import { productChannelExclusivityEnum_ProductChannelExclusivityFromJSON, productChannelExclusivityEnum_ProductChannelExclusivityToJSON, } from "../enums/product_channel_exclusivity.js";
import { productConditionEnum_ProductConditionFromJSON, productConditionEnum_ProductConditionToJSON, } from "../enums/product_condition.js";
import { productCustomAttributeIndexEnum_ProductCustomAttributeIndexFromJSON, productCustomAttributeIndexEnum_ProductCustomAttributeIndexToJSON, } from "../enums/product_custom_attribute_index.js";
import { productTypeLevelEnum_ProductTypeLevelFromJSON, productTypeLevelEnum_ProductTypeLevelToJSON, } from "../enums/product_type_level.js";
import { proximityRadiusUnitsEnum_ProximityRadiusUnitsFromJSON, proximityRadiusUnitsEnum_ProximityRadiusUnitsToJSON, } from "../enums/proximity_radius_units.js";
import { webpageConditionOperandEnum_WebpageConditionOperandFromJSON, webpageConditionOperandEnum_WebpageConditionOperandToJSON, } from "../enums/webpage_condition_operand.js";
import { webpageConditionOperatorEnum_WebpageConditionOperatorFromJSON, webpageConditionOperatorEnum_WebpageConditionOperatorToJSON, } from "../enums/webpage_condition_operator.js";
function createBaseKeywordInfo() {
return { text: undefined, match_type: 0 };
}
export const KeywordInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.text !== undefined) {
writer.uint32(26).string(message.text);
}
if (message.match_type !== undefined && message.match_type !== 0) {
writer.uint32(16).int32(message.match_type);
}
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 = createBaseKeywordInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 3:
if (tag !== 26) {
break;
}
message.text = reader.string();
continue;
case 2:
if (tag !== 16) {
break;
}
message.match_type = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
text: isSet(object.text) ? globalThis.String(object.text) : undefined,
match_type: isSet(object.match_type) ? keywordMatchTypeEnum_KeywordMatchTypeFromJSON(object.match_type) : 0,
};
},
toJSON(message) {
const obj = {};
if (message.text !== undefined) {
obj.text = message.text;
}
if (message.match_type !== undefined && message.match_type !== 0) {
obj.match_type = keywordMatchTypeEnum_KeywordMatchTypeToJSON(message.match_type);
}
return obj;
},
create(base) {
return KeywordInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseKeywordInfo();
message.text = (_a = object.text) !== null && _a !== void 0 ? _a : undefined;
message.match_type = (_b = object.match_type) !== null && _b !== void 0 ? _b : 0;
return message;
},
};
function createBasePlacementInfo() {
return { url: undefined };
}
export const PlacementInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.url !== undefined) {
writer.uint32(18).string(message.url);
}
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 = createBasePlacementInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2:
if (tag !== 18) {
break;
}
message.url = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return { url: isSet(object.url) ? globalThis.String(object.url) : undefined };
},
toJSON(message) {
const obj = {};
if (message.url !== undefined) {
obj.url = message.url;
}
return obj;
},
create(base) {
return PlacementInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a;
const message = createBasePlacementInfo();
message.url = (_a = object.url) !== null && _a !== void 0 ? _a : undefined;
return message;
},
};
function createBaseNegativeKeywordListInfo() {
return { shared_set: undefined };
}
export const NegativeKeywordListInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.shared_set !== undefined) {
writer.uint32(10).string(message.shared_set);
}
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 = createBaseNegativeKeywordListInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.shared_set = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return { shared_set: isSet(object.shared_set) ? globalThis.String(object.shared_set) : undefined };
},
toJSON(message) {
const obj = {};
if (message.shared_set !== undefined) {
obj.shared_set = message.shared_set;
}
return obj;
},
create(base) {
return NegativeKeywordListInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a;
const message = createBaseNegativeKeywordListInfo();
message.shared_set = (_a = object.shared_set) !== null && _a !== void 0 ? _a : undefined;
return message;
},
};
function createBaseMobileAppCategoryInfo() {
return { mobile_app_category_constant: undefined };
}
export const MobileAppCategoryInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.mobile_app_category_constant !== undefined) {
writer.uint32(18).string(message.mobile_app_category_constant);
}
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 = createBaseMobileAppCategoryInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2:
if (tag !== 18) {
break;
}
message.mobile_app_category_constant = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
mobile_app_category_constant: isSet(object.mobile_app_category_constant)
? globalThis.String(object.mobile_app_category_constant)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.mobile_app_category_constant !== undefined) {
obj.mobile_app_category_constant = message.mobile_app_category_constant;
}
return obj;
},
create(base) {
return MobileAppCategoryInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a;
const message = createBaseMobileAppCategoryInfo();
message.mobile_app_category_constant = (_a = object.mobile_app_category_constant) !== null && _a !== void 0 ? _a : undefined;
return message;
},
};
function createBaseMobileApplicationInfo() {
return { app_id: undefined, name: undefined };
}
export const MobileApplicationInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.app_id !== undefined) {
writer.uint32(34).string(message.app_id);
}
if (message.name !== undefined) {
writer.uint32(42).string(message.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 = createBaseMobileApplicationInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 4:
if (tag !== 34) {
break;
}
message.app_id = reader.string();
continue;
case 5:
if (tag !== 42) {
break;
}
message.name = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
app_id: isSet(object.app_id) ? globalThis.String(object.app_id) : undefined,
name: isSet(object.name) ? globalThis.String(object.name) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.app_id !== undefined) {
obj.app_id = message.app_id;
}
if (message.name !== undefined) {
obj.name = message.name;
}
return obj;
},
create(base) {
return MobileApplicationInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseMobileApplicationInfo();
message.app_id = (_a = object.app_id) !== null && _a !== void 0 ? _a : undefined;
message.name = (_b = object.name) !== null && _b !== void 0 ? _b : undefined;
return message;
},
};
function createBaseLocationInfo() {
return { geo_target_constant: undefined };
}
export const LocationInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.geo_target_constant !== undefined) {
writer.uint32(18).string(message.geo_target_constant);
}
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 = createBaseLocationInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2:
if (tag !== 18) {
break;
}
message.geo_target_constant = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
geo_target_constant: isSet(object.geo_target_constant)
? globalThis.String(object.geo_target_constant)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.geo_target_constant !== undefined) {
obj.geo_target_constant = message.geo_target_constant;
}
return obj;
},
create(base) {
return LocationInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a;
const message = createBaseLocationInfo();
message.geo_target_constant = (_a = object.geo_target_constant) !== null && _a !== void 0 ? _a : undefined;
return message;
},
};
function createBaseDeviceInfo() {
return { type: 0 };
}
export const DeviceInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.type !== undefined && message.type !== 0) {
writer.uint32(8).int32(message.type);
}
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 = createBaseDeviceInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.type = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return { type: isSet(object.type) ? deviceEnum_DeviceFromJSON(object.type) : 0 };
},
toJSON(message) {
const obj = {};
if (message.type !== undefined && message.type !== 0) {
obj.type = deviceEnum_DeviceToJSON(message.type);
}
return obj;
},
create(base) {
return DeviceInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a;
const message = createBaseDeviceInfo();
message.type = (_a = object.type) !== null && _a !== void 0 ? _a : 0;
return message;
},
};
function createBaseListingGroupInfo() {
return { type: 0, case_value: undefined, parent_ad_group_criterion: undefined, path: undefined };
}
export const ListingGroupInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.type !== undefined && message.type !== 0) {
writer.uint32(8).int32(message.type);
}
if (message.case_value !== undefined) {
ListingDimensionInfo.encode(message.case_value, writer.uint32(18).fork()).ldelim();
}
if (message.parent_ad_group_criterion !== undefined) {
writer.uint32(34).string(message.parent_ad_group_criterion);
}
if (message.path !== undefined) {
ListingDimensionPath.encode(message.path, writer.uint32(42).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 = createBaseListingGroupInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.type = reader.int32();
continue;
case 2:
if (tag !== 18) {
break;
}
message.case_value = ListingDimensionInfo.decode(reader, reader.uint32());
continue;
case 4:
if (tag !== 34) {
break;
}
message.parent_ad_group_criterion = reader.string();
continue;
case 5:
if (tag !== 42) {
break;
}
message.path = ListingDimensionPath.decode(reader, reader.uint32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
type: isSet(object.type) ? listingGroupTypeEnum_ListingGroupTypeFromJSON(object.type) : 0,
case_value: isSet(object.case_value) ? ListingDimensionInfo.fromJSON(object.case_value) : undefined,
parent_ad_group_criterion: isSet(object.parent_ad_group_criterion)
? globalThis.String(object.parent_ad_group_criterion)
: undefined,
path: isSet(object.path) ? ListingDimensionPath.fromJSON(object.path) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.type !== undefined && message.type !== 0) {
obj.type = listingGroupTypeEnum_ListingGroupTypeToJSON(message.type);
}
if (message.case_value !== undefined) {
obj.case_value = ListingDimensionInfo.toJSON(message.case_value);
}
if (message.parent_ad_group_criterion !== undefined) {
obj.parent_ad_group_criterion = message.parent_ad_group_criterion;
}
if (message.path !== undefined) {
obj.path = ListingDimensionPath.toJSON(message.path);
}
return obj;
},
create(base) {
return ListingGroupInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseListingGroupInfo();
message.type = (_a = object.type) !== null && _a !== void 0 ? _a : 0;
message.case_value = (object.case_value !== undefined && object.case_value !== null)
? ListingDimensionInfo.fromPartial(object.case_value)
: undefined;
message.parent_ad_group_criterion = (_b = object.parent_ad_group_criterion) !== null && _b !== void 0 ? _b : undefined;
message.path = (object.path !== undefined && object.path !== null)
? ListingDimensionPath.fromPartial(object.path)
: undefined;
return message;
},
};
function createBaseListingDimensionPath() {
return { dimensions: [] };
}
export const ListingDimensionPath = {
encode(message, writer = _m0.Writer.create()) {
if (message.dimensions !== undefined && message.dimensions.length !== 0) {
for (const v of message.dimensions) {
ListingDimensionInfo.encode(v, 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 = createBaseListingDimensionPath();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.dimensions.push(ListingDimensionInfo.decode(reader, reader.uint32()));
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
dimensions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.dimensions)
? object.dimensions.map((e) => ListingDimensionInfo.fromJSON(e))
: [],
};
},
toJSON(message) {
var _a;
const obj = {};
if ((_a = message.dimensions) === null || _a === void 0 ? void 0 : _a.length) {
obj.dimensions = message.dimensions.map((e) => ListingDimensionInfo.toJSON(e));
}
return obj;
},
create(base) {
return ListingDimensionPath.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a;
const message = createBaseListingDimensionPath();
message.dimensions = ((_a = object.dimensions) === null || _a === void 0 ? void 0 : _a.map((e) => ListingDimensionInfo.fromPartial(e))) || [];
return message;
},
};
function createBaseListingScopeInfo() {
return { dimensions: [] };
}
export const ListingScopeInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.dimensions !== undefined && message.dimensions.length !== 0) {
for (const v of message.dimensions) {
ListingDimensionInfo.encode(v, writer.uint32(18).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 = createBaseListingScopeInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2:
if (tag !== 18) {
break;
}
message.dimensions.push(ListingDimensionInfo.decode(reader, reader.uint32()));
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
dimensions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.dimensions)
? object.dimensions.map((e) => ListingDimensionInfo.fromJSON(e))
: [],
};
},
toJSON(message) {
var _a;
const obj = {};
if ((_a = message.dimensions) === null || _a === void 0 ? void 0 : _a.length) {
obj.dimensions = message.dimensions.map((e) => ListingDimensionInfo.toJSON(e));
}
return obj;
},
create(base) {
return ListingScopeInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a;
const message = createBaseListingScopeInfo();
message.dimensions = ((_a = object.dimensions) === null || _a === void 0 ? void 0 : _a.map((e) => ListingDimensionInfo.fromPartial(e))) || [];
return message;
},
};
function createBaseListingDimensionInfo() {
return {
hotel_id: undefined,
hotel_class: undefined,
hotel_country_region: undefined,
hotel_state: undefined,
hotel_city: undefined,
product_category: undefined,
product_brand: undefined,
product_channel: undefined,
product_channel_exclusivity: undefined,
product_condition: undefined,
product_custom_attribute: undefined,
product_item_id: undefined,
product_type: undefined,
product_grouping: undefined,
product_labels: undefined,
product_legacy_condition: undefined,
product_type_full: undefined,
activity_id: undefined,
activity_rating: undefined,
activity_country: undefined,
activity_state: undefined,
activity_city: undefined,
unknown_listing_dimension: undefined,
};
}
export const ListingDimensionInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.hotel_id !== undefined) {
HotelIdInfo.encode(message.hotel_id, writer.uint32(18).fork()).ldelim();
}
if (message.hotel_class !== undefined) {
HotelClassInfo.encode(message.hotel_class, writer.uint32(26).fork()).ldelim();
}
if (message.hotel_country_region !== undefined) {
HotelCountryRegionInfo.encode(message.hotel_country_region, writer.uint32(34).fork()).ldelim();
}
if (message.hotel_state !== undefined) {
HotelStateInfo.encode(message.hotel_state, writer.uint32(42).fork()).ldelim();
}
if (message.hotel_city !== undefined) {
HotelCityInfo.encode(message.hotel_city, writer.uint32(50).fork()).ldelim();
}
if (message.product_category !== undefined) {
ProductCategoryInfo.encode(message.product_category, writer.uint32(194).fork()).ldelim();
}
if (message.product_brand !== undefined) {
ProductBrandInfo.encode(message.product_brand, writer.uint32(122).fork()).ldelim();
}
if (message.product_channel !== undefined) {
ProductChannelInfo.encode(message.product_channel, writer.uint32(66).fork()).ldelim();
}
if (message.product_channel_exclusivity !== undefined) {
ProductChannelExclusivityInfo.encode(message.product_channel_exclusivity, writer.uint32(74).fork()).ldelim();
}
if (message.product_condition !== undefined) {
ProductConditionInfo.encode(message.product_condition, writer.uint32(82).fork()).ldelim();
}
if (message.product_custom_attribute !== undefined) {
ProductCustomAttributeInfo.encode(message.product_custom_attribute, writer.uint32(130).fork()).ldelim();
}
if (message.product_item_id !== undefined) {
ProductItemIdInfo.encode(message.product_item_id, writer.uint32(90).fork()).ldelim();
}
if (message.product_type !== undefined) {
ProductTypeInfo.encode(message.product_type, writer.uint32(98).fork()).ldelim();
}
if (message.product_grouping !== undefined) {
ProductGroupingInfo.encode(message.product_grouping, writer.uint32(138).fork()).ldelim();
}
if (message.product_labels !== undefined) {
ProductLabelsInfo.encode(message.product_labels, writer.uint32(146).fork()).ldelim();
}
if (message.product_legacy_condition !== undefined) {
ProductLegacyConditionInfo.encode(message.product_legacy_condition, writer.uint32(154).fork()).ldelim();
}
if (message.product_type_full !== undefined) {
ProductTypeFullInfo.encode(message.product_type_full, writer.uint32(162).fork()).ldelim();
}
if (message.activity_id !== undefined) {
ActivityIdInfo.encode(message.activity_id, writer.uint32(170).fork()).ldelim();
}
if (message.activity_rating !== undefined) {
ActivityRatingInfo.encode(message.activity_rating, writer.uint32(178).fork()).ldelim();
}
if (message.activity_country !== undefined) {
ActivityCountryInfo.encode(message.activity_country, writer.uint32(186).fork()).ldelim();
}
if (message.activity_state !== undefined) {
ActivityStateInfo.encode(message.activity_state, writer.uint32(202).fork()).ldelim();
}
if (message.activity_city !== undefined) {
ActivityCityInfo.encode(message.activity_city, writer.uint32(210).fork()).ldelim();
}
if (message.unknown_listing_dimension !== undefined) {
UnknownListingDimensionInfo.encode(message.unknown_listing_dimension, writer.uint32(114).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 = createBaseListingDimensionInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2:
if (tag !== 18) {
break;
}
message.hotel_id = HotelIdInfo.decode(reader, reader.uint32());
continue;
case 3:
if (tag !== 26) {
break;
}
message.hotel_class = HotelClassInfo.decode(reader, reader.uint32());
continue;
case 4:
if (tag !== 34) {
break;
}
message.hotel_country_region = HotelCountryRegionInfo.decode(reader, reader.uint32());
continue;
case 5:
if (tag !== 42) {
break;
}
message.hotel_state = HotelStateInfo.decode(reader, reader.uint32());
continue;
case 6:
if (tag !== 50) {
break;
}
message.hotel_city = HotelCityInfo.decode(reader, reader.uint32());
continue;
case 24:
if (tag !== 194) {
break;
}
message.product_category = ProductCategoryInfo.decode(reader, reader.uint32());
continue;
case 15:
if (tag !== 122) {
break;
}
message.product_brand = ProductBrandInfo.decode(reader, reader.uint32());
continue;
case 8:
if (tag !== 66) {
break;
}
message.product_channel = ProductChannelInfo.decode(reader, reader.uint32());
continue;
case 9:
if (tag !== 74) {
break;
}
message.product_channel_exclusivity = ProductChannelExclusivityInfo.decode(reader, reader.uint32());
continue;
case 10:
if (tag !== 82) {
break;
}
message.product_condition = ProductConditionInfo.decode(reader, reader.uint32());
continue;
case 16:
if (tag !== 130) {
break;
}
message.product_custom_attribute = ProductCustomAttributeInfo.decode(reader, reader.uint32());
continue;
case 11:
if (tag !== 90) {
break;
}
message.product_item_id = ProductItemIdInfo.decode(reader, reader.uint32());
continue;
case 12:
if (tag !== 98) {
break;
}
message.product_type = ProductTypeInfo.decode(reader, reader.uint32());
continue;
case 17:
if (tag !== 138) {
break;
}
message.product_grouping = ProductGroupingInfo.decode(reader, reader.uint32());
continue;
case 18:
if (tag !== 146) {
break;
}
message.product_labels = ProductLabelsInfo.decode(reader, reader.uint32());
continue;
case 19:
if (tag !== 154) {
break;
}
message.product_legacy_condition = ProductLegacyConditionInfo.decode(reader, reader.uint32());
continue;
case 20:
if (tag !== 162) {
break;
}
message.product_type_full = ProductTypeFullInfo.decode(reader, reader.uint32());
continue;
case 21:
if (tag !== 170) {
break;
}
message.activity_id = ActivityIdInfo.decode(reader, reader.uint32());
continue;
case 22:
if (tag !== 178) {
break;
}
message.activity_rating = ActivityRatingInfo.decode(reader, reader.uint32());
continue;
case 23:
if (tag !== 186) {
break;
}
message.activity_country = ActivityCountryInfo.decode(reader, reader.uint32());
continue;
case 25:
if (tag !== 202) {
break;
}
message.activity_state = ActivityStateInfo.decode(reader, reader.uint32());
continue;
case 26:
if (tag !== 210) {
break;
}
message.activity_city = ActivityCityInfo.decode(reader, reader.uint32());
continue;
case 14:
if (tag !== 114) {
break;
}
message.unknown_listing_dimension = UnknownListingDimensionInfo.decode(reader, reader.uint32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
hotel_id: isSet(object.hotel_id) ? HotelIdInfo.fromJSON(object.hotel_id) : undefined,
hotel_class: isSet(object.hotel_class) ? HotelClassInfo.fromJSON(object.hotel_class) : undefined,
hotel_country_region: isSet(object.hotel_country_region)
? HotelCountryRegionInfo.fromJSON(object.hotel_country_region)
: undefined,
hotel_state: isSet(object.hotel_state) ? HotelStateInfo.fromJSON(object.hotel_state) : undefined,
hotel_city: isSet(object.hotel_city) ? HotelCityInfo.fromJSON(object.hotel_city) : undefined,
product_category: isSet(object.product_category)
? ProductCategoryInfo.fromJSON(object.product_category)
: undefined,
product_brand: isSet(object.product_brand) ? ProductBrandInfo.fromJSON(object.product_brand) : undefined,
product_channel: isSet(object.product_channel) ? ProductChannelInfo.fromJSON(object.product_channel) : undefined,
product_channel_exclusivity: isSet(object.product_channel_exclusivity)
? ProductChannelExclusivityInfo.fromJSON(object.product_channel_exclusivity)
: undefined,
product_condition: isSet(object.product_condition)
? ProductConditionInfo.fromJSON(object.product_condition)
: undefined,
product_custom_attribute: isSet(object.product_custom_attribute)
? ProductCustomAttributeInfo.fromJSON(object.product_custom_attribute)
: undefined,
product_item_id: isSet(object.product_item_id) ? ProductItemIdInfo.fromJSON(object.product_item_id) : undefined,
product_type: isSet(object.product_type) ? ProductTypeInfo.fromJSON(object.product_type) : undefined,
product_grouping: isSet(object.product_grouping)
? ProductGroupingInfo.fromJSON(object.product_grouping)
: undefined,
product_labels: isSet(object.product_labels) ? ProductLabelsInfo.fromJSON(object.product_labels) : undefined,
product_legacy_condition: isSet(object.product_legacy_condition)
? ProductLegacyConditionInfo.fromJSON(object.product_legacy_condition)
: undefined,
product_type_full: isSet(object.product_type_full)
? ProductTypeFullInfo.fromJSON(object.product_type_full)
: undefined,
activity_id: isSet(object.activity_id) ? ActivityIdInfo.fromJSON(object.activity_id) : undefined,
activity_rating: isSet(object.activity_rating) ? ActivityRatingInfo.fromJSON(object.activity_rating) : undefined,
activity_country: isSet(object.activity_country)
? ActivityCountryInfo.fromJSON(object.activity_country)
: undefined,
activity_state: isSet(object.activity_state) ? ActivityStateInfo.fromJSON(object.activity_state) : undefined,
activity_city: isSet(object.activity_city) ? ActivityCityInfo.fromJSON(object.activity_city) : undefined,
unknown_listing_dimension: isSet(object.unknown_listing_dimension)
? UnknownListingDimensionInfo.fromJSON(object.unknown_listing_dimension)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.hotel_id !== undefined) {
obj.hotel_id = HotelIdInfo.toJSON(message.hotel_id);
}
if (message.hotel_class !== undefined) {
obj.hotel_class = HotelClassInfo.toJSON(message.hotel_class);
}
if (message.hotel_country_region !== undefined) {
obj.hotel_country_region = HotelCountryRegionInfo.toJSON(message.hotel_country_region);
}
if (message.hotel_state !== undefined) {
obj.hotel_state = HotelStateInfo.toJSON(message.hotel_state);
}
if (message.hotel_city !== undefined) {
obj.hotel_city = HotelCityInfo.toJSON(message.hotel_city);
}
if (message.product_category !== undefined) {
obj.product_category = ProductCategoryInfo.toJSON(message.product_category);
}
if (message.product_brand !== undefined) {
obj.product_brand = ProductBrandInfo.toJSON(message.product_brand);
}
if (message.product_channel !== undefined) {
obj.product_channel = ProductChannelInfo.toJSON(message.product_channel);
}
if (message.product_channel_exclusivity !== undefined) {
obj.product_channel_exclusivity = ProductChannelExclusivityInfo.toJSON(message.product_channel_exclusivity);
}
if (message.product_condition !== undefined) {
obj.product_condition = ProductConditionInfo.toJSON(message.product_condition);
}
if (message.product_custom_attribute !== undefined) {
obj.product_custom_attribute = ProductCustomAttributeInfo.toJSON(message.product_custom_attribute);
}
if (message.product_item_id !== undefined) {
obj.product_item_id = ProductItemIdInfo.toJSON(message.product_item_id);
}
if (message.product_type !== undefined) {
obj.product_type = ProductTypeInfo.toJSON(message.product_type);
}
if (message.product_grouping !== undefined) {
obj.product_grouping = ProductGroupingInfo.toJSON(message.product_grouping);
}
if (message.product_labels !== undefined) {
obj.product_labels = ProductLabelsInfo.toJSON(message.product_labels);
}
if (message.product_legacy_condition !== undefined) {
obj.product_legacy_condition = ProductLegacyConditionInfo.toJSON(message.product_legacy_condition);
}
if (message.product_type_full !== undefined) {
obj.product_type_full = ProductTypeFullInfo.toJSON(message.product_type_full);
}
if (message.activity_id !== undefined) {
obj.activity_id = ActivityIdInfo.toJSON(message.activity_id);
}
if (message.activity_rating !== undefined) {
obj.activity_rating = ActivityRatingInfo.toJSON(message.activity_rating);
}
if (message.activity_country !== undefined) {
obj.activity_country = ActivityCountryInfo.toJSON(message.activity_country);
}
if (message.activity_state !== undefined) {
obj.activity_state = ActivityStateInfo.toJSON(message.activity_state);
}
if (message.activity_city !== undefined) {
obj.activity_city = ActivityCityInfo.toJSON(message.activity_city);
}
if (message.unknown_listing_dimension !== undefined) {
obj.unknown_listing_dimension = UnknownListingDimensionInfo.toJSON(message.unknown_listing_dimension);
}
return obj;
},
create(base) {
return ListingDimensionInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
const message = createBaseListingDimensionInfo();
message.hotel_id = (object.hotel_id !== undefined && object.hotel_id !== null)
? HotelIdInfo.fromPartial(object.hotel_id)
: undefined;
message.hotel_class = (object.hotel_class !== undefined && object.hotel_class !== null)
? HotelClassInfo.fromPartial(object.hotel_class)
: undefined;
message.hotel_country_region = (object.hotel_country_region !== undefined && object.hotel_country_region !== null)
? HotelCountryRegionInfo.fromPartial(object.hotel_country_region)
: undefined;
message.hotel_state = (object.hotel_state !== undefined && object.hotel_state !== null)
? HotelStateInfo.fromPartial(object.hotel_state)
: undefined;
message.hotel_city = (object.hotel_city !== undefined && object.hotel_city !== null)
? HotelCityInfo.fromPartial(object.hotel_city)
: undefined;
message.product_category = (object.product_category !== undefined && object.product_category !== null)
? ProductCategoryInfo.fromPartial(object.product_category)
: undefined;
message.product_brand = (object.product_brand !== undefined && object.product_brand !== null)
? ProductBrandInfo.fromPartial(object.product_brand)
: undefined;
message.product_channel = (object.product_channel !== undefined && object.product_channel !== null)
? ProductChannelInfo.fromPartial(object.product_channel)
: undefined;
message.product_channel_exclusivity =
(object.product_channel_exclusivity !== undefined && object.product_channel_exclusivity !== null)
? ProductChannelExclusivityInfo.fromPartial(object.product_channel_exclusivity)
: undefined;
message.product_condition = (object.product_condition !== undefined && object.product_condition !== null)
? ProductConditionInfo.fromPartial(object.product_condition)
: undefined;
message.product_custom_attribute =
(object.product_custom_attribute !== undefined && object.product_custom_attribute !== null)
? ProductCustomAttributeInfo.fromPartial(object.product_custom_attribute)
: undefined;
message.product_item_id = (object.product_item_id !== undefined && object.product_item_id !== null)
? ProductItemIdInfo.fromPartial(object.product_item_id)
: undefined;
message.product_type = (object.product_type !== undefined && object.product_type !== null)
? ProductTypeInfo.fromPartial(object.product_type)
: undefined;
message.product_grouping = (object.product_grouping !== undefined && object.product_grouping !== null)
? ProductGroupingInfo.fromPartial(object.product_grouping)
: undefined;
message.product_labels = (object.product_labels !== undefined && object.product_labels !== null)
? ProductLabelsInfo.fromPartial(object.product_labels)
: undefined;
message.product_legacy_condition =
(object.product_legacy_condition !== undefined && object.product_legacy_condition !== null)
? ProductLegacyConditionInfo.fromPartial(object.product_legacy_condition)
: undefined;
message.product_type_full = (object.product_type_full !== undefined && object.product_type_full !== null)
? ProductTypeFullInfo.fromPartial(object.product_type_full)
: undefined;
message.activity_id = (object.activity_id !== undefined && object.activity_id !== null)
? ActivityIdInfo.fromPartial(object.activity_id)
: undefined;
message.activity_rating = (object.activity_rating !== undefined && object.activity_rating !== null)
? ActivityRatingInfo.fromPartial(object.activity_rating)
: undefined;
message.activity_country = (object.activity_country !== undefined && object.activity_country !== null)
? ActivityCountryInfo.fromPartial(object.activity_country)
: undefined;
message.activity_state = (object.activity_state !== undefined && object.activity_state !== null)
? ActivityStateInfo.fromPartial(object.activity_state)
: undefined;
message.activity_city = (object.activity_city !== undefined && object.activity_city !== null)
? ActivityCityInfo.fromPartial(object.activity_city)
: undefined;
message.unknown_listing_dimension =
(object.unknown_listing_dimension !== undefined && object.unknown_listing_dimension !== null)
? UnknownListingDimensionInfo.fromPartial(object.unknown_listing_dimension)
: undefined;
return message;
},
};
function createBaseHotelIdInfo() {
return { value: undefined };
}
export const HotelIdInfo = {
encode(message, writer = _m0.Writer.create()) {
if (message.value !== undefined) {
writer.uint32(18).string(message.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 = createBaseHotelIdInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2:
if (tag !== 18) {
break;
}
message.value = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}