UNPKG

box-node-sdk

Version:

Official SDK for Box Platform APIs

151 lines 6.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.serializeExternalCollabSecuritySettingsV2025R0 = serializeExternalCollabSecuritySettingsV2025R0; exports.deserializeExternalCollabSecuritySettingsV2025R0 = deserializeExternalCollabSecuritySettingsV2025R0; const utils_1 = require("../../internal/utils"); const utils_2 = require("../../internal/utils"); const errors_1 = require("../../box/errors"); const json_1 = require("../../serialization/json"); const json_2 = require("../../serialization/json"); const json_3 = require("../../serialization/json"); function serializeExternalCollabSecuritySettingsV2025R0(val) { return { ['denylist_domains']: val.denylistDomains == void 0 ? val.denylistDomains : val.denylistDomains.map(function (item) { return item; }), ['denylist_emails']: val.denylistEmails == void 0 ? val.denylistEmails : val.denylistEmails.map(function (item) { return item; }), ['allowlist_domains']: val.allowlistDomains == void 0 ? val.allowlistDomains : val.allowlistDomains.map(function (item) { return item; }), ['allowlist_emails']: val.allowlistEmails == void 0 ? val.allowlistEmails : val.allowlistEmails.map(function (item) { return item; }), ['state']: val.state, ['scheduled_status']: val.scheduledStatus, ['scheduled_at']: val.scheduledAt == void 0 ? val.scheduledAt : (0, utils_1.serializeDateTime)(val.scheduledAt), ['factor_type_settings']: val.factorTypeSettings, }; } function deserializeExternalCollabSecuritySettingsV2025R0(val) { if (!(0, json_3.sdIsMap)(val)) { throw new errors_1.BoxSdkError({ message: 'Expecting a map for "ExternalCollabSecuritySettingsV2025R0"', }); } if (!(val.denylist_domains == void 0) && !(0, json_2.sdIsList)(val.denylist_domains)) { throw new errors_1.BoxSdkError({ message: 'Expecting array for "denylist_domains" of type "ExternalCollabSecuritySettingsV2025R0"', }); } const denylistDomains = val.denylist_domains == void 0 ? void 0 : (0, json_2.sdIsList)(val.denylist_domains) ? val.denylist_domains.map(function (itm) { if (!(0, json_1.sdIsString)(itm)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "ExternalCollabSecuritySettingsV2025R0"', }); } return itm; }) : []; if (!(val.denylist_emails == void 0) && !(0, json_2.sdIsList)(val.denylist_emails)) { throw new errors_1.BoxSdkError({ message: 'Expecting array for "denylist_emails" of type "ExternalCollabSecuritySettingsV2025R0"', }); } const denylistEmails = val.denylist_emails == void 0 ? void 0 : (0, json_2.sdIsList)(val.denylist_emails) ? val.denylist_emails.map(function (itm) { if (!(0, json_1.sdIsString)(itm)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "ExternalCollabSecuritySettingsV2025R0"', }); } return itm; }) : []; if (!(val.allowlist_domains == void 0) && !(0, json_2.sdIsList)(val.allowlist_domains)) { throw new errors_1.BoxSdkError({ message: 'Expecting array for "allowlist_domains" of type "ExternalCollabSecuritySettingsV2025R0"', }); } const allowlistDomains = val.allowlist_domains == void 0 ? void 0 : (0, json_2.sdIsList)(val.allowlist_domains) ? val.allowlist_domains.map(function (itm) { if (!(0, json_1.sdIsString)(itm)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "ExternalCollabSecuritySettingsV2025R0"', }); } return itm; }) : []; if (!(val.allowlist_emails == void 0) && !(0, json_2.sdIsList)(val.allowlist_emails)) { throw new errors_1.BoxSdkError({ message: 'Expecting array for "allowlist_emails" of type "ExternalCollabSecuritySettingsV2025R0"', }); } const allowlistEmails = val.allowlist_emails == void 0 ? void 0 : (0, json_2.sdIsList)(val.allowlist_emails) ? val.allowlist_emails.map(function (itm) { if (!(0, json_1.sdIsString)(itm)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "ExternalCollabSecuritySettingsV2025R0"', }); } return itm; }) : []; if (!(val.state == void 0) && !(0, json_1.sdIsString)(val.state)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "state" of type "ExternalCollabSecuritySettingsV2025R0"', }); } const state = val.state == void 0 ? void 0 : val.state; if (!(val.scheduled_status == void 0) && !(0, json_1.sdIsString)(val.scheduled_status)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "scheduled_status" of type "ExternalCollabSecuritySettingsV2025R0"', }); } const scheduledStatus = val.scheduled_status == void 0 ? void 0 : val.scheduled_status; if (!(val.scheduled_at == void 0) && !(0, json_1.sdIsString)(val.scheduled_at)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "scheduled_at" of type "ExternalCollabSecuritySettingsV2025R0"', }); } const scheduledAt = val.scheduled_at == void 0 ? void 0 : (0, utils_2.deserializeDateTime)(val.scheduled_at); if (!(val.factor_type_settings == void 0) && !(0, json_1.sdIsString)(val.factor_type_settings)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "factor_type_settings" of type "ExternalCollabSecuritySettingsV2025R0"', }); } const factorTypeSettings = val.factor_type_settings == void 0 ? void 0 : val.factor_type_settings; return { denylistDomains: denylistDomains, denylistEmails: denylistEmails, allowlistDomains: allowlistDomains, allowlistEmails: allowlistEmails, state: state, scheduledStatus: scheduledStatus, scheduledAt: scheduledAt, factorTypeSettings: factorTypeSettings, }; } //# sourceMappingURL=externalCollabSecuritySettingsV2025R0.js.map