UNPKG

@htdangkhoa/google-ads

Version:
221 lines (220 loc) 9.28 kB
// 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/click_view.proto /* eslint-disable */ import Long from "long"; import _m0 from "protobufjs/minimal.js"; import { ClickLocation } from "../common/click_location.js"; import { KeywordInfo } from "../common/criteria.js"; function createBaseClickView() { return { resource_name: "", gclid: undefined, area_of_interest: undefined, location_of_presence: undefined, page_number: undefined, ad_group_ad: undefined, campaign_location_target: undefined, user_list: undefined, keyword: "", keyword_info: undefined, }; } export const ClickView = { encode(message, writer = _m0.Writer.create()) { if (message.resource_name !== undefined && message.resource_name !== "") { writer.uint32(10).string(message.resource_name); } if (message.gclid !== undefined) { writer.uint32(66).string(message.gclid); } if (message.area_of_interest !== undefined) { ClickLocation.encode(message.area_of_interest, writer.uint32(26).fork()).ldelim(); } if (message.location_of_presence !== undefined) { ClickLocation.encode(message.location_of_presence, writer.uint32(34).fork()).ldelim(); } if (message.page_number !== undefined) { writer.uint32(72).int64(message.page_number); } if (message.ad_group_ad !== undefined) { writer.uint32(82).string(message.ad_group_ad); } if (message.campaign_location_target !== undefined) { writer.uint32(90).string(message.campaign_location_target); } if (message.user_list !== undefined) { writer.uint32(98).string(message.user_list); } if (message.keyword !== undefined && message.keyword !== "") { writer.uint32(106).string(message.keyword); } if (message.keyword_info !== undefined) { KeywordInfo.encode(message.keyword_info, 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 = createBaseClickView(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.resource_name = reader.string(); continue; case 8: if (tag !== 66) { break; } message.gclid = reader.string(); continue; case 3: if (tag !== 26) { break; } message.area_of_interest = ClickLocation.decode(reader, reader.uint32()); continue; case 4: if (tag !== 34) { break; } message.location_of_presence = ClickLocation.decode(reader, reader.uint32()); continue; case 9: if (tag !== 72) { break; } message.page_number = longToString(reader.int64()); continue; case 10: if (tag !== 82) { break; } message.ad_group_ad = reader.string(); continue; case 11: if (tag !== 90) { break; } message.campaign_location_target = reader.string(); continue; case 12: if (tag !== 98) { break; } message.user_list = reader.string(); continue; case 13: if (tag !== 106) { break; } message.keyword = reader.string(); continue; case 14: if (tag !== 114) { break; } message.keyword_info = KeywordInfo.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) : "", gclid: isSet(object.gclid) ? globalThis.String(object.gclid) : undefined, area_of_interest: isSet(object.area_of_interest) ? ClickLocation.fromJSON(object.area_of_interest) : undefined, location_of_presence: isSet(object.location_of_presence) ? ClickLocation.fromJSON(object.location_of_presence) : undefined, page_number: isSet(object.page_number) ? globalThis.String(object.page_number) : undefined, ad_group_ad: isSet(object.ad_group_ad) ? globalThis.String(object.ad_group_ad) : undefined, campaign_location_target: isSet(object.campaign_location_target) ? globalThis.String(object.campaign_location_target) : undefined, user_list: isSet(object.user_list) ? globalThis.String(object.user_list) : undefined, keyword: isSet(object.keyword) ? globalThis.String(object.keyword) : "", keyword_info: isSet(object.keyword_info) ? KeywordInfo.fromJSON(object.keyword_info) : undefined, }; }, toJSON(message) { const obj = {}; if (message.resource_name !== undefined && message.resource_name !== "") { obj.resource_name = message.resource_name; } if (message.gclid !== undefined) { obj.gclid = message.gclid; } if (message.area_of_interest !== undefined) { obj.area_of_interest = ClickLocation.toJSON(message.area_of_interest); } if (message.location_of_presence !== undefined) { obj.location_of_presence = ClickLocation.toJSON(message.location_of_presence); } if (message.page_number !== undefined) { obj.page_number = message.page_number; } if (message.ad_group_ad !== undefined) { obj.ad_group_ad = message.ad_group_ad; } if (message.campaign_location_target !== undefined) { obj.campaign_location_target = message.campaign_location_target; } if (message.user_list !== undefined) { obj.user_list = message.user_list; } if (message.keyword !== undefined && message.keyword !== "") { obj.keyword = message.keyword; } if (message.keyword_info !== undefined) { obj.keyword_info = KeywordInfo.toJSON(message.keyword_info); } return obj; }, create(base) { return ClickView.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b, _c, _d, _e, _f, _g; const message = createBaseClickView(); message.resource_name = (_a = object.resource_name) !== null && _a !== void 0 ? _a : ""; message.gclid = (_b = object.gclid) !== null && _b !== void 0 ? _b : undefined; message.area_of_interest = (object.area_of_interest !== undefined && object.area_of_interest !== null) ? ClickLocation.fromPartial(object.area_of_interest) : undefined; message.location_of_presence = (object.location_of_presence !== undefined && object.location_of_presence !== null) ? ClickLocation.fromPartial(object.location_of_presence) : undefined; message.page_number = (_c = object.page_number) !== null && _c !== void 0 ? _c : undefined; message.ad_group_ad = (_d = object.ad_group_ad) !== null && _d !== void 0 ? _d : undefined; message.campaign_location_target = (_e = object.campaign_location_target) !== null && _e !== void 0 ? _e : undefined; message.user_list = (_f = object.user_list) !== null && _f !== void 0 ? _f : undefined; message.keyword = (_g = object.keyword) !== null && _g !== void 0 ? _g : ""; message.keyword_info = (object.keyword_info !== undefined && object.keyword_info !== null) ? KeywordInfo.fromPartial(object.keyword_info) : undefined; 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; }