"""
    Metadata API v1

    The `metadata` service provides a way to get information (metadata) about layers and partitions stored in a catalog. This service exposes the metadata for all the partitions or all the changed partitions. For a catalog with versioned layers, you can retrieve metadata for a particular version or version range of the catalog. You can perform the following operations for a catalog with versioned layers: - List versions of the catalog - Get latest and minimum version of the catalog - Get metadata of the specific layers  For a volatile layer, you can get metadata for all or a subset of partitions of the layer.  # noqa: E501

    The version of the OpenAPI document: 1.0.3
    Generated by: https://openapi-generator.tech
"""


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

from here_data_metadata_v1_client.api_client import ApiClient, Endpoint as _Endpoint
from here_data_metadata_v1_client.model_utils import (  # noqa: F401
    check_allowed_values,
    check_validations,
    date,
    datetime,
    file_type,
    none_type,
    validate_and_convert_types
)
from here_data_metadata_v1_client.model.additional_fields_enum import AdditionalFieldsEnum
from here_data_metadata_v1_client.model.dependencies import Dependencies
from here_data_metadata_v1_client.model.layer_versions import LayerVersions
from here_data_metadata_v1_client.model.minimum_version_info import MinimumVersionInfo
from here_data_metadata_v1_client.model.partitions import Partitions
from here_data_metadata_v1_client.model.parts_response import PartsResponse
from here_data_metadata_v1_client.model.version_infos import VersionInfos
from here_data_metadata_v1_client.model.version_response import VersionResponse
from here_data_metadata_v1_client.model.versions_response import VersionsResponse


class MetadataApi(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

        def __compatible_versions(
            self,
            dependencies,
            **kwargs
        ):
            """Gets a list of available catalog versions that respect the given dependencies  # noqa: E501

            Given a list of HRNs and versions provided by the user, returns a list of versions of this catalog for which the listed HRN are either present in the direct or indirect dependencies with the same version, or are not present. Please note that versions that don't depend on any of the provided catalog HRNs, are also considered compatible. The compatible versions are returned in reverse order, from the newest to the oldest. When there is no compatible version the service returns an empty list. When the catalog has no version a 404 is returned.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.compatible_versions(dependencies, async_req=True)
            >>> result = thread.get()

            Args:
                dependencies (Dependencies): The catalog dependencies we want to search for

            Keyword Args:
                limit (int): The numbers of items to return per page. [optional] if omitted the server will use the default value of 1
                _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 (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:
                VersionsResponse
                    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['dependencies'] = \
                dependencies
            return self.call_with_http_info(**kwargs)

        self.compatible_versions = _Endpoint(
            settings={
                'response_type': (VersionsResponse,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/versions/compatibles',
                'operation_id': 'compatible_versions',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'dependencies',
                    'limit',
                ],
                'required': [
                    'dependencies',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'dependencies':
                        (Dependencies,),
                    'limit':
                        (int,),
                },
                'attribute_map': {
                    'limit': 'limit',
                },
                'location_map': {
                    'dependencies': 'body',
                    'limit': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client,
            callable=__compatible_versions
        )

        def __get_changes(
            self,
            layer_id,
            **kwargs
        ):
            """Gets changes for the version range.  # noqa: E501

            Gets the latest partition metadata in a version range for a versioned layer or a time range for a volatile layer. For versioned layers the range is expressed as a start and end version and might not return all changes for the partitions which were added and removed in between the specified start and end versions.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_changes(layer_id, async_req=True)
            >>> result = thread.get()

            Args:
                layer_id (str): Unique layer ID. Content of this parameter must refer to a valid layer ID.

            Keyword Args:
                start_version (int): Available/Required for versioned layers only; the beginning of the range of versions you want to get (exclusive). By convention -1 indicates the initial version before the first publication. After the first publication, the catalog version is 0.. [optional]
                end_version (int): Available/Required for versioned layers only; the end of the range of versions you want to get (inclusive). This must be a valid catalog version greater than the startVersion.. [optional]
                since_time (int): Available/Required for volatile layers only; will return partitions whose data has been modified since this time, in milliseconds since epoch, inclusive.. [optional]
                part (str): Available/Required for versioned layers only; indicates which part of the layer shall be queried.. [optional]
                additional_fields ([AdditionalFieldsEnum]): Additional fields - `dataSize`, `checksum`, `compressedDataSize`, `crc`.. [optional]
                range (str): Use this parameter to resume download of a large response for versioned layers when there is a connection issue between the client and server. Specify a single byte range offset like this: `Range: bytes=10-`. This parameter is compliant with [RFC 7233](https://tools.ietf.org/html/rfc7233), but note that this parameter only supports a single byte range. The `range` parameter can also be specified as a query parameter, i.e. `range=bytes=10-`. For volatile layers use the pagination links returned in the response body.. [optional]
                billing_tag (str): Billing Tag is an optional free-form tag which is used for grouping billing records together. If supplied, it must be between 4 - 16 characters, contain only alpha/numeric ASCII characters  [A-Za-z0-9]. Grouping billing records by billing tag will be available in future releases.. [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 (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:
                Partitions
                    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['layer_id'] = \
                layer_id
            return self.call_with_http_info(**kwargs)

        self.get_changes = _Endpoint(
            settings={
                'response_type': (Partitions,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/changes',
                'operation_id': 'get_changes',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'start_version',
                    'end_version',
                    'since_time',
                    'part',
                    'additional_fields',
                    'range',
                    'billing_tag',
                ],
                'required': [
                    'layer_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'start_version':
                        (int,),
                    'end_version':
                        (int,),
                    'since_time':
                        (int,),
                    'part':
                        (str,),
                    'additional_fields':
                        ([AdditionalFieldsEnum],),
                    'range':
                        (str,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'start_version': 'startVersion',
                    'end_version': 'endVersion',
                    'since_time': 'sinceTime',
                    'part': 'part',
                    'additional_fields': 'additionalFields',
                    'range': 'Range',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'layer_id': 'path',
                    'start_version': 'query',
                    'end_version': 'query',
                    'since_time': 'query',
                    'part': 'query',
                    'additional_fields': 'query',
                    'range': 'header',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                    'additional_fields': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_changes
        )

        def __get_changes_parts(
            self,
            layer_id,
            num_requested_parts,
            **kwargs
        ):
            """Get partIds for parallel queries of changes for the version range.  # noqa: E501

            Returns a list of Part Ids which represent the parts that can be used to limit the scope of queries of changes for the version range. This allows to run parallel queries with multiple parts. The user has to provide the desired number of parts and the service will return a list of Part Ids. Please note in some cases the requested number of parts will make them too small and in this case the service might return lesser amount of the parts than requested.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_changes_parts(layer_id, num_requested_parts, async_req=True)
            >>> result = thread.get()

            Args:
                layer_id (str): Unique layer ID. Content of this parameter must refer to a valid layer ID.
                num_requested_parts (int): Indicates requested number of parts.

            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 (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:
                PartsResponse
                    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['layer_id'] = \
                layer_id
            kwargs['num_requested_parts'] = \
                num_requested_parts
            return self.call_with_http_info(**kwargs)

        self.get_changes_parts = _Endpoint(
            settings={
                'response_type': (PartsResponse,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/changes/parts',
                'operation_id': 'get_changes_parts',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'num_requested_parts',
                ],
                'required': [
                    'layer_id',
                    'num_requested_parts',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'num_requested_parts':
                        (int,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'num_requested_parts': 'numRequestedParts',
                },
                'location_map': {
                    'layer_id': 'path',
                    'num_requested_parts': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_changes_parts
        )

        def __get_layers_version(
            self,
            version,
            **kwargs
        ):
            """Gets layer versions for catalog version  # noqa: E501

            Returns information about layer versions for the catalog version. It will return an error if the catalog does not have any versions or if the version passed in the query parameter does not exist. If a layer does not have any data for the requested version it is excluded from the response.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_layers_version(version, async_req=True)
            >>> result = thread.get()

            Args:
                version (int): Catalog version

            Keyword Args:
                billing_tag (str): Billing Tag is an optional free-form tag which is used for grouping billing records together. If supplied, it must be between 4 - 16 characters, contain only alphanumeric ASCII characters [A-Za-z0-9]. Grouping billing records by billing tag will be available in future releases.. [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 (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:
                LayerVersions
                    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['version'] = \
                version
            return self.call_with_http_info(**kwargs)

        self.get_layers_version = _Endpoint(
            settings={
                'response_type': (LayerVersions,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layerVersions',
                'operation_id': 'get_layers_version',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'version',
                    'billing_tag',
                ],
                'required': [
                    'version',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'version':
                        (int,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'version': 'version',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'version': 'query',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_layers_version
        )

        def __get_partitions(
            self,
            layer_id,
            **kwargs
        ):
            """Gets partitions  # noqa: E501

            Gets the metadata for all partitions in a specific layer.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_partitions(layer_id, async_req=True)
            >>> result = thread.get()

            Args:
                layer_id (str): Unique layer ID. Content of this parameter must refer to a valid layer ID.

            Keyword Args:
                version (int): If you are getting metadata from a versioned layer, specify the version of the layer you want. This parameter is required for versioned layers. If you are getting metadata from another layer type, do not specify this parameter.. [optional]
                part (str): Available/Required for versioned layers only; indicates which part of the layer shall be queried.. [optional]
                additional_fields ([AdditionalFieldsEnum]): Additional fields - `dataSize`, `checksum`, `compressedDataSize`, `crc`.. [optional]
                range (str): Use this parameter to resume download of a large response for versioned layers when there is a connection issue between the client and server. Specify a single byte range offset like this: `Range: bytes=10-`. This parameter is compliant with [RFC 7233](https://tools.ietf.org/html/rfc7233), but note that this parameter only supports a single byte range. The `range` parameter can also be specified as a query parameter, i.e. `range=bytes=10-`. For volatile layers use the pagination links returned in the response body.. [optional]
                billing_tag (str): Billing Tag is an optional free-form tag which is used for grouping billing records together. If supplied, it must be between 4 - 16 characters, contain only alpha/numeric ASCII characters [A-Za-z0-9]. Grouping billing records by billing tag will be available in future releases.. [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 (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:
                Partitions
                    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['layer_id'] = \
                layer_id
            return self.call_with_http_info(**kwargs)

        self.get_partitions = _Endpoint(
            settings={
                'response_type': (Partitions,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/partitions',
                'operation_id': 'get_partitions',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'version',
                    'part',
                    'additional_fields',
                    'range',
                    'billing_tag',
                ],
                'required': [
                    'layer_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'version':
                        (int,),
                    'part':
                        (str,),
                    'additional_fields':
                        ([AdditionalFieldsEnum],),
                    'range':
                        (str,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'version': 'version',
                    'part': 'part',
                    'additional_fields': 'additionalFields',
                    'range': 'Range',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'layer_id': 'path',
                    'version': 'query',
                    'part': 'query',
                    'additional_fields': 'query',
                    'range': 'header',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                    'additional_fields': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_partitions
        )

        def __get_partitions_parts(
            self,
            layer_id,
            num_requested_parts,
            **kwargs
        ):
            """Get partIds for parallel queries of the metadata for all partitions in a specific layer.  # noqa: E501

            Returns a list of Part Ids which represent the parts that can be used to limit the scope of queries of the metadata for all partitions in a specific layer. This allows to run parallel queries with multiple parts. The user has to provide the desired number of parts and the service will return a list of Part Ids. Please note in some cases the requested number of parts will make them too small and in this case the service might return lesser amount of the parts than requested.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_partitions_parts(layer_id, num_requested_parts, async_req=True)
            >>> result = thread.get()

            Args:
                layer_id (str): Unique layer ID. Content of this parameter must refer to a valid layer ID.
                num_requested_parts (int): Indicates requested number of parts.

            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 (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:
                PartsResponse
                    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['layer_id'] = \
                layer_id
            kwargs['num_requested_parts'] = \
                num_requested_parts
            return self.call_with_http_info(**kwargs)

        self.get_partitions_parts = _Endpoint(
            settings={
                'response_type': (PartsResponse,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/partitions/parts',
                'operation_id': 'get_partitions_parts',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'num_requested_parts',
                ],
                'required': [
                    'layer_id',
                    'num_requested_parts',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'num_requested_parts':
                        (int,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'num_requested_parts': 'numRequestedParts',
                },
                'location_map': {
                    'layer_id': 'path',
                    'num_requested_parts': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_partitions_parts
        )

        def __latest_version(
            self,
            start_version,
            **kwargs
        ):
            """Gets the latest available catalog version  # noqa: E501

            Returns information about the latest version for the given catalog. If the catalog doesn't contain any versions a 404 will be returned.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.latest_version(start_version, async_req=True)
            >>> result = thread.get()

            Args:
                start_version (int): The catalog version returned from a prior request to `/versions/latest`. You should save the version from each request so that you can use it in the `startVersion` parameter of subsequent requests. If you don't have the version from a prior request, set the parameter to -1.

            Keyword Args:
                billing_tag (str): Billing Tag is an optional free-form tag which is used for grouping billing records together. If supplied, it must be between 4 - 16 characters, contain only alpha/numeric ASCII characters  [A-Za-z0-9]. Grouping billing records by billing tag will be available in future releases.. [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 (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:
                VersionResponse
                    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['start_version'] = \
                start_version
            return self.call_with_http_info(**kwargs)

        self.latest_version = _Endpoint(
            settings={
                'response_type': (VersionResponse,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/versions/latest',
                'operation_id': 'latest_version',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'start_version',
                    'billing_tag',
                ],
                'required': [
                    'start_version',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'start_version':
                        (int,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'start_version': 'startVersion',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'start_version': 'query',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__latest_version
        )

        def __list_versions(
            self,
            start_version,
            end_version,
            **kwargs
        ):
            """Gets catalog versions  # noqa: E501

            Returns information about specific catalog version(s). If the catalog doesn't contain any versions 404 will be returned. Maximum number of versions to be returned per call is 1000 versions. If requested range is bigger than 1000 versions 400 Bad Request will be returned  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.list_versions(start_version, end_version, async_req=True)
            >>> result = thread.get()

            Args:
                start_version (int): The beginning of the range of versions you want to get (exclusive). By convention -1 indicates the initial version before the first publication. After the first publication, the catalog version is 0.
                end_version (int): The end of the range of versions you want to get (inclusive). This must be a valid catalog version greater than the startVersion. The maximum value for this parameter is returned from the `/versions/latest` endpoint. If this version does not exist, 400 Bad Request is returned

            Keyword Args:
                billing_tag (str): Billing Tag is an optional free-form tag which is used for grouping billing records together. If supplied, it must be between 4 - 16 characters, contain only alpha/numeric ASCII characters  [A-Za-z0-9]. Grouping billing records by billing tag will be available in future releases.. [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 (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:
                VersionInfos
                    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['start_version'] = \
                start_version
            kwargs['end_version'] = \
                end_version
            return self.call_with_http_info(**kwargs)

        self.list_versions = _Endpoint(
            settings={
                'response_type': (VersionInfos,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/versions',
                'operation_id': 'list_versions',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'start_version',
                    'end_version',
                    'billing_tag',
                ],
                'required': [
                    'start_version',
                    'end_version',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'start_version':
                        (int,),
                    'end_version':
                        (int,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'start_version': 'startVersion',
                    'end_version': 'endVersion',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'start_version': 'query',
                    'end_version': 'query',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__list_versions
        )

        def __minimum_version(
            self,
            **kwargs
        ):
            """Gets the earliest available catalog version  # noqa: E501

            Returns minimum version for the given catalog. If the catalog doesn't contain any versions 404 will be returned.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.minimum_version(async_req=True)
            >>> result = thread.get()


            Keyword Args:
                billing_tag (str): Billing Tag is an optional free-form tag which is used for grouping billing records together. If supplied, it must be between 4 - 16 characters, contain only alpha/numeric ASCII characters  [A-Za-z0-9]. Grouping billing records by billing tag will be available in future releases.. [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 (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:
                VersionResponse
                    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')
            return self.call_with_http_info(**kwargs)

        self.minimum_version = _Endpoint(
            settings={
                'response_type': (VersionResponse,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/versions/minimum',
                'operation_id': 'minimum_version',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'billing_tag',
                ],
                'required': [],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__minimum_version
        )

        def __set_minimum_version(
            self,
            minimum_version_info,
            **kwargs
        ):
            """Sets the earliest available catalog version  # noqa: E501

            Sets minimum version for the given catalog. All prior versions will be deleted. If the catalog doesn't contain any versions, a 404 will be returned.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.set_minimum_version(minimum_version_info, async_req=True)
            >>> result = thread.get()

            Args:
                minimum_version_info (MinimumVersionInfo): A version object that contains new minimum version.

            Keyword Args:
                billing_tag (str): Billing Tag is an optional free-form tag which is used for grouping billing records together. If supplied, it must be between 4 - 16 characters, contain only alpha/numeric ASCII characters  [A-Za-z0-9]. Grouping billing records by billing tag will be available in future releases.. [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 (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['minimum_version_info'] = \
                minimum_version_info
            return self.call_with_http_info(**kwargs)

        self.set_minimum_version = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/versions/minimum',
                'operation_id': 'set_minimum_version',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'minimum_version_info',
                    'billing_tag',
                ],
                'required': [
                    'minimum_version_info',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'minimum_version_info':
                        (MinimumVersionInfo,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'minimum_version_info': 'body',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client,
            callable=__set_minimum_version
        )
