vectorize_client.models.destination_connector

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 typing import Optional, Set
 23from typing_extensions import Self
 24
 25class DestinationConnector(BaseModel):
 26    """
 27    DestinationConnector
 28    """ # noqa: E501
 29    id: StrictStr
 30    type: StrictStr
 31    name: StrictStr
 32    config_doc: Optional[Dict[str, Any]] = Field(default=None, alias="configDoc")
 33    created_at: Optional[StrictStr] = Field(default=None, alias="createdAt")
 34    created_by_id: Optional[StrictStr] = Field(default=None, alias="createdById")
 35    last_updated_by_id: Optional[StrictStr] = Field(default=None, alias="lastUpdatedById")
 36    created_by_email: Optional[StrictStr] = Field(default=None, alias="createdByEmail")
 37    last_updated_by_email: Optional[StrictStr] = Field(default=None, alias="lastUpdatedByEmail")
 38    error_message: Optional[StrictStr] = Field(default=None, alias="errorMessage")
 39    verification_status: Optional[StrictStr] = Field(default=None, alias="verificationStatus")
 40    __properties: ClassVar[List[str]] = ["id", "type", "name", "configDoc", "createdAt", "createdById", "lastUpdatedById", "createdByEmail", "lastUpdatedByEmail", "errorMessage", "verificationStatus"]
 41
 42    model_config = ConfigDict(
 43        populate_by_name=True,
 44        validate_assignment=True,
 45        protected_namespaces=(),
 46    )
 47
 48
 49    def to_str(self) -> str:
 50        """Returns the string representation of the model using alias"""
 51        return pprint.pformat(self.model_dump(by_alias=True))
 52
 53    def to_json(self) -> str:
 54        """Returns the JSON representation of the model using alias"""
 55        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 56        return json.dumps(self.to_dict())
 57
 58    @classmethod
 59    def from_json(cls, json_str: str) -> Optional[Self]:
 60        """Create an instance of DestinationConnector from a JSON string"""
 61        return cls.from_dict(json.loads(json_str))
 62
 63    def to_dict(self) -> Dict[str, Any]:
 64        """Return the dictionary representation of the model using alias.
 65
 66        This has the following differences from calling pydantic's
 67        `self.model_dump(by_alias=True)`:
 68
 69        * `None` is only added to the output dict for nullable fields that
 70          were set at model initialization. Other fields with value `None`
 71          are ignored.
 72        """
 73        excluded_fields: Set[str] = set([
 74        ])
 75
 76        _dict = self.model_dump(
 77            by_alias=True,
 78            exclude=excluded_fields,
 79            exclude_none=True,
 80        )
 81        # set to None if created_at (nullable) is None
 82        # and model_fields_set contains the field
 83        if self.created_at is None and "created_at" in self.model_fields_set:
 84            _dict['createdAt'] = None
 85
 86        return _dict
 87
 88    @classmethod
 89    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
 90        """Create an instance of DestinationConnector from a dict"""
 91        if obj is None:
 92            return None
 93
 94        if not isinstance(obj, dict):
 95            return cls.model_validate(obj)
 96
 97        _obj = cls.model_validate({
 98            "id": obj.get("id"),
 99            "type": obj.get("type"),
100            "name": obj.get("name"),
101            "configDoc": obj.get("configDoc"),
102            "createdAt": obj.get("createdAt"),
103            "createdById": obj.get("createdById"),
104            "lastUpdatedById": obj.get("lastUpdatedById"),
105            "createdByEmail": obj.get("createdByEmail"),
106            "lastUpdatedByEmail": obj.get("lastUpdatedByEmail"),
107            "errorMessage": obj.get("errorMessage"),
108            "verificationStatus": obj.get("verificationStatus")
109        })
110        return _obj
class DestinationConnector(pydantic.main.BaseModel):
 26class DestinationConnector(BaseModel):
 27    """
 28    DestinationConnector
 29    """ # noqa: E501
 30    id: StrictStr
 31    type: StrictStr
 32    name: StrictStr
 33    config_doc: Optional[Dict[str, Any]] = Field(default=None, alias="configDoc")
 34    created_at: Optional[StrictStr] = Field(default=None, alias="createdAt")
 35    created_by_id: Optional[StrictStr] = Field(default=None, alias="createdById")
 36    last_updated_by_id: Optional[StrictStr] = Field(default=None, alias="lastUpdatedById")
 37    created_by_email: Optional[StrictStr] = Field(default=None, alias="createdByEmail")
 38    last_updated_by_email: Optional[StrictStr] = Field(default=None, alias="lastUpdatedByEmail")
 39    error_message: Optional[StrictStr] = Field(default=None, alias="errorMessage")
 40    verification_status: Optional[StrictStr] = Field(default=None, alias="verificationStatus")
 41    __properties: ClassVar[List[str]] = ["id", "type", "name", "configDoc", "createdAt", "createdById", "lastUpdatedById", "createdByEmail", "lastUpdatedByEmail", "errorMessage", "verificationStatus"]
 42
 43    model_config = ConfigDict(
 44        populate_by_name=True,
 45        validate_assignment=True,
 46        protected_namespaces=(),
 47    )
 48
 49
 50    def to_str(self) -> str:
 51        """Returns the string representation of the model using alias"""
 52        return pprint.pformat(self.model_dump(by_alias=True))
 53
 54    def to_json(self) -> str:
 55        """Returns the JSON representation of the model using alias"""
 56        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 57        return json.dumps(self.to_dict())
 58
 59    @classmethod
 60    def from_json(cls, json_str: str) -> Optional[Self]:
 61        """Create an instance of DestinationConnector from a JSON string"""
 62        return cls.from_dict(json.loads(json_str))
 63
 64    def to_dict(self) -> Dict[str, Any]:
 65        """Return the dictionary representation of the model using alias.
 66
 67        This has the following differences from calling pydantic's
 68        `self.model_dump(by_alias=True)`:
 69
 70        * `None` is only added to the output dict for nullable fields that
 71          were set at model initialization. Other fields with value `None`
 72          are ignored.
 73        """
 74        excluded_fields: Set[str] = set([
 75        ])
 76
 77        _dict = self.model_dump(
 78            by_alias=True,
 79            exclude=excluded_fields,
 80            exclude_none=True,
 81        )
 82        # set to None if created_at (nullable) is None
 83        # and model_fields_set contains the field
 84        if self.created_at is None and "created_at" in self.model_fields_set:
 85            _dict['createdAt'] = None
 86
 87        return _dict
 88
 89    @classmethod
 90    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
 91        """Create an instance of DestinationConnector from a dict"""
 92        if obj is None:
 93            return None
 94
 95        if not isinstance(obj, dict):
 96            return cls.model_validate(obj)
 97
 98        _obj = cls.model_validate({
 99            "id": obj.get("id"),
100            "type": obj.get("type"),
101            "name": obj.get("name"),
102            "configDoc": obj.get("configDoc"),
103            "createdAt": obj.get("createdAt"),
104            "createdById": obj.get("createdById"),
105            "lastUpdatedById": obj.get("lastUpdatedById"),
106            "createdByEmail": obj.get("createdByEmail"),
107            "lastUpdatedByEmail": obj.get("lastUpdatedByEmail"),
108            "errorMessage": obj.get("errorMessage"),
109            "verificationStatus": obj.get("verificationStatus")
110        })
111        return _obj

DestinationConnector

id: typing.Annotated[str, Strict(strict=True)]
type: typing.Annotated[str, Strict(strict=True)]
name: typing.Annotated[str, Strict(strict=True)]
config_doc: Optional[Dict[str, Any]]
created_at: Optional[Annotated[str, Strict(strict=True)]]
created_by_id: Optional[Annotated[str, Strict(strict=True)]]
last_updated_by_id: Optional[Annotated[str, Strict(strict=True)]]
created_by_email: Optional[Annotated[str, Strict(strict=True)]]
last_updated_by_email: Optional[Annotated[str, Strict(strict=True)]]
error_message: Optional[Annotated[str, Strict(strict=True)]]
verification_status: Optional[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:
50    def to_str(self) -> str:
51        """Returns the string representation of the model using alias"""
52        return pprint.pformat(self.model_dump(by_alias=True))

Returns the string representation of the model using alias

def to_json(self) -> str:
54    def to_json(self) -> str:
55        """Returns the JSON representation of the model using alias"""
56        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57        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]:
59    @classmethod
60    def from_json(cls, json_str: str) -> Optional[Self]:
61        """Create an instance of DestinationConnector from a JSON string"""
62        return cls.from_dict(json.loads(json_str))

Create an instance of DestinationConnector from a JSON string

def to_dict(self) -> Dict[str, Any]:
64    def to_dict(self) -> Dict[str, Any]:
65        """Return the dictionary representation of the model using alias.
66
67        This has the following differences from calling pydantic's
68        `self.model_dump(by_alias=True)`:
69
70        * `None` is only added to the output dict for nullable fields that
71          were set at model initialization. Other fields with value `None`
72          are ignored.
73        """
74        excluded_fields: Set[str] = set([
75        ])
76
77        _dict = self.model_dump(
78            by_alias=True,
79            exclude=excluded_fields,
80            exclude_none=True,
81        )
82        # set to None if created_at (nullable) is None
83        # and model_fields_set contains the field
84        if self.created_at is None and "created_at" in self.model_fields_set:
85            _dict['createdAt'] = None
86
87        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]:
 89    @classmethod
 90    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
 91        """Create an instance of DestinationConnector from a dict"""
 92        if obj is None:
 93            return None
 94
 95        if not isinstance(obj, dict):
 96            return cls.model_validate(obj)
 97
 98        _obj = cls.model_validate({
 99            "id": obj.get("id"),
100            "type": obj.get("type"),
101            "name": obj.get("name"),
102            "configDoc": obj.get("configDoc"),
103            "createdAt": obj.get("createdAt"),
104            "createdById": obj.get("createdById"),
105            "lastUpdatedById": obj.get("lastUpdatedById"),
106            "createdByEmail": obj.get("createdByEmail"),
107            "lastUpdatedByEmail": obj.get("lastUpdatedByEmail"),
108            "errorMessage": obj.get("errorMessage"),
109            "verificationStatus": obj.get("verificationStatus")
110        })
111        return _obj

Create an instance of DestinationConnector from a dict