UNPKG

@htdangkhoa/google-ads

Version:
1,070 lines (1,069 loc) 48 kB
"use strict"; // 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/policy.proto var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PolicyTopicConstraint_CountryConstraint = exports.PolicyTopicConstraint_ResellerConstraint = exports.PolicyTopicConstraint_CountryConstraintList = exports.PolicyTopicConstraint = exports.PolicyTopicEvidence_DestinationNotWorking = exports.PolicyTopicEvidence_DestinationMismatch = exports.PolicyTopicEvidence_DestinationTextList = exports.PolicyTopicEvidence_WebsiteList = exports.PolicyTopicEvidence_TextList = exports.PolicyTopicEvidence = exports.PolicyTopicEntry = exports.PolicyValidationParameter = exports.PolicyViolationKey = void 0; /* eslint-disable */ const long_1 = __importDefault(require("long")); const minimal_js_1 = __importDefault(require("protobufjs/minimal.js")); const policy_topic_entry_type_js_1 = require("../enums/policy_topic_entry_type.js"); const policy_topic_evidence_destination_mismatch_url_type_js_1 = require("../enums/policy_topic_evidence_destination_mismatch_url_type.js"); const policy_topic_evidence_destination_not_working_device_js_1 = require("../enums/policy_topic_evidence_destination_not_working_device.js"); const policy_topic_evidence_destination_not_working_dns_error_type_js_1 = require("../enums/policy_topic_evidence_destination_not_working_dns_error_type.js"); function createBasePolicyViolationKey() { return { policy_name: undefined, violating_text: undefined }; } exports.PolicyViolationKey = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.policy_name !== undefined) { writer.uint32(26).string(message.policy_name); } if (message.violating_text !== undefined) { writer.uint32(34).string(message.violating_text); } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyViolationKey(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 3: if (tag !== 26) { break; } message.policy_name = reader.string(); continue; case 4: if (tag !== 34) { break; } message.violating_text = reader.string(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { policy_name: isSet(object.policy_name) ? globalThis.String(object.policy_name) : undefined, violating_text: isSet(object.violating_text) ? globalThis.String(object.violating_text) : undefined, }; }, toJSON(message) { const obj = {}; if (message.policy_name !== undefined) { obj.policy_name = message.policy_name; } if (message.violating_text !== undefined) { obj.violating_text = message.violating_text; } return obj; }, create(base) { return exports.PolicyViolationKey.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b; const message = createBasePolicyViolationKey(); message.policy_name = (_a = object.policy_name) !== null && _a !== void 0 ? _a : undefined; message.violating_text = (_b = object.violating_text) !== null && _b !== void 0 ? _b : undefined; return message; }, }; function createBasePolicyValidationParameter() { return { ignorable_policy_topics: [], exempt_policy_violation_keys: [] }; } exports.PolicyValidationParameter = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.ignorable_policy_topics !== undefined && message.ignorable_policy_topics.length !== 0) { for (const v of message.ignorable_policy_topics) { writer.uint32(26).string(v); } } if (message.exempt_policy_violation_keys !== undefined && message.exempt_policy_violation_keys.length !== 0) { for (const v of message.exempt_policy_violation_keys) { exports.PolicyViolationKey.encode(v, writer.uint32(18).fork()).ldelim(); } } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyValidationParameter(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 3: if (tag !== 26) { break; } message.ignorable_policy_topics.push(reader.string()); continue; case 2: if (tag !== 18) { break; } message.exempt_policy_violation_keys.push(exports.PolicyViolationKey.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { ignorable_policy_topics: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.ignorable_policy_topics) ? object.ignorable_policy_topics.map((e) => globalThis.String(e)) : [], exempt_policy_violation_keys: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.exempt_policy_violation_keys) ? object.exempt_policy_violation_keys.map((e) => exports.PolicyViolationKey.fromJSON(e)) : [], }; }, toJSON(message) { var _a, _b; const obj = {}; if ((_a = message.ignorable_policy_topics) === null || _a === void 0 ? void 0 : _a.length) { obj.ignorable_policy_topics = message.ignorable_policy_topics; } if ((_b = message.exempt_policy_violation_keys) === null || _b === void 0 ? void 0 : _b.length) { obj.exempt_policy_violation_keys = message.exempt_policy_violation_keys.map((e) => exports.PolicyViolationKey.toJSON(e)); } return obj; }, create(base) { return exports.PolicyValidationParameter.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b; const message = createBasePolicyValidationParameter(); message.ignorable_policy_topics = ((_a = object.ignorable_policy_topics) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; message.exempt_policy_violation_keys = ((_b = object.exempt_policy_violation_keys) === null || _b === void 0 ? void 0 : _b.map((e) => exports.PolicyViolationKey.fromPartial(e))) || []; return message; }, }; function createBasePolicyTopicEntry() { return { topic: undefined, type: 0, evidences: [], constraints: [] }; } exports.PolicyTopicEntry = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.topic !== undefined) { writer.uint32(42).string(message.topic); } if (message.type !== undefined && message.type !== 0) { writer.uint32(16).int32(message.type); } if (message.evidences !== undefined && message.evidences.length !== 0) { for (const v of message.evidences) { exports.PolicyTopicEvidence.encode(v, writer.uint32(26).fork()).ldelim(); } } if (message.constraints !== undefined && message.constraints.length !== 0) { for (const v of message.constraints) { exports.PolicyTopicConstraint.encode(v, writer.uint32(34).fork()).ldelim(); } } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 5: if (tag !== 42) { break; } message.topic = reader.string(); continue; case 2: if (tag !== 16) { break; } message.type = reader.int32(); continue; case 3: if (tag !== 26) { break; } message.evidences.push(exports.PolicyTopicEvidence.decode(reader, reader.uint32())); continue; case 4: if (tag !== 34) { break; } message.constraints.push(exports.PolicyTopicConstraint.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { topic: isSet(object.topic) ? globalThis.String(object.topic) : undefined, type: isSet(object.type) ? (0, policy_topic_entry_type_js_1.policyTopicEntryTypeEnum_PolicyTopicEntryTypeFromJSON)(object.type) : 0, evidences: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.evidences) ? object.evidences.map((e) => exports.PolicyTopicEvidence.fromJSON(e)) : [], constraints: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.constraints) ? object.constraints.map((e) => exports.PolicyTopicConstraint.fromJSON(e)) : [], }; }, toJSON(message) { var _a, _b; const obj = {}; if (message.topic !== undefined) { obj.topic = message.topic; } if (message.type !== undefined && message.type !== 0) { obj.type = (0, policy_topic_entry_type_js_1.policyTopicEntryTypeEnum_PolicyTopicEntryTypeToJSON)(message.type); } if ((_a = message.evidences) === null || _a === void 0 ? void 0 : _a.length) { obj.evidences = message.evidences.map((e) => exports.PolicyTopicEvidence.toJSON(e)); } if ((_b = message.constraints) === null || _b === void 0 ? void 0 : _b.length) { obj.constraints = message.constraints.map((e) => exports.PolicyTopicConstraint.toJSON(e)); } return obj; }, create(base) { return exports.PolicyTopicEntry.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b, _c, _d; const message = createBasePolicyTopicEntry(); message.topic = (_a = object.topic) !== null && _a !== void 0 ? _a : undefined; message.type = (_b = object.type) !== null && _b !== void 0 ? _b : 0; message.evidences = ((_c = object.evidences) === null || _c === void 0 ? void 0 : _c.map((e) => exports.PolicyTopicEvidence.fromPartial(e))) || []; message.constraints = ((_d = object.constraints) === null || _d === void 0 ? void 0 : _d.map((e) => exports.PolicyTopicConstraint.fromPartial(e))) || []; return message; }, }; function createBasePolicyTopicEvidence() { return { website_list: undefined, text_list: undefined, language_code: undefined, destination_text_list: undefined, destination_mismatch: undefined, destination_not_working: undefined, }; } exports.PolicyTopicEvidence = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.website_list !== undefined) { exports.PolicyTopicEvidence_WebsiteList.encode(message.website_list, writer.uint32(26).fork()).ldelim(); } if (message.text_list !== undefined) { exports.PolicyTopicEvidence_TextList.encode(message.text_list, writer.uint32(34).fork()).ldelim(); } if (message.language_code !== undefined) { writer.uint32(74).string(message.language_code); } if (message.destination_text_list !== undefined) { exports.PolicyTopicEvidence_DestinationTextList.encode(message.destination_text_list, writer.uint32(50).fork()).ldelim(); } if (message.destination_mismatch !== undefined) { exports.PolicyTopicEvidence_DestinationMismatch.encode(message.destination_mismatch, writer.uint32(58).fork()).ldelim(); } if (message.destination_not_working !== undefined) { exports.PolicyTopicEvidence_DestinationNotWorking.encode(message.destination_not_working, writer.uint32(66).fork()) .ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicEvidence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 3: if (tag !== 26) { break; } message.website_list = exports.PolicyTopicEvidence_WebsiteList.decode(reader, reader.uint32()); continue; case 4: if (tag !== 34) { break; } message.text_list = exports.PolicyTopicEvidence_TextList.decode(reader, reader.uint32()); continue; case 9: if (tag !== 74) { break; } message.language_code = reader.string(); continue; case 6: if (tag !== 50) { break; } message.destination_text_list = exports.PolicyTopicEvidence_DestinationTextList.decode(reader, reader.uint32()); continue; case 7: if (tag !== 58) { break; } message.destination_mismatch = exports.PolicyTopicEvidence_DestinationMismatch.decode(reader, reader.uint32()); continue; case 8: if (tag !== 66) { break; } message.destination_not_working = exports.PolicyTopicEvidence_DestinationNotWorking.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { website_list: isSet(object.website_list) ? exports.PolicyTopicEvidence_WebsiteList.fromJSON(object.website_list) : undefined, text_list: isSet(object.text_list) ? exports.PolicyTopicEvidence_TextList.fromJSON(object.text_list) : undefined, language_code: isSet(object.language_code) ? globalThis.String(object.language_code) : undefined, destination_text_list: isSet(object.destination_text_list) ? exports.PolicyTopicEvidence_DestinationTextList.fromJSON(object.destination_text_list) : undefined, destination_mismatch: isSet(object.destination_mismatch) ? exports.PolicyTopicEvidence_DestinationMismatch.fromJSON(object.destination_mismatch) : undefined, destination_not_working: isSet(object.destination_not_working) ? exports.PolicyTopicEvidence_DestinationNotWorking.fromJSON(object.destination_not_working) : undefined, }; }, toJSON(message) { const obj = {}; if (message.website_list !== undefined) { obj.website_list = exports.PolicyTopicEvidence_WebsiteList.toJSON(message.website_list); } if (message.text_list !== undefined) { obj.text_list = exports.PolicyTopicEvidence_TextList.toJSON(message.text_list); } if (message.language_code !== undefined) { obj.language_code = message.language_code; } if (message.destination_text_list !== undefined) { obj.destination_text_list = exports.PolicyTopicEvidence_DestinationTextList.toJSON(message.destination_text_list); } if (message.destination_mismatch !== undefined) { obj.destination_mismatch = exports.PolicyTopicEvidence_DestinationMismatch.toJSON(message.destination_mismatch); } if (message.destination_not_working !== undefined) { obj.destination_not_working = exports.PolicyTopicEvidence_DestinationNotWorking.toJSON(message.destination_not_working); } return obj; }, create(base) { return exports.PolicyTopicEvidence.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBasePolicyTopicEvidence(); message.website_list = (object.website_list !== undefined && object.website_list !== null) ? exports.PolicyTopicEvidence_WebsiteList.fromPartial(object.website_list) : undefined; message.text_list = (object.text_list !== undefined && object.text_list !== null) ? exports.PolicyTopicEvidence_TextList.fromPartial(object.text_list) : undefined; message.language_code = (_a = object.language_code) !== null && _a !== void 0 ? _a : undefined; message.destination_text_list = (object.destination_text_list !== undefined && object.destination_text_list !== null) ? exports.PolicyTopicEvidence_DestinationTextList.fromPartial(object.destination_text_list) : undefined; message.destination_mismatch = (object.destination_mismatch !== undefined && object.destination_mismatch !== null) ? exports.PolicyTopicEvidence_DestinationMismatch.fromPartial(object.destination_mismatch) : undefined; message.destination_not_working = (object.destination_not_working !== undefined && object.destination_not_working !== null) ? exports.PolicyTopicEvidence_DestinationNotWorking.fromPartial(object.destination_not_working) : undefined; return message; }, }; function createBasePolicyTopicEvidence_TextList() { return { texts: [] }; } exports.PolicyTopicEvidence_TextList = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.texts !== undefined && message.texts.length !== 0) { for (const v of message.texts) { writer.uint32(18).string(v); } } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicEvidence_TextList(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: if (tag !== 18) { break; } message.texts.push(reader.string()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { texts: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.texts) ? object.texts.map((e) => globalThis.String(e)) : [] }; }, toJSON(message) { var _a; const obj = {}; if ((_a = message.texts) === null || _a === void 0 ? void 0 : _a.length) { obj.texts = message.texts; } return obj; }, create(base) { return exports.PolicyTopicEvidence_TextList.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBasePolicyTopicEvidence_TextList(); message.texts = ((_a = object.texts) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; return message; }, }; function createBasePolicyTopicEvidence_WebsiteList() { return { websites: [] }; } exports.PolicyTopicEvidence_WebsiteList = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.websites !== undefined && message.websites.length !== 0) { for (const v of message.websites) { writer.uint32(18).string(v); } } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicEvidence_WebsiteList(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: if (tag !== 18) { break; } message.websites.push(reader.string()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { websites: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.websites) ? object.websites.map((e) => globalThis.String(e)) : [], }; }, toJSON(message) { var _a; const obj = {}; if ((_a = message.websites) === null || _a === void 0 ? void 0 : _a.length) { obj.websites = message.websites; } return obj; }, create(base) { return exports.PolicyTopicEvidence_WebsiteList.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBasePolicyTopicEvidence_WebsiteList(); message.websites = ((_a = object.websites) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; return message; }, }; function createBasePolicyTopicEvidence_DestinationTextList() { return { destination_texts: [] }; } exports.PolicyTopicEvidence_DestinationTextList = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.destination_texts !== undefined && message.destination_texts.length !== 0) { for (const v of message.destination_texts) { writer.uint32(18).string(v); } } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicEvidence_DestinationTextList(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: if (tag !== 18) { break; } message.destination_texts.push(reader.string()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { destination_texts: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.destination_texts) ? object.destination_texts.map((e) => globalThis.String(e)) : [], }; }, toJSON(message) { var _a; const obj = {}; if ((_a = message.destination_texts) === null || _a === void 0 ? void 0 : _a.length) { obj.destination_texts = message.destination_texts; } return obj; }, create(base) { return exports.PolicyTopicEvidence_DestinationTextList.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBasePolicyTopicEvidence_DestinationTextList(); message.destination_texts = ((_a = object.destination_texts) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; return message; }, }; function createBasePolicyTopicEvidence_DestinationMismatch() { return { url_types: [] }; } exports.PolicyTopicEvidence_DestinationMismatch = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.url_types !== undefined && message.url_types.length !== 0) { writer.uint32(10).fork(); for (const v of message.url_types) { writer.int32(v); } writer.ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicEvidence_DestinationMismatch(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag === 8) { message.url_types.push(reader.int32()); continue; } if (tag === 10) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { message.url_types.push(reader.int32()); } continue; } break; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { url_types: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.url_types) ? object.url_types.map((e) => (0, policy_topic_evidence_destination_mismatch_url_type_js_1.policyTopicEvidenceDestinationMismatchUrlTypeEnum_PolicyTopicEvidenceDestinationMismatchUrlTypeFromJSON)(e)) : [], }; }, toJSON(message) { var _a; const obj = {}; if ((_a = message.url_types) === null || _a === void 0 ? void 0 : _a.length) { obj.url_types = message.url_types.map((e) => (0, policy_topic_evidence_destination_mismatch_url_type_js_1.policyTopicEvidenceDestinationMismatchUrlTypeEnum_PolicyTopicEvidenceDestinationMismatchUrlTypeToJSON)(e)); } return obj; }, create(base) { return exports.PolicyTopicEvidence_DestinationMismatch.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBasePolicyTopicEvidence_DestinationMismatch(); message.url_types = ((_a = object.url_types) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; return message; }, }; function createBasePolicyTopicEvidence_DestinationNotWorking() { return { expanded_url: undefined, device: 0, last_checked_date_time: undefined, dns_error_type: undefined, http_error_code: undefined, }; } exports.PolicyTopicEvidence_DestinationNotWorking = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.expanded_url !== undefined) { writer.uint32(58).string(message.expanded_url); } if (message.device !== undefined && message.device !== 0) { writer.uint32(32).int32(message.device); } if (message.last_checked_date_time !== undefined) { writer.uint32(66).string(message.last_checked_date_time); } if (message.dns_error_type !== undefined) { writer.uint32(8).int32(message.dns_error_type); } if (message.http_error_code !== undefined) { writer.uint32(48).int64(message.http_error_code); } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicEvidence_DestinationNotWorking(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 7: if (tag !== 58) { break; } message.expanded_url = reader.string(); continue; case 4: if (tag !== 32) { break; } message.device = reader.int32(); continue; case 8: if (tag !== 66) { break; } message.last_checked_date_time = reader.string(); continue; case 1: if (tag !== 8) { break; } message.dns_error_type = reader.int32(); continue; case 6: if (tag !== 48) { break; } message.http_error_code = longToString(reader.int64()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { expanded_url: isSet(object.expanded_url) ? globalThis.String(object.expanded_url) : undefined, device: isSet(object.device) ? (0, policy_topic_evidence_destination_not_working_device_js_1.policyTopicEvidenceDestinationNotWorkingDeviceEnum_PolicyTopicEvidenceDestinationNotWorkingDeviceFromJSON)(object.device) : 0, last_checked_date_time: isSet(object.last_checked_date_time) ? globalThis.String(object.last_checked_date_time) : undefined, dns_error_type: isSet(object.dns_error_type) ? (0, policy_topic_evidence_destination_not_working_dns_error_type_js_1.policyTopicEvidenceDestinationNotWorkingDnsErrorTypeEnum_PolicyTopicEvidenceDestinationNotWorkingDnsErrorTypeFromJSON)(object.dns_error_type) : undefined, http_error_code: isSet(object.http_error_code) ? globalThis.String(object.http_error_code) : undefined, }; }, toJSON(message) { const obj = {}; if (message.expanded_url !== undefined) { obj.expanded_url = message.expanded_url; } if (message.device !== undefined && message.device !== 0) { obj.device = (0, policy_topic_evidence_destination_not_working_device_js_1.policyTopicEvidenceDestinationNotWorkingDeviceEnum_PolicyTopicEvidenceDestinationNotWorkingDeviceToJSON)(message.device); } if (message.last_checked_date_time !== undefined) { obj.last_checked_date_time = message.last_checked_date_time; } if (message.dns_error_type !== undefined) { obj.dns_error_type = (0, policy_topic_evidence_destination_not_working_dns_error_type_js_1.policyTopicEvidenceDestinationNotWorkingDnsErrorTypeEnum_PolicyTopicEvidenceDestinationNotWorkingDnsErrorTypeToJSON)(message.dns_error_type); } if (message.http_error_code !== undefined) { obj.http_error_code = message.http_error_code; } return obj; }, create(base) { return exports.PolicyTopicEvidence_DestinationNotWorking.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b, _c, _d, _e; const message = createBasePolicyTopicEvidence_DestinationNotWorking(); message.expanded_url = (_a = object.expanded_url) !== null && _a !== void 0 ? _a : undefined; message.device = (_b = object.device) !== null && _b !== void 0 ? _b : 0; message.last_checked_date_time = (_c = object.last_checked_date_time) !== null && _c !== void 0 ? _c : undefined; message.dns_error_type = (_d = object.dns_error_type) !== null && _d !== void 0 ? _d : undefined; message.http_error_code = (_e = object.http_error_code) !== null && _e !== void 0 ? _e : undefined; return message; }, }; function createBasePolicyTopicConstraint() { return { country_constraint_list: undefined, reseller_constraint: undefined, certificate_missing_in_country_list: undefined, certificate_domain_mismatch_in_country_list: undefined, }; } exports.PolicyTopicConstraint = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.country_constraint_list !== undefined) { exports.PolicyTopicConstraint_CountryConstraintList.encode(message.country_constraint_list, writer.uint32(10).fork()) .ldelim(); } if (message.reseller_constraint !== undefined) { exports.PolicyTopicConstraint_ResellerConstraint.encode(message.reseller_constraint, writer.uint32(18).fork()).ldelim(); } if (message.certificate_missing_in_country_list !== undefined) { exports.PolicyTopicConstraint_CountryConstraintList.encode(message.certificate_missing_in_country_list, writer.uint32(26).fork()).ldelim(); } if (message.certificate_domain_mismatch_in_country_list !== undefined) { exports.PolicyTopicConstraint_CountryConstraintList.encode(message.certificate_domain_mismatch_in_country_list, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicConstraint(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.country_constraint_list = exports.PolicyTopicConstraint_CountryConstraintList.decode(reader, reader.uint32()); continue; case 2: if (tag !== 18) { break; } message.reseller_constraint = exports.PolicyTopicConstraint_ResellerConstraint.decode(reader, reader.uint32()); continue; case 3: if (tag !== 26) { break; } message.certificate_missing_in_country_list = exports.PolicyTopicConstraint_CountryConstraintList.decode(reader, reader.uint32()); continue; case 4: if (tag !== 34) { break; } message.certificate_domain_mismatch_in_country_list = exports.PolicyTopicConstraint_CountryConstraintList.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { country_constraint_list: isSet(object.country_constraint_list) ? exports.PolicyTopicConstraint_CountryConstraintList.fromJSON(object.country_constraint_list) : undefined, reseller_constraint: isSet(object.reseller_constraint) ? exports.PolicyTopicConstraint_ResellerConstraint.fromJSON(object.reseller_constraint) : undefined, certificate_missing_in_country_list: isSet(object.certificate_missing_in_country_list) ? exports.PolicyTopicConstraint_CountryConstraintList.fromJSON(object.certificate_missing_in_country_list) : undefined, certificate_domain_mismatch_in_country_list: isSet(object.certificate_domain_mismatch_in_country_list) ? exports.PolicyTopicConstraint_CountryConstraintList.fromJSON(object.certificate_domain_mismatch_in_country_list) : undefined, }; }, toJSON(message) { const obj = {}; if (message.country_constraint_list !== undefined) { obj.country_constraint_list = exports.PolicyTopicConstraint_CountryConstraintList.toJSON(message.country_constraint_list); } if (message.reseller_constraint !== undefined) { obj.reseller_constraint = exports.PolicyTopicConstraint_ResellerConstraint.toJSON(message.reseller_constraint); } if (message.certificate_missing_in_country_list !== undefined) { obj.certificate_missing_in_country_list = exports.PolicyTopicConstraint_CountryConstraintList.toJSON(message.certificate_missing_in_country_list); } if (message.certificate_domain_mismatch_in_country_list !== undefined) { obj.certificate_domain_mismatch_in_country_list = exports.PolicyTopicConstraint_CountryConstraintList.toJSON(message.certificate_domain_mismatch_in_country_list); } return obj; }, create(base) { return exports.PolicyTopicConstraint.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { const message = createBasePolicyTopicConstraint(); message.country_constraint_list = (object.country_constraint_list !== undefined && object.country_constraint_list !== null) ? exports.PolicyTopicConstraint_CountryConstraintList.fromPartial(object.country_constraint_list) : undefined; message.reseller_constraint = (object.reseller_constraint !== undefined && object.reseller_constraint !== null) ? exports.PolicyTopicConstraint_ResellerConstraint.fromPartial(object.reseller_constraint) : undefined; message.certificate_missing_in_country_list = (object.certificate_missing_in_country_list !== undefined && object.certificate_missing_in_country_list !== null) ? exports.PolicyTopicConstraint_CountryConstraintList.fromPartial(object.certificate_missing_in_country_list) : undefined; message.certificate_domain_mismatch_in_country_list = (object.certificate_domain_mismatch_in_country_list !== undefined && object.certificate_domain_mismatch_in_country_list !== null) ? exports.PolicyTopicConstraint_CountryConstraintList.fromPartial(object.certificate_domain_mismatch_in_country_list) : undefined; return message; }, }; function createBasePolicyTopicConstraint_CountryConstraintList() { return { total_targeted_countries: undefined, countries: [] }; } exports.PolicyTopicConstraint_CountryConstraintList = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.total_targeted_countries !== undefined) { writer.uint32(24).int32(message.total_targeted_countries); } if (message.countries !== undefined && message.countries.length !== 0) { for (const v of message.countries) { exports.PolicyTopicConstraint_CountryConstraint.encode(v, writer.uint32(18).fork()).ldelim(); } } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicConstraint_CountryConstraintList(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 3: if (tag !== 24) { break; } message.total_targeted_countries = reader.int32(); continue; case 2: if (tag !== 18) { break; } message.countries.push(exports.PolicyTopicConstraint_CountryConstraint.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { total_targeted_countries: isSet(object.total_targeted_countries) ? globalThis.Number(object.total_targeted_countries) : undefined, countries: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.countries) ? object.countries.map((e) => exports.PolicyTopicConstraint_CountryConstraint.fromJSON(e)) : [], }; }, toJSON(message) { var _a; const obj = {}; if (message.total_targeted_countries !== undefined) { obj.total_targeted_countries = Math.round(message.total_targeted_countries); } if ((_a = message.countries) === null || _a === void 0 ? void 0 : _a.length) { obj.countries = message.countries.map((e) => exports.PolicyTopicConstraint_CountryConstraint.toJSON(e)); } return obj; }, create(base) { return exports.PolicyTopicConstraint_CountryConstraintList.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b; const message = createBasePolicyTopicConstraint_CountryConstraintList(); message.total_targeted_countries = (_a = object.total_targeted_countries) !== null && _a !== void 0 ? _a : undefined; message.countries = ((_b = object.countries) === null || _b === void 0 ? void 0 : _b.map((e) => exports.PolicyTopicConstraint_CountryConstraint.fromPartial(e))) || []; return message; }, }; function createBasePolicyTopicConstraint_ResellerConstraint() { return {}; } exports.PolicyTopicConstraint_ResellerConstraint = { encode(_, writer = minimal_js_1.default.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicConstraint_ResellerConstraint(); 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 exports.PolicyTopicConstraint_ResellerConstraint.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(_) { const message = createBasePolicyTopicConstraint_ResellerConstraint(); return message; }, }; function createBasePolicyTopicConstraint_CountryConstraint() { return { country_criterion: undefined }; } exports.PolicyTopicConstraint_CountryConstraint = { encode(message, writer = minimal_js_1.default.Writer.create()) { if (message.country_criterion !== undefined) { writer.uint32(18).string(message.country_criterion); } return writer; }, decode(input, length) { const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePolicyTopicConstraint_CountryConstraint(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: if (tag !== 18) { break; } message.country_criterion = reader.string(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { country_criterion: isSet(object.country_criterion) ? globalThis.String(object.country_criterion) : undefined, }; }, toJSON(message) { const obj = {}; if (message.country_criterion !== undefined) { obj.country_criterion = message.country_criterion; } return obj; }, create(base) { return exports.PolicyTopicConstraint_CountryConstraint.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBasePolicyTopicConstraint_CountryConstraint(); message.country_criterion = (_a = object.country_criterion) !== null && _a !== void 0 ? _a : undefined; return message; }, }; function longToString(long) { return long.toString(); } if (minimal_js_1.default.util.Long !== long_1.default) { minimal_js_1.default.util.Long = long_1.default; minimal_js_1.default.configure(); } function isSet(value) { return value !== null && value !== undefined; }