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