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 folder_ids: Optional[List[StrictStr]] = Field(default=None, description="Folder Names. Select which DocuSign folders to include in the import") 34 max_documents: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Max Documents. 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 their content. Example: Enter text to search within envelope content", alias="search-text") 36 __properties: ClassVar[List[str]] = ["envelope-statuses", "from-date", "to-date", "folder_ids", "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 @field_validator('folder_ids') 50 def folder_ids_validate_enum(cls, value): 51 """Validates the enum""" 52 if value is None: 53 return value 54 55 for i in value: 56 if i not in set(['inbox', 'sentitems', 'draft', 'recyclebin', 'awaiting_my_signature', 'completed', 'out_for_signature', 'waiting_for_others', 'expiring_soon', 'all']): 57 raise ValueError("each list item must be one of ('inbox', 'sentitems', 'draft', 'recyclebin', 'awaiting_my_signature', 'completed', 'out_for_signature', 'waiting_for_others', 'expiring_soon', 'all')") 58 return value 59 60 model_config = ConfigDict( 61 populate_by_name=True, 62 validate_assignment=True, 63 protected_namespaces=(), 64 ) 65 66 67 def to_str(self) -> str: 68 """Returns the string representation of the model using alias""" 69 return pprint.pformat(self.model_dump(by_alias=True)) 70 71 def to_json(self) -> str: 72 """Returns the JSON representation of the model using alias""" 73 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 74 return json.dumps(self.to_dict()) 75 76 @classmethod 77 def from_json(cls, json_str: str) -> Optional[Self]: 78 """Create an instance of DOCUSIGNConfig from a JSON string""" 79 return cls.from_dict(json.loads(json_str)) 80 81 def to_dict(self) -> Dict[str, Any]: 82 """Return the dictionary representation of the model using alias. 83 84 This has the following differences from calling pydantic's 85 `self.model_dump(by_alias=True)`: 86 87 * `None` is only added to the output dict for nullable fields that 88 were set at model initialization. Other fields with value `None` 89 are ignored. 90 """ 91 excluded_fields: Set[str] = set([ 92 ]) 93 94 _dict = self.model_dump( 95 by_alias=True, 96 exclude=excluded_fields, 97 exclude_none=True, 98 ) 99 return _dict 100 101 @classmethod 102 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 103 """Create an instance of DOCUSIGNConfig from a dict""" 104 if obj is None: 105 return None 106 107 if not isinstance(obj, dict): 108 return cls.model_validate(obj) 109 110 _obj = cls.model_validate({ 111 "envelope-statuses": obj.get("envelope-statuses"), 112 "from-date": obj.get("from-date"), 113 "to-date": obj.get("to-date"), 114 "folder_ids": obj.get("folder_ids"), 115 "max-documents": obj.get("max-documents"), 116 "search-text": obj.get("search-text") 117 }) 118 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 folder_ids: Optional[List[StrictStr]] = Field(default=None, description="Folder Names. Select which DocuSign folders to include in the import") 35 max_documents: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Max Documents. 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") 36 search_text: Optional[StrictStr] = Field(default=None, description="Search Text. Filter envelopes containing this text in their content. Example: Enter text to search within envelope content", alias="search-text") 37 __properties: ClassVar[List[str]] = ["envelope-statuses", "from-date", "to-date", "folder_ids", "max-documents", "search-text"] 38 39 @field_validator('envelope_statuses') 40 def envelope_statuses_validate_enum(cls, value): 41 """Validates the enum""" 42 if value is None: 43 return value 44 45 for i in value: 46 if i not in set(['completed', 'correct', 'created', 'declined', 'delivered', 'sent', 'signed', 'voided', 'all']): 47 raise ValueError("each list item must be one of ('completed', 'correct', 'created', 'declined', 'delivered', 'sent', 'signed', 'voided', 'all')") 48 return value 49 50 @field_validator('folder_ids') 51 def folder_ids_validate_enum(cls, value): 52 """Validates the enum""" 53 if value is None: 54 return value 55 56 for i in value: 57 if i not in set(['inbox', 'sentitems', 'draft', 'recyclebin', 'awaiting_my_signature', 'completed', 'out_for_signature', 'waiting_for_others', 'expiring_soon', 'all']): 58 raise ValueError("each list item must be one of ('inbox', 'sentitems', 'draft', 'recyclebin', 'awaiting_my_signature', 'completed', 'out_for_signature', 'waiting_for_others', 'expiring_soon', 'all')") 59 return value 60 61 model_config = ConfigDict( 62 populate_by_name=True, 63 validate_assignment=True, 64 protected_namespaces=(), 65 ) 66 67 68 def to_str(self) -> str: 69 """Returns the string representation of the model using alias""" 70 return pprint.pformat(self.model_dump(by_alias=True)) 71 72 def to_json(self) -> str: 73 """Returns the JSON representation of the model using alias""" 74 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 75 return json.dumps(self.to_dict()) 76 77 @classmethod 78 def from_json(cls, json_str: str) -> Optional[Self]: 79 """Create an instance of DOCUSIGNConfig from a JSON string""" 80 return cls.from_dict(json.loads(json_str)) 81 82 def to_dict(self) -> Dict[str, Any]: 83 """Return the dictionary representation of the model using alias. 84 85 This has the following differences from calling pydantic's 86 `self.model_dump(by_alias=True)`: 87 88 * `None` is only added to the output dict for nullable fields that 89 were set at model initialization. Other fields with value `None` 90 are ignored. 91 """ 92 excluded_fields: Set[str] = set([ 93 ]) 94 95 _dict = self.model_dump( 96 by_alias=True, 97 exclude=excluded_fields, 98 exclude_none=True, 99 ) 100 return _dict 101 102 @classmethod 103 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 104 """Create an instance of DOCUSIGNConfig from a dict""" 105 if obj is None: 106 return None 107 108 if not isinstance(obj, dict): 109 return cls.model_validate(obj) 110 111 _obj = cls.model_validate({ 112 "envelope-statuses": obj.get("envelope-statuses"), 113 "from-date": obj.get("from-date"), 114 "to-date": obj.get("to-date"), 115 "folder_ids": obj.get("folder_ids"), 116 "max-documents": obj.get("max-documents"), 117 "search-text": obj.get("search-text") 118 }) 119 return _obj
Configuration for DocuSign connector
max_documents: Union[Annotated[float, Strict(strict=True)], Annotated[int, Strict(strict=True)], NoneType]
@field_validator('envelope_statuses')
def
envelope_statuses_validate_enum(cls, value):
39 @field_validator('envelope_statuses') 40 def envelope_statuses_validate_enum(cls, value): 41 """Validates the enum""" 42 if value is None: 43 return value 44 45 for i in value: 46 if i not in set(['completed', 'correct', 'created', 'declined', 'delivered', 'sent', 'signed', 'voided', 'all']): 47 raise ValueError("each list item must be one of ('completed', 'correct', 'created', 'declined', 'delivered', 'sent', 'signed', 'voided', 'all')") 48 return value
Validates the enum
@field_validator('folder_ids')
def
folder_ids_validate_enum(cls, value):
50 @field_validator('folder_ids') 51 def folder_ids_validate_enum(cls, value): 52 """Validates the enum""" 53 if value is None: 54 return value 55 56 for i in value: 57 if i not in set(['inbox', 'sentitems', 'draft', 'recyclebin', 'awaiting_my_signature', 'completed', 'out_for_signature', 'waiting_for_others', 'expiring_soon', 'all']): 58 raise ValueError("each list item must be one of ('inbox', 'sentitems', 'draft', 'recyclebin', 'awaiting_my_signature', 'completed', 'out_for_signature', 'waiting_for_others', 'expiring_soon', 'all')") 59 return value
Validates the enum
model_config =
{'populate_by_name': True, 'validate_assignment': True, 'protected_namespaces': (), 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict
][pydantic.config.ConfigDict].
def
to_str(self) -> str:
68 def to_str(self) -> str: 69 """Returns the string representation of the model using alias""" 70 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
def
to_json(self) -> str:
72 def to_json(self) -> str: 73 """Returns the JSON representation of the model using alias""" 74 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 75 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]:
77 @classmethod 78 def from_json(cls, json_str: str) -> Optional[Self]: 79 """Create an instance of DOCUSIGNConfig from a JSON string""" 80 return cls.from_dict(json.loads(json_str))
Create an instance of DOCUSIGNConfig from a JSON string
def
to_dict(self) -> Dict[str, Any]:
82 def to_dict(self) -> Dict[str, Any]: 83 """Return the dictionary representation of the model using alias. 84 85 This has the following differences from calling pydantic's 86 `self.model_dump(by_alias=True)`: 87 88 * `None` is only added to the output dict for nullable fields that 89 were set at model initialization. Other fields with value `None` 90 are ignored. 91 """ 92 excluded_fields: Set[str] = set([ 93 ]) 94 95 _dict = self.model_dump( 96 by_alias=True, 97 exclude=excluded_fields, 98 exclude_none=True, 99 ) 100 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 valueNone
are ignored.
@classmethod
def
from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
102 @classmethod 103 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 104 """Create an instance of DOCUSIGNConfig from a dict""" 105 if obj is None: 106 return None 107 108 if not isinstance(obj, dict): 109 return cls.model_validate(obj) 110 111 _obj = cls.model_validate({ 112 "envelope-statuses": obj.get("envelope-statuses"), 113 "from-date": obj.get("from-date"), 114 "to-date": obj.get("to-date"), 115 "folder_ids": obj.get("folder_ids"), 116 "max-documents": obj.get("max-documents"), 117 "search-text": obj.get("search-text") 118 }) 119 return _obj
Create an instance of DOCUSIGNConfig from a dict