import * as basicValidation from "./basicValidation.cjs";
/**
 * This function validates the inputs of a GET request on /devices
 */
export function validateGetDevicesInput() {
    return true;
}
/**
 * This function validates the outputs to a GET request on /devices
 */
export function validateGetDevicesOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!basicValidation.validateGetDevicesResponse200Response(response.body)) {
            validateGetDevicesOutput.errors = basicValidation.validateGetDevicesResponse200Response.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;
    }
    validateGetDevicesOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a POST request on /devices
 */
export function validatePostDevicesInput(parameters, body) {
    if (parameters) {
        if (!basicValidation.validateChangedUrlRequest(parameters["changedUrl"])
            && parameters['changedUrl'] !== undefined) {
            validatePostDevicesInput.errors = basicValidation.validateChangedUrlRequest.errors;
            return false;
        }
    }
    else {
        if (parameters !== undefined) {
            return false;
        }
    }
    if (!basicValidation.validatePostDevicesRequestBodyRequest(body)) {
        validatePostDevicesInput.errors = basicValidation.validatePostDevicesRequestBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a POST request on /devices
 */
export function validatePostDevicesOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 201) {
        if (!basicValidation.validatePostDevicesResponse201Response(response.body)) {
            validatePostDevicesOutput.errors = basicValidation.validatePostDevicesResponse201Response.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;
    }
    validatePostDevicesOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a GET request on /devices/{device_id}
 */
export function validateGetDevicesByDeviceIdInput(parameters) {
    if (parameters) {
        if (!basicValidation.validateDeviceIdRequest(parameters["device_id"])) {
            validateGetDevicesByDeviceIdInput.errors = basicValidation.validateDeviceIdRequest.errors;
            return false;
        }
        if (!basicValidation.validateFlatGroupRequest(parameters["flat_group"])
            && parameters['flat_group'] !== undefined) {
            validateGetDevicesByDeviceIdInput.errors = basicValidation.validateFlatGroupRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a GET request on /devices/{device_id}
 */
export function validateGetDevicesByDeviceIdOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!basicValidation.validateGetDevicesByDeviceIdResponse200Response(response.body)) {
            validateGetDevicesByDeviceIdOutput.errors = basicValidation.validateGetDevicesByDeviceIdResponse200Response.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;
    }
    validateGetDevicesByDeviceIdOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a PATCH request on /devices/{device_id}
 */
export function validatePatchDevicesByDeviceIdInput(parameters, body) {
    if (parameters) {
        if (!basicValidation.validateDeviceIdRequest(parameters["device_id"])) {
            validatePatchDevicesByDeviceIdInput.errors = basicValidation.validateDeviceIdRequest.errors;
            return false;
        }
        if (!basicValidation.validateChangedUrlRequest(parameters["changedUrl"])
            && parameters['changedUrl'] !== undefined) {
            validatePatchDevicesByDeviceIdInput.errors = basicValidation.validateChangedUrlRequest.errors;
            return false;
        }
        if (!basicValidation.validateDeletedUrlRequest(parameters["deletedUrl"])
            && parameters['deletedUrl'] !== undefined) {
            validatePatchDevicesByDeviceIdInput.errors = basicValidation.validateDeletedUrlRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    if (body === undefined) {
        return true;
    }
    if (!basicValidation.validatePatchDevicesByDeviceIdRequestBodyRequest(body)) {
        validatePatchDevicesByDeviceIdInput.errors = basicValidation.validatePatchDevicesByDeviceIdRequestBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a PATCH request on /devices/{device_id}
 */
export function validatePatchDevicesByDeviceIdOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!basicValidation.validatePatchDevicesByDeviceIdResponse200Response(response.body)) {
            validatePatchDevicesByDeviceIdOutput.errors = basicValidation.validatePatchDevicesByDeviceIdResponse200Response.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;
    }
    validatePatchDevicesByDeviceIdOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a DELETE request on /devices/{device_id}
 */
export function validateDeleteDevicesByDeviceIdInput(parameters) {
    if (parameters) {
        if (!basicValidation.validateDeviceIdRequest(parameters["device_id"])) {
            validateDeleteDevicesByDeviceIdInput.errors = basicValidation.validateDeviceIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a DELETE request on /devices/{device_id}
 */
export function validateDeleteDevicesByDeviceIdOutput(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;
    }
    validateDeleteDevicesByDeviceIdOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a POST request on /devices/{device_id}
 */
export function validatePostDevicesByDeviceIdInput(parameters) {
    if (parameters) {
        if (!basicValidation.validateDeviceIdRequest(parameters["device_id"])) {
            validatePostDevicesByDeviceIdInput.errors = basicValidation.validateDeviceIdRequest.errors;
            return false;
        }
        if (!basicValidation.validateChangedUrlRequest(parameters["changedUrl"])
            && parameters['changedUrl'] !== undefined) {
            validatePostDevicesByDeviceIdInput.errors = basicValidation.validateChangedUrlRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a POST request on /devices/{device_id}
 */
export function validatePostDevicesByDeviceIdOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 201) {
        if (!basicValidation.validatePostDevicesByDeviceIdResponse201Response(response.body)) {
            validatePostDevicesByDeviceIdOutput.errors = basicValidation.validatePostDevicesByDeviceIdResponse201Response.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;
    }
    validatePostDevicesByDeviceIdOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a GET request on /devices/{device_id}/availability
 */
export function validateGetDevicesByDeviceIdAvailabilityInput(parameters) {
    if (parameters) {
        if (!basicValidation.validateDeviceIdRequest(parameters["device_id"])) {
            validateGetDevicesByDeviceIdAvailabilityInput.errors = basicValidation.validateDeviceIdRequest.errors;
            return false;
        }
        if (!basicValidation.validateStartTimeRequest(parameters["startTime"])
            && parameters['startTime'] !== undefined) {
            validateGetDevicesByDeviceIdAvailabilityInput.errors = basicValidation.validateStartTimeRequest.errors;
            return false;
        }
        if (!basicValidation.validateEndTimeRequest(parameters["endTime"])
            && parameters['endTime'] !== undefined) {
            validateGetDevicesByDeviceIdAvailabilityInput.errors = basicValidation.validateEndTimeRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a GET request on /devices/{device_id}/availability
 */
export function validateGetDevicesByDeviceIdAvailabilityOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!basicValidation.validateGetDevicesByDeviceIdAvailabilityResponse200Response(response.body)) {
            validateGetDevicesByDeviceIdAvailabilityOutput.errors = basicValidation.validateGetDevicesByDeviceIdAvailabilityResponse200Response.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;
    }
    validateGetDevicesByDeviceIdAvailabilityOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a DELETE request on /devices/{device_id}/availability
 */
export function validateDeleteDevicesByDeviceIdAvailabilityInput(parameters) {
    if (parameters) {
        if (!basicValidation.validateDeviceIdRequest(parameters["device_id"])) {
            validateDeleteDevicesByDeviceIdAvailabilityInput.errors = basicValidation.validateDeviceIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a DELETE request on /devices/{device_id}/availability
 */
export function validateDeleteDevicesByDeviceIdAvailabilityOutput(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;
    }
    validateDeleteDevicesByDeviceIdAvailabilityOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a POST request on /devices/{device_id}/availability
 */
export function validatePostDevicesByDeviceIdAvailabilityInput(parameters, body) {
    if (parameters) {
        if (!basicValidation.validateDeviceIdRequest(parameters["device_id"])) {
            validatePostDevicesByDeviceIdAvailabilityInput.errors = basicValidation.validateDeviceIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    if (body === undefined) {
        return true;
    }
    if (!basicValidation.validatePostDevicesByDeviceIdAvailabilityRequestBodyRequest(body)) {
        validatePostDevicesByDeviceIdAvailabilityInput.errors = basicValidation.validatePostDevicesByDeviceIdAvailabilityRequestBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a POST request on /devices/{device_id}/availability
 */
export function validatePostDevicesByDeviceIdAvailabilityOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!basicValidation.validatePostDevicesByDeviceIdAvailabilityResponse200Response(response.body)) {
            validatePostDevicesByDeviceIdAvailabilityOutput.errors = basicValidation.validatePostDevicesByDeviceIdAvailabilityResponse200Response.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;
    }
    validatePostDevicesByDeviceIdAvailabilityOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a POST request on /devices/{device_id}/websocket
 */
export function validatePostDevicesByDeviceIdWebsocketInput(parameters) {
    if (parameters) {
        if (!basicValidation.validateDeviceIdRequest(parameters["device_id"])) {
            validatePostDevicesByDeviceIdWebsocketInput.errors = basicValidation.validateDeviceIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a POST request on /devices/{device_id}/websocket
 */
export function validatePostDevicesByDeviceIdWebsocketOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!basicValidation.validatePostDevicesByDeviceIdWebsocketResponse200Response(response.body)) {
            validatePostDevicesByDeviceIdWebsocketOutput.errors = basicValidation.validatePostDevicesByDeviceIdWebsocketResponse200Response.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;
    }
    validatePostDevicesByDeviceIdWebsocketOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a POST request on /devices/{device_id}/signaling
 */
export function validatePostDevicesByDeviceIdSignalingInput(parameters, body) {
    if (parameters) {
        if (!basicValidation.validateDeviceIdRequest(parameters["device_id"])) {
            validatePostDevicesByDeviceIdSignalingInput.errors = basicValidation.validateDeviceIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    if (!basicValidation.validatePostDevicesByDeviceIdSignalingRequestBodyRequest(body)) {
        validatePostDevicesByDeviceIdSignalingInput.errors = basicValidation.validatePostDevicesByDeviceIdSignalingRequestBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a POST request on /devices/{device_id}/signaling
 */
export function validatePostDevicesByDeviceIdSignalingOutput(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;
    }
    validatePostDevicesByDeviceIdSignalingOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a GET request on /peerconnections
 */
export function validateGetPeerconnectionsInput() {
    return true;
}
/**
 * This function validates the outputs to a GET request on /peerconnections
 */
export function validateGetPeerconnectionsOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!basicValidation.validateGetPeerconnectionsResponse200Response(response.body)) {
            validateGetPeerconnectionsOutput.errors = basicValidation.validateGetPeerconnectionsResponse200Response.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;
    }
    validateGetPeerconnectionsOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a POST request on /peerconnections
 */
export function validatePostPeerconnectionsInput(parameters, body) {
    if (parameters) {
        if (!basicValidation.validateClosedUrlRequest(parameters["closedUrl"])
            && parameters['closedUrl'] !== undefined) {
            validatePostPeerconnectionsInput.errors = basicValidation.validateClosedUrlRequest.errors;
            return false;
        }
        if (!basicValidation.validateStatusChangedUrlRequest(parameters["statusChangedUrl"])
            && parameters['statusChangedUrl'] !== undefined) {
            validatePostPeerconnectionsInput.errors = basicValidation.validateStatusChangedUrlRequest.errors;
            return false;
        }
    }
    else {
        if (parameters !== undefined) {
            return false;
        }
    }
    if (!basicValidation.validatePostPeerconnectionsRequestBodyRequest(body)) {
        validatePostPeerconnectionsInput.errors = basicValidation.validatePostPeerconnectionsRequestBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a POST request on /peerconnections
 */
export function validatePostPeerconnectionsOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 201) {
        if (!basicValidation.validatePostPeerconnectionsResponse201Response(response.body)) {
            validatePostPeerconnectionsOutput.errors = basicValidation.validatePostPeerconnectionsResponse201Response.errors;
            return false;
        }
        return true;
    }
    if (response.status === 202) {
        if (!basicValidation.validatePostPeerconnectionsResponse202Response(response.body)) {
            validatePostPeerconnectionsOutput.errors = basicValidation.validatePostPeerconnectionsResponse202Response.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;
    }
    validatePostPeerconnectionsOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a GET request on /peerconnections/{peerconnection_id}
 */
export function validateGetPeerconnectionsByPeerconnectionIdInput(parameters) {
    if (parameters) {
        if (!basicValidation.validatePeerconnectionIdRequest(parameters["peerconnection_id"])) {
            validateGetPeerconnectionsByPeerconnectionIdInput.errors = basicValidation.validatePeerconnectionIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a GET request on /peerconnections/{peerconnection_id}
 */
export function validateGetPeerconnectionsByPeerconnectionIdOutput(response) {
    if (response.status < 100 || response.status >= 600)
        return false;
    if (response.status === 200) {
        if (!basicValidation.validateGetPeerconnectionsByPeerconnectionIdResponse200Response(response.body)) {
            validateGetPeerconnectionsByPeerconnectionIdOutput.errors = basicValidation.validateGetPeerconnectionsByPeerconnectionIdResponse200Response.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;
    }
    validateGetPeerconnectionsByPeerconnectionIdOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a DELETE request on /peerconnections/{peerconnection_id}
 */
export function validateDeletePeerconnectionsByPeerconnectionIdInput(parameters) {
    if (parameters) {
        if (!basicValidation.validatePeerconnectionIdRequest(parameters["peerconnection_id"])) {
            validateDeletePeerconnectionsByPeerconnectionIdInput.errors = basicValidation.validatePeerconnectionIdRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a DELETE request on /peerconnections/{peerconnection_id}
 */
export function validateDeletePeerconnectionsByPeerconnectionIdOutput(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;
    }
    validateDeletePeerconnectionsByPeerconnectionIdOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
/**
 * This function validates the inputs of a PATCH request on /peerconnections/{peerconnection_id}/device_status
 */
export function validatePatchPeerconnectionsByPeerconnectionIdDeviceStatusInput(parameters, body) {
    if (parameters) {
        if (!basicValidation.validatePeerconnectionIdRequest(parameters["peerconnection_id"])) {
            validatePatchPeerconnectionsByPeerconnectionIdDeviceStatusInput.errors = basicValidation.validatePeerconnectionIdRequest.errors;
            return false;
        }
        if (!basicValidation.validateDeviceUrlRequest(parameters["device_url"])) {
            validatePatchPeerconnectionsByPeerconnectionIdDeviceStatusInput.errors = basicValidation.validateDeviceUrlRequest.errors;
            return false;
        }
    }
    else {
        return false;
    }
    if (!basicValidation.validatePatchPeerconnectionsByPeerconnectionIdDeviceStatusRequestBodyRequest(body)) {
        validatePatchPeerconnectionsByPeerconnectionIdDeviceStatusInput.errors = basicValidation.validatePatchPeerconnectionsByPeerconnectionIdDeviceStatusRequestBodyRequest.errors;
        return false;
    }
    return true;
}
/**
 * This function validates the outputs to a PATCH request on /peerconnections/{peerconnection_id}/device_status
 */
export function validatePatchPeerconnectionsByPeerconnectionIdDeviceStatusOutput(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;
    }
    validatePatchPeerconnectionsByPeerconnectionIdDeviceStatusOutput.errors = `Response status ${response.status} is unexpected`;
    return false;
}
//# sourceMappingURL=requestValidation.js.map