github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python-legacy/lakefs_client/api/metadata_api.py (about)

     1  """
     2      lakeFS API
     3  
     4      lakeFS HTTP API  # noqa: E501
     5  
     6      The version of the OpenAPI document: 1.0.0
     7      Contact: services@treeverse.io
     8      Generated by: https://openapi-generator.tech
     9  """
    10  
    11  
    12  import re  # noqa: F401
    13  import sys  # noqa: F401
    14  
    15  from lakefs_client.api_client import ApiClient, Endpoint as _Endpoint
    16  from lakefs_client.model_utils import (  # noqa: F401
    17      check_allowed_values,
    18      check_validations,
    19      date,
    20      datetime,
    21      file_type,
    22      none_type,
    23      validate_and_convert_types
    24  )
    25  from lakefs_client.model.error import Error
    26  from lakefs_client.model.storage_uri import StorageURI
    27  
    28  
    29  class MetadataApi(object):
    30      """NOTE: This class is auto generated by OpenAPI Generator
    31      Ref: https://openapi-generator.tech
    32  
    33      Do not edit the class manually.
    34      """
    35  
    36      def __init__(self, api_client=None):
    37          if api_client is None:
    38              api_client = ApiClient()
    39          self.api_client = api_client
    40          self.get_meta_range_endpoint = _Endpoint(
    41              settings={
    42                  'response_type': (StorageURI,),
    43                  'auth': [
    44                      'basic_auth',
    45                      'cookie_auth',
    46                      'jwt_token',
    47                      'oidc_auth',
    48                      'saml_auth'
    49                  ],
    50                  'endpoint_path': '/repositories/{repository}/metadata/meta_range/{meta_range}',
    51                  'operation_id': 'get_meta_range',
    52                  'http_method': 'GET',
    53                  'servers': None,
    54              },
    55              params_map={
    56                  'all': [
    57                      'repository',
    58                      'meta_range',
    59                  ],
    60                  'required': [
    61                      'repository',
    62                      'meta_range',
    63                  ],
    64                  'nullable': [
    65                  ],
    66                  'enum': [
    67                  ],
    68                  'validation': [
    69                  ]
    70              },
    71              root_map={
    72                  'validations': {
    73                  },
    74                  'allowed_values': {
    75                  },
    76                  'openapi_types': {
    77                      'repository':
    78                          (str,),
    79                      'meta_range':
    80                          (str,),
    81                  },
    82                  'attribute_map': {
    83                      'repository': 'repository',
    84                      'meta_range': 'meta_range',
    85                  },
    86                  'location_map': {
    87                      'repository': 'path',
    88                      'meta_range': 'path',
    89                  },
    90                  'collection_format_map': {
    91                  }
    92              },
    93              headers_map={
    94                  'accept': [
    95                      'application/json'
    96                  ],
    97                  'content_type': [],
    98              },
    99              api_client=api_client
   100          )
   101          self.get_range_endpoint = _Endpoint(
   102              settings={
   103                  'response_type': (StorageURI,),
   104                  'auth': [
   105                      'basic_auth',
   106                      'cookie_auth',
   107                      'jwt_token',
   108                      'oidc_auth',
   109                      'saml_auth'
   110                  ],
   111                  'endpoint_path': '/repositories/{repository}/metadata/range/{range}',
   112                  'operation_id': 'get_range',
   113                  'http_method': 'GET',
   114                  'servers': None,
   115              },
   116              params_map={
   117                  'all': [
   118                      'repository',
   119                      'range',
   120                  ],
   121                  'required': [
   122                      'repository',
   123                      'range',
   124                  ],
   125                  'nullable': [
   126                  ],
   127                  'enum': [
   128                  ],
   129                  'validation': [
   130                  ]
   131              },
   132              root_map={
   133                  'validations': {
   134                  },
   135                  'allowed_values': {
   136                  },
   137                  'openapi_types': {
   138                      'repository':
   139                          (str,),
   140                      'range':
   141                          (str,),
   142                  },
   143                  'attribute_map': {
   144                      'repository': 'repository',
   145                      'range': 'range',
   146                  },
   147                  'location_map': {
   148                      'repository': 'path',
   149                      'range': 'path',
   150                  },
   151                  'collection_format_map': {
   152                  }
   153              },
   154              headers_map={
   155                  'accept': [
   156                      'application/json'
   157                  ],
   158                  'content_type': [],
   159              },
   160              api_client=api_client
   161          )
   162  
   163      def get_meta_range(
   164          self,
   165          repository,
   166          meta_range,
   167          **kwargs
   168      ):
   169          """return URI to a meta-range file  # noqa: E501
   170  
   171          This method makes a synchronous HTTP request by default. To make an
   172          asynchronous HTTP request, please pass async_req=True
   173  
   174          >>> thread = api.get_meta_range(repository, meta_range, async_req=True)
   175          >>> result = thread.get()
   176  
   177          Args:
   178              repository (str):
   179              meta_range (str):
   180  
   181          Keyword Args:
   182              _return_http_data_only (bool): response data without head status
   183                  code and headers. Default is True.
   184              _preload_content (bool): if False, the urllib3.HTTPResponse object
   185                  will be returned without reading/decoding response data.
   186                  Default is True.
   187              _request_timeout (int/float/tuple): timeout setting for this request. If
   188                  one number provided, it will be total request timeout. It can also
   189                  be a pair (tuple) of (connection, read) timeouts.
   190                  Default is None.
   191              _check_input_type (bool): specifies if type checking
   192                  should be done one the data sent to the server.
   193                  Default is True.
   194              _check_return_type (bool): specifies if type checking
   195                  should be done one the data received from the server.
   196                  Default is True.
   197              _host_index (int/None): specifies the index of the server
   198                  that we want to use.
   199                  Default is read from the configuration.
   200              async_req (bool): execute request asynchronously
   201  
   202          Returns:
   203              StorageURI
   204                  If the method is called asynchronously, returns the request
   205                  thread.
   206          """
   207          kwargs['async_req'] = kwargs.get(
   208              'async_req', False
   209          )
   210          kwargs['_return_http_data_only'] = kwargs.get(
   211              '_return_http_data_only', True
   212          )
   213          kwargs['_preload_content'] = kwargs.get(
   214              '_preload_content', True
   215          )
   216          kwargs['_request_timeout'] = kwargs.get(
   217              '_request_timeout', None
   218          )
   219          kwargs['_check_input_type'] = kwargs.get(
   220              '_check_input_type', True
   221          )
   222          kwargs['_check_return_type'] = kwargs.get(
   223              '_check_return_type', True
   224          )
   225          kwargs['_host_index'] = kwargs.get('_host_index')
   226          kwargs['repository'] = \
   227              repository
   228          kwargs['meta_range'] = \
   229              meta_range
   230          return self.get_meta_range_endpoint.call_with_http_info(**kwargs)
   231  
   232      def get_range(
   233          self,
   234          repository,
   235          range,
   236          **kwargs
   237      ):
   238          """return URI to a range file  # noqa: E501
   239  
   240          This method makes a synchronous HTTP request by default. To make an
   241          asynchronous HTTP request, please pass async_req=True
   242  
   243          >>> thread = api.get_range(repository, range, async_req=True)
   244          >>> result = thread.get()
   245  
   246          Args:
   247              repository (str):
   248              range (str):
   249  
   250          Keyword Args:
   251              _return_http_data_only (bool): response data without head status
   252                  code and headers. Default is True.
   253              _preload_content (bool): if False, the urllib3.HTTPResponse object
   254                  will be returned without reading/decoding response data.
   255                  Default is True.
   256              _request_timeout (int/float/tuple): timeout setting for this request. If
   257                  one number provided, it will be total request timeout. It can also
   258                  be a pair (tuple) of (connection, read) timeouts.
   259                  Default is None.
   260              _check_input_type (bool): specifies if type checking
   261                  should be done one the data sent to the server.
   262                  Default is True.
   263              _check_return_type (bool): specifies if type checking
   264                  should be done one the data received from the server.
   265                  Default is True.
   266              _host_index (int/None): specifies the index of the server
   267                  that we want to use.
   268                  Default is read from the configuration.
   269              async_req (bool): execute request asynchronously
   270  
   271          Returns:
   272              StorageURI
   273                  If the method is called asynchronously, returns the request
   274                  thread.
   275          """
   276          kwargs['async_req'] = kwargs.get(
   277              'async_req', False
   278          )
   279          kwargs['_return_http_data_only'] = kwargs.get(
   280              '_return_http_data_only', True
   281          )
   282          kwargs['_preload_content'] = kwargs.get(
   283              '_preload_content', True
   284          )
   285          kwargs['_request_timeout'] = kwargs.get(
   286              '_request_timeout', None
   287          )
   288          kwargs['_check_input_type'] = kwargs.get(
   289              '_check_input_type', True
   290          )
   291          kwargs['_check_return_type'] = kwargs.get(
   292              '_check_return_type', True
   293          )
   294          kwargs['_host_index'] = kwargs.get('_host_index')
   295          kwargs['repository'] = \
   296              repository
   297          kwargs['range'] = \
   298              range
   299          return self.get_range_endpoint.call_with_http_info(**kwargs)
   300