"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SignRequestSignerInputSsnValidation = void 0;
exports.serializeSignRequestSignerInputSsnValidationValidationTypeField = serializeSignRequestSignerInputSsnValidationValidationTypeField;
exports.deserializeSignRequestSignerInputSsnValidationValidationTypeField = deserializeSignRequestSignerInputSsnValidationValidationTypeField;
exports.serializeSignRequestSignerInputSsnValidation = serializeSignRequestSignerInputSsnValidation;
exports.deserializeSignRequestSignerInputSsnValidation = deserializeSignRequestSignerInputSsnValidation;
exports.serializeSignRequestSignerInputSsnValidationInput = serializeSignRequestSignerInputSsnValidationInput;
exports.deserializeSignRequestSignerInputSsnValidationInput = deserializeSignRequestSignerInputSsnValidationInput;
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
const json_2 = require("../serialization/json");
class SignRequestSignerInputSsnValidation {
    /**
     * Validates that the text input is a Social Security Number (SSN). */
    validationType = 'ssn';
    rawData;
    constructor(fields) {
        if (fields.validationType !== undefined) {
            this.validationType = fields.validationType;
        }
        if (fields.rawData !== undefined) {
            this.rawData = fields.rawData;
        }
    }
}
exports.SignRequestSignerInputSsnValidation = SignRequestSignerInputSsnValidation;
function serializeSignRequestSignerInputSsnValidationValidationTypeField(val) {
    return val;
}
function deserializeSignRequestSignerInputSsnValidationValidationTypeField(val) {
    if (val == 'ssn') {
        return val;
    }
    if ((0, json_1.sdIsString)(val)) {
        return val;
    }
    throw new errors_1.BoxSdkError({
        message: "Can't deserialize SignRequestSignerInputSsnValidationValidationTypeField",
    });
}
function serializeSignRequestSignerInputSsnValidation(val) {
    return {
        ['validation_type']: serializeSignRequestSignerInputSsnValidationValidationTypeField(val.validationType),
    };
}
function deserializeSignRequestSignerInputSsnValidation(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "SignRequestSignerInputSsnValidation"',
        });
    }
    if (val.validation_type == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "validation_type" of type "SignRequestSignerInputSsnValidation" to be defined',
        });
    }
    const validationType = deserializeSignRequestSignerInputSsnValidationValidationTypeField(val.validation_type);
    return {
        validationType: validationType,
    };
}
function serializeSignRequestSignerInputSsnValidationInput(val) {
    return {
        ['validationType']: val.validationType == void 0
            ? val.validationType
            : serializeSignRequestSignerInputSsnValidationValidationTypeField(val.validationType),
    };
}
function deserializeSignRequestSignerInputSsnValidationInput(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "SignRequestSignerInputSsnValidationInput"',
        });
    }
    const validationType = val.validationType == void 0
        ? void 0
        : deserializeSignRequestSignerInputSsnValidationValidationTypeField(val.validationType);
    return {
        validationType: validationType,
    };
}
//# sourceMappingURL=signRequestSignerInputSsnValidation.js.map