"""
    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.document import Document
from xbim_flex.aim.model.document_create import DocumentCreate
from xbim_flex.aim.model.entity import Entity
from xbim_flex.aim.model.o_data_list_response_of_attribute_definition import ODataListResponseOfAttributeDefinition
from xbim_flex.aim.model.o_data_list_response_of_component import ODataListResponseOfComponent
from xbim_flex.aim.model.o_data_list_response_of_entity import ODataListResponseOfEntity
from xbim_flex.aim.model.o_data_list_response_of_space import ODataListResponseOfSpace
from xbim_flex.aim.model.space import Space
from xbim_flex.aim.model.space_create import SpaceCreate
from xbim_flex.aim.model.space_edit import SpaceEdit


class SpacesApi(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.spaces_add_document_by_assetmodelid_and_entityid_and_tenantid_endpoint = _Endpoint(
            settings={
                'response_type': (Document,),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/{tenantId}/Spaces(AssetModelId={assetModelId}, EntityId={entityId})/DocumentEntities",
                'operation_id': 'spaces_add_document_by_assetmodelid_and_entityid_and_tenantid',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'asset_model_id',
                    'entity_id',
                    'tenant_id',
                    'region',
                    'document',
                ],
                'required': [
                    'asset_model_id',
                    'entity_id',
                    'tenant_id',
                    'region',
                    'document',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'asset_model_id':
                        (int,),
                    'entity_id':
                        (int,),
                    'tenant_id':
                        (str,),
                    'region':
                        (str,),
                    'document':
                        (DocumentCreate,),
                },
                'attribute_map': {
                    'asset_model_id': 'assetModelId',
                    'entity_id': 'entityId',
                    'tenant_id': 'tenantId',
                    'region': 'region',
                },
                'location_map': {
                    'asset_model_id': 'path',
                    'entity_id': 'path',
                    'tenant_id': 'path',
                    'region': 'path',
                    'document': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client
        )
        self.spaces_as_of_by_date_and_tenantid_endpoint = _Endpoint(
            settings={
                'response_type': (ODataListResponseOfEntity,),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/{tenantId}/Spaces/AsOf(date={date})",
                'operation_id': 'spaces_as_of_by_date_and_tenantid',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'date',
                    'tenant_id',
                    'region',
                    'expand',
                    'filter',
                    'select',
                    'orderby',
                    'top',
                    'skip',
                    'count',
                ],
                'required': [
                    'date',
                    'tenant_id',
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'date':
                        (datetime,),
                    'tenant_id':
                        (str,),
                    'region':
                        (str,),
                    'expand':
                        (str,),
                    'filter':
                        (str,),
                    'select':
                        (str,),
                    'orderby':
                        (str,),
                    'top':
                        (int,),
                    'skip':
                        (int,),
                    'count':
                        (bool,),
                },
                'attribute_map': {
                    'date': 'date',
                    'tenant_id': 'tenantId',
                    'region': 'region',
                    'expand': '$expand',
                    'filter': '$filter',
                    'select': '$select',
                    'orderby': '$orderby',
                    'top': '$top',
                    'skip': '$skip',
                    'count': '$count',
                },
                'location_map': {
                    'date': 'path',
                    'tenant_id': 'path',
                    'region': 'path',
                    'expand': 'query',
                    'filter': 'query',
                    'select': 'query',
                    'orderby': 'query',
                    'top': 'query',
                    'skip': 'query',
                    'count': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json',
                    'application/json;odata.metadata=none',
                    'application/json;odata.metadata=minimal',
                    'application/json;odata.metadata=full',
                    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.spaces_contained_components_by_assetmodelid_and_entityid_and_tenantid_endpoint = _Endpoint(
            settings={
                'response_type': (ODataListResponseOfComponent,),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/{tenantId}/Spaces(AssetModelId={assetModelId}, EntityId={entityId})/ContainedComponents",
                'operation_id': 'spaces_contained_components_by_assetmodelid_and_entityid_and_tenantid',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'asset_model_id',
                    'entity_id',
                    'tenant_id',
                    'region',
                    'expand',
                    'filter',
                    'select',
                    'orderby',
                    'top',
                    'skip',
                    'count',
                    'tolerance',
                    'in_same_asset',
                ],
                'required': [
                    'asset_model_id',
                    'entity_id',
                    'tenant_id',
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'asset_model_id':
                        (int,),
                    'entity_id':
                        (int,),
                    'tenant_id':
                        (str,),
                    'region':
                        (str,),
                    'expand':
                        (str,),
                    'filter':
                        (str,),
                    'select':
                        (str,),
                    'orderby':
                        (str,),
                    'top':
                        (int,),
                    'skip':
                        (int,),
                    'count':
                        (bool,),
                    'tolerance':
                        (float,),
                    'in_same_asset':
                        (bool,),
                },
                'attribute_map': {
                    'asset_model_id': 'assetModelId',
                    'entity_id': 'entityId',
                    'tenant_id': 'tenantId',
                    'region': 'region',
                    'expand': '$expand',
                    'filter': '$filter',
                    'select': '$select',
                    'orderby': '$orderby',
                    'top': '$top',
                    'skip': '$skip',
                    'count': '$count',
                    'tolerance': 'tolerance',
                    'in_same_asset': 'inSameAsset',
                },
                'location_map': {
                    'asset_model_id': 'path',
                    'entity_id': 'path',
                    'tenant_id': 'path',
                    'region': 'path',
                    'expand': 'query',
                    'filter': 'query',
                    'select': 'query',
                    'orderby': 'query',
                    'top': 'query',
                    'skip': 'query',
                    'count': 'query',
                    'tolerance': 'query',
                    'in_same_asset': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json',
                    'application/json;odata.metadata=none',
                    'application/json;odata.metadata=minimal',
                    'application/json;odata.metadata=full',
                    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.spaces_get_available_properties_by_assetid_and_tenantid_endpoint = _Endpoint(
            settings={
                'response_type': (ODataListResponseOfAttributeDefinition,),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/{tenantId}/Spaces/GetAvailableProperties(assetId={assetId})",
                'operation_id': 'spaces_get_available_properties_by_assetid_and_tenantid',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'asset_id',
                    'tenant_id',
                    'region',
                    'expand',
                    'filter',
                    'select',
                    'orderby',
                    'top',
                    'skip',
                    'count',
                ],
                'required': [
                    'asset_id',
                    'tenant_id',
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'asset_id':
                        (int,),
                    'tenant_id':
                        (str,),
                    'region':
                        (str,),
                    'expand':
                        (str,),
                    'filter':
                        (str,),
                    'select':
                        (str,),
                    'orderby':
                        (str,),
                    'top':
                        (int,),
                    'skip':
                        (int,),
                    'count':
                        (bool,),
                },
                'attribute_map': {
                    'asset_id': 'assetId',
                    'tenant_id': 'tenantId',
                    'region': 'region',
                    'expand': '$expand',
                    'filter': '$filter',
                    'select': '$select',
                    'orderby': '$orderby',
                    'top': '$top',
                    'skip': '$skip',
                    'count': '$count',
                },
                'location_map': {
                    'asset_id': 'path',
                    'tenant_id': 'path',
                    'region': 'path',
                    'expand': 'query',
                    'filter': 'query',
                    'select': 'query',
                    'orderby': 'query',
                    'top': 'query',
                    'skip': 'query',
                    'count': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json',
                    'application/json;odata.metadata=none',
                    'application/json;odata.metadata=minimal',
                    'application/json;odata.metadata=full',
                    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.spaces_get_by_tenantid_endpoint = _Endpoint(
            settings={
                'response_type': (ODataListResponseOfSpace,),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/{tenantId}/Spaces",
                'operation_id': 'spaces_get_by_tenantid',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'tenant_id',
                    'region',
                    'expand',
                    'filter',
                    'select',
                    'orderby',
                    'top',
                    'skip',
                    'count',
                ],
                'required': [
                    'tenant_id',
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'tenant_id':
                        (str,),
                    'region':
                        (str,),
                    'expand':
                        (str,),
                    'filter':
                        (str,),
                    'select':
                        (str,),
                    'orderby':
                        (str,),
                    'top':
                        (int,),
                    'skip':
                        (int,),
                    'count':
                        (bool,),
                },
                'attribute_map': {
                    'tenant_id': 'tenantId',
                    'region': 'region',
                    'expand': '$expand',
                    'filter': '$filter',
                    'select': '$select',
                    'orderby': '$orderby',
                    'top': '$top',
                    'skip': '$skip',
                    'count': '$count',
                },
                'location_map': {
                    'tenant_id': 'path',
                    'region': 'path',
                    'expand': 'query',
                    'filter': 'query',
                    'select': 'query',
                    'orderby': 'query',
                    'top': 'query',
                    'skip': 'query',
                    'count': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json',
                    'application/json;odata.metadata=none',
                    'application/json;odata.metadata=minimal',
                    'application/json;odata.metadata=full',
                    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.spaces_get_single_entity_by_assetmodelid_and_entityid_and_tenantid_endpoint = _Endpoint(
            settings={
                'response_type': (Space,),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/{tenantId}/Spaces(AssetModelId={assetModelId}, EntityId={entityId})",
                'operation_id': 'spaces_get_single_entity_by_assetmodelid_and_entityid_and_tenantid',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'asset_model_id',
                    'entity_id',
                    'tenant_id',
                    'region',
                    'expand',
                    'select',
                ],
                'required': [
                    'asset_model_id',
                    'entity_id',
                    'tenant_id',
                    'region',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'asset_model_id':
                        (int,),
                    'entity_id':
                        (int,),
                    'tenant_id':
                        (str,),
                    'region':
                        (str,),
                    'expand':
                        (str,),
                    'select':
                        (str,),
                },
                'attribute_map': {
                    'asset_model_id': 'assetModelId',
                    'entity_id': 'entityId',
                    'tenant_id': 'tenantId',
                    'region': 'region',
                    'expand': '$expand',
                    'select': '$select',
                },
                'location_map': {
                    'asset_model_id': 'path',
                    'entity_id': 'path',
                    'tenant_id': 'path',
                    'region': 'path',
                    'expand': 'query',
                    'select': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json',
                    'application/json;odata.metadata=none',
                    'application/json;odata.metadata=minimal',
                    'application/json;odata.metadata=full'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.spaces_patch_by_assetmodelid_and_entityid_and_tenantid_endpoint = _Endpoint(
            settings={
                'response_type': (Entity,),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/{tenantId}/Spaces(AssetModelId={assetModelId}, EntityId={entityId})",
                'operation_id': 'spaces_patch_by_assetmodelid_and_entityid_and_tenantid',
                'http_method': 'PATCH',
                'servers': None,
            },
            params_map={
                'all': [
                    'asset_model_id',
                    'entity_id',
                    'tenant_id',
                    'region',
                    'patch',
                ],
                'required': [
                    'asset_model_id',
                    'entity_id',
                    'tenant_id',
                    'region',
                    'patch',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'asset_model_id':
                        (int,),
                    'entity_id':
                        (int,),
                    'tenant_id':
                        (str,),
                    'region':
                        (str,),
                    'patch':
                        (SpaceEdit,),
                },
                'attribute_map': {
                    'asset_model_id': 'assetModelId',
                    'entity_id': 'entityId',
                    'tenant_id': 'tenantId',
                    'region': 'region',
                },
                'location_map': {
                    'asset_model_id': 'path',
                    'entity_id': 'path',
                    'tenant_id': 'path',
                    'region': 'path',
                    'patch': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client
        )
        self.spaces_post_by_tenantid_endpoint = _Endpoint(
            settings={
                'response_type': (Space,),
                'auth': [
                    'oauth2'
                ],
                'endpoint_path': "/{region}/aim/2.0/{tenantId}/Spaces",
                'operation_id': 'spaces_post_by_tenantid',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'tenant_id',
                    'region',
                    'space',
                ],
                'required': [
                    'tenant_id',
                    'region',
                    'space',
                ],
                'nullable': [
                ],
                'enum': [
                    'region',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('region',): {

                        "UK": "UK",
                        "WESTEUROPE": "WestEurope",
                        "SANDBOX": "Sandbox"
                    },
                },
                'openapi_types': {
                    'tenant_id':
                        (str,),
                    'region':
                        (str,),
                    'space':
                        (SpaceCreate,),
                },
                'attribute_map': {
                    'tenant_id': 'tenantId',
                    'region': 'region',
                },
                'location_map': {
                    'tenant_id': 'path',
                    'region': 'path',
                    'space': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client
        )

    def spaces_add_document_by_assetmodelid_and_entityid_and_tenantid(
        self,
        asset_model_id,
        entity_id,
        tenant_id,
        document,
        region="UK",
        **kwargs
    ):
        """Post Spaces add document by assetmodelid, entityid and tenantid  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Adds a new document to a model entity. Return Type: Document <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.spaces_add_document_by_assetmodelid_and_entityid_and_tenantid(asset_model_id, entity_id, tenant_id, document, region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            asset_model_id (int): The model Id
            entity_id (int): The unique identifier for the target entity (Entity Label)
            tenant_id (str): The unique Tenant ID (UUID or Identifier string)
            document (DocumentCreate): A document to create
            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:
            Document
                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['asset_model_id'] = \
            asset_model_id
        kwargs['entity_id'] = \
            entity_id
        kwargs['tenant_id'] = \
            tenant_id
        kwargs['region'] = \
            region
        kwargs['document'] = \
            document
        return self.spaces_add_document_by_assetmodelid_and_entityid_and_tenantid_endpoint.call_with_http_info(**kwargs)

    def spaces_as_of_by_date_and_tenantid(
        self,
        date,
        tenant_id,
        region="UK",
        **kwargs
    ):
        """Get Spaces as of by date and tenantid  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Return Type: ODataListResponseOfEntity For more information about OData responses <a href='https://www.odata.org/getting-started/understand-odata-in-6-steps/'>link</a>. <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.spaces_as_of_by_date_and_tenantid(date, tenant_id, region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            date (datetime):
            tenant_id (str): The unique Tenant ID (UUID or Identifier string)
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            expand (str): Expands related entities inline.. [optional]
            filter (str): Filters the results, based on a Boolean condition.. [optional]
            select (str): Selects which properties to include in the response.. [optional]
            orderby (str): Sorts the results.. [optional]
            top (int): Returns only the first n results.. [optional]
            skip (int): Skips the first n results.. [optional]
            count (bool): Includes a count of the matching results in the response.. [optional]
            _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:
            ODataListResponseOfEntity
                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['date'] = \
            date
        kwargs['tenant_id'] = \
            tenant_id
        kwargs['region'] = \
            region
        return self.spaces_as_of_by_date_and_tenantid_endpoint.call_with_http_info(**kwargs)

    def spaces_contained_components_by_assetmodelid_and_entityid_and_tenantid(
        self,
        asset_model_id,
        entity_id,
        tenant_id,
        region="UK",
        **kwargs
    ):
        """Get Spaces contained components by assetmodelid, entityid and tenantid  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Gets the set of Components which are placed within the Geometry footprint of this Space. Returns all Components with geometry contained wholly or partly              within the footprint of the space, and wholly or party within the Z-axis.<br />              A 'tolerance' can be provided to extend or reduce the spaces included at the boundary              of the space<br />. Return Type: ODataListResponseOfComponent For more information about OData responses <a href='https://www.odata.org/getting-started/understand-odata-in-6-steps/'>link</a>. <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.spaces_contained_components_by_assetmodelid_and_entityid_and_tenantid(asset_model_id, entity_id, tenant_id, region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            asset_model_id (int): The assetModel ID of the Space
            entity_id (int): The ID of the space entity
            tenant_id (str): The unique Tenant ID (UUID or Identifier string)
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            expand (str): Expands related entities inline.. [optional]
            filter (str): Filters the results, based on a Boolean condition.. [optional]
            select (str): Selects which properties to include in the response.. [optional]
            orderby (str): Sorts the results.. [optional]
            top (int): Returns only the first n results.. [optional]
            skip (int): Skips the first n results.. [optional]
            count (bool): Includes a count of the matching results in the response.. [optional]
            tolerance (float): Tolerance in millimeters. Can be negative. Default: 10mm. [optional] if omitted the server will use the default value of 10.0
            in_same_asset (bool): Limit the results to spaces in the same Asset. [optional] if omitted the server will use the default value of True
            _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:
            ODataListResponseOfComponent
                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['asset_model_id'] = \
            asset_model_id
        kwargs['entity_id'] = \
            entity_id
        kwargs['tenant_id'] = \
            tenant_id
        kwargs['region'] = \
            region
        return self.spaces_contained_components_by_assetmodelid_and_entityid_and_tenantid_endpoint.call_with_http_info(**kwargs)

    def spaces_get_available_properties_by_assetid_and_tenantid(
        self,
        asset_id,
        tenant_id,
        region="UK",
        **kwargs
    ):
        """Get Spaces available properties by assetid and tenantid  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Gets the Properties available on this Model. Return Type: ODataListResponseOfAttributeDefinition For more information about OData responses <a href='https://www.odata.org/getting-started/understand-odata-in-6-steps/'>link</a>. <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.spaces_get_available_properties_by_assetid_and_tenantid(asset_id, tenant_id, region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            asset_id (int): The unique key for the asset
            tenant_id (str): The unique Tenant ID (UUID or Identifier string)
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            expand (str): Expands related entities inline.. [optional]
            filter (str): Filters the results, based on a Boolean condition.. [optional]
            select (str): Selects which properties to include in the response.. [optional]
            orderby (str): Sorts the results.. [optional]
            top (int): Returns only the first n results.. [optional]
            skip (int): Skips the first n results.. [optional]
            count (bool): Includes a count of the matching results in the response.. [optional]
            _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:
            ODataListResponseOfAttributeDefinition
                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['asset_id'] = \
            asset_id
        kwargs['tenant_id'] = \
            tenant_id
        kwargs['region'] = \
            region
        return self.spaces_get_available_properties_by_assetid_and_tenantid_endpoint.call_with_http_info(**kwargs)

    def spaces_get_by_tenantid(
        self,
        tenant_id,
        region="UK",
        **kwargs
    ):
        """Get Spaces by tenantid  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Returns the EntitySet Spaces. Return Type: ODataListResponseOfSpace For more information about OData responses <a href='https://www.odata.org/getting-started/understand-odata-in-6-steps/'>link</a>. <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.spaces_get_by_tenantid(tenant_id, region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            tenant_id (str): The unique Tenant ID (UUID or Identifier string)
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            expand (str): Expands related entities inline.. [optional]
            filter (str): Filters the results, based on a Boolean condition.. [optional]
            select (str): Selects which properties to include in the response.. [optional]
            orderby (str): Sorts the results.. [optional]
            top (int): Returns only the first n results.. [optional]
            skip (int): Skips the first n results.. [optional]
            count (bool): Includes a count of the matching results in the response.. [optional]
            _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:
            ODataListResponseOfSpace
                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['tenant_id'] = \
            tenant_id
        kwargs['region'] = \
            region
        return self.spaces_get_by_tenantid_endpoint.call_with_http_info(**kwargs)

    def spaces_get_single_entity_by_assetmodelid_and_entityid_and_tenantid(
        self,
        asset_model_id,
        entity_id,
        tenant_id,
        region="UK",
        **kwargs
    ):
        """Get Spaces single entity by assetmodelid, entityid and tenantid  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Return Type: Space <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.spaces_get_single_entity_by_assetmodelid_and_entityid_and_tenantid(asset_model_id, entity_id, tenant_id, region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            asset_model_id (int):
            entity_id (int):
            tenant_id (str): The unique Tenant ID (UUID or Identifier string)
            region (str): The data center region the data resides in. defaults to "UK", must be one of ["UK"]

        Keyword Args:
            expand (str): Expands related entities inline.. [optional]
            select (str): Selects which properties to include in the response.. [optional]
            _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:
            Space
                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['asset_model_id'] = \
            asset_model_id
        kwargs['entity_id'] = \
            entity_id
        kwargs['tenant_id'] = \
            tenant_id
        kwargs['region'] = \
            region
        return self.spaces_get_single_entity_by_assetmodelid_and_entityid_and_tenantid_endpoint.call_with_http_info(**kwargs)

    def spaces_patch_by_assetmodelid_and_entityid_and_tenantid(
        self,
        asset_model_id,
        entity_id,
        tenant_id,
        patch,
        region="UK",
        **kwargs
    ):
        """Patch Spaces by assetmodelid, entityid and tenantid  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Edit an existing space. Return Type: Entity <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.spaces_patch_by_assetmodelid_and_entityid_and_tenantid(asset_model_id, entity_id, tenant_id, patch, region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            asset_model_id (int):
            entity_id (int):
            tenant_id (str): The unique Tenant ID (UUID or Identifier string)
            patch (SpaceEdit):
            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:
            Entity
                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['asset_model_id'] = \
            asset_model_id
        kwargs['entity_id'] = \
            entity_id
        kwargs['tenant_id'] = \
            tenant_id
        kwargs['region'] = \
            region
        kwargs['patch'] = \
            patch
        return self.spaces_patch_by_assetmodelid_and_entityid_and_tenantid_endpoint.call_with_http_info(**kwargs)

    def spaces_post_by_tenantid(
        self,
        tenant_id,
        space,
        region="UK",
        **kwargs
    ):
        """Post Spaces by tenantid  # noqa: E501

        <span style='font-size: 17px;'>Summary</span><br/>Adds a new Space to a model. Return Type: Space <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.spaces_post_by_tenantid(tenant_id, space, region="UK", async_req=True)
        >>> result = thread.get()

        Args:
            tenant_id (str): The unique Tenant ID (UUID or Identifier string)
            space (SpaceCreate): The entity to post
            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:
            Space
                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['tenant_id'] = \
            tenant_id
        kwargs['region'] = \
            region
        kwargs['space'] = \
            space
        return self.spaces_post_by_tenantid_endpoint.call_with_http_info(**kwargs)

