pinecone.core.client.model.create_request

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 CreateRequest(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
 61    @cached_property
 62    def additional_properties_type():
 63        """
 64        This must be a method because a model may have properties that are
 65        of type self, this must run after the class is loaded
 66        """
 67        return (
 68            bool,
 69            date,
 70            datetime,
 71            dict,
 72            float,
 73            int,
 74            list,
 75            str,
 76            none_type,
 77        )  # 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        return {
 92            "name": (str,),  # noqa: E501
 93            "dimension": (int,),  # noqa: E501
 94            "index_type": (str,),  # noqa: E501
 95            "metric": (str,),  # noqa: E501
 96            "pods": (int,),  # noqa: E501
 97            "replicas": (int,),  # noqa: E501
 98            "shards": (int,),  # noqa: E501
 99            "pod_type": (str,),  # noqa: E501
100            "index_config": (dict,),  # noqa: E501
101            "metadata_config": (
102                {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
103                none_type,
104            ),  # noqa: E501
105            "source_collection": (str,),  # noqa: E501
106        }
107
108    @cached_property
109    def discriminator():
110        return None
111
112    attribute_map = {
113        "name": "name",  # noqa: E501
114        "dimension": "dimension",  # noqa: E501
115        "index_type": "index_type",  # noqa: E501
116        "metric": "metric",  # noqa: E501
117        "pods": "pods",  # noqa: E501
118        "replicas": "replicas",  # noqa: E501
119        "shards": "shards",  # noqa: E501
120        "pod_type": "pod_type",  # noqa: E501
121        "index_config": "index_config",  # noqa: E501
122        "metadata_config": "metadata_config",  # noqa: E501
123        "source_collection": "source_collection",  # noqa: E501
124    }
125
126    read_only_vars = {}
127
128    _composed_schemas = {}
129
130    @classmethod
131    @convert_js_args_to_python_args
132    def _from_openapi_data(cls, name, dimension, *args, **kwargs):  # noqa: E501
133        """CreateRequest - a model defined in OpenAPI
134
135        Args:
136            name (str): The name of the index to be created. The maximum length is 45 characters.
137            dimension (int): The dimensions of the vectors to be inserted in the index
138
139        Keyword Args:
140            _check_type (bool): if True, values for parameters in openapi_types
141                                will be type checked and a TypeError will be
142                                raised if the wrong type is input.
143                                Defaults to True
144            _path_to_item (tuple/list): This is a list of keys or values to
145                                drill down to the model in received_data
146                                when deserializing a response
147            _spec_property_naming (bool): True if the variable names in the input data
148                                are serialized names, as specified in the OpenAPI document.
149                                False if the variable names in the input data
150                                are pythonic names, e.g. snake case (default)
151            _configuration (Configuration): the instance to use when
152                                deserializing a file_type parameter.
153                                If passed, type conversion is attempted
154                                If omitted no type conversion is done.
155            _visited_composed_classes (tuple): This stores a tuple of
156                                classes that we have traveled through so that
157                                if we see that class again we will not use its
158                                discriminator again.
159                                When traveling through a discriminator, the
160                                composed schema that is
161                                is traveled through is added to this set.
162                                For example if Animal has a discriminator
163                                petType and we pass in "Dog", and the class Dog
164                                allOf includes Animal, we move through Animal
165                                once using the discriminator, and pick Dog.
166                                Then in Dog, we will make an instance of the
167                                Animal class but this time we won't travel
168                                through its discriminator because we passed in
169                                _visited_composed_classes = (Animal,)
170            index_type (str): The type of vector index. Pinecone supports 'approximated'.. [optional] if omitted the server will use the default value of "approximated"  # noqa: E501
171            metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine"  # noqa: E501
172            pods (int): The number of pods for the index to use,including replicas.. [optional] if omitted the server will use the default value of 1  # noqa: E501
173            replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput.. [optional] if omitted the server will use the default value of 1  # noqa: E501
174            shards (int): The number of shards to be used in the index.. [optional] if omitted the server will use the default value of 1  # noqa: E501
175            pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] if omitted the server will use the default value of "p1.x1"  # noqa: E501
176            index_config (dict): [optional]  # noqa: E501
177            metadata_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `metadata_config` is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form:    ```   {\"indexed\": [\"example_metadata_field\"]}   ``` . [optional]  # noqa: E501
178            source_collection (str): The name of the collection to create an index from. [optional]  # noqa: E501
179        """
180
181        _check_type = kwargs.pop("_check_type", True)
182        _spec_property_naming = kwargs.pop("_spec_property_naming", False)
183        _path_to_item = kwargs.pop("_path_to_item", ())
184        _configuration = kwargs.pop("_configuration", None)
185        _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
186
187        self = super(OpenApiModel, cls).__new__(cls)
188
189        if args:
190            raise ApiTypeError(
191                "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
192                % (
193                    args,
194                    self.__class__.__name__,
195                ),
196                path_to_item=_path_to_item,
197                valid_classes=(self.__class__,),
198            )
199
200        self._data_store = {}
201        self._check_type = _check_type
202        self._spec_property_naming = _spec_property_naming
203        self._path_to_item = _path_to_item
204        self._configuration = _configuration
205        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
206
207        self.name = name
208        self.dimension = dimension
209        for var_name, var_value in kwargs.items():
210            if (
211                var_name not in self.attribute_map
212                and self._configuration is not None
213                and self._configuration.discard_unknown_keys
214                and self.additional_properties_type is None
215            ):
216                # discard variable.
217                continue
218            setattr(self, var_name, var_value)
219        return self
220
221    required_properties = set(
222        [
223            "_data_store",
224            "_check_type",
225            "_spec_property_naming",
226            "_path_to_item",
227            "_configuration",
228            "_visited_composed_classes",
229        ]
230    )
231
232    @convert_js_args_to_python_args
233    def __init__(self, name, dimension, *args, **kwargs):  # noqa: E501
234        """CreateRequest - a model defined in OpenAPI
235
236        Args:
237            name (str): The name of the index to be created. The maximum length is 45 characters.
238            dimension (int): The dimensions of the vectors to be inserted in the index
239
240        Keyword Args:
241            _check_type (bool): if True, values for parameters in openapi_types
242                                will be type checked and a TypeError will be
243                                raised if the wrong type is input.
244                                Defaults to True
245            _path_to_item (tuple/list): This is a list of keys or values to
246                                drill down to the model in received_data
247                                when deserializing a response
248            _spec_property_naming (bool): True if the variable names in the input data
249                                are serialized names, as specified in the OpenAPI document.
250                                False if the variable names in the input data
251                                are pythonic names, e.g. snake case (default)
252            _configuration (Configuration): the instance to use when
253                                deserializing a file_type parameter.
254                                If passed, type conversion is attempted
255                                If omitted no type conversion is done.
256            _visited_composed_classes (tuple): This stores a tuple of
257                                classes that we have traveled through so that
258                                if we see that class again we will not use its
259                                discriminator again.
260                                When traveling through a discriminator, the
261                                composed schema that is
262                                is traveled through is added to this set.
263                                For example if Animal has a discriminator
264                                petType and we pass in "Dog", and the class Dog
265                                allOf includes Animal, we move through Animal
266                                once using the discriminator, and pick Dog.
267                                Then in Dog, we will make an instance of the
268                                Animal class but this time we won't travel
269                                through its discriminator because we passed in
270                                _visited_composed_classes = (Animal,)
271            index_type (str): The type of vector index. Pinecone supports 'approximated'.. [optional] if omitted the server will use the default value of "approximated"  # noqa: E501
272            metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine"  # noqa: E501
273            pods (int): The number of pods for the index to use,including replicas.. [optional] if omitted the server will use the default value of 1  # noqa: E501
274            replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput.. [optional] if omitted the server will use the default value of 1  # noqa: E501
275            shards (int): The number of shards to be used in the index.. [optional] if omitted the server will use the default value of 1  # noqa: E501
276            pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] if omitted the server will use the default value of "p1.x1"  # noqa: E501
277            index_config (dict): [optional]  # noqa: E501
278            metadata_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `metadata_config` is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form:    ```   {\"indexed\": [\"example_metadata_field\"]}   ``` . [optional]  # noqa: E501
279            source_collection (str): The name of the collection to create an index from. [optional]  # noqa: E501
280        """
281
282        _check_type = kwargs.pop("_check_type", True)
283        _spec_property_naming = kwargs.pop("_spec_property_naming", False)
284        _path_to_item = kwargs.pop("_path_to_item", ())
285        _configuration = kwargs.pop("_configuration", None)
286        _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
287
288        if args:
289            raise ApiTypeError(
290                "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
291                % (
292                    args,
293                    self.__class__.__name__,
294                ),
295                path_to_item=_path_to_item,
296                valid_classes=(self.__class__,),
297            )
298
299        self._data_store = {}
300        self._check_type = _check_type
301        self._spec_property_naming = _spec_property_naming
302        self._path_to_item = _path_to_item
303        self._configuration = _configuration
304        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
305
306        self.name = name
307        self.dimension = dimension
308        for var_name, var_value in kwargs.items():
309            if (
310                var_name not in self.attribute_map
311                and self._configuration is not None
312                and self._configuration.discard_unknown_keys
313                and self.additional_properties_type is None
314            ):
315                # discard variable.
316                continue
317            setattr(self, var_name, var_value)
318            if var_name in self.read_only_vars:
319                raise ApiAttributeError(
320                    f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
321                    f"class with read only attributes."
322                )
class CreateRequest(pinecone.core.client.model_utils.ModelNormal):
 34class CreateRequest(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
 62    @cached_property
 63    def additional_properties_type():
 64        """
 65        This must be a method because a model may have properties that are
 66        of type self, this must run after the class is loaded
 67        """
 68        return (
 69            bool,
 70            date,
 71            datetime,
 72            dict,
 73            float,
 74            int,
 75            list,
 76            str,
 77            none_type,
 78        )  # noqa: E501
 79
 80    _nullable = False
 81
 82    @cached_property
 83    def openapi_types():
 84        """
 85        This must be a method because a model may have properties that are
 86        of type self, this must run after the class is loaded
 87
 88        Returns
 89            openapi_types (dict): The key is attribute name
 90                and the value is attribute type.
 91        """
 92        return {
 93            "name": (str,),  # noqa: E501
 94            "dimension": (int,),  # noqa: E501
 95            "index_type": (str,),  # noqa: E501
 96            "metric": (str,),  # noqa: E501
 97            "pods": (int,),  # noqa: E501
 98            "replicas": (int,),  # noqa: E501
 99            "shards": (int,),  # noqa: E501
100            "pod_type": (str,),  # noqa: E501
101            "index_config": (dict,),  # noqa: E501
102            "metadata_config": (
103                {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
104                none_type,
105            ),  # noqa: E501
106            "source_collection": (str,),  # noqa: E501
107        }
108
109    @cached_property
110    def discriminator():
111        return None
112
113    attribute_map = {
114        "name": "name",  # noqa: E501
115        "dimension": "dimension",  # noqa: E501
116        "index_type": "index_type",  # noqa: E501
117        "metric": "metric",  # noqa: E501
118        "pods": "pods",  # noqa: E501
119        "replicas": "replicas",  # noqa: E501
120        "shards": "shards",  # noqa: E501
121        "pod_type": "pod_type",  # noqa: E501
122        "index_config": "index_config",  # noqa: E501
123        "metadata_config": "metadata_config",  # noqa: E501
124        "source_collection": "source_collection",  # noqa: E501
125    }
126
127    read_only_vars = {}
128
129    _composed_schemas = {}
130
131    @classmethod
132    @convert_js_args_to_python_args
133    def _from_openapi_data(cls, name, dimension, *args, **kwargs):  # noqa: E501
134        """CreateRequest - a model defined in OpenAPI
135
136        Args:
137            name (str): The name of the index to be created. The maximum length is 45 characters.
138            dimension (int): The dimensions of the vectors to be inserted in the index
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            index_type (str): The type of vector index. Pinecone supports 'approximated'.. [optional] if omitted the server will use the default value of "approximated"  # noqa: E501
172            metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine"  # noqa: E501
173            pods (int): The number of pods for the index to use,including replicas.. [optional] if omitted the server will use the default value of 1  # noqa: E501
174            replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput.. [optional] if omitted the server will use the default value of 1  # noqa: E501
175            shards (int): The number of shards to be used in the index.. [optional] if omitted the server will use the default value of 1  # noqa: E501
176            pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] if omitted the server will use the default value of "p1.x1"  # noqa: E501
177            index_config (dict): [optional]  # noqa: E501
178            metadata_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `metadata_config` is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form:    ```   {\"indexed\": [\"example_metadata_field\"]}   ``` . [optional]  # noqa: E501
179            source_collection (str): The name of the collection to create an index from. [optional]  # noqa: E501
180        """
181
182        _check_type = kwargs.pop("_check_type", True)
183        _spec_property_naming = kwargs.pop("_spec_property_naming", False)
184        _path_to_item = kwargs.pop("_path_to_item", ())
185        _configuration = kwargs.pop("_configuration", None)
186        _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
187
188        self = super(OpenApiModel, cls).__new__(cls)
189
190        if args:
191            raise ApiTypeError(
192                "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
193                % (
194                    args,
195                    self.__class__.__name__,
196                ),
197                path_to_item=_path_to_item,
198                valid_classes=(self.__class__,),
199            )
200
201        self._data_store = {}
202        self._check_type = _check_type
203        self._spec_property_naming = _spec_property_naming
204        self._path_to_item = _path_to_item
205        self._configuration = _configuration
206        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
207
208        self.name = name
209        self.dimension = dimension
210        for var_name, var_value in kwargs.items():
211            if (
212                var_name not in self.attribute_map
213                and self._configuration is not None
214                and self._configuration.discard_unknown_keys
215                and self.additional_properties_type is None
216            ):
217                # discard variable.
218                continue
219            setattr(self, var_name, var_value)
220        return self
221
222    required_properties = set(
223        [
224            "_data_store",
225            "_check_type",
226            "_spec_property_naming",
227            "_path_to_item",
228            "_configuration",
229            "_visited_composed_classes",
230        ]
231    )
232
233    @convert_js_args_to_python_args
234    def __init__(self, name, dimension, *args, **kwargs):  # noqa: E501
235        """CreateRequest - a model defined in OpenAPI
236
237        Args:
238            name (str): The name of the index to be created. The maximum length is 45 characters.
239            dimension (int): The dimensions of the vectors to be inserted in the index
240
241        Keyword Args:
242            _check_type (bool): if True, values for parameters in openapi_types
243                                will be type checked and a TypeError will be
244                                raised if the wrong type is input.
245                                Defaults to True
246            _path_to_item (tuple/list): This is a list of keys or values to
247                                drill down to the model in received_data
248                                when deserializing a response
249            _spec_property_naming (bool): True if the variable names in the input data
250                                are serialized names, as specified in the OpenAPI document.
251                                False if the variable names in the input data
252                                are pythonic names, e.g. snake case (default)
253            _configuration (Configuration): the instance to use when
254                                deserializing a file_type parameter.
255                                If passed, type conversion is attempted
256                                If omitted no type conversion is done.
257            _visited_composed_classes (tuple): This stores a tuple of
258                                classes that we have traveled through so that
259                                if we see that class again we will not use its
260                                discriminator again.
261                                When traveling through a discriminator, the
262                                composed schema that is
263                                is traveled through is added to this set.
264                                For example if Animal has a discriminator
265                                petType and we pass in "Dog", and the class Dog
266                                allOf includes Animal, we move through Animal
267                                once using the discriminator, and pick Dog.
268                                Then in Dog, we will make an instance of the
269                                Animal class but this time we won't travel
270                                through its discriminator because we passed in
271                                _visited_composed_classes = (Animal,)
272            index_type (str): The type of vector index. Pinecone supports 'approximated'.. [optional] if omitted the server will use the default value of "approximated"  # noqa: E501
273            metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine"  # noqa: E501
274            pods (int): The number of pods for the index to use,including replicas.. [optional] if omitted the server will use the default value of 1  # noqa: E501
275            replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput.. [optional] if omitted the server will use the default value of 1  # noqa: E501
276            shards (int): The number of shards to be used in the index.. [optional] if omitted the server will use the default value of 1  # noqa: E501
277            pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] if omitted the server will use the default value of "p1.x1"  # noqa: E501
278            index_config (dict): [optional]  # noqa: E501
279            metadata_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `metadata_config` is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form:    ```   {\"indexed\": [\"example_metadata_field\"]}   ``` . [optional]  # noqa: E501
280            source_collection (str): The name of the collection to create an index from. [optional]  # noqa: E501
281        """
282
283        _check_type = kwargs.pop("_check_type", True)
284        _spec_property_naming = kwargs.pop("_spec_property_naming", False)
285        _path_to_item = kwargs.pop("_path_to_item", ())
286        _configuration = kwargs.pop("_configuration", None)
287        _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
288
289        if args:
290            raise ApiTypeError(
291                "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
292                % (
293                    args,
294                    self.__class__.__name__,
295                ),
296                path_to_item=_path_to_item,
297                valid_classes=(self.__class__,),
298            )
299
300        self._data_store = {}
301        self._check_type = _check_type
302        self._spec_property_naming = _spec_property_naming
303        self._path_to_item = _path_to_item
304        self._configuration = _configuration
305        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
306
307        self.name = name
308        self.dimension = dimension
309        for var_name, var_value in kwargs.items():
310            if (
311                var_name not in self.attribute_map
312                and self._configuration is not None
313                and self._configuration.discard_unknown_keys
314                and self.additional_properties_type is None
315            ):
316                # discard variable.
317                continue
318            setattr(self, var_name, var_value)
319            if var_name in self.read_only_vars:
320                raise ApiAttributeError(
321                    f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
322                    f"class with read only attributes."
323                )

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
CreateRequest(name, dimension, *args, **kwargs)
233    @convert_js_args_to_python_args
234    def __init__(self, name, dimension, *args, **kwargs):  # noqa: E501
235        """CreateRequest - a model defined in OpenAPI
236
237        Args:
238            name (str): The name of the index to be created. The maximum length is 45 characters.
239            dimension (int): The dimensions of the vectors to be inserted in the index
240
241        Keyword Args:
242            _check_type (bool): if True, values for parameters in openapi_types
243                                will be type checked and a TypeError will be
244                                raised if the wrong type is input.
245                                Defaults to True
246            _path_to_item (tuple/list): This is a list of keys or values to
247                                drill down to the model in received_data
248                                when deserializing a response
249            _spec_property_naming (bool): True if the variable names in the input data
250                                are serialized names, as specified in the OpenAPI document.
251                                False if the variable names in the input data
252                                are pythonic names, e.g. snake case (default)
253            _configuration (Configuration): the instance to use when
254                                deserializing a file_type parameter.
255                                If passed, type conversion is attempted
256                                If omitted no type conversion is done.
257            _visited_composed_classes (tuple): This stores a tuple of
258                                classes that we have traveled through so that
259                                if we see that class again we will not use its
260                                discriminator again.
261                                When traveling through a discriminator, the
262                                composed schema that is
263                                is traveled through is added to this set.
264                                For example if Animal has a discriminator
265                                petType and we pass in "Dog", and the class Dog
266                                allOf includes Animal, we move through Animal
267                                once using the discriminator, and pick Dog.
268                                Then in Dog, we will make an instance of the
269                                Animal class but this time we won't travel
270                                through its discriminator because we passed in
271                                _visited_composed_classes = (Animal,)
272            index_type (str): The type of vector index. Pinecone supports 'approximated'.. [optional] if omitted the server will use the default value of "approximated"  # noqa: E501
273            metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine"  # noqa: E501
274            pods (int): The number of pods for the index to use,including replicas.. [optional] if omitted the server will use the default value of 1  # noqa: E501
275            replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput.. [optional] if omitted the server will use the default value of 1  # noqa: E501
276            shards (int): The number of shards to be used in the index.. [optional] if omitted the server will use the default value of 1  # noqa: E501
277            pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] if omitted the server will use the default value of "p1.x1"  # noqa: E501
278            index_config (dict): [optional]  # noqa: E501
279            metadata_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `metadata_config` is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form:    ```   {\"indexed\": [\"example_metadata_field\"]}   ``` . [optional]  # noqa: E501
280            source_collection (str): The name of the collection to create an index from. [optional]  # noqa: E501
281        """
282
283        _check_type = kwargs.pop("_check_type", True)
284        _spec_property_naming = kwargs.pop("_spec_property_naming", False)
285        _path_to_item = kwargs.pop("_path_to_item", ())
286        _configuration = kwargs.pop("_configuration", None)
287        _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
288
289        if args:
290            raise ApiTypeError(
291                "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
292                % (
293                    args,
294                    self.__class__.__name__,
295                ),
296                path_to_item=_path_to_item,
297                valid_classes=(self.__class__,),
298            )
299
300        self._data_store = {}
301        self._check_type = _check_type
302        self._spec_property_naming = _spec_property_naming
303        self._path_to_item = _path_to_item
304        self._configuration = _configuration
305        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
306
307        self.name = name
308        self.dimension = dimension
309        for var_name, var_value in kwargs.items():
310            if (
311                var_name not in self.attribute_map
312                and self._configuration is not None
313                and self._configuration.discard_unknown_keys
314                and self.additional_properties_type is None
315            ):
316                # discard variable.
317                continue
318            setattr(self, var_name, var_value)
319            if var_name in self.read_only_vars:
320                raise ApiAttributeError(
321                    f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
322                    f"class with read only attributes."
323                )

CreateRequest - a model defined in OpenAPI

Arguments:
  • name (str): The name of the index to be created. The maximum length is 45 characters.
  • dimension (int): The dimensions of the vectors to be inserted in the index
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,) index_type (str): The type of vector index. Pinecone supports 'approximated'.. [optional] if omitted the server will use the default value of "approximated" # noqa: E501 metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine" # noqa: E501 pods (int): The number of pods for the index to use,including replicas.. [optional] if omitted the server will use the default value of 1 # noqa: E501 replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput.. [optional] if omitted the server will use the default value of 1 # noqa: E501 shards (int): The number of shards to be used in the index.. [optional] if omitted the server will use the default value of 1 # noqa: E501 pod_type (str): The type of pod to use. One of s1, p1, or p2 appended with . and one of x1, x2, x4, or x8.. [optional] if omitted the server will use the default value of "p1.x1" # noqa: E501 index_config (dict): [optional] # noqa: E501 metadata_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when metadata_config is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form: {"indexed": ["example_metadata_field"]} . [optional] # noqa: E501 source_collection (str): The name of the collection to create an index from. [optional] # noqa: E501

allowed_values = {}
validations = {}
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 = {'name': 'name', 'dimension': 'dimension', 'index_type': 'index_type', 'metric': 'metric', 'pods': 'pods', 'replicas': 'replicas', 'shards': 'shards', 'pod_type': 'pod_type', 'index_config': 'index_config', 'metadata_config': 'metadata_config', 'source_collection': 'source_collection'}
read_only_vars = {}
required_properties = {'_spec_property_naming', '_data_store', '_check_type', '_visited_composed_classes', '_configuration', '_path_to_item'}
name
dimension