pinecone.core.client.model.sparse_values

Pinecone API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501

The version of the OpenAPI document: version not set Contact: support@pinecone.io Generated by: https://openapi-generator.tech

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

NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech

Do not edit the class manually.

Attributes:
  • allowed_values (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict with a capitalized key describing the allowed value and an allowed value. These dicts store the allowed enum values.
  • attribute_map (dict): The key is attribute name and the value is json key in definition.
  • discriminator_value_class_map (dict): A dict to go from the discriminator variable value to the discriminator class name.
  • validations (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict that stores validations for max_length, min_length, max_items, min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, inclusive_minimum, and regex.
  • additional_properties_type (tuple): A tuple of classes accepted as additional properties values.
@convert_js_args_to_python_args
SparseValues(indices, values, *args, **kwargs)
206    @convert_js_args_to_python_args
207    def __init__(self, indices, values, *args, **kwargs):  # noqa: E501
208        """SparseValues - a model defined in OpenAPI
209
210        Args:
211            indices ([int]):
212            values ([float]):
213
214        Keyword Args:
215            _check_type (bool): if True, values for parameters in openapi_types
216                                will be type checked and a TypeError will be
217                                raised if the wrong type is input.
218                                Defaults to True
219            _path_to_item (tuple/list): This is a list of keys or values to
220                                drill down to the model in received_data
221                                when deserializing a response
222            _spec_property_naming (bool): True if the variable names in the input data
223                                are serialized names, as specified in the OpenAPI document.
224                                False if the variable names in the input data
225                                are pythonic names, e.g. snake case (default)
226            _configuration (Configuration): the instance to use when
227                                deserializing a file_type parameter.
228                                If passed, type conversion is attempted
229                                If omitted no type conversion is done.
230            _visited_composed_classes (tuple): This stores a tuple of
231                                classes that we have traveled through so that
232                                if we see that class again we will not use its
233                                discriminator again.
234                                When traveling through a discriminator, the
235                                composed schema that is
236                                is traveled through is added to this set.
237                                For example if Animal has a discriminator
238                                petType and we pass in "Dog", and the class Dog
239                                allOf includes Animal, we move through Animal
240                                once using the discriminator, and pick Dog.
241                                Then in Dog, we will make an instance of the
242                                Animal class but this time we won't travel
243                                through its discriminator because we passed in
244                                _visited_composed_classes = (Animal,)
245        """
246
247        _check_type = kwargs.pop("_check_type", True)
248        _spec_property_naming = kwargs.pop("_spec_property_naming", False)
249        _path_to_item = kwargs.pop("_path_to_item", ())
250        _configuration = kwargs.pop("_configuration", None)
251        _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
252
253        if args:
254            raise ApiTypeError(
255                "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
256                % (
257                    args,
258                    self.__class__.__name__,
259                ),
260                path_to_item=_path_to_item,
261                valid_classes=(self.__class__,),
262            )
263
264        self._data_store = {}
265        self._check_type = _check_type
266        self._spec_property_naming = _spec_property_naming
267        self._path_to_item = _path_to_item
268        self._configuration = _configuration
269        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
270
271        self.indices = indices
272        self.values = values
273        for var_name, var_value in kwargs.items():
274            if (
275                var_name not in self.attribute_map
276                and self._configuration is not None
277                and self._configuration.discard_unknown_keys
278                and self.additional_properties_type is None
279            ):
280                # discard variable.
281                continue
282            setattr(self, var_name, var_value)
283            if var_name in self.read_only_vars:
284                raise ApiAttributeError(
285                    f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
286                    f"class with read only attributes."
287                )

SparseValues - a model defined in OpenAPI

Arguments:
  • indices ([int]):
  • values ([float]):
Keyword Args:

_check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. Defaults to True _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted If omitted no type conversion is done. _visited_composed_classes (tuple): This stores a tuple of classes that we have traveled through so that if we see that class again we will not use its discriminator again. When traveling through a discriminator, the composed schema that is is traveled through is added to this set. For example if Animal has a discriminator petType and we pass in "Dog", and the class Dog allOf includes Animal, we move through Animal once using the discriminator, and pick Dog. Then in Dog, we will make an instance of the Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,)

allowed_values = {}
validations = {('indices',): {}, ('values',): {}}
def additional_properties_type(unknown):

This must be a method because a model may have properties that are of type self, this must run after the class is loaded

def openapi_types(unknown):

This must be a method because a model may have properties that are of type self, this must run after the class is loaded

Returns openapi_types (dict): The key is attribute name and the value is attribute type.

def discriminator(unknown):
attribute_map = {'indices': 'indices', 'values': 'values'}
read_only_vars = {}
required_properties = {'_spec_property_naming', '_data_store', '_check_type', '_visited_composed_classes', '_configuration', '_path_to_item'}
indices
values