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

UpdateSourceConnectorRequest

UpdateSourceConnectorRequest(*args, **kwargs)
85    def __init__(self, *args, **kwargs) -> None:
86        if args:
87            if len(args) > 1:
88                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
89            if kwargs:
90                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
91            super().__init__(actual_instance=args[0])
92        else:
93            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_s31.AwsS31]
oneof_schema_2_validator: Optional[vectorize_client.models.azure_blob1.AzureBlob1]
oneof_schema_3_validator: Optional[vectorize_client.models.confluence1.Confluence1]
oneof_schema_4_validator: Optional[vectorize_client.models.discord1.Discord1]
oneof_schema_5_validator: Optional[vectorize_client.models.file_upload1.FileUpload1]
oneof_schema_6_validator: Optional[vectorize_client.models.google_drive1.GoogleDrive1]
oneof_schema_7_validator: Optional[vectorize_client.models.firecrawl1.Firecrawl1]
oneof_schema_8_validator: Optional[vectorize_client.models.gcs1.Gcs1]
oneof_schema_9_validator: Optional[vectorize_client.models.zoom1.Zoom1]
oneof_schema_10_validator: Optional[vectorize_client.models.zoom_admin1.ZoomAdmin1]
oneof_schema_11_validator: Optional[vectorize_client.models.one_drive1.OneDrive1]
oneof_schema_12_validator: Optional[vectorize_client.models.sharepoint1.Sharepoint1]
oneof_schema_13_validator: Optional[vectorize_client.models.web_crawler1.WebCrawler1]
oneof_schema_14_validator: Optional[vectorize_client.models.github1.Github1]
oneof_schema_15_validator: Optional[vectorize_client.models.fireflies1.Fireflies1]
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].

@field_validator('actual_instance')
def actual_instance_must_validate_oneof(cls, v):
 95    @field_validator('actual_instance')
 96    def actual_instance_must_validate_oneof(cls, v):
 97        instance = UpdateSourceConnectorRequest.model_construct()
 98        error_messages = []
 99        match = 0
100        # validate data type: AwsS31
101        if not isinstance(v, AwsS31):
102            error_messages.append(f"Error! Input type `{type(v)}` is not `AwsS31`")
103        else:
104            match += 1
105        # validate data type: AzureBlob1
106        if not isinstance(v, AzureBlob1):
107            error_messages.append(f"Error! Input type `{type(v)}` is not `AzureBlob1`")
108        else:
109            match += 1
110        # validate data type: Confluence1
111        if not isinstance(v, Confluence1):
112            error_messages.append(f"Error! Input type `{type(v)}` is not `Confluence1`")
113        else:
114            match += 1
115        # validate data type: Discord1
116        if not isinstance(v, Discord1):
117            error_messages.append(f"Error! Input type `{type(v)}` is not `Discord1`")
118        else:
119            match += 1
120        # validate data type: FileUpload1
121        if not isinstance(v, FileUpload1):
122            error_messages.append(f"Error! Input type `{type(v)}` is not `FileUpload1`")
123        else:
124            match += 1
125        # validate data type: GoogleDrive1
126        if not isinstance(v, GoogleDrive1):
127            error_messages.append(f"Error! Input type `{type(v)}` is not `GoogleDrive1`")
128        else:
129            match += 1
130        # validate data type: Firecrawl1
131        if not isinstance(v, Firecrawl1):
132            error_messages.append(f"Error! Input type `{type(v)}` is not `Firecrawl1`")
133        else:
134            match += 1
135        # validate data type: Gcs1
136        if not isinstance(v, Gcs1):
137            error_messages.append(f"Error! Input type `{type(v)}` is not `Gcs1`")
138        else:
139            match += 1
140        # validate data type: Zoom1
141        if not isinstance(v, Zoom1):
142            error_messages.append(f"Error! Input type `{type(v)}` is not `Zoom1`")
143        else:
144            match += 1
145        # validate data type: ZoomAdmin1
146        if not isinstance(v, ZoomAdmin1):
147            error_messages.append(f"Error! Input type `{type(v)}` is not `ZoomAdmin1`")
148        else:
149            match += 1
150        # validate data type: OneDrive1
151        if not isinstance(v, OneDrive1):
152            error_messages.append(f"Error! Input type `{type(v)}` is not `OneDrive1`")
153        else:
154            match += 1
155        # validate data type: Sharepoint1
156        if not isinstance(v, Sharepoint1):
157            error_messages.append(f"Error! Input type `{type(v)}` is not `Sharepoint1`")
158        else:
159            match += 1
160        # validate data type: WebCrawler1
161        if not isinstance(v, WebCrawler1):
162            error_messages.append(f"Error! Input type `{type(v)}` is not `WebCrawler1`")
163        else:
164            match += 1
165        # validate data type: Github1
166        if not isinstance(v, Github1):
167            error_messages.append(f"Error! Input type `{type(v)}` is not `Github1`")
168        else:
169            match += 1
170        # validate data type: Fireflies1
171        if not isinstance(v, Fireflies1):
172            error_messages.append(f"Error! Input type `{type(v)}` is not `Fireflies1`")
173        else:
174            match += 1
175        if match > 1:
176            # more than 1 match
177            raise ValueError("Multiple matches found when setting `actual_instance` in UpdateSourceConnectorRequest with oneOf schemas: AwsS31, AzureBlob1, Confluence1, Discord1, FileUpload1, Firecrawl1, Fireflies1, Gcs1, Github1, GoogleDrive1, OneDrive1, Sharepoint1, WebCrawler1, Zoom1, ZoomAdmin1. Details: " + ", ".join(error_messages))
178        elif match == 0:
179            # no match
180            raise ValueError("No match found when setting `actual_instance` in UpdateSourceConnectorRequest with oneOf schemas: AwsS31, AzureBlob1, Confluence1, Discord1, FileUpload1, Firecrawl1, Fireflies1, Gcs1, Github1, GoogleDrive1, OneDrive1, Sharepoint1, WebCrawler1, Zoom1, ZoomAdmin1. Details: " + ", ".join(error_messages))
181        else:
182            return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
184    @classmethod
185    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
186        return cls.from_json(json.dumps(obj))
@classmethod
def from_json(cls, json_str: str) -> Self:
188    @classmethod
189    def from_json(cls, json_str: str) -> Self:
190        """Returns the object represented by the json string"""
191        instance = cls.model_construct()
192        error_messages = []
193        match = 0
194
195        # deserialize data into AwsS31
196        try:
197            instance.actual_instance = AwsS31.from_json(json_str)
198            match += 1
199        except (ValidationError, ValueError) as e:
200            error_messages.append(str(e))
201        # deserialize data into AzureBlob1
202        try:
203            instance.actual_instance = AzureBlob1.from_json(json_str)
204            match += 1
205        except (ValidationError, ValueError) as e:
206            error_messages.append(str(e))
207        # deserialize data into Confluence1
208        try:
209            instance.actual_instance = Confluence1.from_json(json_str)
210            match += 1
211        except (ValidationError, ValueError) as e:
212            error_messages.append(str(e))
213        # deserialize data into Discord1
214        try:
215            instance.actual_instance = Discord1.from_json(json_str)
216            match += 1
217        except (ValidationError, ValueError) as e:
218            error_messages.append(str(e))
219        # deserialize data into FileUpload1
220        try:
221            instance.actual_instance = FileUpload1.from_json(json_str)
222            match += 1
223        except (ValidationError, ValueError) as e:
224            error_messages.append(str(e))
225        # deserialize data into GoogleDrive1
226        try:
227            instance.actual_instance = GoogleDrive1.from_json(json_str)
228            match += 1
229        except (ValidationError, ValueError) as e:
230            error_messages.append(str(e))
231        # deserialize data into Firecrawl1
232        try:
233            instance.actual_instance = Firecrawl1.from_json(json_str)
234            match += 1
235        except (ValidationError, ValueError) as e:
236            error_messages.append(str(e))
237        # deserialize data into Gcs1
238        try:
239            instance.actual_instance = Gcs1.from_json(json_str)
240            match += 1
241        except (ValidationError, ValueError) as e:
242            error_messages.append(str(e))
243        # deserialize data into Zoom1
244        try:
245            instance.actual_instance = Zoom1.from_json(json_str)
246            match += 1
247        except (ValidationError, ValueError) as e:
248            error_messages.append(str(e))
249        # deserialize data into ZoomAdmin1
250        try:
251            instance.actual_instance = ZoomAdmin1.from_json(json_str)
252            match += 1
253        except (ValidationError, ValueError) as e:
254            error_messages.append(str(e))
255        # deserialize data into OneDrive1
256        try:
257            instance.actual_instance = OneDrive1.from_json(json_str)
258            match += 1
259        except (ValidationError, ValueError) as e:
260            error_messages.append(str(e))
261        # deserialize data into Sharepoint1
262        try:
263            instance.actual_instance = Sharepoint1.from_json(json_str)
264            match += 1
265        except (ValidationError, ValueError) as e:
266            error_messages.append(str(e))
267        # deserialize data into WebCrawler1
268        try:
269            instance.actual_instance = WebCrawler1.from_json(json_str)
270            match += 1
271        except (ValidationError, ValueError) as e:
272            error_messages.append(str(e))
273        # deserialize data into Github1
274        try:
275            instance.actual_instance = Github1.from_json(json_str)
276            match += 1
277        except (ValidationError, ValueError) as e:
278            error_messages.append(str(e))
279        # deserialize data into Fireflies1
280        try:
281            instance.actual_instance = Fireflies1.from_json(json_str)
282            match += 1
283        except (ValidationError, ValueError) as e:
284            error_messages.append(str(e))
285
286        if match > 1:
287            # more than 1 match
288            raise ValueError("Multiple matches found when deserializing the JSON string into UpdateSourceConnectorRequest with oneOf schemas: AwsS31, AzureBlob1, Confluence1, Discord1, FileUpload1, Firecrawl1, Fireflies1, Gcs1, Github1, GoogleDrive1, OneDrive1, Sharepoint1, WebCrawler1, Zoom1, ZoomAdmin1. Details: " + ", ".join(error_messages))
289        elif match == 0:
290            # no match
291            raise ValueError("No match found when deserializing the JSON string into UpdateSourceConnectorRequest with oneOf schemas: AwsS31, AzureBlob1, Confluence1, Discord1, FileUpload1, Firecrawl1, Fireflies1, Gcs1, Github1, GoogleDrive1, OneDrive1, Sharepoint1, WebCrawler1, Zoom1, ZoomAdmin1. Details: " + ", ".join(error_messages))
292        else:
293            return instance

Returns the object represented by the json string

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

Returns the JSON representation of the actual instance

305    def to_dict(self) -> Optional[Union[Dict[str, Any], AwsS31, AzureBlob1, Confluence1, Discord1, FileUpload1, Firecrawl1, Fireflies1, Gcs1, Github1, GoogleDrive1, OneDrive1, Sharepoint1, WebCrawler1, Zoom1, ZoomAdmin1]]:
306        """Returns the dict representation of the actual instance"""
307        if self.actual_instance is None:
308            return None
309
310        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
311            return self.actual_instance.to_dict()
312        else:
313            # primitive type
314            return self.actual_instance

Returns the dict representation of the actual instance

def to_str(self) -> str:
316    def to_str(self) -> str:
317        """Returns the string representation of the actual instance"""
318        return pprint.pformat(self.model_dump())

Returns the string representation of the actual instance