vectorize_client.models.docusign_config

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 pprint
 17import re  # noqa: F401
 18import json
 19
 20from datetime import date
 21from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
 22from typing import Any, ClassVar, Dict, List, Optional, Union
 23from typing import Optional, Set
 24from typing_extensions import Self
 25
 26class DOCUSIGNConfig(BaseModel):
 27    """
 28    Configuration for DocuSign connector
 29    """ # noqa: E501
 30    envelope_statuses: Optional[List[StrictStr]] = Field(default=None, description="Envelope Statuses. Filter envelopes by status", alias="envelope-statuses")
 31    from_date: date = Field(description="Created From Date. Include envelopes created on or after this date. Example: Enter start date (YYYY-MM-DD)", alias="from-date")
 32    to_date: Optional[date] = Field(default=None, description="Created To Date. Include envelopes that were last updated up to this date. Example: Enter end date (YYYY-MM-DD)", alias="to-date")
 33    max_documents: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Max Envelopes. Leave blank for no limit, or specify a maximum number. Example: Enter maximum number of documents to retrieve (leave blank for no limit)", alias="max-documents")
 34    search_text: Optional[StrictStr] = Field(default=None, description="Search Text. Filter envelopes containing this text in the email subject, sender, body, or custom fields. Example: Enter text to search within envelope content", alias="search-text")
 35    __properties: ClassVar[List[str]] = ["envelope-statuses", "from-date", "to-date", "max-documents", "search-text"]
 36
 37    @field_validator('envelope_statuses')
 38    def envelope_statuses_validate_enum(cls, value):
 39        """Validates the enum"""
 40        if value is None:
 41            return value
 42
 43        for i in value:
 44            if i not in set(['completed', 'correct', 'created', 'declined', 'delivered', 'sent', 'signed', 'voided', 'all']):
 45                raise ValueError("each list item must be one of ('completed', 'correct', 'created', 'declined', 'delivered', 'sent', 'signed', 'voided', 'all')")
 46        return value
 47
 48    model_config = ConfigDict(
 49        populate_by_name=True,
 50        validate_assignment=True,
 51        protected_namespaces=(),
 52    )
 53
 54
 55    def to_str(self) -> str:
 56        """Returns the string representation of the model using alias"""
 57        return pprint.pformat(self.model_dump(by_alias=True))
 58
 59    def to_json(self) -> str:
 60        """Returns the JSON representation of the model using alias"""
 61        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 62        return json.dumps(self.to_dict())
 63
 64    @classmethod
 65    def from_json(cls, json_str: str) -> Optional[Self]:
 66        """Create an instance of DOCUSIGNConfig from a JSON string"""
 67        return cls.from_dict(json.loads(json_str))
 68
 69    def to_dict(self) -> Dict[str, Any]:
 70        """Return the dictionary representation of the model using alias.
 71
 72        This has the following differences from calling pydantic's
 73        `self.model_dump(by_alias=True)`:
 74
 75        * `None` is only added to the output dict for nullable fields that
 76          were set at model initialization. Other fields with value `None`
 77          are ignored.
 78        """
 79        excluded_fields: Set[str] = set([
 80        ])
 81
 82        _dict = self.model_dump(
 83            by_alias=True,
 84            exclude=excluded_fields,
 85            exclude_none=True,
 86        )
 87        return _dict
 88
 89    @classmethod
 90    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
 91        """Create an instance of DOCUSIGNConfig 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            "envelope-statuses": obj.get("envelope-statuses"),
100            "from-date": obj.get("from-date"),
101            "to-date": obj.get("to-date"),
102            "max-documents": obj.get("max-documents"),
103            "search-text": obj.get("search-text")
104        })
105        return _obj
class DOCUSIGNConfig(pydantic.main.BaseModel):
 27class DOCUSIGNConfig(BaseModel):
 28    """
 29    Configuration for DocuSign connector
 30    """ # noqa: E501
 31    envelope_statuses: Optional[List[StrictStr]] = Field(default=None, description="Envelope Statuses. Filter envelopes by status", alias="envelope-statuses")
 32    from_date: date = Field(description="Created From Date. Include envelopes created on or after this date. Example: Enter start date (YYYY-MM-DD)", alias="from-date")
 33    to_date: Optional[date] = Field(default=None, description="Created To Date. Include envelopes that were last updated up to this date. Example: Enter end date (YYYY-MM-DD)", alias="to-date")
 34    max_documents: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Max Envelopes. Leave blank for no limit, or specify a maximum number. Example: Enter maximum number of documents to retrieve (leave blank for no limit)", alias="max-documents")
 35    search_text: Optional[StrictStr] = Field(default=None, description="Search Text. Filter envelopes containing this text in the email subject, sender, body, or custom fields. Example: Enter text to search within envelope content", alias="search-text")
 36    __properties: ClassVar[List[str]] = ["envelope-statuses", "from-date", "to-date", "max-documents", "search-text"]
 37
 38    @field_validator('envelope_statuses')
 39    def envelope_statuses_validate_enum(cls, value):
 40        """Validates the enum"""
 41        if value is None:
 42            return value
 43
 44        for i in value:
 45            if i not in set(['completed', 'correct', 'created', 'declined', 'delivered', 'sent', 'signed', 'voided', 'all']):
 46                raise ValueError("each list item must be one of ('completed', 'correct', 'created', 'declined', 'delivered', 'sent', 'signed', 'voided', 'all')")
 47        return value
 48
 49    model_config = ConfigDict(
 50        populate_by_name=True,
 51        validate_assignment=True,
 52        protected_namespaces=(),
 53    )
 54
 55
 56    def to_str(self) -> str:
 57        """Returns the string representation of the model using alias"""
 58        return pprint.pformat(self.model_dump(by_alias=True))
 59
 60    def to_json(self) -> str:
 61        """Returns the JSON representation of the model using alias"""
 62        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 63        return json.dumps(self.to_dict())
 64
 65    @classmethod
 66    def from_json(cls, json_str: str) -> Optional[Self]:
 67        """Create an instance of DOCUSIGNConfig from a JSON string"""
 68        return cls.from_dict(json.loads(json_str))
 69
 70    def to_dict(self) -> Dict[str, Any]:
 71        """Return the dictionary representation of the model using alias.
 72
 73        This has the following differences from calling pydantic's
 74        `self.model_dump(by_alias=True)`:
 75
 76        * `None` is only added to the output dict for nullable fields that
 77          were set at model initialization. Other fields with value `None`
 78          are ignored.
 79        """
 80        excluded_fields: Set[str] = set([
 81        ])
 82
 83        _dict = self.model_dump(
 84            by_alias=True,
 85            exclude=excluded_fields,
 86            exclude_none=True,
 87        )
 88        return _dict
 89
 90    @classmethod
 91    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
 92        """Create an instance of DOCUSIGNConfig from a dict"""
 93        if obj is None:
 94            return None
 95
 96        if not isinstance(obj, dict):
 97            return cls.model_validate(obj)
 98
 99        _obj = cls.model_validate({
100            "envelope-statuses": obj.get("envelope-statuses"),
101            "from-date": obj.get("from-date"),
102            "to-date": obj.get("to-date"),
103            "max-documents": obj.get("max-documents"),
104            "search-text": obj.get("search-text")
105        })
106        return _obj

Configuration for DocuSign connector

envelope_statuses: Optional[List[Annotated[str, Strict(strict=True)]]]
from_date: datetime.date
to_date: Optional[datetime.date]
max_documents: Union[Annotated[float, Strict(strict=True)], Annotated[int, Strict(strict=True)], NoneType]
search_text: Optional[Annotated[str, Strict(strict=True)]]
@field_validator('envelope_statuses')
def envelope_statuses_validate_enum(cls, value):
38    @field_validator('envelope_statuses')
39    def envelope_statuses_validate_enum(cls, value):
40        """Validates the enum"""
41        if value is None:
42            return value
43
44        for i in value:
45            if i not in set(['completed', 'correct', 'created', 'declined', 'delivered', 'sent', 'signed', 'voided', 'all']):
46                raise ValueError("each list item must be one of ('completed', 'correct', 'created', 'declined', 'delivered', 'sent', 'signed', 'voided', 'all')")
47        return value

Validates the enum

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:
56    def to_str(self) -> str:
57        """Returns the string representation of the model using alias"""
58        return pprint.pformat(self.model_dump(by_alias=True))

Returns the string representation of the model using alias

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

Create an instance of DOCUSIGNConfig from a JSON string

def to_dict(self) -> Dict[str, Any]:
70    def to_dict(self) -> Dict[str, Any]:
71        """Return the dictionary representation of the model using alias.
72
73        This has the following differences from calling pydantic's
74        `self.model_dump(by_alias=True)`:
75
76        * `None` is only added to the output dict for nullable fields that
77          were set at model initialization. Other fields with value `None`
78          are ignored.
79        """
80        excluded_fields: Set[str] = set([
81        ])
82
83        _dict = self.model_dump(
84            by_alias=True,
85            exclude=excluded_fields,
86            exclude_none=True,
87        )
88        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]:
 90    @classmethod
 91    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
 92        """Create an instance of DOCUSIGNConfig from a dict"""
 93        if obj is None:
 94            return None
 95
 96        if not isinstance(obj, dict):
 97            return cls.model_validate(obj)
 98
 99        _obj = cls.model_validate({
100            "envelope-statuses": obj.get("envelope-statuses"),
101            "from-date": obj.get("from-date"),
102            "to-date": obj.get("to-date"),
103            "max-documents": obj.get("max-documents"),
104            "search-text": obj.get("search-text")
105        })
106        return _obj

Create an instance of DOCUSIGNConfig from a dict