"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SignRequestSignerInputZipValidation = void 0;
exports.serializeSignRequestSignerInputZipValidationValidationTypeField = serializeSignRequestSignerInputZipValidationValidationTypeField;
exports.deserializeSignRequestSignerInputZipValidationValidationTypeField = deserializeSignRequestSignerInputZipValidationValidationTypeField;
exports.serializeSignRequestSignerInputZipValidation = serializeSignRequestSignerInputZipValidation;
exports.deserializeSignRequestSignerInputZipValidation = deserializeSignRequestSignerInputZipValidation;
exports.serializeSignRequestSignerInputZipValidationInput = serializeSignRequestSignerInputZipValidationInput;
exports.deserializeSignRequestSignerInputZipValidationInput = deserializeSignRequestSignerInputZipValidationInput;
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
const json_2 = require("../serialization/json");
class SignRequestSignerInputZipValidation {
    /**
     * Validates that the text input is a ZIP code. */
    validationType = 'zip';
    rawData;
    constructor(fields) {
        if (fields.validationType !== undefined) {
            this.validationType = fields.validationType;
        }
        if (fields.rawData !== undefined) {
            this.rawData = fields.rawData;
        }
    }
}
exports.SignRequestSignerInputZipValidation = SignRequestSignerInputZipValidation;
function serializeSignRequestSignerInputZipValidationValidationTypeField(val) {
    return val;
}
function deserializeSignRequestSignerInputZipValidationValidationTypeField(val) {
    if (val == 'zip') {
        return val;
    }
    if ((0, json_1.sdIsString)(val)) {
        return val;
    }
    throw new errors_1.BoxSdkError({
        message: "Can't deserialize SignRequestSignerInputZipValidationValidationTypeField",
    });
}
function serializeSignRequestSignerInputZipValidation(val) {
    return {
        ['validation_type']: serializeSignRequestSignerInputZipValidationValidationTypeField(val.validationType),
    };
}
function deserializeSignRequestSignerInputZipValidation(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "SignRequestSignerInputZipValidation"',
        });
    }
    if (val.validation_type == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "validation_type" of type "SignRequestSignerInputZipValidation" to be defined',
        });
    }
    const validationType = deserializeSignRequestSignerInputZipValidationValidationTypeField(val.validation_type);
    return {
        validationType: validationType,
    };
}
function serializeSignRequestSignerInputZipValidationInput(val) {
    return {
        ['validationType']: val.validationType == void 0
            ? val.validationType
            : serializeSignRequestSignerInputZipValidationValidationTypeField(val.validationType),
    };
}
function deserializeSignRequestSignerInputZipValidationInput(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "SignRequestSignerInputZipValidationInput"',
        });
    }
    const validationType = val.validationType == void 0
        ? void 0
        : deserializeSignRequestSignerInputZipValidationValidationTypeField(val.validationType);
    return {
        validationType: validationType,
    };
}
//# sourceMappingURL=signRequestSignerInputZipValidation.js.map