import { validateUserType, validateAuthenticationMessage, validateConnectionStateChangedMessage, validateDeviceOverview, validateInstantiableCloudDevice, validateConcreteDevice, validateInstantiableBrowserDevice, validateDeviceGroup, validateDevice, validateCallback, validateEventCallback, validateDeviceChangedEventCallback, validateDeviceDeletedEventCallback, validateMessage, validateCommandMessage, validateCreatePeerconnectionMessage, validateClosePeerconnectionMessage, validateSignalingMessage, validateConfigurationMessage, validateExperimentStatusChangedMessage, validateLoggingMessage, validatePeerconnection, validatePeerconnectionClosedEventCallback, validatePeerconnectionStatusChangedEventCallback, validateUserTypeRequest, validateUserTypeResponse, validateAuthenticationMessageRequest, validateAuthenticationMessageResponse, validateConnectionStateChangedMessageRequest, validateConnectionStateChangedMessageResponse, validateDeviceOverviewRequest, validateDeviceOverviewResponse, validateInstantiableCloudDeviceRequest, validateInstantiableCloudDeviceResponse, validateConcreteDeviceRequest, validateConcreteDeviceResponse, validateInstantiableBrowserDeviceRequest, validateInstantiableBrowserDeviceResponse, validateDeviceGroupRequest, validateDeviceGroupResponse, validateDeviceRequest, validateDeviceResponse, validateCallbackRequest, validateCallbackResponse, validateEventCallbackRequest, validateEventCallbackResponse, validateDeviceChangedEventCallbackRequest, validateDeviceChangedEventCallbackResponse, validateDeviceDeletedEventCallbackRequest, validateDeviceDeletedEventCallbackResponse, validateMessageRequest, validateMessageResponse, validateCommandMessageRequest, validateCommandMessageResponse, validateCreatePeerconnectionMessageRequest, validateCreatePeerconnectionMessageResponse, validateClosePeerconnectionMessageRequest, validateClosePeerconnectionMessageResponse, validateSignalingMessageRequest, validateSignalingMessageResponse, validateConfigurationMessageRequest, validateConfigurationMessageResponse, validateExperimentStatusChangedMessageRequest, validateExperimentStatusChangedMessageResponse, validateLoggingMessageRequest, validateLoggingMessageResponse, validatePeerconnectionRequest, validatePeerconnectionResponse, validatePeerconnectionClosedEventCallbackRequest, validatePeerconnectionClosedEventCallbackResponse, validatePeerconnectionStatusChangedEventCallbackRequest, validatePeerconnectionStatusChangedEventCallbackResponse } from "./basicValidation.cjs";
export function isSuccessResponse(response) {
    return response.status < 400;
}
export function isErrorResponse(response) {
    return response.status >= 400;
}
export class ErrorWithStatus extends Error {
    status;
    constructor(message, status) {
        super(message);
        this.status = status;
        this.name = "ErrorWithStatus";
    }
}
export class ValidationError extends ErrorWithStatus {
    errors;
    constructor(message, errors, status) {
        super(message, status);
        this.name = "ValidationError";
        this.errors = errors;
    }
}
export function isUserType(obj, type = "all") {
    switch (type) {
        case "request":
            return validateUserTypeRequest(obj);
        case "response":
            return validateUserTypeResponse(obj);
        default:
            return validateUserType(obj);
    }
}
export function isAuthenticationMessage(obj, type = "all") {
    switch (type) {
        case "request":
            return validateAuthenticationMessageRequest(obj);
        case "response":
            return validateAuthenticationMessageResponse(obj);
        default:
            return validateAuthenticationMessage(obj);
    }
}
export function isConnectionStateChangedMessage(obj, type = "all") {
    switch (type) {
        case "request":
            return validateConnectionStateChangedMessageRequest(obj);
        case "response":
            return validateConnectionStateChangedMessageResponse(obj);
        default:
            return validateConnectionStateChangedMessage(obj);
    }
}
export function isDeviceOverview(obj, type = "all") {
    switch (type) {
        case "request":
            return validateDeviceOverviewRequest(obj);
        case "response":
            return validateDeviceOverviewResponse(obj);
        default:
            return validateDeviceOverview(obj);
    }
}
export function isInstantiableCloudDevice(obj, type = "all") {
    switch (type) {
        case "request":
            return validateInstantiableCloudDeviceRequest(obj);
        case "response":
            return validateInstantiableCloudDeviceResponse(obj);
        default:
            return validateInstantiableCloudDevice(obj);
    }
}
export function isConcreteDevice(obj, type = "all") {
    switch (type) {
        case "request":
            return validateConcreteDeviceRequest(obj);
        case "response":
            return validateConcreteDeviceResponse(obj);
        default:
            return validateConcreteDevice(obj);
    }
}
export function isInstantiableBrowserDevice(obj, type = "all") {
    switch (type) {
        case "request":
            return validateInstantiableBrowserDeviceRequest(obj);
        case "response":
            return validateInstantiableBrowserDeviceResponse(obj);
        default:
            return validateInstantiableBrowserDevice(obj);
    }
}
export function isDeviceGroup(obj, type = "all") {
    switch (type) {
        case "request":
            return validateDeviceGroupRequest(obj);
        case "response":
            return validateDeviceGroupResponse(obj);
        default:
            return validateDeviceGroup(obj);
    }
}
export function isDevice(obj, type = "all") {
    switch (type) {
        case "request":
            return validateDeviceRequest(obj);
        case "response":
            return validateDeviceResponse(obj);
        default:
            return validateDevice(obj);
    }
}
export function isCallback(obj, type = "all") {
    switch (type) {
        case "request":
            return validateCallbackRequest(obj);
        case "response":
            return validateCallbackResponse(obj);
        default:
            return validateCallback(obj);
    }
}
export function isEventCallback(obj, type = "all") {
    switch (type) {
        case "request":
            return validateEventCallbackRequest(obj);
        case "response":
            return validateEventCallbackResponse(obj);
        default:
            return validateEventCallback(obj);
    }
}
export function isDeviceChangedEventCallback(obj, type = "all") {
    switch (type) {
        case "request":
            return validateDeviceChangedEventCallbackRequest(obj);
        case "response":
            return validateDeviceChangedEventCallbackResponse(obj);
        default:
            return validateDeviceChangedEventCallback(obj);
    }
}
export function isDeviceDeletedEventCallback(obj, type = "all") {
    switch (type) {
        case "request":
            return validateDeviceDeletedEventCallbackRequest(obj);
        case "response":
            return validateDeviceDeletedEventCallbackResponse(obj);
        default:
            return validateDeviceDeletedEventCallback(obj);
    }
}
export function isMessage(obj, type = "all") {
    switch (type) {
        case "request":
            return validateMessageRequest(obj);
        case "response":
            return validateMessageResponse(obj);
        default:
            return validateMessage(obj);
    }
}
export function isCommandMessage(obj, type = "all") {
    switch (type) {
        case "request":
            return validateCommandMessageRequest(obj);
        case "response":
            return validateCommandMessageResponse(obj);
        default:
            return validateCommandMessage(obj);
    }
}
export function isCreatePeerconnectionMessage(obj, type = "all") {
    switch (type) {
        case "request":
            return validateCreatePeerconnectionMessageRequest(obj);
        case "response":
            return validateCreatePeerconnectionMessageResponse(obj);
        default:
            return validateCreatePeerconnectionMessage(obj);
    }
}
export function isClosePeerconnectionMessage(obj, type = "all") {
    switch (type) {
        case "request":
            return validateClosePeerconnectionMessageRequest(obj);
        case "response":
            return validateClosePeerconnectionMessageResponse(obj);
        default:
            return validateClosePeerconnectionMessage(obj);
    }
}
export function isSignalingMessage(obj, type = "all") {
    switch (type) {
        case "request":
            return validateSignalingMessageRequest(obj);
        case "response":
            return validateSignalingMessageResponse(obj);
        default:
            return validateSignalingMessage(obj);
    }
}
export function isConfigurationMessage(obj, type = "all") {
    switch (type) {
        case "request":
            return validateConfigurationMessageRequest(obj);
        case "response":
            return validateConfigurationMessageResponse(obj);
        default:
            return validateConfigurationMessage(obj);
    }
}
export function isExperimentStatusChangedMessage(obj, type = "all") {
    switch (type) {
        case "request":
            return validateExperimentStatusChangedMessageRequest(obj);
        case "response":
            return validateExperimentStatusChangedMessageResponse(obj);
        default:
            return validateExperimentStatusChangedMessage(obj);
    }
}
export function isLoggingMessage(obj, type = "all") {
    switch (type) {
        case "request":
            return validateLoggingMessageRequest(obj);
        case "response":
            return validateLoggingMessageResponse(obj);
        default:
            return validateLoggingMessage(obj);
    }
}
export function isPeerconnection(obj, type = "all") {
    switch (type) {
        case "request":
            return validatePeerconnectionRequest(obj);
        case "response":
            return validatePeerconnectionResponse(obj);
        default:
            return validatePeerconnection(obj);
    }
}
export function isPeerconnectionClosedEventCallback(obj, type = "all") {
    switch (type) {
        case "request":
            return validatePeerconnectionClosedEventCallbackRequest(obj);
        case "response":
            return validatePeerconnectionClosedEventCallbackResponse(obj);
        default:
            return validatePeerconnectionClosedEventCallback(obj);
    }
}
export function isPeerconnectionStatusChangedEventCallback(obj, type = "all") {
    switch (type) {
        case "request":
            return validatePeerconnectionStatusChangedEventCallbackRequest(obj);
        case "response":
            return validatePeerconnectionStatusChangedEventCallbackResponse(obj);
        default:
            return validatePeerconnectionStatusChangedEventCallback(obj);
    }
}
//# sourceMappingURL=types.js.map