vectorize_client.models.update_source_connector_response_data

Vectorize API (Beta)

API for Vectorize services

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

Do not edit the class manually.

 1# coding: utf-8
 2
 3"""
 4    Vectorize API (Beta)
 5
 6    API for Vectorize services
 7
 8    The version of the OpenAPI document: 0.0.1
 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 pprint
17import re  # noqa: F401
18import json
19
20from pydantic import BaseModel, ConfigDict, Field, StrictStr
21from typing import Any, ClassVar, Dict, List, Optional
22from vectorize_client.models.source_connector import SourceConnector
23from typing import Optional, Set
24from typing_extensions import Self
25
26class UpdateSourceConnectorResponseData(BaseModel):
27    """
28    UpdateSourceConnectorResponseData
29    """ # noqa: E501
30    updated_connector: SourceConnector = Field(alias="updatedConnector")
31    pipeline_ids: Optional[List[StrictStr]] = Field(default=None, alias="pipelineIds")
32    __properties: ClassVar[List[str]] = ["updatedConnector", "pipelineIds"]
33
34    model_config = ConfigDict(
35        populate_by_name=True,
36        validate_assignment=True,
37        protected_namespaces=(),
38    )
39
40
41    def to_str(self) -> str:
42        """Returns the string representation of the model using alias"""
43        return pprint.pformat(self.model_dump(by_alias=True))
44
45    def to_json(self) -> str:
46        """Returns the JSON representation of the model using alias"""
47        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48        return json.dumps(self.to_dict())
49
50    @classmethod
51    def from_json(cls, json_str: str) -> Optional[Self]:
52        """Create an instance of UpdateSourceConnectorResponseData from a JSON string"""
53        return cls.from_dict(json.loads(json_str))
54
55    def to_dict(self) -> Dict[str, Any]:
56        """Return the dictionary representation of the model using alias.
57
58        This has the following differences from calling pydantic's
59        `self.model_dump(by_alias=True)`:
60
61        * `None` is only added to the output dict for nullable fields that
62          were set at model initialization. Other fields with value `None`
63          are ignored.
64        """
65        excluded_fields: Set[str] = set([
66        ])
67
68        _dict = self.model_dump(
69            by_alias=True,
70            exclude=excluded_fields,
71            exclude_none=True,
72        )
73        # override the default output from pydantic by calling `to_dict()` of updated_connector
74        if self.updated_connector:
75            _dict['updatedConnector'] = self.updated_connector.to_dict()
76        return _dict
77
78    @classmethod
79    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80        """Create an instance of UpdateSourceConnectorResponseData from a dict"""
81        if obj is None:
82            return None
83
84        if not isinstance(obj, dict):
85            return cls.model_validate(obj)
86
87        _obj = cls.model_validate({
88            "updatedConnector": SourceConnector.from_dict(obj["updatedConnector"]) if obj.get("updatedConnector") is not None else None,
89            "pipelineIds": obj.get("pipelineIds")
90        })
91        return _obj
class UpdateSourceConnectorResponseData(pydantic.main.BaseModel):
27class UpdateSourceConnectorResponseData(BaseModel):
28    """
29    UpdateSourceConnectorResponseData
30    """ # noqa: E501
31    updated_connector: SourceConnector = Field(alias="updatedConnector")
32    pipeline_ids: Optional[List[StrictStr]] = Field(default=None, alias="pipelineIds")
33    __properties: ClassVar[List[str]] = ["updatedConnector", "pipelineIds"]
34
35    model_config = ConfigDict(
36        populate_by_name=True,
37        validate_assignment=True,
38        protected_namespaces=(),
39    )
40
41
42    def to_str(self) -> str:
43        """Returns the string representation of the model using alias"""
44        return pprint.pformat(self.model_dump(by_alias=True))
45
46    def to_json(self) -> str:
47        """Returns the JSON representation of the model using alias"""
48        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49        return json.dumps(self.to_dict())
50
51    @classmethod
52    def from_json(cls, json_str: str) -> Optional[Self]:
53        """Create an instance of UpdateSourceConnectorResponseData from a JSON string"""
54        return cls.from_dict(json.loads(json_str))
55
56    def to_dict(self) -> Dict[str, Any]:
57        """Return the dictionary representation of the model using alias.
58
59        This has the following differences from calling pydantic's
60        `self.model_dump(by_alias=True)`:
61
62        * `None` is only added to the output dict for nullable fields that
63          were set at model initialization. Other fields with value `None`
64          are ignored.
65        """
66        excluded_fields: Set[str] = set([
67        ])
68
69        _dict = self.model_dump(
70            by_alias=True,
71            exclude=excluded_fields,
72            exclude_none=True,
73        )
74        # override the default output from pydantic by calling `to_dict()` of updated_connector
75        if self.updated_connector:
76            _dict['updatedConnector'] = self.updated_connector.to_dict()
77        return _dict
78
79    @classmethod
80    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81        """Create an instance of UpdateSourceConnectorResponseData from a dict"""
82        if obj is None:
83            return None
84
85        if not isinstance(obj, dict):
86            return cls.model_validate(obj)
87
88        _obj = cls.model_validate({
89            "updatedConnector": SourceConnector.from_dict(obj["updatedConnector"]) if obj.get("updatedConnector") is not None else None,
90            "pipelineIds": obj.get("pipelineIds")
91        })
92        return _obj

UpdateSourceConnectorResponseData

pipeline_ids: Optional[List[Annotated[str, Strict(strict=True)]]]
model_config = {'populate_by_name': True, 'validate_assignment': True, 'protected_namespaces': ()}

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

def to_str(self) -> str:
42    def to_str(self) -> str:
43        """Returns the string representation of the model using alias"""
44        return pprint.pformat(self.model_dump(by_alias=True))

Returns the string representation of the model using alias

def to_json(self) -> str:
46    def to_json(self) -> str:
47        """Returns the JSON representation of the model using alias"""
48        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49        return json.dumps(self.to_dict())

Returns the JSON representation of the model using alias

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
51    @classmethod
52    def from_json(cls, json_str: str) -> Optional[Self]:
53        """Create an instance of UpdateSourceConnectorResponseData from a JSON string"""
54        return cls.from_dict(json.loads(json_str))

Create an instance of UpdateSourceConnectorResponseData from a JSON string

def to_dict(self) -> Dict[str, Any]:
56    def to_dict(self) -> Dict[str, Any]:
57        """Return the dictionary representation of the model using alias.
58
59        This has the following differences from calling pydantic's
60        `self.model_dump(by_alias=True)`:
61
62        * `None` is only added to the output dict for nullable fields that
63          were set at model initialization. Other fields with value `None`
64          are ignored.
65        """
66        excluded_fields: Set[str] = set([
67        ])
68
69        _dict = self.model_dump(
70            by_alias=True,
71            exclude=excluded_fields,
72            exclude_none=True,
73        )
74        # override the default output from pydantic by calling `to_dict()` of updated_connector
75        if self.updated_connector:
76            _dict['updatedConnector'] = self.updated_connector.to_dict()
77        return _dict

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79    @classmethod
80    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81        """Create an instance of UpdateSourceConnectorResponseData from a dict"""
82        if obj is None:
83            return None
84
85        if not isinstance(obj, dict):
86            return cls.model_validate(obj)
87
88        _obj = cls.model_validate({
89            "updatedConnector": SourceConnector.from_dict(obj["updatedConnector"]) if obj.get("updatedConnector") is not None else None,
90            "pipelineIds": obj.get("pipelineIds")
91        })
92        return _obj

Create an instance of UpdateSourceConnectorResponseData from a dict