vectorize_client.models.create_source_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.aws_s3 import AwsS3
 21from vectorize_client.models.azure_blob import AzureBlob
 22from vectorize_client.models.confluence import Confluence
 23from vectorize_client.models.discord import Discord
 24from vectorize_client.models.file_upload import FileUpload
 25from vectorize_client.models.firecrawl import Firecrawl
 26from vectorize_client.models.fireflies import Fireflies
 27from vectorize_client.models.gcs import Gcs
 28from vectorize_client.models.github import Github
 29from vectorize_client.models.google_drive import GoogleDrive
 30from vectorize_client.models.one_drive import OneDrive
 31from vectorize_client.models.sharepoint import Sharepoint
 32from vectorize_client.models.web_crawler import WebCrawler
 33from pydantic import StrictStr, Field
 34from typing import Union, List, Set, Optional, Dict
 35from typing_extensions import Literal, Self
 36
 37CREATESOURCECONNECTORREQUEST_ONE_OF_SCHEMAS = ["AwsS3", "AzureBlob", "Confluence", "Discord", "FileUpload", "Firecrawl", "Fireflies", "Gcs", "Github", "GoogleDrive", "OneDrive", "Sharepoint", "WebCrawler"]
 38
 39class CreateSourceConnectorRequest(BaseModel):
 40    """
 41    CreateSourceConnectorRequest
 42    """
 43    # data type: AwsS3
 44    oneof_schema_1_validator: Optional[AwsS3] = None
 45    # data type: AzureBlob
 46    oneof_schema_2_validator: Optional[AzureBlob] = None
 47    # data type: Confluence
 48    oneof_schema_3_validator: Optional[Confluence] = None
 49    # data type: Discord
 50    oneof_schema_4_validator: Optional[Discord] = None
 51    # data type: FileUpload
 52    oneof_schema_5_validator: Optional[FileUpload] = None
 53    # data type: GoogleDrive
 54    oneof_schema_6_validator: Optional[GoogleDrive] = None
 55    # data type: Firecrawl
 56    oneof_schema_7_validator: Optional[Firecrawl] = None
 57    # data type: Gcs
 58    oneof_schema_8_validator: Optional[Gcs] = None
 59    # data type: OneDrive
 60    oneof_schema_9_validator: Optional[OneDrive] = None
 61    # data type: Sharepoint
 62    oneof_schema_10_validator: Optional[Sharepoint] = None
 63    # data type: WebCrawler
 64    oneof_schema_11_validator: Optional[WebCrawler] = None
 65    # data type: Github
 66    oneof_schema_12_validator: Optional[Github] = None
 67    # data type: Fireflies
 68    oneof_schema_13_validator: Optional[Fireflies] = None
 69    actual_instance: Optional[Union[AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler]] = None
 70    one_of_schemas: Set[str] = { "AwsS3", "AzureBlob", "Confluence", "Discord", "FileUpload", "Firecrawl", "Fireflies", "Gcs", "Github", "GoogleDrive", "OneDrive", "Sharepoint", "WebCrawler" }
 71
 72    model_config = ConfigDict(
 73        validate_assignment=True,
 74        protected_namespaces=(),
 75    )
 76
 77
 78    discriminator_value_class_map: Dict[str, str] = {
 79    }
 80
 81    def __init__(self, *args, **kwargs) -> None:
 82        if args:
 83            if len(args) > 1:
 84                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
 85            if kwargs:
 86                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
 87            super().__init__(actual_instance=args[0])
 88        else:
 89            super().__init__(**kwargs)
 90
 91    @field_validator('actual_instance')
 92    def actual_instance_must_validate_oneof(cls, v):
 93        instance = CreateSourceConnectorRequest.model_construct()
 94        error_messages = []
 95        match = 0
 96        # validate data type: AwsS3
 97        if not isinstance(v, AwsS3):
 98            error_messages.append(f"Error! Input type `{type(v)}` is not `AwsS3`")
 99        else:
100            match += 1
101        # validate data type: AzureBlob
102        if not isinstance(v, AzureBlob):
103            error_messages.append(f"Error! Input type `{type(v)}` is not `AzureBlob`")
104        else:
105            match += 1
106        # validate data type: Confluence
107        if not isinstance(v, Confluence):
108            error_messages.append(f"Error! Input type `{type(v)}` is not `Confluence`")
109        else:
110            match += 1
111        # validate data type: Discord
112        if not isinstance(v, Discord):
113            error_messages.append(f"Error! Input type `{type(v)}` is not `Discord`")
114        else:
115            match += 1
116        # validate data type: FileUpload
117        if not isinstance(v, FileUpload):
118            error_messages.append(f"Error! Input type `{type(v)}` is not `FileUpload`")
119        else:
120            match += 1
121        # validate data type: GoogleDrive
122        if not isinstance(v, GoogleDrive):
123            error_messages.append(f"Error! Input type `{type(v)}` is not `GoogleDrive`")
124        else:
125            match += 1
126        # validate data type: Firecrawl
127        if not isinstance(v, Firecrawl):
128            error_messages.append(f"Error! Input type `{type(v)}` is not `Firecrawl`")
129        else:
130            match += 1
131        # validate data type: Gcs
132        if not isinstance(v, Gcs):
133            error_messages.append(f"Error! Input type `{type(v)}` is not `Gcs`")
134        else:
135            match += 1
136        # validate data type: OneDrive
137        if not isinstance(v, OneDrive):
138            error_messages.append(f"Error! Input type `{type(v)}` is not `OneDrive`")
139        else:
140            match += 1
141        # validate data type: Sharepoint
142        if not isinstance(v, Sharepoint):
143            error_messages.append(f"Error! Input type `{type(v)}` is not `Sharepoint`")
144        else:
145            match += 1
146        # validate data type: WebCrawler
147        if not isinstance(v, WebCrawler):
148            error_messages.append(f"Error! Input type `{type(v)}` is not `WebCrawler`")
149        else:
150            match += 1
151        # validate data type: Github
152        if not isinstance(v, Github):
153            error_messages.append(f"Error! Input type `{type(v)}` is not `Github`")
154        else:
155            match += 1
156        # validate data type: Fireflies
157        if not isinstance(v, Fireflies):
158            error_messages.append(f"Error! Input type `{type(v)}` is not `Fireflies`")
159        else:
160            match += 1
161        if match > 1:
162            # more than 1 match
163            raise ValueError("Multiple matches found when setting `actual_instance` in CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
164        elif match == 0:
165            # no match
166            raise ValueError("No match found when setting `actual_instance` in CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
167        else:
168            return v
169
170    @classmethod
171    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
172        return cls.from_json(json.dumps(obj))
173
174    @classmethod
175    def from_json(cls, json_str: str) -> Self:
176        """Returns the object represented by the json string"""
177        instance = cls.model_construct()
178        error_messages = []
179        match = 0
180
181        # deserialize data into AwsS3
182        try:
183            instance.actual_instance = AwsS3.from_json(json_str)
184            match += 1
185        except (ValidationError, ValueError) as e:
186            error_messages.append(str(e))
187        # deserialize data into AzureBlob
188        try:
189            instance.actual_instance = AzureBlob.from_json(json_str)
190            match += 1
191        except (ValidationError, ValueError) as e:
192            error_messages.append(str(e))
193        # deserialize data into Confluence
194        try:
195            instance.actual_instance = Confluence.from_json(json_str)
196            match += 1
197        except (ValidationError, ValueError) as e:
198            error_messages.append(str(e))
199        # deserialize data into Discord
200        try:
201            instance.actual_instance = Discord.from_json(json_str)
202            match += 1
203        except (ValidationError, ValueError) as e:
204            error_messages.append(str(e))
205        # deserialize data into FileUpload
206        try:
207            instance.actual_instance = FileUpload.from_json(json_str)
208            match += 1
209        except (ValidationError, ValueError) as e:
210            error_messages.append(str(e))
211        # deserialize data into GoogleDrive
212        try:
213            instance.actual_instance = GoogleDrive.from_json(json_str)
214            match += 1
215        except (ValidationError, ValueError) as e:
216            error_messages.append(str(e))
217        # deserialize data into Firecrawl
218        try:
219            instance.actual_instance = Firecrawl.from_json(json_str)
220            match += 1
221        except (ValidationError, ValueError) as e:
222            error_messages.append(str(e))
223        # deserialize data into Gcs
224        try:
225            instance.actual_instance = Gcs.from_json(json_str)
226            match += 1
227        except (ValidationError, ValueError) as e:
228            error_messages.append(str(e))
229        # deserialize data into OneDrive
230        try:
231            instance.actual_instance = OneDrive.from_json(json_str)
232            match += 1
233        except (ValidationError, ValueError) as e:
234            error_messages.append(str(e))
235        # deserialize data into Sharepoint
236        try:
237            instance.actual_instance = Sharepoint.from_json(json_str)
238            match += 1
239        except (ValidationError, ValueError) as e:
240            error_messages.append(str(e))
241        # deserialize data into WebCrawler
242        try:
243            instance.actual_instance = WebCrawler.from_json(json_str)
244            match += 1
245        except (ValidationError, ValueError) as e:
246            error_messages.append(str(e))
247        # deserialize data into Github
248        try:
249            instance.actual_instance = Github.from_json(json_str)
250            match += 1
251        except (ValidationError, ValueError) as e:
252            error_messages.append(str(e))
253        # deserialize data into Fireflies
254        try:
255            instance.actual_instance = Fireflies.from_json(json_str)
256            match += 1
257        except (ValidationError, ValueError) as e:
258            error_messages.append(str(e))
259
260        if match > 1:
261            # more than 1 match
262            raise ValueError("Multiple matches found when deserializing the JSON string into CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
263        elif match == 0:
264            # no match
265            raise ValueError("No match found when deserializing the JSON string into CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
266        else:
267            return instance
268
269    def to_json(self) -> str:
270        """Returns the JSON representation of the actual instance"""
271        if self.actual_instance is None:
272            return "null"
273
274        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
275            return self.actual_instance.to_json()
276        else:
277            return json.dumps(self.actual_instance)
278
279    def to_dict(self) -> Optional[Union[Dict[str, Any], AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler]]:
280        """Returns the dict representation of the actual instance"""
281        if self.actual_instance is None:
282            return None
283
284        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
285            return self.actual_instance.to_dict()
286        else:
287            # primitive type
288            return self.actual_instance
289
290    def to_str(self) -> str:
291        """Returns the string representation of the actual instance"""
292        return pprint.pformat(self.model_dump())
CREATESOURCECONNECTORREQUEST_ONE_OF_SCHEMAS = ['AwsS3', 'AzureBlob', 'Confluence', 'Discord', 'FileUpload', 'Firecrawl', 'Fireflies', 'Gcs', 'Github', 'GoogleDrive', 'OneDrive', 'Sharepoint', 'WebCrawler']
class CreateSourceConnectorRequest(pydantic.main.BaseModel):
 40class CreateSourceConnectorRequest(BaseModel):
 41    """
 42    CreateSourceConnectorRequest
 43    """
 44    # data type: AwsS3
 45    oneof_schema_1_validator: Optional[AwsS3] = None
 46    # data type: AzureBlob
 47    oneof_schema_2_validator: Optional[AzureBlob] = None
 48    # data type: Confluence
 49    oneof_schema_3_validator: Optional[Confluence] = None
 50    # data type: Discord
 51    oneof_schema_4_validator: Optional[Discord] = None
 52    # data type: FileUpload
 53    oneof_schema_5_validator: Optional[FileUpload] = None
 54    # data type: GoogleDrive
 55    oneof_schema_6_validator: Optional[GoogleDrive] = None
 56    # data type: Firecrawl
 57    oneof_schema_7_validator: Optional[Firecrawl] = None
 58    # data type: Gcs
 59    oneof_schema_8_validator: Optional[Gcs] = None
 60    # data type: OneDrive
 61    oneof_schema_9_validator: Optional[OneDrive] = None
 62    # data type: Sharepoint
 63    oneof_schema_10_validator: Optional[Sharepoint] = None
 64    # data type: WebCrawler
 65    oneof_schema_11_validator: Optional[WebCrawler] = None
 66    # data type: Github
 67    oneof_schema_12_validator: Optional[Github] = None
 68    # data type: Fireflies
 69    oneof_schema_13_validator: Optional[Fireflies] = None
 70    actual_instance: Optional[Union[AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler]] = None
 71    one_of_schemas: Set[str] = { "AwsS3", "AzureBlob", "Confluence", "Discord", "FileUpload", "Firecrawl", "Fireflies", "Gcs", "Github", "GoogleDrive", "OneDrive", "Sharepoint", "WebCrawler" }
 72
 73    model_config = ConfigDict(
 74        validate_assignment=True,
 75        protected_namespaces=(),
 76    )
 77
 78
 79    discriminator_value_class_map: Dict[str, str] = {
 80    }
 81
 82    def __init__(self, *args, **kwargs) -> None:
 83        if args:
 84            if len(args) > 1:
 85                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
 86            if kwargs:
 87                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
 88            super().__init__(actual_instance=args[0])
 89        else:
 90            super().__init__(**kwargs)
 91
 92    @field_validator('actual_instance')
 93    def actual_instance_must_validate_oneof(cls, v):
 94        instance = CreateSourceConnectorRequest.model_construct()
 95        error_messages = []
 96        match = 0
 97        # validate data type: AwsS3
 98        if not isinstance(v, AwsS3):
 99            error_messages.append(f"Error! Input type `{type(v)}` is not `AwsS3`")
100        else:
101            match += 1
102        # validate data type: AzureBlob
103        if not isinstance(v, AzureBlob):
104            error_messages.append(f"Error! Input type `{type(v)}` is not `AzureBlob`")
105        else:
106            match += 1
107        # validate data type: Confluence
108        if not isinstance(v, Confluence):
109            error_messages.append(f"Error! Input type `{type(v)}` is not `Confluence`")
110        else:
111            match += 1
112        # validate data type: Discord
113        if not isinstance(v, Discord):
114            error_messages.append(f"Error! Input type `{type(v)}` is not `Discord`")
115        else:
116            match += 1
117        # validate data type: FileUpload
118        if not isinstance(v, FileUpload):
119            error_messages.append(f"Error! Input type `{type(v)}` is not `FileUpload`")
120        else:
121            match += 1
122        # validate data type: GoogleDrive
123        if not isinstance(v, GoogleDrive):
124            error_messages.append(f"Error! Input type `{type(v)}` is not `GoogleDrive`")
125        else:
126            match += 1
127        # validate data type: Firecrawl
128        if not isinstance(v, Firecrawl):
129            error_messages.append(f"Error! Input type `{type(v)}` is not `Firecrawl`")
130        else:
131            match += 1
132        # validate data type: Gcs
133        if not isinstance(v, Gcs):
134            error_messages.append(f"Error! Input type `{type(v)}` is not `Gcs`")
135        else:
136            match += 1
137        # validate data type: OneDrive
138        if not isinstance(v, OneDrive):
139            error_messages.append(f"Error! Input type `{type(v)}` is not `OneDrive`")
140        else:
141            match += 1
142        # validate data type: Sharepoint
143        if not isinstance(v, Sharepoint):
144            error_messages.append(f"Error! Input type `{type(v)}` is not `Sharepoint`")
145        else:
146            match += 1
147        # validate data type: WebCrawler
148        if not isinstance(v, WebCrawler):
149            error_messages.append(f"Error! Input type `{type(v)}` is not `WebCrawler`")
150        else:
151            match += 1
152        # validate data type: Github
153        if not isinstance(v, Github):
154            error_messages.append(f"Error! Input type `{type(v)}` is not `Github`")
155        else:
156            match += 1
157        # validate data type: Fireflies
158        if not isinstance(v, Fireflies):
159            error_messages.append(f"Error! Input type `{type(v)}` is not `Fireflies`")
160        else:
161            match += 1
162        if match > 1:
163            # more than 1 match
164            raise ValueError("Multiple matches found when setting `actual_instance` in CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
165        elif match == 0:
166            # no match
167            raise ValueError("No match found when setting `actual_instance` in CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
168        else:
169            return v
170
171    @classmethod
172    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
173        return cls.from_json(json.dumps(obj))
174
175    @classmethod
176    def from_json(cls, json_str: str) -> Self:
177        """Returns the object represented by the json string"""
178        instance = cls.model_construct()
179        error_messages = []
180        match = 0
181
182        # deserialize data into AwsS3
183        try:
184            instance.actual_instance = AwsS3.from_json(json_str)
185            match += 1
186        except (ValidationError, ValueError) as e:
187            error_messages.append(str(e))
188        # deserialize data into AzureBlob
189        try:
190            instance.actual_instance = AzureBlob.from_json(json_str)
191            match += 1
192        except (ValidationError, ValueError) as e:
193            error_messages.append(str(e))
194        # deserialize data into Confluence
195        try:
196            instance.actual_instance = Confluence.from_json(json_str)
197            match += 1
198        except (ValidationError, ValueError) as e:
199            error_messages.append(str(e))
200        # deserialize data into Discord
201        try:
202            instance.actual_instance = Discord.from_json(json_str)
203            match += 1
204        except (ValidationError, ValueError) as e:
205            error_messages.append(str(e))
206        # deserialize data into FileUpload
207        try:
208            instance.actual_instance = FileUpload.from_json(json_str)
209            match += 1
210        except (ValidationError, ValueError) as e:
211            error_messages.append(str(e))
212        # deserialize data into GoogleDrive
213        try:
214            instance.actual_instance = GoogleDrive.from_json(json_str)
215            match += 1
216        except (ValidationError, ValueError) as e:
217            error_messages.append(str(e))
218        # deserialize data into Firecrawl
219        try:
220            instance.actual_instance = Firecrawl.from_json(json_str)
221            match += 1
222        except (ValidationError, ValueError) as e:
223            error_messages.append(str(e))
224        # deserialize data into Gcs
225        try:
226            instance.actual_instance = Gcs.from_json(json_str)
227            match += 1
228        except (ValidationError, ValueError) as e:
229            error_messages.append(str(e))
230        # deserialize data into OneDrive
231        try:
232            instance.actual_instance = OneDrive.from_json(json_str)
233            match += 1
234        except (ValidationError, ValueError) as e:
235            error_messages.append(str(e))
236        # deserialize data into Sharepoint
237        try:
238            instance.actual_instance = Sharepoint.from_json(json_str)
239            match += 1
240        except (ValidationError, ValueError) as e:
241            error_messages.append(str(e))
242        # deserialize data into WebCrawler
243        try:
244            instance.actual_instance = WebCrawler.from_json(json_str)
245            match += 1
246        except (ValidationError, ValueError) as e:
247            error_messages.append(str(e))
248        # deserialize data into Github
249        try:
250            instance.actual_instance = Github.from_json(json_str)
251            match += 1
252        except (ValidationError, ValueError) as e:
253            error_messages.append(str(e))
254        # deserialize data into Fireflies
255        try:
256            instance.actual_instance = Fireflies.from_json(json_str)
257            match += 1
258        except (ValidationError, ValueError) as e:
259            error_messages.append(str(e))
260
261        if match > 1:
262            # more than 1 match
263            raise ValueError("Multiple matches found when deserializing the JSON string into CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
264        elif match == 0:
265            # no match
266            raise ValueError("No match found when deserializing the JSON string into CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
267        else:
268            return instance
269
270    def to_json(self) -> str:
271        """Returns the JSON representation of the actual instance"""
272        if self.actual_instance is None:
273            return "null"
274
275        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
276            return self.actual_instance.to_json()
277        else:
278            return json.dumps(self.actual_instance)
279
280    def to_dict(self) -> Optional[Union[Dict[str, Any], AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler]]:
281        """Returns the dict representation of the actual instance"""
282        if self.actual_instance is None:
283            return None
284
285        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
286            return self.actual_instance.to_dict()
287        else:
288            # primitive type
289            return self.actual_instance
290
291    def to_str(self) -> str:
292        """Returns the string representation of the actual instance"""
293        return pprint.pformat(self.model_dump())

CreateSourceConnectorRequest

CreateSourceConnectorRequest(*args, **kwargs)
82    def __init__(self, *args, **kwargs) -> None:
83        if args:
84            if len(args) > 1:
85                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
86            if kwargs:
87                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
88            super().__init__(actual_instance=args[0])
89        else:
90            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.aws_s3.AwsS3]
oneof_schema_2_validator: Optional[vectorize_client.models.azure_blob.AzureBlob]
oneof_schema_3_validator: Optional[vectorize_client.models.confluence.Confluence]
oneof_schema_4_validator: Optional[vectorize_client.models.discord.Discord]
oneof_schema_5_validator: Optional[vectorize_client.models.file_upload.FileUpload]
oneof_schema_6_validator: Optional[vectorize_client.models.google_drive.GoogleDrive]
oneof_schema_7_validator: Optional[vectorize_client.models.firecrawl.Firecrawl]
oneof_schema_8_validator: Optional[vectorize_client.models.gcs.Gcs]
oneof_schema_9_validator: Optional[vectorize_client.models.one_drive.OneDrive]
oneof_schema_10_validator: Optional[vectorize_client.models.sharepoint.Sharepoint]
oneof_schema_11_validator: Optional[vectorize_client.models.web_crawler.WebCrawler]
oneof_schema_12_validator: Optional[vectorize_client.models.github.Github]
oneof_schema_13_validator: Optional[vectorize_client.models.fireflies.Fireflies]
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):
 92    @field_validator('actual_instance')
 93    def actual_instance_must_validate_oneof(cls, v):
 94        instance = CreateSourceConnectorRequest.model_construct()
 95        error_messages = []
 96        match = 0
 97        # validate data type: AwsS3
 98        if not isinstance(v, AwsS3):
 99            error_messages.append(f"Error! Input type `{type(v)}` is not `AwsS3`")
100        else:
101            match += 1
102        # validate data type: AzureBlob
103        if not isinstance(v, AzureBlob):
104            error_messages.append(f"Error! Input type `{type(v)}` is not `AzureBlob`")
105        else:
106            match += 1
107        # validate data type: Confluence
108        if not isinstance(v, Confluence):
109            error_messages.append(f"Error! Input type `{type(v)}` is not `Confluence`")
110        else:
111            match += 1
112        # validate data type: Discord
113        if not isinstance(v, Discord):
114            error_messages.append(f"Error! Input type `{type(v)}` is not `Discord`")
115        else:
116            match += 1
117        # validate data type: FileUpload
118        if not isinstance(v, FileUpload):
119            error_messages.append(f"Error! Input type `{type(v)}` is not `FileUpload`")
120        else:
121            match += 1
122        # validate data type: GoogleDrive
123        if not isinstance(v, GoogleDrive):
124            error_messages.append(f"Error! Input type `{type(v)}` is not `GoogleDrive`")
125        else:
126            match += 1
127        # validate data type: Firecrawl
128        if not isinstance(v, Firecrawl):
129            error_messages.append(f"Error! Input type `{type(v)}` is not `Firecrawl`")
130        else:
131            match += 1
132        # validate data type: Gcs
133        if not isinstance(v, Gcs):
134            error_messages.append(f"Error! Input type `{type(v)}` is not `Gcs`")
135        else:
136            match += 1
137        # validate data type: OneDrive
138        if not isinstance(v, OneDrive):
139            error_messages.append(f"Error! Input type `{type(v)}` is not `OneDrive`")
140        else:
141            match += 1
142        # validate data type: Sharepoint
143        if not isinstance(v, Sharepoint):
144            error_messages.append(f"Error! Input type `{type(v)}` is not `Sharepoint`")
145        else:
146            match += 1
147        # validate data type: WebCrawler
148        if not isinstance(v, WebCrawler):
149            error_messages.append(f"Error! Input type `{type(v)}` is not `WebCrawler`")
150        else:
151            match += 1
152        # validate data type: Github
153        if not isinstance(v, Github):
154            error_messages.append(f"Error! Input type `{type(v)}` is not `Github`")
155        else:
156            match += 1
157        # validate data type: Fireflies
158        if not isinstance(v, Fireflies):
159            error_messages.append(f"Error! Input type `{type(v)}` is not `Fireflies`")
160        else:
161            match += 1
162        if match > 1:
163            # more than 1 match
164            raise ValueError("Multiple matches found when setting `actual_instance` in CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
165        elif match == 0:
166            # no match
167            raise ValueError("No match found when setting `actual_instance` in CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
168        else:
169            return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
171    @classmethod
172    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
173        return cls.from_json(json.dumps(obj))
@classmethod
def from_json(cls, json_str: str) -> Self:
175    @classmethod
176    def from_json(cls, json_str: str) -> Self:
177        """Returns the object represented by the json string"""
178        instance = cls.model_construct()
179        error_messages = []
180        match = 0
181
182        # deserialize data into AwsS3
183        try:
184            instance.actual_instance = AwsS3.from_json(json_str)
185            match += 1
186        except (ValidationError, ValueError) as e:
187            error_messages.append(str(e))
188        # deserialize data into AzureBlob
189        try:
190            instance.actual_instance = AzureBlob.from_json(json_str)
191            match += 1
192        except (ValidationError, ValueError) as e:
193            error_messages.append(str(e))
194        # deserialize data into Confluence
195        try:
196            instance.actual_instance = Confluence.from_json(json_str)
197            match += 1
198        except (ValidationError, ValueError) as e:
199            error_messages.append(str(e))
200        # deserialize data into Discord
201        try:
202            instance.actual_instance = Discord.from_json(json_str)
203            match += 1
204        except (ValidationError, ValueError) as e:
205            error_messages.append(str(e))
206        # deserialize data into FileUpload
207        try:
208            instance.actual_instance = FileUpload.from_json(json_str)
209            match += 1
210        except (ValidationError, ValueError) as e:
211            error_messages.append(str(e))
212        # deserialize data into GoogleDrive
213        try:
214            instance.actual_instance = GoogleDrive.from_json(json_str)
215            match += 1
216        except (ValidationError, ValueError) as e:
217            error_messages.append(str(e))
218        # deserialize data into Firecrawl
219        try:
220            instance.actual_instance = Firecrawl.from_json(json_str)
221            match += 1
222        except (ValidationError, ValueError) as e:
223            error_messages.append(str(e))
224        # deserialize data into Gcs
225        try:
226            instance.actual_instance = Gcs.from_json(json_str)
227            match += 1
228        except (ValidationError, ValueError) as e:
229            error_messages.append(str(e))
230        # deserialize data into OneDrive
231        try:
232            instance.actual_instance = OneDrive.from_json(json_str)
233            match += 1
234        except (ValidationError, ValueError) as e:
235            error_messages.append(str(e))
236        # deserialize data into Sharepoint
237        try:
238            instance.actual_instance = Sharepoint.from_json(json_str)
239            match += 1
240        except (ValidationError, ValueError) as e:
241            error_messages.append(str(e))
242        # deserialize data into WebCrawler
243        try:
244            instance.actual_instance = WebCrawler.from_json(json_str)
245            match += 1
246        except (ValidationError, ValueError) as e:
247            error_messages.append(str(e))
248        # deserialize data into Github
249        try:
250            instance.actual_instance = Github.from_json(json_str)
251            match += 1
252        except (ValidationError, ValueError) as e:
253            error_messages.append(str(e))
254        # deserialize data into Fireflies
255        try:
256            instance.actual_instance = Fireflies.from_json(json_str)
257            match += 1
258        except (ValidationError, ValueError) as e:
259            error_messages.append(str(e))
260
261        if match > 1:
262            # more than 1 match
263            raise ValueError("Multiple matches found when deserializing the JSON string into CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
264        elif match == 0:
265            # no match
266            raise ValueError("No match found when deserializing the JSON string into CreateSourceConnectorRequest with oneOf schemas: AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler. Details: " + ", ".join(error_messages))
267        else:
268            return instance

Returns the object represented by the json string

def to_json(self) -> str:
270    def to_json(self) -> str:
271        """Returns the JSON representation of the actual instance"""
272        if self.actual_instance is None:
273            return "null"
274
275        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
276            return self.actual_instance.to_json()
277        else:
278            return json.dumps(self.actual_instance)

Returns the JSON representation of the actual instance

280    def to_dict(self) -> Optional[Union[Dict[str, Any], AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler]]:
281        """Returns the dict representation of the actual instance"""
282        if self.actual_instance is None:
283            return None
284
285        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
286            return self.actual_instance.to_dict()
287        else:
288            # primitive type
289            return self.actual_instance

Returns the dict representation of the actual instance

def to_str(self) -> str:
291    def to_str(self) -> str:
292        """Returns the string representation of the actual instance"""
293        return pprint.pformat(self.model_dump())

Returns the string representation of the actual instance