UNPKG

box-node-sdk

Version:

Official SDK for Box Platform APIs

78 lines 3.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.serializeKeysafeSettingsV2025R0 = serializeKeysafeSettingsV2025R0; exports.deserializeKeysafeSettingsV2025R0 = deserializeKeysafeSettingsV2025R0; 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 serializeKeysafeSettingsV2025R0(val) { return { ['keysafe_enabled']: val.keysafeEnabled, ['cloud_provider']: val.cloudProvider, ['key_id']: val.keyId, ['account_id']: val.accountId, ['location_id']: val.locationId, ['project_id']: val.projectId, ['keyring_id']: val.keyringId, }; } function deserializeKeysafeSettingsV2025R0(val) { if (!(0, json_3.sdIsMap)(val)) { throw new errors_1.BoxSdkError({ message: 'Expecting a map for "KeysafeSettingsV2025R0"', }); } if (!(val.keysafe_enabled == void 0) && !(0, json_1.sdIsBoolean)(val.keysafe_enabled)) { throw new errors_1.BoxSdkError({ message: 'Expecting boolean for "keysafe_enabled" of type "KeysafeSettingsV2025R0"', }); } const keysafeEnabled = val.keysafe_enabled == void 0 ? void 0 : val.keysafe_enabled; if (!(val.cloud_provider == void 0) && !(0, json_2.sdIsString)(val.cloud_provider)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "cloud_provider" of type "KeysafeSettingsV2025R0"', }); } const cloudProvider = val.cloud_provider == void 0 ? void 0 : val.cloud_provider; if (!(val.key_id == void 0) && !(0, json_2.sdIsString)(val.key_id)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "key_id" of type "KeysafeSettingsV2025R0"', }); } const keyId = val.key_id == void 0 ? void 0 : val.key_id; if (!(val.account_id == void 0) && !(0, json_2.sdIsString)(val.account_id)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "account_id" of type "KeysafeSettingsV2025R0"', }); } const accountId = val.account_id == void 0 ? void 0 : val.account_id; if (!(val.location_id == void 0) && !(0, json_2.sdIsString)(val.location_id)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "location_id" of type "KeysafeSettingsV2025R0"', }); } const locationId = val.location_id == void 0 ? void 0 : val.location_id; if (!(val.project_id == void 0) && !(0, json_2.sdIsString)(val.project_id)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "project_id" of type "KeysafeSettingsV2025R0"', }); } const projectId = val.project_id == void 0 ? void 0 : val.project_id; if (!(val.keyring_id == void 0) && !(0, json_2.sdIsString)(val.keyring_id)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "keyring_id" of type "KeysafeSettingsV2025R0"', }); } const keyringId = val.keyring_id == void 0 ? void 0 : val.keyring_id; return { keysafeEnabled: keysafeEnabled, cloudProvider: cloudProvider, keyId: keyId, accountId: accountId, locationId: locationId, projectId: projectId, keyringId: keyringId, }; } //# sourceMappingURL=keysafeSettingsV2025R0.js.map