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