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

UpdateSourceConnectorRequest

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

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

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

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

oneof_schema_1_validator: Optional[vectorize_client.models.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.one_drive1.OneDrive1]
oneof_schema_10_validator: Optional[vectorize_client.models.sharepoint1.Sharepoint1]
oneof_schema_11_validator: Optional[vectorize_client.models.web_crawler1.WebCrawler1]
oneof_schema_12_validator: Optional[vectorize_client.models.github1.Github1]
oneof_schema_13_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):
 89    @field_validator('actual_instance')
 90    def actual_instance_must_validate_oneof(cls, v):
 91        instance = UpdateSourceConnectorRequest.model_construct()
 92        error_messages = []
 93        match = 0
 94        # validate data type: AwsS31
 95        if not isinstance(v, AwsS31):
 96            error_messages.append(f"Error! Input type `{type(v)}` is not `AwsS31`")
 97        else:
 98            match += 1
 99        # validate data type: AzureBlob1
100        if not isinstance(v, AzureBlob1):
101            error_messages.append(f"Error! Input type `{type(v)}` is not `AzureBlob1`")
102        else:
103            match += 1
104        # validate data type: Confluence1
105        if not isinstance(v, Confluence1):
106            error_messages.append(f"Error! Input type `{type(v)}` is not `Confluence1`")
107        else:
108            match += 1
109        # validate data type: Discord1
110        if not isinstance(v, Discord1):
111            error_messages.append(f"Error! Input type `{type(v)}` is not `Discord1`")
112        else:
113            match += 1
114        # validate data type: FileUpload1
115        if not isinstance(v, FileUpload1):
116            error_messages.append(f"Error! Input type `{type(v)}` is not `FileUpload1`")
117        else:
118            match += 1
119        # validate data type: GoogleDrive1
120        if not isinstance(v, GoogleDrive1):
121            error_messages.append(f"Error! Input type `{type(v)}` is not `GoogleDrive1`")
122        else:
123            match += 1
124        # validate data type: Firecrawl1
125        if not isinstance(v, Firecrawl1):
126            error_messages.append(f"Error! Input type `{type(v)}` is not `Firecrawl1`")
127        else:
128            match += 1
129        # validate data type: Gcs1
130        if not isinstance(v, Gcs1):
131            error_messages.append(f"Error! Input type `{type(v)}` is not `Gcs1`")
132        else:
133            match += 1
134        # validate data type: OneDrive1
135        if not isinstance(v, OneDrive1):
136            error_messages.append(f"Error! Input type `{type(v)}` is not `OneDrive1`")
137        else:
138            match += 1
139        # validate data type: Sharepoint1
140        if not isinstance(v, Sharepoint1):
141            error_messages.append(f"Error! Input type `{type(v)}` is not `Sharepoint1`")
142        else:
143            match += 1
144        # validate data type: WebCrawler1
145        if not isinstance(v, WebCrawler1):
146            error_messages.append(f"Error! Input type `{type(v)}` is not `WebCrawler1`")
147        else:
148            match += 1
149        # validate data type: Github1
150        if not isinstance(v, Github1):
151            error_messages.append(f"Error! Input type `{type(v)}` is not `Github1`")
152        else:
153            match += 1
154        # validate data type: Fireflies1
155        if not isinstance(v, Fireflies1):
156            error_messages.append(f"Error! Input type `{type(v)}` is not `Fireflies1`")
157        else:
158            match += 1
159        if match > 1:
160            # more than 1 match
161            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. Details: " + ", ".join(error_messages))
162        elif match == 0:
163            # no match
164            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. Details: " + ", ".join(error_messages))
165        else:
166            return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
168    @classmethod
169    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
170        return cls.from_json(json.dumps(obj))
@classmethod
def from_json(cls, json_str: str) -> Self:
172    @classmethod
173    def from_json(cls, json_str: str) -> Self:
174        """Returns the object represented by the json string"""
175        instance = cls.model_construct()
176        error_messages = []
177        match = 0
178
179        # deserialize data into AwsS31
180        try:
181            instance.actual_instance = AwsS31.from_json(json_str)
182            match += 1
183        except (ValidationError, ValueError) as e:
184            error_messages.append(str(e))
185        # deserialize data into AzureBlob1
186        try:
187            instance.actual_instance = AzureBlob1.from_json(json_str)
188            match += 1
189        except (ValidationError, ValueError) as e:
190            error_messages.append(str(e))
191        # deserialize data into Confluence1
192        try:
193            instance.actual_instance = Confluence1.from_json(json_str)
194            match += 1
195        except (ValidationError, ValueError) as e:
196            error_messages.append(str(e))
197        # deserialize data into Discord1
198        try:
199            instance.actual_instance = Discord1.from_json(json_str)
200            match += 1
201        except (ValidationError, ValueError) as e:
202            error_messages.append(str(e))
203        # deserialize data into FileUpload1
204        try:
205            instance.actual_instance = FileUpload1.from_json(json_str)
206            match += 1
207        except (ValidationError, ValueError) as e:
208            error_messages.append(str(e))
209        # deserialize data into GoogleDrive1
210        try:
211            instance.actual_instance = GoogleDrive1.from_json(json_str)
212            match += 1
213        except (ValidationError, ValueError) as e:
214            error_messages.append(str(e))
215        # deserialize data into Firecrawl1
216        try:
217            instance.actual_instance = Firecrawl1.from_json(json_str)
218            match += 1
219        except (ValidationError, ValueError) as e:
220            error_messages.append(str(e))
221        # deserialize data into Gcs1
222        try:
223            instance.actual_instance = Gcs1.from_json(json_str)
224            match += 1
225        except (ValidationError, ValueError) as e:
226            error_messages.append(str(e))
227        # deserialize data into OneDrive1
228        try:
229            instance.actual_instance = OneDrive1.from_json(json_str)
230            match += 1
231        except (ValidationError, ValueError) as e:
232            error_messages.append(str(e))
233        # deserialize data into Sharepoint1
234        try:
235            instance.actual_instance = Sharepoint1.from_json(json_str)
236            match += 1
237        except (ValidationError, ValueError) as e:
238            error_messages.append(str(e))
239        # deserialize data into WebCrawler1
240        try:
241            instance.actual_instance = WebCrawler1.from_json(json_str)
242            match += 1
243        except (ValidationError, ValueError) as e:
244            error_messages.append(str(e))
245        # deserialize data into Github1
246        try:
247            instance.actual_instance = Github1.from_json(json_str)
248            match += 1
249        except (ValidationError, ValueError) as e:
250            error_messages.append(str(e))
251        # deserialize data into Fireflies1
252        try:
253            instance.actual_instance = Fireflies1.from_json(json_str)
254            match += 1
255        except (ValidationError, ValueError) as e:
256            error_messages.append(str(e))
257
258        if match > 1:
259            # more than 1 match
260            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. Details: " + ", ".join(error_messages))
261        elif match == 0:
262            # no match
263            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. Details: " + ", ".join(error_messages))
264        else:
265            return instance

Returns the object represented by the json string

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

Returns the JSON representation of the actual instance

277    def to_dict(self) -> Optional[Union[Dict[str, Any], AwsS31, AzureBlob1, Confluence1, Discord1, FileUpload1, Firecrawl1, Fireflies1, Gcs1, Github1, GoogleDrive1, OneDrive1, Sharepoint1, WebCrawler1]]:
278        """Returns the dict representation of the actual instance"""
279        if self.actual_instance is None:
280            return None
281
282        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
283            return self.actual_instance.to_dict()
284        else:
285            # primitive type
286            return self.actual_instance

Returns the dict representation of the actual instance

def to_str(self) -> str:
288    def to_str(self) -> str:
289        """Returns the string representation of the actual instance"""
290        return pprint.pformat(self.model_dump())

Returns the string representation of the actual instance