/**
 * 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 listDevices()
 */
export function validateListDevicesInput() {
    return true;
}
/**
 * This function validates the outputs of listDevices()
 */
export function validateListDevicesOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateListDevicesResponse200Response(response.body)) {
            validateListDevicesOutput.errors = BasicValidation.validateListDevicesResponse200Response.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;
    }
    validateListDevicesOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to createDevice()
 */
export function validateCreateDeviceInput(parameters, body) {
    if (parameters) {
        if (!BasicValidation.validateChangedUrlRequest(parameters['changedUrl']) &&
            parameters['changedUrl'] !== undefined) {
            validateCreateDeviceInput.errors = BasicValidation.validateChangedUrlRequest.errors;
            return false;
        }
    }
    else {
        if (parameters !== undefined) {
            return false;
        }
    }
    if (!BasicValidation.validateCreateDeviceBodyRequest(body)) {
        validateCreateDeviceInput.errors = BasicValidation.validateCreateDeviceBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of createDevice()
 */
export function validateCreateDeviceOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 201) {
        if (!BasicValidation.validateCreateDeviceResponse201Response(response.body)) {
            validateCreateDeviceOutput.errors = BasicValidation.validateCreateDeviceResponse201Response.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;
    }
    validateCreateDeviceOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to getDevice()
 */
export function validateGetDeviceInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) {
            validateGetDeviceInput.errors = BasicValidation.validateDeviceIdRequest.errors;
            return false;
        }
        if (!BasicValidation.validateFlatGroupRequest(parameters['flat_group']) &&
            parameters['flat_group'] !== undefined) {
            validateGetDeviceInput.errors = BasicValidation.validateFlatGroupRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of getDevice()
 */
export function validateGetDeviceOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateGetDeviceResponse200Response(response.body)) {
            validateGetDeviceOutput.errors = BasicValidation.validateGetDeviceResponse200Response.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;
    }
    validateGetDeviceOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to updateDevice()
 */
export function validateUpdateDeviceInput(parameters, body) {
    if (parameters) {
        if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) {
            validateUpdateDeviceInput.errors = BasicValidation.validateDeviceIdRequest.errors;
            return false;
        }
        if (!BasicValidation.validateChangedUrlRequest(parameters['changedUrl']) &&
            parameters['changedUrl'] !== undefined) {
            validateUpdateDeviceInput.errors = BasicValidation.validateChangedUrlRequest.errors;
            return false;
        }
        if (!BasicValidation.validateDeletedUrlRequest(parameters['deletedUrl']) &&
            parameters['deletedUrl'] !== undefined) {
            validateUpdateDeviceInput.errors = BasicValidation.validateDeletedUrlRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    if (body === undefined) {
        return true;
    }
    if (!BasicValidation.validateUpdateDeviceBodyRequest(body)) {
        validateUpdateDeviceInput.errors = BasicValidation.validateUpdateDeviceBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of updateDevice()
 */
export function validateUpdateDeviceOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateUpdateDeviceResponse200Response(response.body)) {
            validateUpdateDeviceOutput.errors = BasicValidation.validateUpdateDeviceResponse200Response.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;
    }
    validateUpdateDeviceOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to deleteDevice()
 */
export function validateDeleteDeviceInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) {
            validateDeleteDeviceInput.errors = BasicValidation.validateDeviceIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of deleteDevice()
 */
export function validateDeleteDeviceOutput(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;
    }
    validateDeleteDeviceOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to instantiateDevice()
 */
export function validateInstantiateDeviceInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) {
            validateInstantiateDeviceInput.errors = BasicValidation.validateDeviceIdRequest.errors;
            return false;
        }
        if (!BasicValidation.validateChangedUrlRequest(parameters['changedUrl']) &&
            parameters['changedUrl'] !== undefined) {
            validateInstantiateDeviceInput.errors = BasicValidation.validateChangedUrlRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of instantiateDevice()
 */
export function validateInstantiateDeviceOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 201) {
        if (!BasicValidation.validateInstantiateDeviceResponse201Response(response.body)) {
            validateInstantiateDeviceOutput.errors = BasicValidation.validateInstantiateDeviceResponse201Response.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;
    }
    validateInstantiateDeviceOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to getDeviceAvailability()
 */
export function validateGetDeviceAvailabilityInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) {
            validateGetDeviceAvailabilityInput.errors = BasicValidation.validateDeviceIdRequest.errors;
            return false;
        }
        if (!BasicValidation.validateStartTimeRequest(parameters['startTime']) &&
            parameters['startTime'] !== undefined) {
            validateGetDeviceAvailabilityInput.errors = BasicValidation.validateStartTimeRequest.errors;
            return false;
        }
        if (!BasicValidation.validateEndTimeRequest(parameters['endTime']) &&
            parameters['endTime'] !== undefined) {
            validateGetDeviceAvailabilityInput.errors = BasicValidation.validateEndTimeRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of getDeviceAvailability()
 */
export function validateGetDeviceAvailabilityOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateGetDeviceAvailabilityResponse200Response(response.body)) {
            validateGetDeviceAvailabilityOutput.errors = BasicValidation.validateGetDeviceAvailabilityResponse200Response.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;
    }
    validateGetDeviceAvailabilityOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to deleteDeviceAvailabilityRules()
 */
export function validateDeleteDeviceAvailabilityRulesInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) {
            validateDeleteDeviceAvailabilityRulesInput.errors = BasicValidation.validateDeviceIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of deleteDeviceAvailabilityRules()
 */
export function validateDeleteDeviceAvailabilityRulesOutput(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;
    }
    validateDeleteDeviceAvailabilityRulesOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to addDeviceAvailabilityRules()
 */
export function validateAddDeviceAvailabilityRulesInput(parameters, body) {
    if (parameters) {
        if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) {
            validateAddDeviceAvailabilityRulesInput.errors = BasicValidation.validateDeviceIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    if (body === undefined) {
        return true;
    }
    if (!BasicValidation.validateAddDeviceAvailabilityRulesBodyRequest(body)) {
        validateAddDeviceAvailabilityRulesInput.errors = BasicValidation.validateAddDeviceAvailabilityRulesBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of addDeviceAvailabilityRules()
 */
export function validateAddDeviceAvailabilityRulesOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateAddDeviceAvailabilityRulesResponse200Response(response.body)) {
            validateAddDeviceAvailabilityRulesOutput.errors = BasicValidation.validateAddDeviceAvailabilityRulesResponse200Response.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;
    }
    validateAddDeviceAvailabilityRulesOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to createWebsocketToken()
 */
export function validateCreateWebsocketTokenInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) {
            validateCreateWebsocketTokenInput.errors = BasicValidation.validateDeviceIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of createWebsocketToken()
 */
export function validateCreateWebsocketTokenOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateCreateWebsocketTokenResponse200Response(response.body)) {
            validateCreateWebsocketTokenOutput.errors = BasicValidation.validateCreateWebsocketTokenResponse200Response.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;
    }
    validateCreateWebsocketTokenOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to sendSignalingMessage()
 */
export function validateSendSignalingMessageInput(parameters, body) {
    if (parameters) {
        if (!BasicValidation.validateDeviceIdRequest(parameters['device_id'])) {
            validateSendSignalingMessageInput.errors = BasicValidation.validateDeviceIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    if (!BasicValidation.validateSendSignalingMessageBodyRequest(body)) {
        validateSendSignalingMessageInput.errors = BasicValidation.validateSendSignalingMessageBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of sendSignalingMessage()
 */
export function validateSendSignalingMessageOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        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;
    }
    validateSendSignalingMessageOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to listPeerconnections()
 */
export function validateListPeerconnectionsInput() {
    return true;
}
/**
 * This function validates the outputs of listPeerconnections()
 */
export function validateListPeerconnectionsOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateListPeerconnectionsResponse200Response(response.body)) {
            validateListPeerconnectionsOutput.errors = BasicValidation.validateListPeerconnectionsResponse200Response.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;
    }
    validateListPeerconnectionsOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to createPeerconnection()
 */
export function validateCreatePeerconnectionInput(parameters, body) {
    if (parameters) {
        if (!BasicValidation.validateClosedUrlRequest(parameters['closedUrl']) &&
            parameters['closedUrl'] !== undefined) {
            validateCreatePeerconnectionInput.errors = BasicValidation.validateClosedUrlRequest.errors;
            return false;
        }
        if (!BasicValidation.validateStatusChangedUrlRequest(parameters['statusChangedUrl']) &&
            parameters['statusChangedUrl'] !== undefined) {
            validateCreatePeerconnectionInput.errors = BasicValidation.validateStatusChangedUrlRequest.errors;
            return false;
        }
    }
    else {
        if (parameters !== undefined) {
            return false;
        }
    }
    if (!BasicValidation.validateCreatePeerconnectionBodyRequest(body)) {
        validateCreatePeerconnectionInput.errors = BasicValidation.validateCreatePeerconnectionBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of createPeerconnection()
 */
export function validateCreatePeerconnectionOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 201) {
        if (!BasicValidation.validateCreatePeerconnectionResponse201Response(response.body)) {
            validateCreatePeerconnectionOutput.errors = BasicValidation.validateCreatePeerconnectionResponse201Response.errors;
            return false;
        }
        return true;
    }
    if (response.status === 202) {
        if (!BasicValidation.validateCreatePeerconnectionResponse202Response(response.body)) {
            validateCreatePeerconnectionOutput.errors = BasicValidation.validateCreatePeerconnectionResponse202Response.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;
    }
    validateCreatePeerconnectionOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to getPeerconnection()
 */
export function validateGetPeerconnectionInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validatePeerconnectionIdRequest(parameters['peerconnection_id'])) {
            validateGetPeerconnectionInput.errors = BasicValidation.validatePeerconnectionIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of getPeerconnection()
 */
export function validateGetPeerconnectionOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!BasicValidation.validateGetPeerconnectionResponse200Response(response.body)) {
            validateGetPeerconnectionOutput.errors = BasicValidation.validateGetPeerconnectionResponse200Response.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;
    }
    validateGetPeerconnectionOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to deletePeerconnection()
 */
export function validateDeletePeerconnectionInput(parameters) {
    if (parameters) {
        if (!BasicValidation.validatePeerconnectionIdRequest(parameters['peerconnection_id'])) {
            validateDeletePeerconnectionInput.errors = BasicValidation.validatePeerconnectionIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of deletePeerconnection()
 */
export function validateDeletePeerconnectionOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 202) {
        return true;
    }
    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;
    }
    validateDeletePeerconnectionOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs to patchPeerconnectionDeviceStatus()
 */
export function validatePatchPeerconnectionDeviceStatusInput(parameters, body) {
    if (parameters) {
        if (!BasicValidation.validatePeerconnectionIdRequest(parameters['peerconnection_id'])) {
            validatePatchPeerconnectionDeviceStatusInput.errors = BasicValidation.validatePeerconnectionIdRequest.errors;
            return false;
        }
        if (!BasicValidation.validateDeviceUrlRequest(parameters['device_url'])) {
            validatePatchPeerconnectionDeviceStatusInput.errors = BasicValidation.validateDeviceUrlRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    if (!BasicValidation.validatePatchPeerconnectionDeviceStatusBodyRequest(body)) {
        validatePatchPeerconnectionDeviceStatusInput.errors = BasicValidation.validatePatchPeerconnectionDeviceStatusBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs of patchPeerconnectionDeviceStatus()
 */
export function validatePatchPeerconnectionDeviceStatusOutput(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;
    }
    validatePatchPeerconnectionDeviceStatusOutput.errors =
        `Response status ${response.status} is unexpected`;
    return false;
}
//# sourceMappingURL=requestValidation.js.map