"""
    Blob API v1

    The `blob` service supports the upload and retrieval of large volumes of data from the storage of a catalog. Each discrete chunk of data is stored as a blob (Binary Large Object). Each blob has its own unique ID (data handle). The data handles can be stored in  services like `metadata`, `index` or `stream`. To get data, use your preferred service to retrieve the data handle of the relevant blobs. Then use the data handle to pull the data using the `blob` service.  Currently, the blob service supports REST API versions v1 and v2. Version v1 should be used to access versioned, index and stream (if the stream payload is larger than 1MB) layers. Version v2 should be used to access the object store layer. Always pick the proper API version from API Lookup to ensure you get back the correct API version response.  If you are writing to a volatile layer, see volatile-blob API definition.  # noqa: E501

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


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

from here_data_blob_v1_client.api_client import ApiClient, Endpoint as _Endpoint
from here_data_blob_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_blob_v1_client.model.blob_init_response import BlobInitResponse
from here_data_blob_v1_client.model.multipart_complete_request import MultipartCompleteRequest
from here_data_blob_v1_client.model.multipart_upload_metadata import MultipartUploadMetadata
from here_data_blob_v1_client.model.multipart_upload_status import MultipartUploadStatus


class BlobApi(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 __cancel_multipart_upload(
            self,
            layer_id,
            data_handle,
            multi_part_token,
            **kwargs
        ):
            """Cancels a multipart upload  # noqa: E501

            Cancels an entire multipart upload operation. You can only cancel a multipart upload before it has been completed. Please keep in mind that the actual URL for this operation must be obtained from the response body of start multipart operation that is 'POST /layers/{layerId}/data/{dataHandle}/multiparts' from the 'delete' element under the top level 'links' element of 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.cancel_multipart_upload(layer_id, data_handle, multi_part_token, async_req=True)
            >>> result = thread.get()

            Args:
                layer_id (str): The ID of the layer that the data blob part belongs to. Content of this parameter must refer to a valid layer already configured in the catalog configuration.
                data_handle (str): The data handle (ID) represents an identifier for the data blob which the part belongs to. The data handle can only contain alphanumeric, '-' and '.' characters, [0-9, a-z, A-Z, -, .]. The maximum length of this field is 1024 characters.
                multi_part_token (str): The identifier of the multi part upload (token). Content of this parameter must refer to a valid token retrieved when starting the multipart upload.

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

        self.cancel_multipart_upload = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/data/{dataHandle}/multiparts/{multiPartToken}',
                'operation_id': 'cancel_multipart_upload',
                'http_method': 'DELETE',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'data_handle',
                    'multi_part_token',
                    'billing_tag',
                ],
                'required': [
                    'layer_id',
                    'data_handle',
                    'multi_part_token',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'data_handle':
                        (str,),
                    'multi_part_token':
                        (str,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'data_handle': 'dataHandle',
                    'multi_part_token': 'multiPartToken',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'layer_id': 'path',
                    'data_handle': 'path',
                    'multi_part_token': 'path',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [],
            },
            api_client=api_client,
            callable=__cancel_multipart_upload
        )

        def __check_blob_exists(
            self,
            layer_id,
            data_handle,
            **kwargs
        ):
            """Checks if a data handle exists  # noqa: E501

            Checks if a blob exists for the requested data handle.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

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

            Args:
                layer_id (str): The ID of the layer that the blob belongs to.
                data_handle (str): The data handle identifies a specific blob so that you can get that blob's contents. The data handle can only contain alphanumeric, '-' and '.' characters, [0-9, a-z, A-Z, -, .]. The maximum length of this field is 1024 characters.

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

        self.check_blob_exists = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/data/{dataHandle}',
                'operation_id': 'check_blob_exists',
                'http_method': 'HEAD',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'data_handle',
                    'billing_tag',
                ],
                'required': [
                    'layer_id',
                    'data_handle',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'data_handle':
                        (str,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'data_handle': 'dataHandle',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'layer_id': 'path',
                    'data_handle': 'path',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [],
            },
            api_client=api_client,
            callable=__check_blob_exists
        )

        def __complete_multipart_upload(
            self,
            layer_id,
            data_handle,
            multi_part_token,
            **kwargs
        ):
            """Completes a multipart upload  # noqa: E501

            Call this API when all parts have been uploaded. Please keep in mind that the actual URL for this operation must be obtained from the response body of start multipart operation that is 'POST /layers/{layerId}/data/{dataHandle}/multiparts' from the 'complete' element under the top level 'links' element of 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.complete_multipart_upload(layer_id, data_handle, multi_part_token, async_req=True)
            >>> result = thread.get()

            Args:
                layer_id (str): The ID of the layer that the data blob part belongs to. 
                data_handle (str): The data handle (ID) represents an identifier for the data blob which the part belongs to. The data handle can only contain alphanumeric, '-' and '.' characters, [0-9, a-z, A-Z, -, .]. The maximum length of this field is 1024 characters.
                multi_part_token (str): The identifier of the multi part upload (token). Content of this parameter must refer to a valid and started multipart upload.

            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]
                parts (MultipartCompleteRequest): The part ids uploaded in this multipart upload which should be used in the resulting blob.. [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['layer_id'] = \
                layer_id
            kwargs['data_handle'] = \
                data_handle
            kwargs['multi_part_token'] = \
                multi_part_token
            return self.call_with_http_info(**kwargs)

        self.complete_multipart_upload = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/data/{dataHandle}/multiparts/{multiPartToken}',
                'operation_id': 'complete_multipart_upload',
                'http_method': 'PUT',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'data_handle',
                    'multi_part_token',
                    'billing_tag',
                    'parts',
                ],
                'required': [
                    'layer_id',
                    'data_handle',
                    'multi_part_token',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'data_handle':
                        (str,),
                    'multi_part_token':
                        (str,),
                    'billing_tag':
                        (str,),
                    'parts':
                        (MultipartCompleteRequest,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'data_handle': 'dataHandle',
                    'multi_part_token': 'multiPartToken',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'layer_id': 'path',
                    'data_handle': 'path',
                    'multi_part_token': 'path',
                    'billing_tag': 'query',
                    'parts': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client,
            callable=__complete_multipart_upload
        )

        def __delete_blob(
            self,
            layer_id,
            data_handle,
            **kwargs
        ):
            """Deletes a data blob from an index layer.  # noqa: E501

            Deletes a data blob from the underlying storage mechanism (volume). The DELETE method works only for index layers. DELETE requests for blobs stored for other kind of layers will be rejected. The DELETE request is successfully accepted even if the data blob does not exist.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

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

            Args:
                layer_id (str): The ID of the layer that the data blob belongs to.
                data_handle (str): The data handle of the blob you want to delete. The data handle can only contain alphanumeric, '-' and '.' characters, [0-9, a-z, A-Z, -, .]. The maximum length of this field is 1024 characters.

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

        self.delete_blob = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/data/{dataHandle}',
                'operation_id': 'delete_blob',
                'http_method': 'DELETE',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'data_handle',
                    'billing_tag',
                ],
                'required': [
                    'layer_id',
                    'data_handle',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'data_handle':
                        (str,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'data_handle': 'dataHandle',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'layer_id': 'path',
                    'data_handle': 'path',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [],
            },
            api_client=api_client,
            callable=__delete_blob
        )

        def __get_blob(
            self,
            layer_id,
            data_handle,
            **kwargs
        ):
            """Gets a blob  # noqa: E501

            Retrieves a blob from storage.  # 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_blob(layer_id, data_handle, async_req=True)
            >>> result = thread.get()

            Args:
                layer_id (str): The ID of the parent layer for this blob.
                data_handle (str): The data handle identifies a specific blob so that you can get that blob's contents. The data handle can only contain alphanumeric, '-' and '.' characters, [0-9, a-z, A-Z, -, .]. The maximum length of this field is 1024 characters.

            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]
                range (str): Use this parameter to resume download of a large response when there is a connection issue between the client and server, or to fetch a specific slice of the blob. To resume download after a connection issue, specify a single byte range offset like this: `Range: bytes=10-`. To fetch a specific slice of the blob, specify a slice like this: `Range: bytes=10-100`. 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-`.. [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:
                file_type
                    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['data_handle'] = \
                data_handle
            return self.call_with_http_info(**kwargs)

        self.get_blob = _Endpoint(
            settings={
                'response_type': (file_type,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/data/{dataHandle}',
                'operation_id': 'get_blob',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'data_handle',
                    'billing_tag',
                    'range',
                ],
                'required': [
                    'layer_id',
                    'data_handle',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'data_handle':
                        (str,),
                    'billing_tag':
                        (str,),
                    'range':
                        (str,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'data_handle': 'dataHandle',
                    'billing_tag': 'billingTag',
                    'range': 'Range',
                },
                'location_map': {
                    'layer_id': 'path',
                    'data_handle': 'path',
                    'billing_tag': 'query',
                    'range': 'header',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    '*/*'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_blob
        )

        def __get_multipart_upload_status(
            self,
            layer_id,
            data_handle,
            multi_part_token,
            **kwargs
        ):
            """Gets the status of a multipart upload.  # noqa: E501

            Gets the status of a multipart upload. The status can be received only when the upload has been completed. Please keep in mind that the actual URL for this operation must be obtained from the response body of start multipart operation that is 'POST /layers/{layerId}/data/{dataHandle}/multiparts' from the 'status' element under the top level 'links' element of 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_multipart_upload_status(layer_id, data_handle, multi_part_token, async_req=True)
            >>> result = thread.get()

            Args:
                layer_id (str): The ID of the layer that the data blob part belongs to.
                data_handle (str): The data handle (ID) is an identifier for the data blob which the part belongs to. The data handle can only contain alphanumeric, '-' and '.' characters, [0-9, a-z, A-Z, -, .]. The maximum length of this field is 1024 characters.
                multi_part_token (str): The identifier of the multipart upload (token). Content of this parameter must refer to a valid token which was provided when the multipart upload was initiated.

            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:
                MultipartUploadStatus
                    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['data_handle'] = \
                data_handle
            kwargs['multi_part_token'] = \
                multi_part_token
            return self.call_with_http_info(**kwargs)

        self.get_multipart_upload_status = _Endpoint(
            settings={
                'response_type': (MultipartUploadStatus,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/data/{dataHandle}/multiparts/{multiPartToken}',
                'operation_id': 'get_multipart_upload_status',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'data_handle',
                    'multi_part_token',
                    'billing_tag',
                ],
                'required': [
                    'layer_id',
                    'data_handle',
                    'multi_part_token',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'data_handle':
                        (str,),
                    'multi_part_token':
                        (str,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'data_handle': 'dataHandle',
                    'multi_part_token': 'multiPartToken',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'layer_id': 'path',
                    'data_handle': 'path',
                    'multi_part_token': 'path',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_multipart_upload_status
        )

        def __put_blob(
            self,
            layer_id,
            data_handle,
            content_length,
            body,
            **kwargs
        ):
            """Publishes a data blob  # noqa: E501

            Persists the data blob in the underlying storage mechanism (volume). Use this upload mechanism for blobs smaller than 50 MB. The size limit for blobs uploaded this way is 5 GB but we do not recommend uploading blobs this large with this method, so use multipart upload instead. When the operation completes successfully there is no guarantee that the data blob will be immediately available although in most cases it will be. To check if the data blob is available use the HEAD method.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.put_blob(layer_id, data_handle, content_length, body, async_req=True)
            >>> result = thread.get()

            Args:
                layer_id (str): The ID of the layer that the data blob belongs to.
                data_handle (str): The data handle (ID) represents an identifier for the data blob. The data handle can only contain alphanumeric, '-' and '.' characters, [0-9, a-z, A-Z, -, .]. The maximum length of this field is 1024 characters.
                content_length (str): Size of the entity-body, in bytes. For more information, see [RFC 7230, section 3.3.2: Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2).
                body (file_type): body

            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['layer_id'] = \
                layer_id
            kwargs['data_handle'] = \
                data_handle
            kwargs['content_length'] = \
                content_length
            kwargs['body'] = \
                body
            return self.call_with_http_info(**kwargs)

        self.put_blob = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/data/{dataHandle}',
                'operation_id': 'put_blob',
                'http_method': 'PUT',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'data_handle',
                    'content_length',
                    'body',
                    'billing_tag',
                ],
                'required': [
                    'layer_id',
                    'data_handle',
                    'content_length',
                    'body',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'data_handle':
                        (str,),
                    'content_length':
                        (str,),
                    'body':
                        (file_type,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'data_handle': 'dataHandle',
                    'content_length': 'Content-Length',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'layer_id': 'path',
                    'data_handle': 'path',
                    'content_length': 'header',
                    'body': 'body',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [],
            },
            api_client=api_client,
            callable=__put_blob
        )

        def __start_multipart_upload(
            self,
            layer_id,
            data_handle,
            **kwargs
        ):
            """Starts a multipart upload of a blob and returns URLs for the next multipart upload operations. The URLs contain the upload token.  # noqa: E501

            Publishes large data blobs where the data payload needs to be split into multiple parts. The multipart upload start is to be followed by the individual parts upload and completed with a call to complete the upload. The limit of the blob uploaded this way is 50GB.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

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

            Args:
                layer_id (str): The ID of the layer that the data blob belongs to.
                data_handle (str): The data handle (ID) represents an identifier for the data blob which contents will be persisted. The data handle can only contain alphanumeric, '-' and '.' characters, [0-9, a-z, A-Z, -, .]. The maximum length of this field is 1024 characters.

            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]
                body (MultipartUploadMetadata): body. [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:
                BlobInitResponse
                    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['data_handle'] = \
                data_handle
            return self.call_with_http_info(**kwargs)

        self.start_multipart_upload = _Endpoint(
            settings={
                'response_type': (BlobInitResponse,),
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/data/{dataHandle}/multiparts',
                'operation_id': 'start_multipart_upload',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'data_handle',
                    'billing_tag',
                    'body',
                ],
                'required': [
                    'layer_id',
                    'data_handle',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'data_handle':
                        (str,),
                    'billing_tag':
                        (str,),
                    'body':
                        (MultipartUploadMetadata,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'data_handle': 'dataHandle',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'layer_id': 'path',
                    'data_handle': 'path',
                    'billing_tag': 'query',
                    'body': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client,
            callable=__start_multipart_upload
        )

        def __upload_part(
            self,
            layer_id,
            data_handle,
            multi_part_token,
            part_number,
            content_type,
            content_length,
            body,
            **kwargs
        ):
            """Uploads a part  # noqa: E501

            Upload a single part of a multipart upload for the blob. Every uploaded part except the last one must have a minimum 5 MB of data and maximum of 5 GB, but we do not recommend uploading parts this large. The maximum number of parts is 10,000. Please keep in mind that the actual URL for this operation must be obtained from the response body of start multipart operation that is 'POST /layers/{layerId}/data/{dataHandle}/multiparts' from the 'uploadPart' element under the top level 'links' element of 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.upload_part(layer_id, data_handle, multi_part_token, part_number, content_type, content_length, body, async_req=True)
            >>> result = thread.get()

            Args:
                layer_id (str): The ID of the layer that the data blob part belongs to.
                data_handle (str): The data handle (ID) represents an identifier for the data blob which the part belongs to. The data handle can only contain alphanumeric, '-' and '.' characters, [0-9, a-z, A-Z, -, .]. The maximum length of this field is 1024 characters.
                multi_part_token (str): The identifier of the multi part upload (token). Content of this parameter must refer to a valid and started multipart upload.
                part_number (str): The number of the part for the multi part upload. The numbers of the upload parts must start from 1, be no greater than 10,000 and be consecutive. Parts uploaded with the same `partNumber` are overridden. Do not reuse the same `partnumber` when retrying an upload in an error situation (network problems, 4xx or 5xx responses). Reusing the same `partnumber` in a retry may cause the publication to fail.
                content_type (str): A standard MIME type describing the format of the blob data. For more information, see [RFC 2616, section 14.17: Content-Type](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17). The value of this header must match the content type specified in the 'contentType' field when the multipart upload was initialized, and this content type must also match the content type specified in the layer's configuration.
                content_length (str): Size of the entity-body, in bytes. For more information, see [RFC 7230, section 3.3.2: Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2).
                body (file_type): The data to upload as part of the blob.

            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['layer_id'] = \
                layer_id
            kwargs['data_handle'] = \
                data_handle
            kwargs['multi_part_token'] = \
                multi_part_token
            kwargs['part_number'] = \
                part_number
            kwargs['content_type'] = \
                content_type
            kwargs['content_length'] = \
                content_length
            kwargs['body'] = \
                body
            return self.call_with_http_info(**kwargs)

        self.upload_part = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'Bearer'
                ],
                'endpoint_path': '/layers/{layerId}/data/{dataHandle}/multiparts/{multiPartToken}/parts',
                'operation_id': 'upload_part',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'layer_id',
                    'data_handle',
                    'multi_part_token',
                    'part_number',
                    'content_type',
                    'content_length',
                    'body',
                    'billing_tag',
                ],
                'required': [
                    'layer_id',
                    'data_handle',
                    'multi_part_token',
                    'part_number',
                    'content_type',
                    'content_length',
                    'body',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'layer_id':
                        (str,),
                    'data_handle':
                        (str,),
                    'multi_part_token':
                        (str,),
                    'part_number':
                        (str,),
                    'content_type':
                        (str,),
                    'content_length':
                        (str,),
                    'body':
                        (file_type,),
                    'billing_tag':
                        (str,),
                },
                'attribute_map': {
                    'layer_id': 'layerId',
                    'data_handle': 'dataHandle',
                    'multi_part_token': 'multiPartToken',
                    'part_number': 'partNumber',
                    'content_type': 'Content-Type',
                    'content_length': 'Content-Length',
                    'billing_tag': 'billingTag',
                },
                'location_map': {
                    'layer_id': 'path',
                    'data_handle': 'path',
                    'multi_part_token': 'path',
                    'part_number': 'query',
                    'content_type': 'header',
                    'content_length': 'header',
                    'body': 'body',
                    'billing_tag': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [],
            },
            api_client=api_client,
            callable=__upload_part
        )
