"""
    XBIM Flex API v2

    This is the XBIM Flex Swagger service where you can explore the REST API for the platform.  # noqa: E501

    The version of the OpenAPI document: 2.0
    Contact: info@xbim.net
    Generated by: https://openapi-generator.tech
"""


import re  # noqa: F401
import sys  # noqa: F401

from xbim_flex.aim.api_client import ApiClient, Endpoint as _Endpoint
from xbim_flex.aim.model_utils import (  # noqa: F401
    check_allowed_values,
    check_validations,
    date,
    datetime,
    file_type,
    none_type,
    validate_and_convert_types
)
from xbim_flex.aim.model.db_update import DbUpdate


class AdminApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client
        self.admin_applied_updates_endpoint = _Endpoint(
            settings={
                'response_type': ([DbUpdate],),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/admin/schema/AppliedUpdates",
                'operation_id': 'admin_applied_updates',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'region',
                ],
                'required': [
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'region':
                        (str,),
                },
                'attribute_map': {
                    'region': 'region',
                },
                'location_map': {
                    'region': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json',
                    'text/json',
                    'application/xml',
                    'text/xml'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.admin_flush_caches_endpoint = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/admin/schema/FlushCaches",
                'operation_id': 'admin_flush_caches',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'region',
                ],
                'required': [
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'region':
                        (str,),
                },
                'attribute_map': {
                    'region': 'region',
                },
                'location_map': {
                    'region': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [],
            },
            api_client=api_client
        )
        self.admin_get_is_current_endpoint = _Endpoint(
            settings={
                'response_type': (bool,),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/admin/schema/IsCurrent",
                'operation_id': 'admin_get_is_current',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'region',
                ],
                'required': [
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'region':
                        (str,),
                },
                'attribute_map': {
                    'region': 'region',
                },
                'location_map': {
                    'region': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json',
                    'text/json',
                    'application/xml',
                    'text/xml'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.admin_pending_updates_endpoint = _Endpoint(
            settings={
                'response_type': ([DbUpdate],),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/admin/schema/PendingUpdates",
                'operation_id': 'admin_pending_updates',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'region',
                ],
                'required': [
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'region':
                        (str,),
                },
                'attribute_map': {
                    'region': 'region',
                },
                'location_map': {
                    'region': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json',
                    'text/json',
                    'application/xml',
                    'text/xml'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.admin_update_schema_endpoint = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/admin/schema/UpdateSchema",
                'operation_id': 'admin_update_schema',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'region',
                ],
                'required': [
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'region':
                        (str,),
                },
                'attribute_map': {
                    'region': 'region',
                },
                'location_map': {
                    'region': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [],
            },
            api_client=api_client
        )

    def admin_applied_updates(
        self,
        region="UK",
        **kwargs
    ):
        """Get Admin applied updates  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Lists the Database schema updates already installed. This can only be used by users in the Flex Superuser role. Return Type: DbUpdate <br/><br/>    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.admin_applied_updates(region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            [DbUpdate]
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['region'] = \
            region
        return self.admin_applied_updates_endpoint.call_with_http_info(**kwargs)

    def admin_flush_caches(
        self,
        region="UK",
        **kwargs
    ):
        """Post Admin flush caches  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Flushes the Flex caches. This can only be used by users in the Flex Superuser role. Return Type:  <br/><br/>    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.admin_flush_caches(region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            None
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['region'] = \
            region
        return self.admin_flush_caches_endpoint.call_with_http_info(**kwargs)

    def admin_get_is_current(
        self,
        region="UK",
        **kwargs
    ):
        """Get Admin is current  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Returns a flag indicating if the database schema requires an upgrade. This service can be used by any client. SuperUser role is not required. Return Type: boolean <br/><br/>    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.admin_get_is_current(region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            bool
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['region'] = \
            region
        return self.admin_get_is_current_endpoint.call_with_http_info(**kwargs)

    def admin_pending_updates(
        self,
        region="UK",
        **kwargs
    ):
        """Get Admin pending updates  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Lists the Database schema updates required. This can only be used by users in the Flex Superuser role. Return Type: DbUpdate <br/><br/>    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.admin_pending_updates(region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            [DbUpdate]
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['region'] = \
            region
        return self.admin_pending_updates_endpoint.call_with_http_info(**kwargs)

    def admin_update_schema(
        self,
        region="UK",
        **kwargs
    ):
        """Post Admin update schema  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Updates the Database schemas to the latest version. This can only be used by users in the Flex Superuser role. Return Type:  <br/><br/>    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.admin_update_schema(region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            None
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['region'] = \
            region
        return self.admin_update_schema_endpoint.call_with_http_info(**kwargs)

