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

CreateSourceConnectorRequest

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

Returns the object represented by the json string

def to_json(self) -> str:
298    def to_json(self) -> str:
299        """Returns the JSON representation of the actual instance"""
300        if self.actual_instance is None:
301            return "null"
302
303        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
304            return self.actual_instance.to_json()
305        else:
306            return json.dumps(self.actual_instance)

Returns the JSON representation of the actual instance

308    def to_dict(self) -> Optional[Union[Dict[str, Any], AwsS3, AzureBlob, Confluence, Discord, FileUpload, Firecrawl, Fireflies, Gcs, Github, GoogleDrive, OneDrive, Sharepoint, WebCrawler, Zoom, ZoomAdmin]]:
309        """Returns the dict representation of the actual instance"""
310        if self.actual_instance is None:
311            return None
312
313        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
314            return self.actual_instance.to_dict()
315        else:
316            # primitive type
317            return self.actual_instance

Returns the dict representation of the actual instance

def to_str(self) -> str:
319    def to_str(self) -> str:
320        """Returns the string representation of the actual instance"""
321        return pprint.pformat(self.model_dump())

Returns the string representation of the actual instance