github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python-legacy/lakefs_client/model/object_stats.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.model_utils import (  # noqa: F401
    16      ApiTypeError,
    17      ModelComposed,
    18      ModelNormal,
    19      ModelSimple,
    20      cached_property,
    21      change_keys_js_to_python,
    22      convert_js_args_to_python_args,
    23      date,
    24      datetime,
    25      file_type,
    26      none_type,
    27      validate_get_composed_info,
    28  )
    29  from ..model_utils import OpenApiModel
    30  from lakefs_client.exceptions import ApiAttributeError
    31  
    32  
    33  def lazy_import():
    34      from lakefs_client.model.object_user_metadata import ObjectUserMetadata
    35      globals()['ObjectUserMetadata'] = ObjectUserMetadata
    36  
    37  
    38  class ObjectStats(ModelNormal):
    39      """NOTE: This class is auto generated by OpenAPI Generator.
    40      Ref: https://openapi-generator.tech
    41  
    42      Do not edit the class manually.
    43  
    44      Attributes:
    45        allowed_values (dict): The key is the tuple path to the attribute
    46            and the for var_name this is (var_name,). The value is a dict
    47            with a capitalized key describing the allowed value and an allowed
    48            value. These dicts store the allowed enum values.
    49        attribute_map (dict): The key is attribute name
    50            and the value is json key in definition.
    51        discriminator_value_class_map (dict): A dict to go from the discriminator
    52            variable value to the discriminator class name.
    53        validations (dict): The key is the tuple path to the attribute
    54            and the for var_name this is (var_name,). The value is a dict
    55            that stores validations for max_length, min_length, max_items,
    56            min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
    57            inclusive_minimum, and regex.
    58        additional_properties_type (tuple): A tuple of classes accepted
    59            as additional properties values.
    60      """
    61  
    62      allowed_values = {
    63          ('path_type',): {
    64              'COMMON_PREFIX': "common_prefix",
    65              'OBJECT': "object",
    66          },
    67      }
    68  
    69      validations = {
    70      }
    71  
    72      @cached_property
    73      def additional_properties_type():
    74          """
    75          This must be a method because a model may have properties that are
    76          of type self, this must run after the class is loaded
    77          """
    78          lazy_import()
    79          return (bool, date, datetime, dict, float, int, list, str, none_type,)  # noqa: E501
    80  
    81      _nullable = False
    82  
    83      @cached_property
    84      def openapi_types():
    85          """
    86          This must be a method because a model may have properties that are
    87          of type self, this must run after the class is loaded
    88  
    89          Returns
    90              openapi_types (dict): The key is attribute name
    91                  and the value is attribute type.
    92          """
    93          lazy_import()
    94          return {
    95              'path': (str,),  # noqa: E501
    96              'path_type': (str,),  # noqa: E501
    97              'physical_address': (str,),  # noqa: E501
    98              'checksum': (str,),  # noqa: E501
    99              'mtime': (int,),  # noqa: E501
   100              'physical_address_expiry': (int,),  # noqa: E501
   101              'size_bytes': (int,),  # noqa: E501
   102              'metadata': (ObjectUserMetadata,),  # noqa: E501
   103              'content_type': (str,),  # noqa: E501
   104          }
   105  
   106      @cached_property
   107      def discriminator():
   108          return None
   109  
   110  
   111      attribute_map = {
   112          'path': 'path',  # noqa: E501
   113          'path_type': 'path_type',  # noqa: E501
   114          'physical_address': 'physical_address',  # noqa: E501
   115          'checksum': 'checksum',  # noqa: E501
   116          'mtime': 'mtime',  # noqa: E501
   117          'physical_address_expiry': 'physical_address_expiry',  # noqa: E501
   118          'size_bytes': 'size_bytes',  # noqa: E501
   119          'metadata': 'metadata',  # noqa: E501
   120          'content_type': 'content_type',  # noqa: E501
   121      }
   122  
   123      read_only_vars = {
   124      }
   125  
   126      _composed_schemas = {}
   127  
   128      @classmethod
   129      @convert_js_args_to_python_args
   130      def _from_openapi_data(cls, path, path_type, physical_address, checksum, mtime, *args, **kwargs):  # noqa: E501
   131          """ObjectStats - a model defined in OpenAPI
   132  
   133          Args:
   134              path (str):
   135              path_type (str):
   136              physical_address (str): The location of the object on the underlying object store. Formatted as a native URI with the object store type as scheme (\"s3://...\", \"gs://...\", etc.) Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET 
   137              checksum (str):
   138              mtime (int): Unix Epoch in seconds
   139  
   140          Keyword Args:
   141              _check_type (bool): if True, values for parameters in openapi_types
   142                                  will be type checked and a TypeError will be
   143                                  raised if the wrong type is input.
   144                                  Defaults to True
   145              _path_to_item (tuple/list): This is a list of keys or values to
   146                                  drill down to the model in received_data
   147                                  when deserializing a response
   148              _spec_property_naming (bool): True if the variable names in the input data
   149                                  are serialized names, as specified in the OpenAPI document.
   150                                  False if the variable names in the input data
   151                                  are pythonic names, e.g. snake case (default)
   152              _configuration (Configuration): the instance to use when
   153                                  deserializing a file_type parameter.
   154                                  If passed, type conversion is attempted
   155                                  If omitted no type conversion is done.
   156              _visited_composed_classes (tuple): This stores a tuple of
   157                                  classes that we have traveled through so that
   158                                  if we see that class again we will not use its
   159                                  discriminator again.
   160                                  When traveling through a discriminator, the
   161                                  composed schema that is
   162                                  is traveled through is added to this set.
   163                                  For example if Animal has a discriminator
   164                                  petType and we pass in "Dog", and the class Dog
   165                                  allOf includes Animal, we move through Animal
   166                                  once using the discriminator, and pick Dog.
   167                                  Then in Dog, we will make an instance of the
   168                                  Animal class but this time we won't travel
   169                                  through its discriminator because we passed in
   170                                  _visited_composed_classes = (Animal,)
   171              physical_address_expiry (int): If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time.  This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire.  This field is *optional*. . [optional]  # noqa: E501
   172              size_bytes (int): [optional]  # noqa: E501
   173              metadata (ObjectUserMetadata): [optional]  # noqa: E501
   174              content_type (str): Object media type. [optional]  # noqa: E501
   175          """
   176  
   177          _check_type = kwargs.pop('_check_type', True)
   178          _spec_property_naming = kwargs.pop('_spec_property_naming', False)
   179          _path_to_item = kwargs.pop('_path_to_item', ())
   180          _configuration = kwargs.pop('_configuration', None)
   181          _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
   182  
   183          self = super(OpenApiModel, cls).__new__(cls)
   184  
   185          if args:
   186              raise ApiTypeError(
   187                  "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
   188                      args,
   189                      self.__class__.__name__,
   190                  ),
   191                  path_to_item=_path_to_item,
   192                  valid_classes=(self.__class__,),
   193              )
   194  
   195          self._data_store = {}
   196          self._check_type = _check_type
   197          self._spec_property_naming = _spec_property_naming
   198          self._path_to_item = _path_to_item
   199          self._configuration = _configuration
   200          self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
   201  
   202          self.path = path
   203          self.path_type = path_type
   204          self.physical_address = physical_address
   205          self.checksum = checksum
   206          self.mtime = mtime
   207          for var_name, var_value in kwargs.items():
   208              if var_name not in self.attribute_map and \
   209                          self._configuration is not None and \
   210                          self._configuration.discard_unknown_keys and \
   211                          self.additional_properties_type is None:
   212                  # discard variable.
   213                  continue
   214              setattr(self, var_name, var_value)
   215          return self
   216  
   217      required_properties = set([
   218          '_data_store',
   219          '_check_type',
   220          '_spec_property_naming',
   221          '_path_to_item',
   222          '_configuration',
   223          '_visited_composed_classes',
   224      ])
   225  
   226      @convert_js_args_to_python_args
   227      def __init__(self, path, path_type, physical_address, checksum, mtime, *args, **kwargs):  # noqa: E501
   228          """ObjectStats - a model defined in OpenAPI
   229  
   230          Args:
   231              path (str):
   232              path_type (str):
   233              physical_address (str): The location of the object on the underlying object store. Formatted as a native URI with the object store type as scheme (\"s3://...\", \"gs://...\", etc.) Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET 
   234              checksum (str):
   235              mtime (int): Unix Epoch in seconds
   236  
   237          Keyword Args:
   238              _check_type (bool): if True, values for parameters in openapi_types
   239                                  will be type checked and a TypeError will be
   240                                  raised if the wrong type is input.
   241                                  Defaults to True
   242              _path_to_item (tuple/list): This is a list of keys or values to
   243                                  drill down to the model in received_data
   244                                  when deserializing a response
   245              _spec_property_naming (bool): True if the variable names in the input data
   246                                  are serialized names, as specified in the OpenAPI document.
   247                                  False if the variable names in the input data
   248                                  are pythonic names, e.g. snake case (default)
   249              _configuration (Configuration): the instance to use when
   250                                  deserializing a file_type parameter.
   251                                  If passed, type conversion is attempted
   252                                  If omitted no type conversion is done.
   253              _visited_composed_classes (tuple): This stores a tuple of
   254                                  classes that we have traveled through so that
   255                                  if we see that class again we will not use its
   256                                  discriminator again.
   257                                  When traveling through a discriminator, the
   258                                  composed schema that is
   259                                  is traveled through is added to this set.
   260                                  For example if Animal has a discriminator
   261                                  petType and we pass in "Dog", and the class Dog
   262                                  allOf includes Animal, we move through Animal
   263                                  once using the discriminator, and pick Dog.
   264                                  Then in Dog, we will make an instance of the
   265                                  Animal class but this time we won't travel
   266                                  through its discriminator because we passed in
   267                                  _visited_composed_classes = (Animal,)
   268              physical_address_expiry (int): If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time.  This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire.  This field is *optional*. . [optional]  # noqa: E501
   269              size_bytes (int): [optional]  # noqa: E501
   270              metadata (ObjectUserMetadata): [optional]  # noqa: E501
   271              content_type (str): Object media type. [optional]  # noqa: E501
   272          """
   273  
   274          _check_type = kwargs.pop('_check_type', True)
   275          _spec_property_naming = kwargs.pop('_spec_property_naming', False)
   276          _path_to_item = kwargs.pop('_path_to_item', ())
   277          _configuration = kwargs.pop('_configuration', None)
   278          _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
   279  
   280          if args:
   281              raise ApiTypeError(
   282                  "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
   283                      args,
   284                      self.__class__.__name__,
   285                  ),
   286                  path_to_item=_path_to_item,
   287                  valid_classes=(self.__class__,),
   288              )
   289  
   290          self._data_store = {}
   291          self._check_type = _check_type
   292          self._spec_property_naming = _spec_property_naming
   293          self._path_to_item = _path_to_item
   294          self._configuration = _configuration
   295          self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
   296  
   297          self.path = path
   298          self.path_type = path_type
   299          self.physical_address = physical_address
   300          self.checksum = checksum
   301          self.mtime = mtime
   302          for var_name, var_value in kwargs.items():
   303              if var_name not in self.attribute_map and \
   304                          self._configuration is not None and \
   305                          self._configuration.discard_unknown_keys and \
   306                          self.additional_properties_type is None:
   307                  # discard variable.
   308                  continue
   309              setattr(self, var_name, var_value)
   310              if var_name in self.read_only_vars:
   311                  raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
   312                                       f"class with read only attributes.")