/**
 * This file was automatically generated by openapi-codegeneration.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file,
 * and run openapi-codegeneration to regenerate this file.
 */
import * as BasicValidation from './basicValidation.cjs';
/**
 * This function validates the inputs to auth()
 */
export function validateAuthInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validateAuthorizationRequest(parameters['Authorization']) &&
            parameters['Authorization'] !== undefined) {
            validateAuthInput.errors = BasicValidation.validateAuthorizationRequest.errors;
            return false;
        }
        if (!BasicValidation.validateXRealIPRequest(parameters['X-Real-IP']) &&
            parameters['X-Real-IP'] !== undefined) {
            validateAuthInput.errors = BasicValidation.validateXRealIPRequest.errors;
            return false;
        }
        if (!BasicValidation.validateXForwardedProtoRequest(parameters['X-Forwarded-Proto']) &&
            parameters['X-Forwarded-Proto'] !== undefined) {
            validateAuthInput.errors = BasicValidation.validateXForwardedProtoRequest.errors;
            return false;
        }
    }
    else {
        if (parameters !== undefined) {
            return false;
        }
    }
    return true;
}
/**
 * This function validates the outputs of auth()
 */
export function validateAuthOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (response.headers) {
            if (!BasicValidation.validateAuthXRequestAuthenticationResponse(response.headers['XRequestAuthentication']) &&
                response.headers['XRequestAuthentication'] !== undefined) {
                validateAuthOutput.errors = BasicValidation.validateAuthXRequestAuthenticationResponse.errors;
                return false;
            }
        }
        else {
            if (response.headers !== undefined) {
                return false;
            }
        }
        return true;
    }
    if (response.status === 400) {
        return true;
    }
    if (response.status === 401) {
        return true;
    }
    if (response.status === 403) {
        return true;
    }
    if (response.status === 404) {
        return true;
    }
    if (response.status === 500) {
        return true;
    }
    validateAuthOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to login()
 */
export function validateLoginInput(body) {
    if (!BasicValidation.validateLoginBodyRequest(body)) {
        validateLoginInput.errors = BasicValidation.validateLoginBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of login()
 */
export function validateLoginOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 201) {
        if (!BasicValidation.validateLoginResponse201Response(response.body)) {
            validateLoginOutput.errors = BasicValidation.validateLoginResponse201Response.errors;
            return false;
        }
        return true;
    }
    if (response.status === 400) {
        return true;
    }
    if (response.status === 401) {
        return true;
    }
    if (response.status === 403) {
        return true;
    }
    if (response.status === 404) {
        return true;
    }
    if (response.status === 500) {
        return true;
    }
    validateLoginOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to logout()
 */
export function validateLogoutInput(body) {
    if (!BasicValidation.validateLogoutBodyRequest(body)) {
        validateLogoutInput.errors = BasicValidation.validateLogoutBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of logout()
 */
export function validateLogoutOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 204) {
        return true;
    }
    if (response.status === 400) {
        return true;
    }
    if (response.status === 401) {
        return true;
    }
    if (response.status === 403) {
        return true;
    }
    if (response.status === 404) {
        return true;
    }
    if (response.status === 500) {
        return true;
    }
    validateLogoutOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to listUsers()
 */
export function validateListUsersInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validateUsernameRequest(parameters['username']) &&
            parameters['username'] !== undefined) {
            validateListUsersInput.errors = BasicValidation.validateUsernameRequest.errors;
            return false;
        }
    }
    else {
        if (parameters !== undefined) {
            return false;
        }
    }
    return true;
}
/**
 * This function validates the outputs of listUsers()
 */
export function validateListUsersOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateListUsersResponse200Response(response.body)) {
            validateListUsersOutput.errors = BasicValidation.validateListUsersResponse200Response.errors;
            return false;
        }
        return true;
    }
    if (response.status === 400) {
        return true;
    }
    if (response.status === 401) {
        return true;
    }
    if (response.status === 403) {
        return true;
    }
    if (response.status === 404) {
        return true;
    }
    if (response.status === 500) {
        return true;
    }
    validateListUsersOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to createUser()
 */
export function validateCreateUserInput(body) {
    if (!BasicValidation.validateCreateUserBodyRequest(body)) {
        validateCreateUserInput.errors = BasicValidation.validateCreateUserBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of createUser()
 */
export function validateCreateUserOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 201) {
        if (!BasicValidation.validateCreateUserResponse201Response(response.body)) {
            validateCreateUserOutput.errors = BasicValidation.validateCreateUserResponse201Response.errors;
            return false;
        }
        return true;
    }
    if (response.status === 400) {
        return true;
    }
    if (response.status === 401) {
        return true;
    }
    if (response.status === 403) {
        return true;
    }
    if (response.status === 404) {
        return true;
    }
    if (response.status === 500) {
        return true;
    }
    validateCreateUserOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to getUser()
 */
export function validateGetUserInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validateUserIdRequest(parameters['user_id'])) {
            validateGetUserInput.errors = BasicValidation.validateUserIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of getUser()
 */
export function validateGetUserOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateGetUserResponse200Response(response.body)) {
            validateGetUserOutput.errors = BasicValidation.validateGetUserResponse200Response.errors;
            return false;
        }
        return true;
    }
    if (response.status === 400) {
        return true;
    }
    if (response.status === 401) {
        return true;
    }
    if (response.status === 403) {
        return true;
    }
    if (response.status === 404) {
        return true;
    }
    if (response.status === 500) {
        return true;
    }
    validateGetUserOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to updateUser()
 */
export function validateUpdateUserInput(parameters, body) {
    if (parameters) {
        if (!BasicValidation.validateUserIdRequest(parameters['user_id'])) {
            validateUpdateUserInput.errors = BasicValidation.validateUserIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    if (!BasicValidation.validateUpdateUserBodyRequest(body)) {
        validateUpdateUserInput.errors = BasicValidation.validateUpdateUserBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of updateUser()
 */
export function validateUpdateUserOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateUpdateUserResponse200Response(response.body)) {
            validateUpdateUserOutput.errors = BasicValidation.validateUpdateUserResponse200Response.errors;
            return false;
        }
        return true;
    }
    if (response.status === 400) {
        return true;
    }
    if (response.status === 401) {
        return true;
    }
    if (response.status === 403) {
        return true;
    }
    if (response.status === 404) {
        return true;
    }
    if (response.status === 500) {
        return true;
    }
    validateUpdateUserOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to deleteUser()
 */
export function validateDeleteUserInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validateUserIdRequest(parameters['user_id'])) {
            validateDeleteUserInput.errors = BasicValidation.validateUserIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of deleteUser()
 */
export function validateDeleteUserOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 204) {
        return true;
    }
    if (response.status === 400) {
        return true;
    }
    if (response.status === 401) {
        return true;
    }
    if (response.status === 403) {
        return true;
    }
    if (response.status === 404) {
        return true;
    }
    if (response.status === 500) {
        return true;
    }
    validateDeleteUserOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to getIdentity()
 */
export function validateGetIdentityInput() {
    return true;
}
/**
 * This function validates the outputs of getIdentity()
 */
export function validateGetIdentityOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateGetIdentityResponse200Response(response.body)) {
            validateGetIdentityOutput.errors = BasicValidation.validateGetIdentityResponse200Response.errors;
            return false;
        }
        return true;
    }
    if (response.status === 400) {
        return true;
    }
    if (response.status === 401) {
        return true;
    }
    if (response.status === 403) {
        return true;
    }
    if (response.status === 404) {
        return true;
    }
    if (response.status === 500) {
        return true;
    }
    validateGetIdentityOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to updateIdentity()
 */
export function validateUpdateIdentityInput(body) {
    if (body === undefined) {
        return true;
    }
    if (!BasicValidation.validateUpdateIdentityBodyRequest(body)) {
        validateUpdateIdentityInput.errors = BasicValidation.validateUpdateIdentityBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of updateIdentity()
 */
export function validateUpdateIdentityOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateUpdateIdentityResponse200Response(response.body)) {
            validateUpdateIdentityOutput.errors = BasicValidation.validateUpdateIdentityResponse200Response.errors;
            return false;
        }
        return true;
    }
    if (response.status === 400) {
        return true;
    }
    if (response.status === 401) {
        return true;
    }
    if (response.status === 403) {
        return true;
    }
    if (response.status === 404) {
        return true;
    }
    if (response.status === 500) {
        return true;
    }
    validateUpdateIdentityOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to createToken()
 */
export function validateCreateTokenInput(body) {
    if (!BasicValidation.validateCreateTokenBodyRequest(body)) {
        validateCreateTokenInput.errors = BasicValidation.validateCreateTokenBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of createToken()
 */
export function validateCreateTokenOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 201) {
        if (!BasicValidation.validateCreateTokenResponse201Response(response.body)) {
            validateCreateTokenOutput.errors = BasicValidation.validateCreateTokenResponse201Response.errors;
            return false;
        }
        return true;
    }
    validateCreateTokenOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
//# sourceMappingURL=requestValidation.js.map