vectorize_client.models.create_destination_connector_request

Vectorize API

API for Vectorize services (Beta)

The version of the OpenAPI document: 0.1.2 Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.

  1# coding: utf-8
  2
  3"""
  4    Vectorize API
  5
  6    API for Vectorize services (Beta)
  7
  8    The version of the OpenAPI document: 0.1.2
  9    Generated by OpenAPI Generator (https://openapi-generator.tech)
 10
 11    Do not edit the class manually.
 12"""  # noqa: E501
 13
 14
 15from __future__ import annotations
 16import json
 17import pprint
 18from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
 19from typing import Any, List, Optional
 20from vectorize_client.models.azureaisearch import Azureaisearch
 21from vectorize_client.models.capella import Capella
 22from vectorize_client.models.datastax import Datastax
 23from vectorize_client.models.elastic import Elastic
 24from vectorize_client.models.milvus import Milvus
 25from vectorize_client.models.pinecone import Pinecone
 26from vectorize_client.models.postgresql import Postgresql
 27from vectorize_client.models.qdrant import Qdrant
 28from vectorize_client.models.singlestore import Singlestore
 29from vectorize_client.models.supabase import Supabase
 30from vectorize_client.models.turbopuffer import Turbopuffer
 31from vectorize_client.models.weaviate import Weaviate
 32from pydantic import StrictStr, Field
 33from typing import Union, List, Set, Optional, Dict
 34from typing_extensions import Literal, Self
 35
 36CREATEDESTINATIONCONNECTORREQUEST_ONE_OF_SCHEMAS = ["Azureaisearch", "Capella", "Datastax", "Elastic", "Milvus", "Pinecone", "Postgresql", "Qdrant", "Singlestore", "Supabase", "Turbopuffer", "Weaviate"]
 37
 38class CreateDestinationConnectorRequest(BaseModel):
 39    """
 40    CreateDestinationConnectorRequest
 41    """
 42    # data type: Capella
 43    oneof_schema_1_validator: Optional[Capella] = None
 44    # data type: Datastax
 45    oneof_schema_2_validator: Optional[Datastax] = None
 46    # data type: Elastic
 47    oneof_schema_3_validator: Optional[Elastic] = None
 48    # data type: Pinecone
 49    oneof_schema_4_validator: Optional[Pinecone] = None
 50    # data type: Singlestore
 51    oneof_schema_5_validator: Optional[Singlestore] = None
 52    # data type: Milvus
 53    oneof_schema_6_validator: Optional[Milvus] = None
 54    # data type: Postgresql
 55    oneof_schema_7_validator: Optional[Postgresql] = None
 56    # data type: Qdrant
 57    oneof_schema_8_validator: Optional[Qdrant] = None
 58    # data type: Supabase
 59    oneof_schema_9_validator: Optional[Supabase] = None
 60    # data type: Weaviate
 61    oneof_schema_10_validator: Optional[Weaviate] = None
 62    # data type: Azureaisearch
 63    oneof_schema_11_validator: Optional[Azureaisearch] = None
 64    # data type: Turbopuffer
 65    oneof_schema_12_validator: Optional[Turbopuffer] = None
 66    actual_instance: Optional[Union[Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate]] = None
 67    one_of_schemas: Set[str] = { "Azureaisearch", "Capella", "Datastax", "Elastic", "Milvus", "Pinecone", "Postgresql", "Qdrant", "Singlestore", "Supabase", "Turbopuffer", "Weaviate" }
 68
 69    model_config = ConfigDict(
 70        validate_assignment=True,
 71        protected_namespaces=(),
 72    )
 73
 74
 75    discriminator_value_class_map: Dict[str, str] = {
 76    }
 77
 78    def __init__(self, *args, **kwargs) -> None:
 79        if args:
 80            if len(args) > 1:
 81                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
 82            if kwargs:
 83                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
 84            super().__init__(actual_instance=args[0])
 85        else:
 86            super().__init__(**kwargs)
 87
 88    @field_validator('actual_instance')
 89    def actual_instance_must_validate_oneof(cls, v):
 90        instance = CreateDestinationConnectorRequest.model_construct()
 91        error_messages = []
 92        match = 0
 93        # validate data type: Capella
 94        if not isinstance(v, Capella):
 95            error_messages.append(f"Error! Input type `{type(v)}` is not `Capella`")
 96        else:
 97            match += 1
 98        # validate data type: Datastax
 99        if not isinstance(v, Datastax):
100            error_messages.append(f"Error! Input type `{type(v)}` is not `Datastax`")
101        else:
102            match += 1
103        # validate data type: Elastic
104        if not isinstance(v, Elastic):
105            error_messages.append(f"Error! Input type `{type(v)}` is not `Elastic`")
106        else:
107            match += 1
108        # validate data type: Pinecone
109        if not isinstance(v, Pinecone):
110            error_messages.append(f"Error! Input type `{type(v)}` is not `Pinecone`")
111        else:
112            match += 1
113        # validate data type: Singlestore
114        if not isinstance(v, Singlestore):
115            error_messages.append(f"Error! Input type `{type(v)}` is not `Singlestore`")
116        else:
117            match += 1
118        # validate data type: Milvus
119        if not isinstance(v, Milvus):
120            error_messages.append(f"Error! Input type `{type(v)}` is not `Milvus`")
121        else:
122            match += 1
123        # validate data type: Postgresql
124        if not isinstance(v, Postgresql):
125            error_messages.append(f"Error! Input type `{type(v)}` is not `Postgresql`")
126        else:
127            match += 1
128        # validate data type: Qdrant
129        if not isinstance(v, Qdrant):
130            error_messages.append(f"Error! Input type `{type(v)}` is not `Qdrant`")
131        else:
132            match += 1
133        # validate data type: Supabase
134        if not isinstance(v, Supabase):
135            error_messages.append(f"Error! Input type `{type(v)}` is not `Supabase`")
136        else:
137            match += 1
138        # validate data type: Weaviate
139        if not isinstance(v, Weaviate):
140            error_messages.append(f"Error! Input type `{type(v)}` is not `Weaviate`")
141        else:
142            match += 1
143        # validate data type: Azureaisearch
144        if not isinstance(v, Azureaisearch):
145            error_messages.append(f"Error! Input type `{type(v)}` is not `Azureaisearch`")
146        else:
147            match += 1
148        # validate data type: Turbopuffer
149        if not isinstance(v, Turbopuffer):
150            error_messages.append(f"Error! Input type `{type(v)}` is not `Turbopuffer`")
151        else:
152            match += 1
153        if match > 1:
154            # more than 1 match
155            raise ValueError("Multiple matches found when setting `actual_instance` in CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
156        elif match == 0:
157            # no match
158            raise ValueError("No match found when setting `actual_instance` in CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
159        else:
160            return v
161
162    @classmethod
163    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
164        return cls.from_json(json.dumps(obj))
165
166    @classmethod
167    def from_json(cls, json_str: str) -> Self:
168        """Returns the object represented by the json string"""
169        instance = cls.model_construct()
170        error_messages = []
171        match = 0
172
173        # deserialize data into Capella
174        try:
175            instance.actual_instance = Capella.from_json(json_str)
176            match += 1
177        except (ValidationError, ValueError) as e:
178            error_messages.append(str(e))
179        # deserialize data into Datastax
180        try:
181            instance.actual_instance = Datastax.from_json(json_str)
182            match += 1
183        except (ValidationError, ValueError) as e:
184            error_messages.append(str(e))
185        # deserialize data into Elastic
186        try:
187            instance.actual_instance = Elastic.from_json(json_str)
188            match += 1
189        except (ValidationError, ValueError) as e:
190            error_messages.append(str(e))
191        # deserialize data into Pinecone
192        try:
193            instance.actual_instance = Pinecone.from_json(json_str)
194            match += 1
195        except (ValidationError, ValueError) as e:
196            error_messages.append(str(e))
197        # deserialize data into Singlestore
198        try:
199            instance.actual_instance = Singlestore.from_json(json_str)
200            match += 1
201        except (ValidationError, ValueError) as e:
202            error_messages.append(str(e))
203        # deserialize data into Milvus
204        try:
205            instance.actual_instance = Milvus.from_json(json_str)
206            match += 1
207        except (ValidationError, ValueError) as e:
208            error_messages.append(str(e))
209        # deserialize data into Postgresql
210        try:
211            instance.actual_instance = Postgresql.from_json(json_str)
212            match += 1
213        except (ValidationError, ValueError) as e:
214            error_messages.append(str(e))
215        # deserialize data into Qdrant
216        try:
217            instance.actual_instance = Qdrant.from_json(json_str)
218            match += 1
219        except (ValidationError, ValueError) as e:
220            error_messages.append(str(e))
221        # deserialize data into Supabase
222        try:
223            instance.actual_instance = Supabase.from_json(json_str)
224            match += 1
225        except (ValidationError, ValueError) as e:
226            error_messages.append(str(e))
227        # deserialize data into Weaviate
228        try:
229            instance.actual_instance = Weaviate.from_json(json_str)
230            match += 1
231        except (ValidationError, ValueError) as e:
232            error_messages.append(str(e))
233        # deserialize data into Azureaisearch
234        try:
235            instance.actual_instance = Azureaisearch.from_json(json_str)
236            match += 1
237        except (ValidationError, ValueError) as e:
238            error_messages.append(str(e))
239        # deserialize data into Turbopuffer
240        try:
241            instance.actual_instance = Turbopuffer.from_json(json_str)
242            match += 1
243        except (ValidationError, ValueError) as e:
244            error_messages.append(str(e))
245
246        if match > 1:
247            # more than 1 match
248            raise ValueError("Multiple matches found when deserializing the JSON string into CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
249        elif match == 0:
250            # no match
251            raise ValueError("No match found when deserializing the JSON string into CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
252        else:
253            return instance
254
255    def to_json(self) -> str:
256        """Returns the JSON representation of the actual instance"""
257        if self.actual_instance is None:
258            return "null"
259
260        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
261            return self.actual_instance.to_json()
262        else:
263            return json.dumps(self.actual_instance)
264
265    def to_dict(self) -> Optional[Union[Dict[str, Any], Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate]]:
266        """Returns the dict representation of the actual instance"""
267        if self.actual_instance is None:
268            return None
269
270        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
271            return self.actual_instance.to_dict()
272        else:
273            # primitive type
274            return self.actual_instance
275
276    def to_str(self) -> str:
277        """Returns the string representation of the actual instance"""
278        return pprint.pformat(self.model_dump())
CREATEDESTINATIONCONNECTORREQUEST_ONE_OF_SCHEMAS = ['Azureaisearch', 'Capella', 'Datastax', 'Elastic', 'Milvus', 'Pinecone', 'Postgresql', 'Qdrant', 'Singlestore', 'Supabase', 'Turbopuffer', 'Weaviate']
class CreateDestinationConnectorRequest(pydantic.main.BaseModel):
 39class CreateDestinationConnectorRequest(BaseModel):
 40    """
 41    CreateDestinationConnectorRequest
 42    """
 43    # data type: Capella
 44    oneof_schema_1_validator: Optional[Capella] = None
 45    # data type: Datastax
 46    oneof_schema_2_validator: Optional[Datastax] = None
 47    # data type: Elastic
 48    oneof_schema_3_validator: Optional[Elastic] = None
 49    # data type: Pinecone
 50    oneof_schema_4_validator: Optional[Pinecone] = None
 51    # data type: Singlestore
 52    oneof_schema_5_validator: Optional[Singlestore] = None
 53    # data type: Milvus
 54    oneof_schema_6_validator: Optional[Milvus] = None
 55    # data type: Postgresql
 56    oneof_schema_7_validator: Optional[Postgresql] = None
 57    # data type: Qdrant
 58    oneof_schema_8_validator: Optional[Qdrant] = None
 59    # data type: Supabase
 60    oneof_schema_9_validator: Optional[Supabase] = None
 61    # data type: Weaviate
 62    oneof_schema_10_validator: Optional[Weaviate] = None
 63    # data type: Azureaisearch
 64    oneof_schema_11_validator: Optional[Azureaisearch] = None
 65    # data type: Turbopuffer
 66    oneof_schema_12_validator: Optional[Turbopuffer] = None
 67    actual_instance: Optional[Union[Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate]] = None
 68    one_of_schemas: Set[str] = { "Azureaisearch", "Capella", "Datastax", "Elastic", "Milvus", "Pinecone", "Postgresql", "Qdrant", "Singlestore", "Supabase", "Turbopuffer", "Weaviate" }
 69
 70    model_config = ConfigDict(
 71        validate_assignment=True,
 72        protected_namespaces=(),
 73    )
 74
 75
 76    discriminator_value_class_map: Dict[str, str] = {
 77    }
 78
 79    def __init__(self, *args, **kwargs) -> None:
 80        if args:
 81            if len(args) > 1:
 82                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
 83            if kwargs:
 84                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
 85            super().__init__(actual_instance=args[0])
 86        else:
 87            super().__init__(**kwargs)
 88
 89    @field_validator('actual_instance')
 90    def actual_instance_must_validate_oneof(cls, v):
 91        instance = CreateDestinationConnectorRequest.model_construct()
 92        error_messages = []
 93        match = 0
 94        # validate data type: Capella
 95        if not isinstance(v, Capella):
 96            error_messages.append(f"Error! Input type `{type(v)}` is not `Capella`")
 97        else:
 98            match += 1
 99        # validate data type: Datastax
100        if not isinstance(v, Datastax):
101            error_messages.append(f"Error! Input type `{type(v)}` is not `Datastax`")
102        else:
103            match += 1
104        # validate data type: Elastic
105        if not isinstance(v, Elastic):
106            error_messages.append(f"Error! Input type `{type(v)}` is not `Elastic`")
107        else:
108            match += 1
109        # validate data type: Pinecone
110        if not isinstance(v, Pinecone):
111            error_messages.append(f"Error! Input type `{type(v)}` is not `Pinecone`")
112        else:
113            match += 1
114        # validate data type: Singlestore
115        if not isinstance(v, Singlestore):
116            error_messages.append(f"Error! Input type `{type(v)}` is not `Singlestore`")
117        else:
118            match += 1
119        # validate data type: Milvus
120        if not isinstance(v, Milvus):
121            error_messages.append(f"Error! Input type `{type(v)}` is not `Milvus`")
122        else:
123            match += 1
124        # validate data type: Postgresql
125        if not isinstance(v, Postgresql):
126            error_messages.append(f"Error! Input type `{type(v)}` is not `Postgresql`")
127        else:
128            match += 1
129        # validate data type: Qdrant
130        if not isinstance(v, Qdrant):
131            error_messages.append(f"Error! Input type `{type(v)}` is not `Qdrant`")
132        else:
133            match += 1
134        # validate data type: Supabase
135        if not isinstance(v, Supabase):
136            error_messages.append(f"Error! Input type `{type(v)}` is not `Supabase`")
137        else:
138            match += 1
139        # validate data type: Weaviate
140        if not isinstance(v, Weaviate):
141            error_messages.append(f"Error! Input type `{type(v)}` is not `Weaviate`")
142        else:
143            match += 1
144        # validate data type: Azureaisearch
145        if not isinstance(v, Azureaisearch):
146            error_messages.append(f"Error! Input type `{type(v)}` is not `Azureaisearch`")
147        else:
148            match += 1
149        # validate data type: Turbopuffer
150        if not isinstance(v, Turbopuffer):
151            error_messages.append(f"Error! Input type `{type(v)}` is not `Turbopuffer`")
152        else:
153            match += 1
154        if match > 1:
155            # more than 1 match
156            raise ValueError("Multiple matches found when setting `actual_instance` in CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
157        elif match == 0:
158            # no match
159            raise ValueError("No match found when setting `actual_instance` in CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
160        else:
161            return v
162
163    @classmethod
164    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
165        return cls.from_json(json.dumps(obj))
166
167    @classmethod
168    def from_json(cls, json_str: str) -> Self:
169        """Returns the object represented by the json string"""
170        instance = cls.model_construct()
171        error_messages = []
172        match = 0
173
174        # deserialize data into Capella
175        try:
176            instance.actual_instance = Capella.from_json(json_str)
177            match += 1
178        except (ValidationError, ValueError) as e:
179            error_messages.append(str(e))
180        # deserialize data into Datastax
181        try:
182            instance.actual_instance = Datastax.from_json(json_str)
183            match += 1
184        except (ValidationError, ValueError) as e:
185            error_messages.append(str(e))
186        # deserialize data into Elastic
187        try:
188            instance.actual_instance = Elastic.from_json(json_str)
189            match += 1
190        except (ValidationError, ValueError) as e:
191            error_messages.append(str(e))
192        # deserialize data into Pinecone
193        try:
194            instance.actual_instance = Pinecone.from_json(json_str)
195            match += 1
196        except (ValidationError, ValueError) as e:
197            error_messages.append(str(e))
198        # deserialize data into Singlestore
199        try:
200            instance.actual_instance = Singlestore.from_json(json_str)
201            match += 1
202        except (ValidationError, ValueError) as e:
203            error_messages.append(str(e))
204        # deserialize data into Milvus
205        try:
206            instance.actual_instance = Milvus.from_json(json_str)
207            match += 1
208        except (ValidationError, ValueError) as e:
209            error_messages.append(str(e))
210        # deserialize data into Postgresql
211        try:
212            instance.actual_instance = Postgresql.from_json(json_str)
213            match += 1
214        except (ValidationError, ValueError) as e:
215            error_messages.append(str(e))
216        # deserialize data into Qdrant
217        try:
218            instance.actual_instance = Qdrant.from_json(json_str)
219            match += 1
220        except (ValidationError, ValueError) as e:
221            error_messages.append(str(e))
222        # deserialize data into Supabase
223        try:
224            instance.actual_instance = Supabase.from_json(json_str)
225            match += 1
226        except (ValidationError, ValueError) as e:
227            error_messages.append(str(e))
228        # deserialize data into Weaviate
229        try:
230            instance.actual_instance = Weaviate.from_json(json_str)
231            match += 1
232        except (ValidationError, ValueError) as e:
233            error_messages.append(str(e))
234        # deserialize data into Azureaisearch
235        try:
236            instance.actual_instance = Azureaisearch.from_json(json_str)
237            match += 1
238        except (ValidationError, ValueError) as e:
239            error_messages.append(str(e))
240        # deserialize data into Turbopuffer
241        try:
242            instance.actual_instance = Turbopuffer.from_json(json_str)
243            match += 1
244        except (ValidationError, ValueError) as e:
245            error_messages.append(str(e))
246
247        if match > 1:
248            # more than 1 match
249            raise ValueError("Multiple matches found when deserializing the JSON string into CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
250        elif match == 0:
251            # no match
252            raise ValueError("No match found when deserializing the JSON string into CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
253        else:
254            return instance
255
256    def to_json(self) -> str:
257        """Returns the JSON representation of the actual instance"""
258        if self.actual_instance is None:
259            return "null"
260
261        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
262            return self.actual_instance.to_json()
263        else:
264            return json.dumps(self.actual_instance)
265
266    def to_dict(self) -> Optional[Union[Dict[str, Any], Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate]]:
267        """Returns the dict representation of the actual instance"""
268        if self.actual_instance is None:
269            return None
270
271        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
272            return self.actual_instance.to_dict()
273        else:
274            # primitive type
275            return self.actual_instance
276
277    def to_str(self) -> str:
278        """Returns the string representation of the actual instance"""
279        return pprint.pformat(self.model_dump())

CreateDestinationConnectorRequest

CreateDestinationConnectorRequest(*args, **kwargs)
79    def __init__(self, *args, **kwargs) -> None:
80        if args:
81            if len(args) > 1:
82                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
83            if kwargs:
84                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
85            super().__init__(actual_instance=args[0])
86        else:
87            super().__init__(**kwargs)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

oneof_schema_1_validator: Optional[vectorize_client.models.capella.Capella]
oneof_schema_2_validator: Optional[vectorize_client.models.datastax.Datastax]
oneof_schema_3_validator: Optional[vectorize_client.models.elastic.Elastic]
oneof_schema_4_validator: Optional[vectorize_client.models.pinecone.Pinecone]
oneof_schema_5_validator: Optional[vectorize_client.models.singlestore.Singlestore]
oneof_schema_6_validator: Optional[vectorize_client.models.milvus.Milvus]
oneof_schema_7_validator: Optional[vectorize_client.models.postgresql.Postgresql]
oneof_schema_8_validator: Optional[vectorize_client.models.qdrant.Qdrant]
oneof_schema_9_validator: Optional[vectorize_client.models.supabase.Supabase]
oneof_schema_10_validator: Optional[vectorize_client.models.weaviate.Weaviate]
oneof_schema_11_validator: Optional[vectorize_client.models.azureaisearch.Azureaisearch]
oneof_schema_12_validator: Optional[vectorize_client.models.turbopuffer.Turbopuffer]
one_of_schemas: Set[str]
model_config = {'validate_assignment': True, 'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

discriminator_value_class_map: Dict[str, str]
@field_validator('actual_instance')
def actual_instance_must_validate_oneof(cls, v):
 89    @field_validator('actual_instance')
 90    def actual_instance_must_validate_oneof(cls, v):
 91        instance = CreateDestinationConnectorRequest.model_construct()
 92        error_messages = []
 93        match = 0
 94        # validate data type: Capella
 95        if not isinstance(v, Capella):
 96            error_messages.append(f"Error! Input type `{type(v)}` is not `Capella`")
 97        else:
 98            match += 1
 99        # validate data type: Datastax
100        if not isinstance(v, Datastax):
101            error_messages.append(f"Error! Input type `{type(v)}` is not `Datastax`")
102        else:
103            match += 1
104        # validate data type: Elastic
105        if not isinstance(v, Elastic):
106            error_messages.append(f"Error! Input type `{type(v)}` is not `Elastic`")
107        else:
108            match += 1
109        # validate data type: Pinecone
110        if not isinstance(v, Pinecone):
111            error_messages.append(f"Error! Input type `{type(v)}` is not `Pinecone`")
112        else:
113            match += 1
114        # validate data type: Singlestore
115        if not isinstance(v, Singlestore):
116            error_messages.append(f"Error! Input type `{type(v)}` is not `Singlestore`")
117        else:
118            match += 1
119        # validate data type: Milvus
120        if not isinstance(v, Milvus):
121            error_messages.append(f"Error! Input type `{type(v)}` is not `Milvus`")
122        else:
123            match += 1
124        # validate data type: Postgresql
125        if not isinstance(v, Postgresql):
126            error_messages.append(f"Error! Input type `{type(v)}` is not `Postgresql`")
127        else:
128            match += 1
129        # validate data type: Qdrant
130        if not isinstance(v, Qdrant):
131            error_messages.append(f"Error! Input type `{type(v)}` is not `Qdrant`")
132        else:
133            match += 1
134        # validate data type: Supabase
135        if not isinstance(v, Supabase):
136            error_messages.append(f"Error! Input type `{type(v)}` is not `Supabase`")
137        else:
138            match += 1
139        # validate data type: Weaviate
140        if not isinstance(v, Weaviate):
141            error_messages.append(f"Error! Input type `{type(v)}` is not `Weaviate`")
142        else:
143            match += 1
144        # validate data type: Azureaisearch
145        if not isinstance(v, Azureaisearch):
146            error_messages.append(f"Error! Input type `{type(v)}` is not `Azureaisearch`")
147        else:
148            match += 1
149        # validate data type: Turbopuffer
150        if not isinstance(v, Turbopuffer):
151            error_messages.append(f"Error! Input type `{type(v)}` is not `Turbopuffer`")
152        else:
153            match += 1
154        if match > 1:
155            # more than 1 match
156            raise ValueError("Multiple matches found when setting `actual_instance` in CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
157        elif match == 0:
158            # no match
159            raise ValueError("No match found when setting `actual_instance` in CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
160        else:
161            return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
163    @classmethod
164    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
165        return cls.from_json(json.dumps(obj))
@classmethod
def from_json(cls, json_str: str) -> Self:
167    @classmethod
168    def from_json(cls, json_str: str) -> Self:
169        """Returns the object represented by the json string"""
170        instance = cls.model_construct()
171        error_messages = []
172        match = 0
173
174        # deserialize data into Capella
175        try:
176            instance.actual_instance = Capella.from_json(json_str)
177            match += 1
178        except (ValidationError, ValueError) as e:
179            error_messages.append(str(e))
180        # deserialize data into Datastax
181        try:
182            instance.actual_instance = Datastax.from_json(json_str)
183            match += 1
184        except (ValidationError, ValueError) as e:
185            error_messages.append(str(e))
186        # deserialize data into Elastic
187        try:
188            instance.actual_instance = Elastic.from_json(json_str)
189            match += 1
190        except (ValidationError, ValueError) as e:
191            error_messages.append(str(e))
192        # deserialize data into Pinecone
193        try:
194            instance.actual_instance = Pinecone.from_json(json_str)
195            match += 1
196        except (ValidationError, ValueError) as e:
197            error_messages.append(str(e))
198        # deserialize data into Singlestore
199        try:
200            instance.actual_instance = Singlestore.from_json(json_str)
201            match += 1
202        except (ValidationError, ValueError) as e:
203            error_messages.append(str(e))
204        # deserialize data into Milvus
205        try:
206            instance.actual_instance = Milvus.from_json(json_str)
207            match += 1
208        except (ValidationError, ValueError) as e:
209            error_messages.append(str(e))
210        # deserialize data into Postgresql
211        try:
212            instance.actual_instance = Postgresql.from_json(json_str)
213            match += 1
214        except (ValidationError, ValueError) as e:
215            error_messages.append(str(e))
216        # deserialize data into Qdrant
217        try:
218            instance.actual_instance = Qdrant.from_json(json_str)
219            match += 1
220        except (ValidationError, ValueError) as e:
221            error_messages.append(str(e))
222        # deserialize data into Supabase
223        try:
224            instance.actual_instance = Supabase.from_json(json_str)
225            match += 1
226        except (ValidationError, ValueError) as e:
227            error_messages.append(str(e))
228        # deserialize data into Weaviate
229        try:
230            instance.actual_instance = Weaviate.from_json(json_str)
231            match += 1
232        except (ValidationError, ValueError) as e:
233            error_messages.append(str(e))
234        # deserialize data into Azureaisearch
235        try:
236            instance.actual_instance = Azureaisearch.from_json(json_str)
237            match += 1
238        except (ValidationError, ValueError) as e:
239            error_messages.append(str(e))
240        # deserialize data into Turbopuffer
241        try:
242            instance.actual_instance = Turbopuffer.from_json(json_str)
243            match += 1
244        except (ValidationError, ValueError) as e:
245            error_messages.append(str(e))
246
247        if match > 1:
248            # more than 1 match
249            raise ValueError("Multiple matches found when deserializing the JSON string into CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
250        elif match == 0:
251            # no match
252            raise ValueError("No match found when deserializing the JSON string into CreateDestinationConnectorRequest with oneOf schemas: Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate. Details: " + ", ".join(error_messages))
253        else:
254            return instance

Returns the object represented by the json string

def to_json(self) -> str:
256    def to_json(self) -> str:
257        """Returns the JSON representation of the actual instance"""
258        if self.actual_instance is None:
259            return "null"
260
261        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
262            return self.actual_instance.to_json()
263        else:
264            return json.dumps(self.actual_instance)

Returns the JSON representation of the actual instance

266    def to_dict(self) -> Optional[Union[Dict[str, Any], Azureaisearch, Capella, Datastax, Elastic, Milvus, Pinecone, Postgresql, Qdrant, Singlestore, Supabase, Turbopuffer, Weaviate]]:
267        """Returns the dict representation of the actual instance"""
268        if self.actual_instance is None:
269            return None
270
271        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
272            return self.actual_instance.to_dict()
273        else:
274            # primitive type
275            return self.actual_instance

Returns the dict representation of the actual instance

def to_str(self) -> str:
277    def to_str(self) -> str:
278        """Returns the string representation of the actual instance"""
279        return pprint.pformat(self.model_dump())

Returns the string representation of the actual instance