// This file is auto-generated by @hey-api/openapi-ts

export const APIKeySchema = {
    properties: {
        id: {
            type: 'string',
            title: 'Id'
        },
        key: {
            type: 'string',
            format: 'password',
            title: 'Key',
            writeOnly: true
        }
    },
    type: 'object',
    required: ['id', 'key'],
    title: 'APIKey',
    description: 'A key-value pair for a known and supported API.'
} as const;

export const AccessSchema = {
    properties: {
        asset: {
            '$ref': '#/components/schemas/Asset'
        },
        classification: {
            anyOf: [
                {
                    '$ref': '#/components/schemas/Classification'
                },
                {
                    type: 'null'
                }
            ]
        }
    },
    type: 'object',
    required: ['asset'],
    title: 'Access',
    description: `The \`\`access\`\` block contains information related to access control for
this data object.`
} as const;

export const AccessTokenSchema = {
    properties: {
        id: {
            type: 'string',
            title: 'Id'
        },
        key: {
            type: 'string',
            format: 'password',
            title: 'Key',
            writeOnly: true
        }
    },
    type: 'object',
    required: ['id', 'key'],
    title: 'AccessToken',
    description: 'A key-value pair for a known and supported access scope.'
} as const;

export const AssetSchema = {
    properties: {
        name: {
            type: 'string',
            title: 'Name',
            examples: ['Drogon']
        }
    },
    type: 'object',
    required: ['name'],
    title: 'Asset',
    description: `The \`\`access.asset\`\` block contains information about the owner asset of
these data.`
} as const;

export const ClassificationSchema = {
    type: 'string',
    enum: ['asset', 'internal', 'restricted'],
    title: 'Classification',
    description: 'The security classification for a given data object.'
} as const;

export const CoordinateSystemSchema = {
    properties: {
        identifier: {
            type: 'string',
            title: 'Identifier',
            examples: ['ST_WGS84_UTM37N_P32637']
        },
        uuid: {
            type: 'string',
            format: 'uuid',
            title: 'Uuid',
            examples: ['15ce3b84-766f-4c93-9050-b154861f9100']
        }
    },
    type: 'object',
    required: ['identifier', 'uuid'],
    title: 'CoordinateSystem',
    description: `The \`\`masterdata.smda.coordinate_system\`\` block contains the coordinate
system known to SMDA.`
} as const;

export const CountryItemSchema = {
    properties: {
        identifier: {
            type: 'string',
            title: 'Identifier',
            examples: ['Norway']
        },
        uuid: {
            type: 'string',
            format: 'uuid',
            title: 'Uuid',
            examples: ['15ce3b84-766f-4c93-9050-b154861f9100']
        }
    },
    type: 'object',
    required: ['identifier', 'uuid'],
    title: 'CountryItem',
    description: `A single country in the \`\`smda.masterdata.country\`\` list of countries
known to SMDA.`
} as const;

export const DiscoveryItemSchema = {
    properties: {
        short_identifier: {
            type: 'string',
            title: 'Short Identifier',
            examples: ['SomeDiscovery']
        },
        uuid: {
            type: 'string',
            format: 'uuid',
            title: 'Uuid',
            examples: ['15ce3b84-766f-4c93-9050-b154861f9100']
        }
    },
    type: 'object',
    required: ['short_identifier', 'uuid'],
    title: 'DiscoveryItem',
    description: `A single discovery in the \`\`masterdata.smda.discovery\`\` list of discoveries
known to SMDA.`
} as const;

export const FMUDirPathSchema = {
    properties: {
        path: {
            type: 'string',
            format: 'path',
            title: 'Path',
            description: 'Absolute path to the directory which maybe contains a .fmu directory.',
            examples: ['/path/to/project.2038.02.02']
        }
    },
    type: 'object',
    required: ['path'],
    title: 'FMUDirPath',
    description: 'Path where a .fmu directory may exist.'
} as const;

export const FMUProjectSchema = {
    properties: {
        path: {
            type: 'string',
            format: 'path',
            title: 'Path',
            description: 'Absolute path to the directory which maybe contains a .fmu directory.',
            examples: ['/path/to/project.2038.02.02']
        },
        project_dir_name: {
            type: 'string',
            title: 'Project Dir Name',
            description: 'The directory name, not the path, that contains the .fmu directory.',
            examples: ['project.2038.02.02']
        },
        config: {
            '$ref': '#/components/schemas/ProjectConfig',
            description: "The configuration of an FMU project's .fmu directory."
        },
        is_read_only: {
            type: 'boolean',
            title: 'Is Read Only',
            description: 'Whether the project is in read-only mode due to lock conflicts.',
            default: false
        }
    },
    type: 'object',
    required: ['path', 'project_dir_name', 'config'],
    title: 'FMUProject',
    description: "Information returned when 'opening' an FMU Directory."
} as const;

export const FieldItemSchema = {
    properties: {
        identifier: {
            type: 'string',
            title: 'Identifier',
            examples: ['OseFax']
        },
        uuid: {
            type: 'string',
            format: 'uuid',
            title: 'Uuid',
            examples: ['15ce3b84-766f-4c93-9050-b154861f9100']
        }
    },
    type: 'object',
    required: ['identifier', 'uuid'],
    title: 'FieldItem',
    description: `A single field in the \`\`masterdata.smda.field\`\` list of fields
known to SMDA.`
} as const;

export const GlobalConfigPathSchema = {
    properties: {
        relative_path: {
            type: 'string',
            format: 'path',
            title: 'Relative Path',
            description: 'Relative path in the project to a global config file.',
            examples: ['relative_path/to/global_config_file']
        }
    },
    type: 'object',
    required: ['relative_path'],
    title: 'GlobalConfigPath',
    description: 'A relative path to a global config file, relative to the project root.'
} as const;

export const HTTPValidationErrorSchema = {
    properties: {
        detail: {
            items: {
                '$ref': '#/components/schemas/ValidationError'
            },
            type: 'array',
            title: 'Detail'
        }
    },
    type: 'object',
    title: 'HTTPValidationError'
} as const;

export const LockInfoSchema = {
    properties: {
        pid: {
            type: 'integer',
            title: 'Pid'
        },
        hostname: {
            type: 'string',
            title: 'Hostname'
        },
        user: {
            type: 'string',
            title: 'User'
        },
        acquired_at: {
            type: 'number',
            title: 'Acquired At'
        },
        expires_at: {
            type: 'number',
            title: 'Expires At'
        },
        version: {
            type: 'string',
            pattern: '(\\d+(\\.\\d+){0,2}|\\d+\\.\\d+\\.[a-z0-9]+\\+[a-z0-9.]+)',
            title: 'Version',
            default: '0.3.3.dev1+g0cc9b0624'
        }
    },
    type: 'object',
    required: ['pid', 'hostname', 'user', 'acquired_at', 'expires_at'],
    title: 'LockInfo',
    description: 'Represents a .fmu directory lock file.'
} as const;

export const LockStatusSchema = {
    properties: {
        is_lock_acquired: {
            type: 'boolean',
            title: 'Is Lock Acquired',
            description: 'Whether the current session holds the write lock.'
        },
        lock_file_exists: {
            type: 'boolean',
            title: 'Lock File Exists',
            description: 'Whether a lock file exists.'
        },
        lock_info: {
            anyOf: [
                {
                    '$ref': '#/components/schemas/LockInfo'
                },
                {
                    type: 'null'
                }
            ],
            description: 'Contents of the lock file, if available and readable.'
        },
        lock_status_error: {
            anyOf: [
                {
                    type: 'string'
                },
                {
                    type: 'null'
                }
            ],
            title: 'Lock Status Error',
            description: 'Error message if checking lock status failed.'
        },
        lock_file_read_error: {
            anyOf: [
                {
                    type: 'string'
                },
                {
                    type: 'null'
                }
            ],
            title: 'Lock File Read Error',
            description: 'Error message if reading the lock file failed.'
        },
        last_lock_acquire_error: {
            anyOf: [
                {
                    type: 'string'
                },
                {
                    type: 'null'
                }
            ],
            title: 'Last Lock Acquire Error',
            description: 'Error message from the last attempt to acquire the lock.'
        },
        last_lock_release_error: {
            anyOf: [
                {
                    type: 'string'
                },
                {
                    type: 'null'
                }
            ],
            title: 'Last Lock Release Error',
            description: 'Error message from the last attempt to release the lock.'
        },
        last_lock_refresh_error: {
            anyOf: [
                {
                    type: 'string'
                },
                {
                    type: 'null'
                }
            ],
            title: 'Last Lock Refresh Error',
            description: 'Error message from the last attempt to refresh the lock.'
        }
    },
    type: 'object',
    required: ['is_lock_acquired', 'lock_file_exists'],
    title: 'LockStatus',
    description: 'Information about the project lock status.'
} as const;

export const MasterdataSchema = {
    properties: {
        smda: {
            '$ref': '#/components/schemas/Smda'
        }
    },
    type: 'object',
    required: ['smda'],
    title: 'Masterdata',
    description: `The \`\`masterdata\`\` block contains information related to masterdata.
Currently, SMDA holds the masterdata.`
} as const;

export const MessageSchema = {
    properties: {
        message: {
            type: 'string',
            title: 'Message'
        }
    },
    type: 'object',
    required: ['message'],
    title: 'Message',
    description: 'A generic message to return to the GUI.'
} as const;

export const ModelSchema = {
    properties: {
        description: {
            anyOf: [
                {
                    items: {
                        type: 'string'
                    },
                    type: 'array'
                },
                {
                    type: 'null'
                }
            ],
            title: 'Description'
        },
        name: {
            type: 'string',
            title: 'Name',
            examples: ['Drogon']
        },
        revision: {
            type: 'string',
            title: 'Revision',
            examples: ['21.0.0.dev']
        }
    },
    type: 'object',
    required: ['name', 'revision'],
    title: 'Model',
    description: `The \`\`fmu.model\`\` block contains information about the model used.

.. note::
   Synonyms for "model" in this context are "template", "setup", etc. The term
   "model" is ultra-generic but was chosen before e.g. "template" as the latter
   deviates from daily communications and is, if possible, even more generic
   than "model".`
} as const;

export const OkSchema = {
    properties: {
        status: {
            type: 'string',
            const: 'ok',
            title: 'Status',
            default: 'ok'
        }
    },
    type: 'object',
    title: 'Ok',
    description: 'Returns "ok" if the route is functioning correctly.'
} as const;

export const ProjectConfigSchema = {
    properties: {
        version: {
            type: 'string',
            pattern: '(\\d+(\\.\\d+){0,2}|\\d+\\.\\d+\\.[a-z0-9]+\\+[a-z0-9.]+)',
            title: 'Version'
        },
        created_at: {
            type: 'string',
            format: 'date-time',
            title: 'Created At'
        },
        created_by: {
            type: 'string',
            title: 'Created By'
        },
        masterdata: {
            anyOf: [
                {
                    '$ref': '#/components/schemas/Masterdata'
                },
                {
                    type: 'null'
                }
            ]
        },
        model: {
            anyOf: [
                {
                    '$ref': '#/components/schemas/Model'
                },
                {
                    type: 'null'
                }
            ]
        },
        access: {
            anyOf: [
                {
                    '$ref': '#/components/schemas/Access'
                },
                {
                    type: 'null'
                }
            ]
        }
    },
    type: 'object',
    required: ['version', 'created_at', 'created_by'],
    title: 'ProjectConfig',
    description: `The configuration file in a .fmu directory.

Stored as config.json.`
} as const;

export const SmdaSchema = {
    properties: {
        coordinate_system: {
            '$ref': '#/components/schemas/CoordinateSystem'
        },
        country: {
            items: {
                '$ref': '#/components/schemas/CountryItem'
            },
            type: 'array',
            title: 'Country'
        },
        discovery: {
            items: {
                '$ref': '#/components/schemas/DiscoveryItem'
            },
            type: 'array',
            title: 'Discovery'
        },
        field: {
            items: {
                '$ref': '#/components/schemas/FieldItem'
            },
            type: 'array',
            title: 'Field'
        },
        stratigraphic_column: {
            '$ref': '#/components/schemas/StratigraphicColumn'
        }
    },
    type: 'object',
    required: ['coordinate_system', 'country', 'discovery', 'field', 'stratigraphic_column'],
    title: 'Smda',
    description: 'The ``masterdata.smda`` block contains SMDA-related attributes.'
} as const;

export const SmdaFieldSchema = {
    properties: {
        identifier: {
            type: 'string',
            title: 'Identifier',
            description: 'A field identifier (name).',
            examples: ['TROLL']
        }
    },
    type: 'object',
    required: ['identifier'],
    title: 'SmdaField',
    description: 'An identifier for a field to be searched for.'
} as const;

export const SmdaFieldSearchResultSchema = {
    properties: {
        hits: {
            type: 'integer',
            title: 'Hits',
            description: 'The number of hits from the field search.'
        },
        pages: {
            type: 'integer',
            title: 'Pages',
            description: 'The number of pages of hits.'
        },
        results: {
            items: {
                '$ref': '#/components/schemas/SmdaFieldUUID'
            },
            type: 'array',
            title: 'Results',
            description: 'A list of field identifier results from the search.'
        }
    },
    type: 'object',
    required: ['hits', 'pages', 'results'],
    title: 'SmdaFieldSearchResult',
    description: 'The search result of a field identifier result.'
} as const;

export const SmdaFieldUUIDSchema = {
    properties: {
        identifier: {
            type: 'string',
            title: 'Identifier',
            description: 'A field identifier (name).',
            examples: ['TROLL']
        },
        uuid: {
            type: 'string',
            format: 'uuid',
            title: 'Uuid',
            description: 'The SMDA UUID identifier corresponding to the field identifier.'
        }
    },
    type: 'object',
    required: ['identifier', 'uuid'],
    title: 'SmdaFieldUUID',
    description: 'Name-UUID identifier for a field as known by SMDA.'
} as const;

export const SmdaMasterdataResultSchema = {
    properties: {
        field: {
            items: {
                '$ref': '#/components/schemas/FieldItem'
            },
            type: 'array',
            title: 'Field',
            description: 'A list referring to fields known to SMDA. First item is primary.'
        },
        country: {
            items: {
                '$ref': '#/components/schemas/CountryItem'
            },
            type: 'array',
            title: 'Country',
            description: 'A list referring to countries known to SMDA. First item is primary.'
        },
        discovery: {
            items: {
                '$ref': '#/components/schemas/DiscoveryItem'
            },
            type: 'array',
            title: 'Discovery',
            description: 'A list referring to discoveries known to SMDA. First item is primary.'
        },
        stratigraphic_columns: {
            items: {
                '$ref': '#/components/schemas/StratigraphicColumn'
            },
            type: 'array',
            title: 'Stratigraphic Columns',
            description: 'Reference to stratigraphic column known to SMDA.'
        },
        field_coordinate_system: {
            '$ref': '#/components/schemas/CoordinateSystem',
            description: `The primary field's coordinate system.

This coordinate system may not be the coordinate system users use in their model.`
        },
        coordinate_systems: {
            items: {
                '$ref': '#/components/schemas/CoordinateSystem'
            },
            type: 'array',
            title: 'Coordinate Systems',
            description: `A list of all coordinate systems known to SMDA.

These are provided when the user needs to select a different coordinate system that
applies to the model they are working on.`
        }
    },
    type: 'object',
    required: ['field', 'country', 'discovery', 'stratigraphic_columns', 'field_coordinate_system', 'coordinate_systems'],
    title: 'SmdaMasterdataResult',
    description: 'Contains SMDA-related attributes.'
} as const;

export const StratigraphicColumnSchema = {
    properties: {
        identifier: {
            type: 'string',
            title: 'Identifier',
            examples: ['DROGON_2020']
        },
        uuid: {
            type: 'string',
            format: 'uuid',
            title: 'Uuid',
            examples: ['15ce3b84-766f-4c93-9050-b154861f9100']
        }
    },
    type: 'object',
    required: ['identifier', 'uuid'],
    title: 'StratigraphicColumn',
    description: `The \`\`masterdata.smda.stratigraphic_column\`\` block contains the
stratigraphic column known to SMDA.`
} as const;

export const UserAPIKeysSchema = {
    properties: {
        smda_subscription: {
            anyOf: [
                {
                    type: 'string'
                },
                {
                    type: 'null'
                }
            ],
            title: 'Smda Subscription'
        }
    },
    type: 'object',
    title: 'UserAPIKeys',
    description: 'Known API keys stored in a user config.'
} as const;

export const UserConfigSchema = {
    properties: {
        version: {
            type: 'string',
            pattern: '(\\d+(\\.\\d+){0,2}|\\d+\\.\\d+\\.[a-z0-9]+\\+[a-z0-9.]+)',
            title: 'Version'
        },
        created_at: {
            type: 'string',
            format: 'date-time',
            title: 'Created At'
        },
        user_api_keys: {
            '$ref': '#/components/schemas/UserAPIKeys'
        },
        recent_project_directories: {
            items: {
                type: 'string',
                format: 'path'
            },
            type: 'array',
            maxItems: 5,
            title: 'Recent Project Directories'
        }
    },
    type: 'object',
    required: ['version', 'created_at', 'user_api_keys', 'recent_project_directories'],
    title: 'UserConfig',
    description: `The configuration file in a $HOME/.fmu directory.

Stored as config.json.`
} as const;

export const ValidationErrorSchema = {
    properties: {
        loc: {
            items: {
                anyOf: [
                    {
                        type: 'string'
                    },
                    {
                        type: 'integer'
                    }
                ]
            },
            type: 'array',
            title: 'Location'
        },
        msg: {
            type: 'string',
            title: 'Message'
        },
        type: {
            type: 'string',
            title: 'Error Type'
        }
    },
    type: 'object',
    required: ['loc', 'msg', 'type'],
    title: 'ValidationError'
} as const;