UNPKG

@htdangkhoa/google-ads

Version:
266 lines (265 loc) 12.3 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/v21/resources/customer_negative_criterion.proto /* eslint-disable */ import Long from "long"; import _m0 from "protobufjs/minimal.js"; import { ContentLabelInfo, IpBlockInfo, MobileAppCategoryInfo, MobileApplicationInfo, NegativeKeywordListInfo, PlacementInfo, PlacementListInfo, YouTubeChannelInfo, YouTubeVideoInfo, } from "../common/criteria.js"; import { criterionTypeEnum_CriterionTypeFromJSON, criterionTypeEnum_CriterionTypeToJSON, } from "../enums/criterion_type.js"; function createBaseCustomerNegativeCriterion() { return { resource_name: "", id: undefined, type: 0, content_label: undefined, mobile_application: undefined, mobile_app_category: undefined, placement: undefined, youtube_video: undefined, youtube_channel: undefined, negative_keyword_list: undefined, ip_block: undefined, placement_list: undefined, }; } export const CustomerNegativeCriterion = { 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(80).int64(message.id); } if (message.type !== undefined && message.type !== 0) { writer.uint32(24).int32(message.type); } if (message.content_label !== undefined) { ContentLabelInfo.encode(message.content_label, writer.uint32(34).fork()).ldelim(); } if (message.mobile_application !== undefined) { MobileApplicationInfo.encode(message.mobile_application, writer.uint32(42).fork()).ldelim(); } if (message.mobile_app_category !== undefined) { MobileAppCategoryInfo.encode(message.mobile_app_category, writer.uint32(50).fork()).ldelim(); } if (message.placement !== undefined) { PlacementInfo.encode(message.placement, writer.uint32(58).fork()).ldelim(); } if (message.youtube_video !== undefined) { YouTubeVideoInfo.encode(message.youtube_video, writer.uint32(66).fork()).ldelim(); } if (message.youtube_channel !== undefined) { YouTubeChannelInfo.encode(message.youtube_channel, writer.uint32(74).fork()).ldelim(); } if (message.negative_keyword_list !== undefined) { NegativeKeywordListInfo.encode(message.negative_keyword_list, writer.uint32(90).fork()).ldelim(); } if (message.ip_block !== undefined) { IpBlockInfo.encode(message.ip_block, writer.uint32(98).fork()).ldelim(); } if (message.placement_list !== undefined) { PlacementListInfo.encode(message.placement_list, writer.uint32(106).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 = createBaseCustomerNegativeCriterion(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.resource_name = reader.string(); continue; case 10: if (tag !== 80) { break; } message.id = longToString(reader.int64()); continue; case 3: if (tag !== 24) { break; } message.type = reader.int32(); continue; case 4: if (tag !== 34) { break; } message.content_label = ContentLabelInfo.decode(reader, reader.uint32()); continue; case 5: if (tag !== 42) { break; } message.mobile_application = MobileApplicationInfo.decode(reader, reader.uint32()); continue; case 6: if (tag !== 50) { break; } message.mobile_app_category = MobileAppCategoryInfo.decode(reader, reader.uint32()); continue; case 7: if (tag !== 58) { break; } message.placement = PlacementInfo.decode(reader, reader.uint32()); continue; case 8: if (tag !== 66) { break; } message.youtube_video = YouTubeVideoInfo.decode(reader, reader.uint32()); continue; case 9: if (tag !== 74) { break; } message.youtube_channel = YouTubeChannelInfo.decode(reader, reader.uint32()); continue; case 11: if (tag !== 90) { break; } message.negative_keyword_list = NegativeKeywordListInfo.decode(reader, reader.uint32()); continue; case 12: if (tag !== 98) { break; } message.ip_block = IpBlockInfo.decode(reader, reader.uint32()); continue; case 13: if (tag !== 106) { break; } message.placement_list = PlacementListInfo.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, type: isSet(object.type) ? criterionTypeEnum_CriterionTypeFromJSON(object.type) : 0, content_label: isSet(object.content_label) ? ContentLabelInfo.fromJSON(object.content_label) : undefined, mobile_application: isSet(object.mobile_application) ? MobileApplicationInfo.fromJSON(object.mobile_application) : undefined, mobile_app_category: isSet(object.mobile_app_category) ? MobileAppCategoryInfo.fromJSON(object.mobile_app_category) : undefined, placement: isSet(object.placement) ? PlacementInfo.fromJSON(object.placement) : undefined, youtube_video: isSet(object.youtube_video) ? YouTubeVideoInfo.fromJSON(object.youtube_video) : undefined, youtube_channel: isSet(object.youtube_channel) ? YouTubeChannelInfo.fromJSON(object.youtube_channel) : undefined, negative_keyword_list: isSet(object.negative_keyword_list) ? NegativeKeywordListInfo.fromJSON(object.negative_keyword_list) : undefined, ip_block: isSet(object.ip_block) ? IpBlockInfo.fromJSON(object.ip_block) : undefined, placement_list: isSet(object.placement_list) ? PlacementListInfo.fromJSON(object.placement_list) : undefined, }; }, toJSON(message) { 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.type !== undefined && message.type !== 0) { obj.type = criterionTypeEnum_CriterionTypeToJSON(message.type); } if (message.content_label !== undefined) { obj.content_label = ContentLabelInfo.toJSON(message.content_label); } if (message.mobile_application !== undefined) { obj.mobile_application = MobileApplicationInfo.toJSON(message.mobile_application); } if (message.mobile_app_category !== undefined) { obj.mobile_app_category = MobileAppCategoryInfo.toJSON(message.mobile_app_category); } if (message.placement !== undefined) { obj.placement = PlacementInfo.toJSON(message.placement); } if (message.youtube_video !== undefined) { obj.youtube_video = YouTubeVideoInfo.toJSON(message.youtube_video); } if (message.youtube_channel !== undefined) { obj.youtube_channel = YouTubeChannelInfo.toJSON(message.youtube_channel); } if (message.negative_keyword_list !== undefined) { obj.negative_keyword_list = NegativeKeywordListInfo.toJSON(message.negative_keyword_list); } if (message.ip_block !== undefined) { obj.ip_block = IpBlockInfo.toJSON(message.ip_block); } if (message.placement_list !== undefined) { obj.placement_list = PlacementListInfo.toJSON(message.placement_list); } return obj; }, create(base) { return CustomerNegativeCriterion.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b, _c; const message = createBaseCustomerNegativeCriterion(); message.resource_name = (_a = object.resource_name) !== null && _a !== void 0 ? _a : ""; message.id = (_b = object.id) !== null && _b !== void 0 ? _b : undefined; message.type = (_c = object.type) !== null && _c !== void 0 ? _c : 0; message.content_label = (object.content_label !== undefined && object.content_label !== null) ? ContentLabelInfo.fromPartial(object.content_label) : undefined; message.mobile_application = (object.mobile_application !== undefined && object.mobile_application !== null) ? MobileApplicationInfo.fromPartial(object.mobile_application) : undefined; message.mobile_app_category = (object.mobile_app_category !== undefined && object.mobile_app_category !== null) ? MobileAppCategoryInfo.fromPartial(object.mobile_app_category) : undefined; message.placement = (object.placement !== undefined && object.placement !== null) ? PlacementInfo.fromPartial(object.placement) : undefined; message.youtube_video = (object.youtube_video !== undefined && object.youtube_video !== null) ? YouTubeVideoInfo.fromPartial(object.youtube_video) : undefined; message.youtube_channel = (object.youtube_channel !== undefined && object.youtube_channel !== null) ? YouTubeChannelInfo.fromPartial(object.youtube_channel) : undefined; message.negative_keyword_list = (object.negative_keyword_list !== undefined && object.negative_keyword_list !== null) ? NegativeKeywordListInfo.fromPartial(object.negative_keyword_list) : undefined; message.ip_block = (object.ip_block !== undefined && object.ip_block !== null) ? IpBlockInfo.fromPartial(object.ip_block) : undefined; message.placement_list = (object.placement_list !== undefined && object.placement_list !== null) ? PlacementListInfo.fromPartial(object.placement_list) : 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; }