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