github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python-legacy/lakefs_client/model/external_principal_list.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.external_principal import ExternalPrincipal
    35      from lakefs_client.model.pagination import Pagination
    36      globals()['ExternalPrincipal'] = ExternalPrincipal
    37      globals()['Pagination'] = Pagination
    38  
    39  
    40  class ExternalPrincipalList(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              'pagination': (Pagination,),  # noqa: E501
    94              'results': ([ExternalPrincipal],),  # noqa: E501
    95          }
    96  
    97      @cached_property
    98      def discriminator():
    99          return None
   100  
   101  
   102      attribute_map = {
   103          'pagination': 'pagination',  # noqa: E501
   104          'results': 'results',  # noqa: E501
   105      }
   106  
   107      read_only_vars = {
   108      }
   109  
   110      _composed_schemas = {}
   111  
   112      @classmethod
   113      @convert_js_args_to_python_args
   114      def _from_openapi_data(cls, pagination, results, *args, **kwargs):  # noqa: E501
   115          """ExternalPrincipalList - a model defined in OpenAPI
   116  
   117          Args:
   118              pagination (Pagination):
   119              results ([ExternalPrincipal]):
   120  
   121          Keyword Args:
   122              _check_type (bool): if True, values for parameters in openapi_types
   123                                  will be type checked and a TypeError will be
   124                                  raised if the wrong type is input.
   125                                  Defaults to True
   126              _path_to_item (tuple/list): This is a list of keys or values to
   127                                  drill down to the model in received_data
   128                                  when deserializing a response
   129              _spec_property_naming (bool): True if the variable names in the input data
   130                                  are serialized names, as specified in the OpenAPI document.
   131                                  False if the variable names in the input data
   132                                  are pythonic names, e.g. snake case (default)
   133              _configuration (Configuration): the instance to use when
   134                                  deserializing a file_type parameter.
   135                                  If passed, type conversion is attempted
   136                                  If omitted no type conversion is done.
   137              _visited_composed_classes (tuple): This stores a tuple of
   138                                  classes that we have traveled through so that
   139                                  if we see that class again we will not use its
   140                                  discriminator again.
   141                                  When traveling through a discriminator, the
   142                                  composed schema that is
   143                                  is traveled through is added to this set.
   144                                  For example if Animal has a discriminator
   145                                  petType and we pass in "Dog", and the class Dog
   146                                  allOf includes Animal, we move through Animal
   147                                  once using the discriminator, and pick Dog.
   148                                  Then in Dog, we will make an instance of the
   149                                  Animal class but this time we won't travel
   150                                  through its discriminator because we passed in
   151                                  _visited_composed_classes = (Animal,)
   152          """
   153  
   154          _check_type = kwargs.pop('_check_type', True)
   155          _spec_property_naming = kwargs.pop('_spec_property_naming', False)
   156          _path_to_item = kwargs.pop('_path_to_item', ())
   157          _configuration = kwargs.pop('_configuration', None)
   158          _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
   159  
   160          self = super(OpenApiModel, cls).__new__(cls)
   161  
   162          if args:
   163              raise ApiTypeError(
   164                  "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
   165                      args,
   166                      self.__class__.__name__,
   167                  ),
   168                  path_to_item=_path_to_item,
   169                  valid_classes=(self.__class__,),
   170              )
   171  
   172          self._data_store = {}
   173          self._check_type = _check_type
   174          self._spec_property_naming = _spec_property_naming
   175          self._path_to_item = _path_to_item
   176          self._configuration = _configuration
   177          self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
   178  
   179          self.pagination = pagination
   180          self.results = results
   181          for var_name, var_value in kwargs.items():
   182              if var_name not in self.attribute_map and \
   183                          self._configuration is not None and \
   184                          self._configuration.discard_unknown_keys and \
   185                          self.additional_properties_type is None:
   186                  # discard variable.
   187                  continue
   188              setattr(self, var_name, var_value)
   189          return self
   190  
   191      required_properties = set([
   192          '_data_store',
   193          '_check_type',
   194          '_spec_property_naming',
   195          '_path_to_item',
   196          '_configuration',
   197          '_visited_composed_classes',
   198      ])
   199  
   200      @convert_js_args_to_python_args
   201      def __init__(self, pagination, results, *args, **kwargs):  # noqa: E501
   202          """ExternalPrincipalList - a model defined in OpenAPI
   203  
   204          Args:
   205              pagination (Pagination):
   206              results ([ExternalPrincipal]):
   207  
   208          Keyword Args:
   209              _check_type (bool): if True, values for parameters in openapi_types
   210                                  will be type checked and a TypeError will be
   211                                  raised if the wrong type is input.
   212                                  Defaults to True
   213              _path_to_item (tuple/list): This is a list of keys or values to
   214                                  drill down to the model in received_data
   215                                  when deserializing a response
   216              _spec_property_naming (bool): True if the variable names in the input data
   217                                  are serialized names, as specified in the OpenAPI document.
   218                                  False if the variable names in the input data
   219                                  are pythonic names, e.g. snake case (default)
   220              _configuration (Configuration): the instance to use when
   221                                  deserializing a file_type parameter.
   222                                  If passed, type conversion is attempted
   223                                  If omitted no type conversion is done.
   224              _visited_composed_classes (tuple): This stores a tuple of
   225                                  classes that we have traveled through so that
   226                                  if we see that class again we will not use its
   227                                  discriminator again.
   228                                  When traveling through a discriminator, the
   229                                  composed schema that is
   230                                  is traveled through is added to this set.
   231                                  For example if Animal has a discriminator
   232                                  petType and we pass in "Dog", and the class Dog
   233                                  allOf includes Animal, we move through Animal
   234                                  once using the discriminator, and pick Dog.
   235                                  Then in Dog, we will make an instance of the
   236                                  Animal class but this time we won't travel
   237                                  through its discriminator because we passed in
   238                                  _visited_composed_classes = (Animal,)
   239          """
   240  
   241          _check_type = kwargs.pop('_check_type', True)
   242          _spec_property_naming = kwargs.pop('_spec_property_naming', False)
   243          _path_to_item = kwargs.pop('_path_to_item', ())
   244          _configuration = kwargs.pop('_configuration', None)
   245          _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
   246  
   247          if args:
   248              raise ApiTypeError(
   249                  "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
   250                      args,
   251                      self.__class__.__name__,
   252                  ),
   253                  path_to_item=_path_to_item,
   254                  valid_classes=(self.__class__,),
   255              )
   256  
   257          self._data_store = {}
   258          self._check_type = _check_type
   259          self._spec_property_naming = _spec_property_naming
   260          self._path_to_item = _path_to_item
   261          self._configuration = _configuration
   262          self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
   263  
   264          self.pagination = pagination
   265          self.results = results
   266          for var_name, var_value in kwargs.items():
   267              if var_name not in self.attribute_map and \
   268                          self._configuration is not None and \
   269                          self._configuration.discard_unknown_keys and \
   270                          self.additional_properties_type is None:
   271                  # discard variable.
   272                  continue
   273              setattr(self, var_name, var_value)
   274              if var_name in self.read_only_vars:
   275                  raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
   276                                       f"class with read only attributes.")