"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeEnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField = serializeEnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField;
exports.deserializeEnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField = deserializeEnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField;
exports.serializeEnterpriseConfigurationUserSettingsV2025R0 = serializeEnterpriseConfigurationUserSettingsV2025R0;
exports.deserializeEnterpriseConfigurationUserSettingsV2025R0 = deserializeEnterpriseConfigurationUserSettingsV2025R0;
const enterpriseFeatureSettingsItemV2025R0_1 = require("./enterpriseFeatureSettingsItemV2025R0");
const enterpriseFeatureSettingsItemV2025R0_2 = require("./enterpriseFeatureSettingsItemV2025R0");
const enterpriseConfigurationItemStringV2025R0_1 = require("./enterpriseConfigurationItemStringV2025R0");
const enterpriseConfigurationItemStringV2025R0_2 = require("./enterpriseConfigurationItemStringV2025R0");
const enterpriseConfigurationItemBooleanV2025R0_1 = require("./enterpriseConfigurationItemBooleanV2025R0");
const enterpriseConfigurationItemBooleanV2025R0_2 = require("./enterpriseConfigurationItemBooleanV2025R0");
const enterpriseConfigurationItemIntegerV2025R0_1 = require("./enterpriseConfigurationItemIntegerV2025R0");
const enterpriseConfigurationItemIntegerV2025R0_2 = require("./enterpriseConfigurationItemIntegerV2025R0");
const enterpriseConfigurationItemV2025R0_1 = require("./enterpriseConfigurationItemV2025R0");
const userTrackingCodeV2025R0_1 = require("./userTrackingCodeV2025R0");
const userTrackingCodeV2025R0_2 = require("./userTrackingCodeV2025R0");
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 serializeEnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField(val) {
    const base = (0, enterpriseConfigurationItemV2025R0_1.serializeEnterpriseConfigurationItemV2025R0)(val);
    if (!(0, json_3.sdIsMap)(base)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "EnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField"',
        });
    }
    return Object.assign(Object.assign({}, base), {
        ['value']: val.value == void 0
            ? val.value
            : val.value.map(function (item) {
                return (0, userTrackingCodeV2025R0_1.serializeUserTrackingCodeV2025R0)(item);
            }),
    });
}
function deserializeEnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField(val) {
    if (!(0, json_3.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "EnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField"',
        });
    }
    if (!(val.value == void 0) && !(0, json_2.sdIsList)(val.value)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting array for "value" of type "EnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField"',
        });
    }
    const value = val.value == void 0
        ? void 0
        : (0, json_2.sdIsList)(val.value)
            ? val.value.map(function (itm) {
                return (0, userTrackingCodeV2025R0_2.deserializeUserTrackingCodeV2025R0)(itm);
            })
            : [];
    if (!(val.is_used == void 0) && !(0, json_1.sdIsBoolean)(val.is_used)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting boolean for "is_used" of type "EnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField"',
        });
    }
    const isUsed = val.is_used == void 0 ? void 0 : val.is_used;
    return {
        value: value,
        isUsed: isUsed,
    };
}
function serializeEnterpriseConfigurationUserSettingsV2025R0(val) {
    return {
        ['enterprise_feature_settings']: val.enterpriseFeatureSettings == void 0
            ? val.enterpriseFeatureSettings
            : val.enterpriseFeatureSettings.map(function (item) {
                return (0, enterpriseFeatureSettingsItemV2025R0_1.serializeEnterpriseFeatureSettingsItemV2025R0)(item);
            }),
        ['user_invites_expiration_time_frame']: val.userInvitesExpirationTimeFrame == void 0
            ? val.userInvitesExpirationTimeFrame
            : (0, enterpriseConfigurationItemStringV2025R0_1.serializeEnterpriseConfigurationItemStringV2025R0)(val.userInvitesExpirationTimeFrame),
        ['is_username_change_restricted']: val.isUsernameChangeRestricted == void 0
            ? val.isUsernameChangeRestricted
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isUsernameChangeRestricted),
        ['is_box_sync_restricted_for_new_users']: val.isBoxSyncRestrictedForNewUsers == void 0
            ? val.isBoxSyncRestrictedForNewUsers
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isBoxSyncRestrictedForNewUsers),
        ['is_view_all_users_enabled_for_new_users']: val.isViewAllUsersEnabledForNewUsers == void 0
            ? val.isViewAllUsersEnabledForNewUsers
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isViewAllUsersEnabledForNewUsers),
        ['is_device_limit_exemption_enabled_for_new_users']: val.isDeviceLimitExemptionEnabledForNewUsers == void 0
            ? val.isDeviceLimitExemptionEnabledForNewUsers
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isDeviceLimitExemptionEnabledForNewUsers),
        ['is_external_collaboration_restricted_for_new_users']: val.isExternalCollaborationRestrictedForNewUsers == void 0
            ? val.isExternalCollaborationRestrictedForNewUsers
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isExternalCollaborationRestrictedForNewUsers),
        ['is_unlimited_storage_enabled_for_new_users']: val.isUnlimitedStorageEnabledForNewUsers == void 0
            ? val.isUnlimitedStorageEnabledForNewUsers
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isUnlimitedStorageEnabledForNewUsers),
        ['new_user_default_storage_limit']: val.newUserDefaultStorageLimit == void 0
            ? val.newUserDefaultStorageLimit
            : (0, enterpriseConfigurationItemIntegerV2025R0_1.serializeEnterpriseConfigurationItemIntegerV2025R0)(val.newUserDefaultStorageLimit),
        ['new_user_default_timezone']: val.newUserDefaultTimezone == void 0
            ? val.newUserDefaultTimezone
            : (0, enterpriseConfigurationItemStringV2025R0_1.serializeEnterpriseConfigurationItemStringV2025R0)(val.newUserDefaultTimezone),
        ['new_user_default_language']: val.newUserDefaultLanguage == void 0
            ? val.newUserDefaultLanguage
            : (0, enterpriseConfigurationItemStringV2025R0_1.serializeEnterpriseConfigurationItemStringV2025R0)(val.newUserDefaultLanguage),
        ['is_enterprise_sso_required']: val.isEnterpriseSsoRequired == void 0
            ? val.isEnterpriseSsoRequired
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isEnterpriseSsoRequired),
        ['is_enterprise_sso_in_testing']: val.isEnterpriseSsoInTesting == void 0
            ? val.isEnterpriseSsoInTesting
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isEnterpriseSsoInTesting),
        ['is_sso_auto_add_groups_enabled']: val.isSsoAutoAddGroupsEnabled == void 0
            ? val.isSsoAutoAddGroupsEnabled
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isSsoAutoAddGroupsEnabled),
        ['is_sso_auto_add_user_to_groups_enabled']: val.isSsoAutoAddUserToGroupsEnabled == void 0
            ? val.isSsoAutoAddUserToGroupsEnabled
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isSsoAutoAddUserToGroupsEnabled),
        ['is_sso_auto_remove_user_from_groups_enabled']: val.isSsoAutoRemoveUserFromGroupsEnabled == void 0
            ? val.isSsoAutoRemoveUserFromGroupsEnabled
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isSsoAutoRemoveUserFromGroupsEnabled),
        ['user_tracking_codes']: val.userTrackingCodes == void 0
            ? val.userTrackingCodes
            : serializeEnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField(val.userTrackingCodes),
        ['number_of_user_tracking_codes_remaining']: val.numberOfUserTrackingCodesRemaining == void 0
            ? val.numberOfUserTrackingCodesRemaining
            : (0, enterpriseConfigurationItemIntegerV2025R0_1.serializeEnterpriseConfigurationItemIntegerV2025R0)(val.numberOfUserTrackingCodesRemaining),
        ['is_instant_login_restricted']: val.isInstantLoginRestricted == void 0
            ? val.isInstantLoginRestricted
            : (0, enterpriseConfigurationItemBooleanV2025R0_1.serializeEnterpriseConfigurationItemBooleanV2025R0)(val.isInstantLoginRestricted),
    };
}
function deserializeEnterpriseConfigurationUserSettingsV2025R0(val) {
    if (!(0, json_3.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "EnterpriseConfigurationUserSettingsV2025R0"',
        });
    }
    if (!(val.enterprise_feature_settings == void 0) &&
        !(0, json_2.sdIsList)(val.enterprise_feature_settings)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting array for "enterprise_feature_settings" of type "EnterpriseConfigurationUserSettingsV2025R0"',
        });
    }
    const enterpriseFeatureSettings = val.enterprise_feature_settings == void 0
        ? void 0
        : (0, json_2.sdIsList)(val.enterprise_feature_settings)
            ? val.enterprise_feature_settings.map(function (itm) {
                return (0, enterpriseFeatureSettingsItemV2025R0_2.deserializeEnterpriseFeatureSettingsItemV2025R0)(itm);
            })
            : [];
    const userInvitesExpirationTimeFrame = val.user_invites_expiration_time_frame == void 0
        ? void 0
        : (0, enterpriseConfigurationItemStringV2025R0_2.deserializeEnterpriseConfigurationItemStringV2025R0)(val.user_invites_expiration_time_frame);
    const isUsernameChangeRestricted = val.is_username_change_restricted == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_username_change_restricted);
    const isBoxSyncRestrictedForNewUsers = val.is_box_sync_restricted_for_new_users == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_box_sync_restricted_for_new_users);
    const isViewAllUsersEnabledForNewUsers = val.is_view_all_users_enabled_for_new_users == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_view_all_users_enabled_for_new_users);
    const isDeviceLimitExemptionEnabledForNewUsers = val.is_device_limit_exemption_enabled_for_new_users == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_device_limit_exemption_enabled_for_new_users);
    const isExternalCollaborationRestrictedForNewUsers = val.is_external_collaboration_restricted_for_new_users == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_external_collaboration_restricted_for_new_users);
    const isUnlimitedStorageEnabledForNewUsers = val.is_unlimited_storage_enabled_for_new_users == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_unlimited_storage_enabled_for_new_users);
    const newUserDefaultStorageLimit = val.new_user_default_storage_limit == void 0
        ? void 0
        : (0, enterpriseConfigurationItemIntegerV2025R0_2.deserializeEnterpriseConfigurationItemIntegerV2025R0)(val.new_user_default_storage_limit);
    const newUserDefaultTimezone = val.new_user_default_timezone == void 0
        ? void 0
        : (0, enterpriseConfigurationItemStringV2025R0_2.deserializeEnterpriseConfigurationItemStringV2025R0)(val.new_user_default_timezone);
    const newUserDefaultLanguage = val.new_user_default_language == void 0
        ? void 0
        : (0, enterpriseConfigurationItemStringV2025R0_2.deserializeEnterpriseConfigurationItemStringV2025R0)(val.new_user_default_language);
    const isEnterpriseSsoRequired = val.is_enterprise_sso_required == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_enterprise_sso_required);
    const isEnterpriseSsoInTesting = val.is_enterprise_sso_in_testing == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_enterprise_sso_in_testing);
    const isSsoAutoAddGroupsEnabled = val.is_sso_auto_add_groups_enabled == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_sso_auto_add_groups_enabled);
    const isSsoAutoAddUserToGroupsEnabled = val.is_sso_auto_add_user_to_groups_enabled == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_sso_auto_add_user_to_groups_enabled);
    const isSsoAutoRemoveUserFromGroupsEnabled = val.is_sso_auto_remove_user_from_groups_enabled == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_sso_auto_remove_user_from_groups_enabled);
    const userTrackingCodes = val.user_tracking_codes == void 0
        ? void 0
        : deserializeEnterpriseConfigurationUserSettingsV2025R0UserTrackingCodesField(val.user_tracking_codes);
    const numberOfUserTrackingCodesRemaining = val.number_of_user_tracking_codes_remaining == void 0
        ? void 0
        : (0, enterpriseConfigurationItemIntegerV2025R0_2.deserializeEnterpriseConfigurationItemIntegerV2025R0)(val.number_of_user_tracking_codes_remaining);
    const isInstantLoginRestricted = val.is_instant_login_restricted == void 0
        ? void 0
        : (0, enterpriseConfigurationItemBooleanV2025R0_2.deserializeEnterpriseConfigurationItemBooleanV2025R0)(val.is_instant_login_restricted);
    return {
        enterpriseFeatureSettings: enterpriseFeatureSettings,
        userInvitesExpirationTimeFrame: userInvitesExpirationTimeFrame,
        isUsernameChangeRestricted: isUsernameChangeRestricted,
        isBoxSyncRestrictedForNewUsers: isBoxSyncRestrictedForNewUsers,
        isViewAllUsersEnabledForNewUsers: isViewAllUsersEnabledForNewUsers,
        isDeviceLimitExemptionEnabledForNewUsers: isDeviceLimitExemptionEnabledForNewUsers,
        isExternalCollaborationRestrictedForNewUsers: isExternalCollaborationRestrictedForNewUsers,
        isUnlimitedStorageEnabledForNewUsers: isUnlimitedStorageEnabledForNewUsers,
        newUserDefaultStorageLimit: newUserDefaultStorageLimit,
        newUserDefaultTimezone: newUserDefaultTimezone,
        newUserDefaultLanguage: newUserDefaultLanguage,
        isEnterpriseSsoRequired: isEnterpriseSsoRequired,
        isEnterpriseSsoInTesting: isEnterpriseSsoInTesting,
        isSsoAutoAddGroupsEnabled: isSsoAutoAddGroupsEnabled,
        isSsoAutoAddUserToGroupsEnabled: isSsoAutoAddUserToGroupsEnabled,
        isSsoAutoRemoveUserFromGroupsEnabled: isSsoAutoRemoveUserFromGroupsEnabled,
        userTrackingCodes: userTrackingCodes,
        numberOfUserTrackingCodesRemaining: numberOfUserTrackingCodesRemaining,
        isInstantLoginRestricted: isInstantLoginRestricted,
    };
}
//# sourceMappingURL=enterpriseConfigurationUserSettingsV2025R0.js.map