/* tslint:disable */
/* eslint-disable */
/**
 * Synapse REST API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import { mapValues } from '../runtime';
/**
 * @export
 */
export const JsonSchemaTypeEnum = {
    null: 'null',
    boolean: 'boolean',
    object: 'object',
    array: 'array',
    number: 'number',
    string: 'string',
    integer: 'integer'
};
/**
 * Check if a given object implements the JsonSchema interface.
 */
export function instanceOfJsonSchema(value) {
    return true;
}
export function JsonSchemaFromJSON(json) {
    return JsonSchemaFromJSONTyped(json, false);
}
export function JsonSchemaFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        '$schema': json['$schema'] == null ? undefined : json['$schema'],
        '$id': json['$id'] == null ? undefined : json['$id'],
        '$ref': json['$ref'] == null ? undefined : json['$ref'],
        'type': json['type'] == null ? undefined : json['type'],
        'items': json['items'] == null ? undefined : JsonSchemaFromJSON(json['items']),
        'properties': json['properties'] == null ? undefined : (mapValues(json['properties'], JsonSchemaFromJSON)),
        'title': json['title'] == null ? undefined : json['title'],
        'description': json['description'] == null ? undefined : json['description'],
        'allOf': json['allOf'] == null ? undefined : (json['allOf'].map(JsonSchemaFromJSON)),
        'anyOf': json['anyOf'] == null ? undefined : (json['anyOf'].map(JsonSchemaFromJSON)),
        'oneOf': json['oneOf'] == null ? undefined : (json['oneOf'].map(JsonSchemaFromJSON)),
        'not': json['not'] == null ? undefined : JsonSchemaFromJSON(json['not']),
        'format': json['format'] == null ? undefined : json['format'],
        'definitions': json['definitions'] == null ? undefined : (mapValues(json['definitions'], JsonSchemaFromJSON)),
        '_enum': json['enum'] == null ? undefined : json['enum'],
        '_const': json['const'] == null ? undefined : json['const'],
        'source': json['source'] == null ? undefined : json['source'],
        'required': json['required'] == null ? undefined : json['required'],
        'maxLength': json['maxLength'] == null ? undefined : json['maxLength'],
        'minLength': json['minLength'] == null ? undefined : json['minLength'],
        'maxItems': json['maxItems'] == null ? undefined : json['maxItems'],
        'minItems': json['minItems'] == null ? undefined : json['minItems'],
        'uniqueItems': json['uniqueItems'] == null ? undefined : json['uniqueItems'],
        'pattern': json['pattern'] == null ? undefined : json['pattern'],
        '_if': json['if'] == null ? undefined : JsonSchemaFromJSON(json['if']),
        'then': json['then'] == null ? undefined : JsonSchemaFromJSON(json['then']),
        '_else': json['else'] == null ? undefined : JsonSchemaFromJSON(json['else']),
        'maximum': json['maximum'] == null ? undefined : json['maximum'],
        'minimum': json['minimum'] == null ? undefined : json['minimum'],
        '_default': json['default'] == null ? undefined : json['default'],
        'contains': json['contains'] == null ? undefined : JsonSchemaFromJSON(json['contains']),
        'additionalProperties': json['additionalProperties'] == null ? undefined : JsonSchemaFromJSON(json['additionalProperties']),
    };
}
export function JsonSchemaToJSON(json) {
    return JsonSchemaToJSONTyped(json, false);
}
export function JsonSchemaToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        '$schema': value['$schema'],
        '$id': value['$id'],
        '$ref': value['$ref'],
        'type': value['type'],
        'items': JsonSchemaToJSON(value['items']),
        'properties': value['properties'] == null ? undefined : (mapValues(value['properties'], JsonSchemaToJSON)),
        'title': value['title'],
        'description': value['description'],
        'allOf': value['allOf'] == null ? undefined : (value['allOf'].map(JsonSchemaToJSON)),
        'anyOf': value['anyOf'] == null ? undefined : (value['anyOf'].map(JsonSchemaToJSON)),
        'oneOf': value['oneOf'] == null ? undefined : (value['oneOf'].map(JsonSchemaToJSON)),
        'not': JsonSchemaToJSON(value['not']),
        'format': value['format'],
        'definitions': value['definitions'] == null ? undefined : (mapValues(value['definitions'], JsonSchemaToJSON)),
        'enum': value['_enum'],
        'const': value['_const'],
        'source': value['source'],
        'required': value['required'],
        'maxLength': value['maxLength'],
        'minLength': value['minLength'],
        'maxItems': value['maxItems'],
        'minItems': value['minItems'],
        'uniqueItems': value['uniqueItems'],
        'pattern': value['pattern'],
        'if': JsonSchemaToJSON(value['_if']),
        'then': JsonSchemaToJSON(value['then']),
        'else': JsonSchemaToJSON(value['_else']),
        'maximum': value['maximum'],
        'minimum': value['minimum'],
        'default': value['_default'],
        'contains': JsonSchemaToJSON(value['contains']),
        'additionalProperties': JsonSchemaToJSON(value['additionalProperties']),
    };
}
//# sourceMappingURL=JsonSchema.js.map