Skip to content

Commit e1af021

Browse files
committed
Discover email config test corrected
1 parent 0c6afcc commit e1af021

File tree

7 files changed

+33
-29
lines changed

7 files changed

+33
-29
lines changed

sdk/AsposeEmailCloudSdk/models/email_account_config.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class EmailAccountConfig(object):
4646
"""
4747
swagger_types = {
4848
'display_name': 'str',
49-
'type': 'str',
49+
'protocol_type': 'str',
5050
'host': 'str',
5151
'port': 'int',
5252
'socket_type': 'str',
@@ -57,7 +57,7 @@ class EmailAccountConfig(object):
5757

5858
attribute_map = {
5959
'display_name': 'displayName',
60-
'type': 'type',
60+
'protocol_type': 'protocolType',
6161
'host': 'host',
6262
'port': 'port',
6363
'socket_type': 'socketType',
@@ -66,11 +66,11 @@ class EmailAccountConfig(object):
6666
'is_validated': 'isValidated'
6767
}
6868

69-
def __init__(self, display_name: str = None, type: str = None, host: str = None, port: int = None, socket_type: str = None, authentication_types: List[str] = None, extra_info: List[NameValuePair] = None, is_validated: bool = None):
69+
def __init__(self, display_name: str = None, protocol_type: str = None, host: str = None, port: int = None, socket_type: str = None, authentication_types: List[str] = None, extra_info: List[NameValuePair] = None, is_validated: bool = None):
7070
"""EmailAccountConfig - a model defined in Swagger"""
7171

7272
self._display_name = None
73-
self._type = None
73+
self._protocol_type = None
7474
self._host = None
7575
self._port = None
7676
self._socket_type = None
@@ -81,8 +81,8 @@ def __init__(self, display_name: str = None, type: str = None, host: str = None,
8181

8282
if display_name is not None:
8383
self.display_name = display_name
84-
if type is not None:
85-
self.type = type
84+
if protocol_type is not None:
85+
self.protocol_type = protocol_type
8686
if host is not None:
8787
self.host = host
8888
if port is not None:
@@ -119,28 +119,28 @@ def display_name(self, display_name: str):
119119
self._display_name = display_name
120120

121121
@property
122-
def type(self) -> str:
123-
"""Gets the type of this EmailAccountConfig.
122+
def protocol_type(self) -> str:
123+
"""Gets the protocol_type of this EmailAccountConfig.
124124
125125
Type of connection protocol. Enum, available values: IMAP, POP3, SMTP, EWS, WebDav
126126
127-
:return: The type of this EmailAccountConfig.
127+
:return: The protocol_type of this EmailAccountConfig.
128128
:rtype: str
129129
"""
130-
return self._type
130+
return self._protocol_type
131131

132-
@type.setter
133-
def type(self, type: str):
134-
"""Sets the type of this EmailAccountConfig.
132+
@protocol_type.setter
133+
def protocol_type(self, protocol_type: str):
134+
"""Sets the protocol_type of this EmailAccountConfig.
135135
136136
Type of connection protocol. Enum, available values: IMAP, POP3, SMTP, EWS, WebDav
137137
138-
:param type: The type of this EmailAccountConfig.
138+
:param protocol_type: The protocol_type of this EmailAccountConfig.
139139
:type: str
140140
"""
141-
if type is None:
142-
raise ValueError("Invalid value for `type`, must not be `None`")
143-
self._type = type
141+
if protocol_type is None:
142+
raise ValueError("Invalid value for `protocol_type`, must not be `None`")
143+
self._protocol_type = protocol_type
144144

145145
@property
146146
def host(self) -> str:
@@ -190,7 +190,7 @@ def port(self, port: int):
190190
def socket_type(self) -> str:
191191
"""Gets the socket_type of this EmailAccountConfig.
192192
193-
Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
193+
Security mode for a mail client Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
194194
195195
:return: The socket_type of this EmailAccountConfig.
196196
:rtype: str
@@ -201,7 +201,7 @@ def socket_type(self) -> str:
201201
def socket_type(self, socket_type: str):
202202
"""Sets the socket_type of this EmailAccountConfig.
203203
204-
Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
204+
Security mode for a mail client Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
205205
206206
:param socket_type: The socket_type of this EmailAccountConfig.
207207
:type: str

sdk/AsposeEmailCloudSdk/models/email_account_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def login(self, login: str):
176176
def security_options(self) -> str:
177177
"""Gets the security_options of this EmailAccountRequest.
178178
179-
Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
179+
Security mode for a mail client Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
180180
181181
:return: The security_options of this EmailAccountRequest.
182182
:rtype: str
@@ -187,7 +187,7 @@ def security_options(self) -> str:
187187
def security_options(self, security_options: str):
188188
"""Sets the security_options of this EmailAccountRequest.
189189
190-
Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
190+
Security mode for a mail client Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
191191
192192
:param security_options: The security_options of this EmailAccountRequest.
193193
:type: str

sdk/AsposeEmailCloudSdk/models/name_value_pair.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434
class NameValuePair(object):
35-
"""
35+
"""An extended property.
3636
"""
3737

3838
"""
@@ -68,6 +68,7 @@ def __init__(self, value: str = None, name: str = None):
6868
def value(self) -> str:
6969
"""Gets the value of this NameValuePair.
7070
71+
Name of the property
7172
7273
:return: The value of this NameValuePair.
7374
:rtype: str
@@ -78,6 +79,7 @@ def value(self) -> str:
7879
def value(self, value: str):
7980
"""Sets the value of this NameValuePair.
8081
82+
Name of the property
8183
8284
:param value: The value of this NameValuePair.
8385
:type: str
@@ -88,6 +90,7 @@ def value(self, value: str):
8890
def name(self) -> str:
8991
"""Gets the name of this NameValuePair.
9092
93+
Value of the property
9194
9295
:return: The name of this NameValuePair.
9396
:rtype: str
@@ -98,6 +101,7 @@ def name(self) -> str:
98101
def name(self, name: str):
99102
"""Sets the name of this NameValuePair.
100103
104+
Value of the property
101105
102106
:param name: The name of this NameValuePair.
103107
:type: str

sdk/docs/EmailAccountConfig.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
Name | Type | Description | Notes
44
------------ | ------------- | ------------- | -------------
55
**display_name** | **str** | Email account display name | [optional]
6-
**type** | **str** | Type of connection protocol. Enum, available values: IMAP, POP3, SMTP, EWS, WebDav |
6+
**protocol_type** | **str** | Type of connection protocol. Enum, available values: IMAP, POP3, SMTP, EWS, WebDav |
77
**host** | **str** | Email account host. | [optional]
88
**port** | **int** | Port. | [optional]
9-
**socket_type** | **str** | Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto |
9+
**socket_type** | **str** | Security mode for a mail client Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto |
1010
**authentication_types** | **list[str]** | Supported authentication types. Items: Email account authentication types. Enum, available values: NoAuth, OAuth2, PasswordCleartext, PasswordEncrypted, SmtpAfterPop, ClientIpAddress | [optional]
1111
**extra_info** | [**list[NameValuePair]**](NameValuePair.md) | Extra account information. | [optional]
1212
**is_validated** | **bool** | Determines that configuration validated. Set to false if validation skipped. |

sdk/docs/EmailAccountRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
55
**host** | **str** | Email account host |
66
**port** | **int** | Email account port |
77
**login** | **str** | Email account login |
8-
**security_options** | **str** | Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto |
8+
**security_options** | **str** | Security mode for a mail client Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto |
99
**protocol_type** | **str** | Type of connection protocol. Enum, available values: IMAP, POP3, SMTP, EWS, WebDav |
1010
**description** | **str** | Email account description | [optional]
1111
**storage_file** | [**StorageFileLocation**](StorageFileLocation.md) | A storage file location info to store email account |

sdk/docs/NameValuePair.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
## Properties
33
Name | Type | Description | Notes
44
------------ | ------------- | ------------- | -------------
5-
**value** | **str** | | [optional]
6-
**name** | **str** | | [optional]
5+
**value** | **str** | Name of the property | [optional]
6+
**name** | **str** | Value of the property | [optional]
77

88

99

tests/tests/sdk_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ def test_ai_bcr_parse_model(td: TestData):
286286

287287
@pytest.mark.pipeline
288288
def test_discover_email_config(td: TestData):
289-
configs = td.email.discover_email_config(requests.DiscoverEmailConfigRequest('example@gmail.com'))
289+
configs = td.email.discover_email_config(requests.DiscoverEmailConfigRequest('example@gmail.com', True))
290290
assert len(configs.value) >= 2
291-
smtp = list(filter(lambda x: x.type == 'SMTP', configs.value))[0] #type: models.EmailAccountConfig
291+
smtp = list(filter(lambda x: x.protocol_type == 'SMTP', configs.value))[0] #type: models.EmailAccountConfig
292292
assert smtp.host == 'smtp.gmail.com'
293293

294294
def _create_calendar(td, start_date_param=None):

0 commit comments

Comments
 (0)