hostinger-mail-api 1.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hostinger_mail_api/__init__.py +76 -0
- hostinger_mail_api/api/__init__.py +10 -0
- hostinger_mail_api/api/account_api.py +284 -0
- hostinger_mail_api/api/folders_api.py +1271 -0
- hostinger_mail_api/api/messages_api.py +4237 -0
- hostinger_mail_api/api/quota_api.py +304 -0
- hostinger_mail_api/api/send_api.py +336 -0
- hostinger_mail_api/api/webhooks_api.py +2154 -0
- hostinger_mail_api/api_client.py +795 -0
- hostinger_mail_api/api_response.py +21 -0
- hostinger_mail_api/configuration.py +579 -0
- hostinger_mail_api/exceptions.py +214 -0
- hostinger_mail_api/models/__init__.py +54 -0
- hostinger_mail_api/models/error.py +89 -0
- hostinger_mail_api/models/pagination.py +91 -0
- hostinger_mail_api/models/v1_folder_messages_collection.py +99 -0
- hostinger_mail_api/models/v1_folder_messages_delete_bulk_request.py +86 -0
- hostinger_mail_api/models/v1_folder_messages_flags_bulk_request.py +90 -0
- hostinger_mail_api/models/v1_folder_messages_flags_request.py +88 -0
- hostinger_mail_api/models/v1_folder_messages_message.py +165 -0
- hostinger_mail_api/models/v1_folder_messages_message_address.py +87 -0
- hostinger_mail_api/models/v1_folder_messages_message_attachment.py +105 -0
- hostinger_mail_api/models/v1_folder_messages_message_text.py +87 -0
- hostinger_mail_api/models/v1_folder_messages_message_text_resource.py +89 -0
- hostinger_mail_api/models/v1_folder_messages_move_bulk_request.py +88 -0
- hostinger_mail_api/models/v1_folder_messages_move_request.py +86 -0
- hostinger_mail_api/models/v1_folder_messages_resource.py +89 -0
- hostinger_mail_api/models/v1_folder_messages_search_request.py +111 -0
- hostinger_mail_api/models/v1_folder_messages_update_flags_result.py +89 -0
- hostinger_mail_api/models/v1_folder_messages_update_flags_result_data.py +95 -0
- hostinger_mail_api/models/v1_folder_messages_update_flags_result_data_failed_inner.py +87 -0
- hostinger_mail_api/models/v1_folders_collection.py +99 -0
- hostinger_mail_api/models/v1_folders_create_request.py +86 -0
- hostinger_mail_api/models/v1_folders_folder.py +100 -0
- hostinger_mail_api/models/v1_folders_resource.py +89 -0
- hostinger_mail_api/models/v1_folders_update_request.py +86 -0
- hostinger_mail_api/models/v1_me_mailbox.py +95 -0
- hostinger_mail_api/models/v1_me_resource.py +89 -0
- hostinger_mail_api/models/v1_me_resource_data.py +103 -0
- hostinger_mail_api/models/v1_quota_quota.py +101 -0
- hostinger_mail_api/models/v1_quota_quota_resource.py +91 -0
- hostinger_mail_api/models/v1_quota_resource.py +89 -0
- hostinger_mail_api/models/v1_send_attachment.py +93 -0
- hostinger_mail_api/models/v1_send_request.py +92 -0
- hostinger_mail_api/models/v1_webhooks_collection.py +99 -0
- hostinger_mail_api/models/v1_webhooks_create_request.py +117 -0
- hostinger_mail_api/models/v1_webhooks_resource.py +89 -0
- hostinger_mail_api/models/v1_webhooks_resource_with_secret.py +89 -0
- hostinger_mail_api/models/v1_webhooks_test_result.py +89 -0
- hostinger_mail_api/models/v1_webhooks_test_result_data.py +94 -0
- hostinger_mail_api/models/v1_webhooks_update_request.py +120 -0
- hostinger_mail_api/models/v1_webhooks_webhook.py +132 -0
- hostinger_mail_api/models/v1_webhooks_webhook_with_secret.py +134 -0
- hostinger_mail_api/py.typed +0 -0
- hostinger_mail_api/rest.py +256 -0
- hostinger_mail_api-1.0.3.dist-info/METADATA +180 -0
- hostinger_mail_api-1.0.3.dist-info/RECORD +59 -0
- hostinger_mail_api-1.0.3.dist-info/WHEEL +5 -0
- hostinger_mail_api-1.0.3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Hostinger Email API Python SDK
|
|
5
|
+
|
|
6
|
+
API Version: 1.0.0
|
|
7
|
+
|
|
8
|
+
NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
|
+
If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
10
|
+
""" # noqa: E501
|
|
11
|
+
|
|
12
|
+
import warnings
|
|
13
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
14
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
15
|
+
from typing_extensions import Annotated
|
|
16
|
+
|
|
17
|
+
from pydantic import Field, StrictStr
|
|
18
|
+
from typing_extensions import Annotated
|
|
19
|
+
from hostinger_mail_api.models.v1_quota_resource import V1QuotaResource
|
|
20
|
+
|
|
21
|
+
from hostinger_mail_api.api_client import ApiClient, RequestSerialized
|
|
22
|
+
from hostinger_mail_api.api_response import ApiResponse
|
|
23
|
+
from hostinger_mail_api.rest import RESTResponseType
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class QuotaApi:
|
|
27
|
+
|
|
28
|
+
def __init__(self, api_client=None) -> None:
|
|
29
|
+
if api_client is None:
|
|
30
|
+
api_client = ApiClient.get_default()
|
|
31
|
+
self.api_client = api_client
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@validate_call
|
|
35
|
+
def get_quota(
|
|
36
|
+
self,
|
|
37
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
38
|
+
_request_timeout: Union[
|
|
39
|
+
None,
|
|
40
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
41
|
+
Tuple[
|
|
42
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
43
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
44
|
+
]
|
|
45
|
+
] = None,
|
|
46
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
47
|
+
_content_type: Optional[StrictStr] = None,
|
|
48
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
49
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
50
|
+
) -> V1QuotaResource:
|
|
51
|
+
"""Get mailbox quota
|
|
52
|
+
|
|
53
|
+
Retrieve storage and message quota usage for the managed mailbox.
|
|
54
|
+
|
|
55
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
56
|
+
:type mailbox_resource_id: str
|
|
57
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
58
|
+
number provided, it will be total request
|
|
59
|
+
timeout. It can also be a pair (tuple) of
|
|
60
|
+
(connection, read) timeouts.
|
|
61
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
62
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
63
|
+
request; this effectively ignores the
|
|
64
|
+
authentication in the spec for a single request.
|
|
65
|
+
:type _request_auth: dict, optional
|
|
66
|
+
:param _content_type: force content-type for the request.
|
|
67
|
+
:type _content_type: str, Optional
|
|
68
|
+
:param _headers: set to override the headers for a single
|
|
69
|
+
request; this effectively ignores the headers
|
|
70
|
+
in the spec for a single request.
|
|
71
|
+
:type _headers: dict, optional
|
|
72
|
+
:param _host_index: set to override the host_index for a single
|
|
73
|
+
request; this effectively ignores the host_index
|
|
74
|
+
in the spec for a single request.
|
|
75
|
+
:type _host_index: int, optional
|
|
76
|
+
:return: Returns the result object.
|
|
77
|
+
""" # noqa: E501
|
|
78
|
+
|
|
79
|
+
_param = self._get_quota_serialize(
|
|
80
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
81
|
+
_request_auth=_request_auth,
|
|
82
|
+
_content_type=_content_type,
|
|
83
|
+
_headers=_headers,
|
|
84
|
+
_host_index=_host_index
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
88
|
+
'200': "V1QuotaResource",
|
|
89
|
+
'401': "Error",
|
|
90
|
+
'403': "Error",
|
|
91
|
+
'500': "Error",
|
|
92
|
+
'502': "Error",
|
|
93
|
+
}
|
|
94
|
+
response_data = self.api_client.call_api(
|
|
95
|
+
*_param,
|
|
96
|
+
_request_timeout=_request_timeout
|
|
97
|
+
)
|
|
98
|
+
response_data.read()
|
|
99
|
+
return self.api_client.response_deserialize(
|
|
100
|
+
response_data=response_data,
|
|
101
|
+
response_types_map=_response_types_map,
|
|
102
|
+
).data
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@validate_call
|
|
106
|
+
def get_quota_with_http_info(
|
|
107
|
+
self,
|
|
108
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
109
|
+
_request_timeout: Union[
|
|
110
|
+
None,
|
|
111
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
112
|
+
Tuple[
|
|
113
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
114
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
115
|
+
]
|
|
116
|
+
] = None,
|
|
117
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
118
|
+
_content_type: Optional[StrictStr] = None,
|
|
119
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
120
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
121
|
+
) -> ApiResponse[V1QuotaResource]:
|
|
122
|
+
"""Get mailbox quota
|
|
123
|
+
|
|
124
|
+
Retrieve storage and message quota usage for the managed mailbox.
|
|
125
|
+
|
|
126
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
127
|
+
:type mailbox_resource_id: str
|
|
128
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
129
|
+
number provided, it will be total request
|
|
130
|
+
timeout. It can also be a pair (tuple) of
|
|
131
|
+
(connection, read) timeouts.
|
|
132
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
133
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
134
|
+
request; this effectively ignores the
|
|
135
|
+
authentication in the spec for a single request.
|
|
136
|
+
:type _request_auth: dict, optional
|
|
137
|
+
:param _content_type: force content-type for the request.
|
|
138
|
+
:type _content_type: str, Optional
|
|
139
|
+
:param _headers: set to override the headers for a single
|
|
140
|
+
request; this effectively ignores the headers
|
|
141
|
+
in the spec for a single request.
|
|
142
|
+
:type _headers: dict, optional
|
|
143
|
+
:param _host_index: set to override the host_index for a single
|
|
144
|
+
request; this effectively ignores the host_index
|
|
145
|
+
in the spec for a single request.
|
|
146
|
+
:type _host_index: int, optional
|
|
147
|
+
:return: Returns the result object.
|
|
148
|
+
""" # noqa: E501
|
|
149
|
+
|
|
150
|
+
_param = self._get_quota_serialize(
|
|
151
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
152
|
+
_request_auth=_request_auth,
|
|
153
|
+
_content_type=_content_type,
|
|
154
|
+
_headers=_headers,
|
|
155
|
+
_host_index=_host_index
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
159
|
+
'200': "V1QuotaResource",
|
|
160
|
+
'401': "Error",
|
|
161
|
+
'403': "Error",
|
|
162
|
+
'500': "Error",
|
|
163
|
+
'502': "Error",
|
|
164
|
+
}
|
|
165
|
+
response_data = self.api_client.call_api(
|
|
166
|
+
*_param,
|
|
167
|
+
_request_timeout=_request_timeout
|
|
168
|
+
)
|
|
169
|
+
response_data.read()
|
|
170
|
+
return self.api_client.response_deserialize(
|
|
171
|
+
response_data=response_data,
|
|
172
|
+
response_types_map=_response_types_map,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
@validate_call
|
|
177
|
+
def get_quota_without_preload_content(
|
|
178
|
+
self,
|
|
179
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
180
|
+
_request_timeout: Union[
|
|
181
|
+
None,
|
|
182
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
183
|
+
Tuple[
|
|
184
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
185
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
186
|
+
]
|
|
187
|
+
] = None,
|
|
188
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
189
|
+
_content_type: Optional[StrictStr] = None,
|
|
190
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
191
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
192
|
+
) -> RESTResponseType:
|
|
193
|
+
"""Get mailbox quota
|
|
194
|
+
|
|
195
|
+
Retrieve storage and message quota usage for the managed mailbox.
|
|
196
|
+
|
|
197
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
198
|
+
:type mailbox_resource_id: str
|
|
199
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
200
|
+
number provided, it will be total request
|
|
201
|
+
timeout. It can also be a pair (tuple) of
|
|
202
|
+
(connection, read) timeouts.
|
|
203
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
204
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
205
|
+
request; this effectively ignores the
|
|
206
|
+
authentication in the spec for a single request.
|
|
207
|
+
:type _request_auth: dict, optional
|
|
208
|
+
:param _content_type: force content-type for the request.
|
|
209
|
+
:type _content_type: str, Optional
|
|
210
|
+
:param _headers: set to override the headers for a single
|
|
211
|
+
request; this effectively ignores the headers
|
|
212
|
+
in the spec for a single request.
|
|
213
|
+
:type _headers: dict, optional
|
|
214
|
+
:param _host_index: set to override the host_index for a single
|
|
215
|
+
request; this effectively ignores the host_index
|
|
216
|
+
in the spec for a single request.
|
|
217
|
+
:type _host_index: int, optional
|
|
218
|
+
:return: Returns the result object.
|
|
219
|
+
""" # noqa: E501
|
|
220
|
+
|
|
221
|
+
_param = self._get_quota_serialize(
|
|
222
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
223
|
+
_request_auth=_request_auth,
|
|
224
|
+
_content_type=_content_type,
|
|
225
|
+
_headers=_headers,
|
|
226
|
+
_host_index=_host_index
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
230
|
+
'200': "V1QuotaResource",
|
|
231
|
+
'401': "Error",
|
|
232
|
+
'403': "Error",
|
|
233
|
+
'500': "Error",
|
|
234
|
+
'502': "Error",
|
|
235
|
+
}
|
|
236
|
+
response_data = self.api_client.call_api(
|
|
237
|
+
*_param,
|
|
238
|
+
_request_timeout=_request_timeout
|
|
239
|
+
)
|
|
240
|
+
return response_data.response
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def _get_quota_serialize(
|
|
244
|
+
self,
|
|
245
|
+
mailbox_resource_id,
|
|
246
|
+
_request_auth,
|
|
247
|
+
_content_type,
|
|
248
|
+
_headers,
|
|
249
|
+
_host_index,
|
|
250
|
+
) -> RequestSerialized:
|
|
251
|
+
|
|
252
|
+
_host = None
|
|
253
|
+
|
|
254
|
+
_collection_formats: Dict[str, str] = {
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
_path_params: Dict[str, str] = {}
|
|
258
|
+
_query_params: List[Tuple[str, str]] = []
|
|
259
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
260
|
+
_form_params: List[Tuple[str, str]] = []
|
|
261
|
+
_files: Dict[
|
|
262
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
263
|
+
] = {}
|
|
264
|
+
_body_params: Optional[bytes] = None
|
|
265
|
+
|
|
266
|
+
# process the path parameters
|
|
267
|
+
if mailbox_resource_id is not None:
|
|
268
|
+
_path_params['mailboxResourceId'] = mailbox_resource_id
|
|
269
|
+
# process the query parameters
|
|
270
|
+
# process the header parameters
|
|
271
|
+
# process the form parameters
|
|
272
|
+
# process the body parameter
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
# set the HTTP header `Accept`
|
|
276
|
+
if 'Accept' not in _header_params:
|
|
277
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
278
|
+
[
|
|
279
|
+
'application/json'
|
|
280
|
+
]
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
# authentication setting
|
|
285
|
+
_auth_settings: List[str] = [
|
|
286
|
+
'BearerAuth'
|
|
287
|
+
]
|
|
288
|
+
|
|
289
|
+
return self.api_client.param_serialize(
|
|
290
|
+
method='GET',
|
|
291
|
+
resource_path='/api/v1/mailboxes/{mailboxResourceId}/quota',
|
|
292
|
+
path_params=_path_params,
|
|
293
|
+
query_params=_query_params,
|
|
294
|
+
header_params=_header_params,
|
|
295
|
+
body=_body_params,
|
|
296
|
+
post_params=_form_params,
|
|
297
|
+
files=_files,
|
|
298
|
+
auth_settings=_auth_settings,
|
|
299
|
+
collection_formats=_collection_formats,
|
|
300
|
+
_host=_host,
|
|
301
|
+
_request_auth=_request_auth
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Hostinger Email API Python SDK
|
|
5
|
+
|
|
6
|
+
API Version: 1.0.0
|
|
7
|
+
|
|
8
|
+
NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
|
+
If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
10
|
+
""" # noqa: E501
|
|
11
|
+
|
|
12
|
+
import warnings
|
|
13
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
14
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
15
|
+
from typing_extensions import Annotated
|
|
16
|
+
|
|
17
|
+
from pydantic import Field, StrictStr
|
|
18
|
+
from typing import Optional
|
|
19
|
+
from typing_extensions import Annotated
|
|
20
|
+
from hostinger_mail_api.models.v1_send_request import V1SendRequest
|
|
21
|
+
|
|
22
|
+
from hostinger_mail_api.api_client import ApiClient, RequestSerialized
|
|
23
|
+
from hostinger_mail_api.api_response import ApiResponse
|
|
24
|
+
from hostinger_mail_api.rest import RESTResponseType
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class SendApi:
|
|
28
|
+
|
|
29
|
+
def __init__(self, api_client=None) -> None:
|
|
30
|
+
if api_client is None:
|
|
31
|
+
api_client = ApiClient.get_default()
|
|
32
|
+
self.api_client = api_client
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@validate_call
|
|
36
|
+
def send_email(
|
|
37
|
+
self,
|
|
38
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
39
|
+
v1_send_request: Optional[V1SendRequest],
|
|
40
|
+
_request_timeout: Union[
|
|
41
|
+
None,
|
|
42
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
43
|
+
Tuple[
|
|
44
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
45
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
46
|
+
]
|
|
47
|
+
] = None,
|
|
48
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
49
|
+
_content_type: Optional[StrictStr] = None,
|
|
50
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
51
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
52
|
+
) -> None:
|
|
53
|
+
"""Send email
|
|
54
|
+
|
|
55
|
+
Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
|
|
56
|
+
|
|
57
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
58
|
+
:type mailbox_resource_id: str
|
|
59
|
+
:param v1_send_request: (required)
|
|
60
|
+
:type v1_send_request: V1SendRequest
|
|
61
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
62
|
+
number provided, it will be total request
|
|
63
|
+
timeout. It can also be a pair (tuple) of
|
|
64
|
+
(connection, read) timeouts.
|
|
65
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
66
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
67
|
+
request; this effectively ignores the
|
|
68
|
+
authentication in the spec for a single request.
|
|
69
|
+
:type _request_auth: dict, optional
|
|
70
|
+
:param _content_type: force content-type for the request.
|
|
71
|
+
:type _content_type: str, Optional
|
|
72
|
+
:param _headers: set to override the headers for a single
|
|
73
|
+
request; this effectively ignores the headers
|
|
74
|
+
in the spec for a single request.
|
|
75
|
+
:type _headers: dict, optional
|
|
76
|
+
:param _host_index: set to override the host_index for a single
|
|
77
|
+
request; this effectively ignores the host_index
|
|
78
|
+
in the spec for a single request.
|
|
79
|
+
:type _host_index: int, optional
|
|
80
|
+
:return: Returns the result object.
|
|
81
|
+
""" # noqa: E501
|
|
82
|
+
|
|
83
|
+
_param = self._send_email_serialize(
|
|
84
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
85
|
+
v1_send_request=v1_send_request,
|
|
86
|
+
_request_auth=_request_auth,
|
|
87
|
+
_content_type=_content_type,
|
|
88
|
+
_headers=_headers,
|
|
89
|
+
_host_index=_host_index
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
93
|
+
'204': None,
|
|
94
|
+
'401': "Error",
|
|
95
|
+
'403': "Error",
|
|
96
|
+
'422': "Error",
|
|
97
|
+
'500': "Error",
|
|
98
|
+
'502': "Error",
|
|
99
|
+
}
|
|
100
|
+
response_data = self.api_client.call_api(
|
|
101
|
+
*_param,
|
|
102
|
+
_request_timeout=_request_timeout
|
|
103
|
+
)
|
|
104
|
+
response_data.read()
|
|
105
|
+
return self.api_client.response_deserialize(
|
|
106
|
+
response_data=response_data,
|
|
107
|
+
response_types_map=_response_types_map,
|
|
108
|
+
).data
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
@validate_call
|
|
112
|
+
def send_email_with_http_info(
|
|
113
|
+
self,
|
|
114
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
115
|
+
v1_send_request: Optional[V1SendRequest],
|
|
116
|
+
_request_timeout: Union[
|
|
117
|
+
None,
|
|
118
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
119
|
+
Tuple[
|
|
120
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
121
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
122
|
+
]
|
|
123
|
+
] = None,
|
|
124
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
125
|
+
_content_type: Optional[StrictStr] = None,
|
|
126
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
127
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
128
|
+
) -> ApiResponse[None]:
|
|
129
|
+
"""Send email
|
|
130
|
+
|
|
131
|
+
Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
|
|
132
|
+
|
|
133
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
134
|
+
:type mailbox_resource_id: str
|
|
135
|
+
:param v1_send_request: (required)
|
|
136
|
+
:type v1_send_request: V1SendRequest
|
|
137
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
138
|
+
number provided, it will be total request
|
|
139
|
+
timeout. It can also be a pair (tuple) of
|
|
140
|
+
(connection, read) timeouts.
|
|
141
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
142
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
143
|
+
request; this effectively ignores the
|
|
144
|
+
authentication in the spec for a single request.
|
|
145
|
+
:type _request_auth: dict, optional
|
|
146
|
+
:param _content_type: force content-type for the request.
|
|
147
|
+
:type _content_type: str, Optional
|
|
148
|
+
:param _headers: set to override the headers for a single
|
|
149
|
+
request; this effectively ignores the headers
|
|
150
|
+
in the spec for a single request.
|
|
151
|
+
:type _headers: dict, optional
|
|
152
|
+
:param _host_index: set to override the host_index for a single
|
|
153
|
+
request; this effectively ignores the host_index
|
|
154
|
+
in the spec for a single request.
|
|
155
|
+
:type _host_index: int, optional
|
|
156
|
+
:return: Returns the result object.
|
|
157
|
+
""" # noqa: E501
|
|
158
|
+
|
|
159
|
+
_param = self._send_email_serialize(
|
|
160
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
161
|
+
v1_send_request=v1_send_request,
|
|
162
|
+
_request_auth=_request_auth,
|
|
163
|
+
_content_type=_content_type,
|
|
164
|
+
_headers=_headers,
|
|
165
|
+
_host_index=_host_index
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
169
|
+
'204': None,
|
|
170
|
+
'401': "Error",
|
|
171
|
+
'403': "Error",
|
|
172
|
+
'422': "Error",
|
|
173
|
+
'500': "Error",
|
|
174
|
+
'502': "Error",
|
|
175
|
+
}
|
|
176
|
+
response_data = self.api_client.call_api(
|
|
177
|
+
*_param,
|
|
178
|
+
_request_timeout=_request_timeout
|
|
179
|
+
)
|
|
180
|
+
response_data.read()
|
|
181
|
+
return self.api_client.response_deserialize(
|
|
182
|
+
response_data=response_data,
|
|
183
|
+
response_types_map=_response_types_map,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
@validate_call
|
|
188
|
+
def send_email_without_preload_content(
|
|
189
|
+
self,
|
|
190
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
191
|
+
v1_send_request: Optional[V1SendRequest],
|
|
192
|
+
_request_timeout: Union[
|
|
193
|
+
None,
|
|
194
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
195
|
+
Tuple[
|
|
196
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
197
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
198
|
+
]
|
|
199
|
+
] = None,
|
|
200
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
201
|
+
_content_type: Optional[StrictStr] = None,
|
|
202
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
203
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
204
|
+
) -> RESTResponseType:
|
|
205
|
+
"""Send email
|
|
206
|
+
|
|
207
|
+
Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
|
|
208
|
+
|
|
209
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
210
|
+
:type mailbox_resource_id: str
|
|
211
|
+
:param v1_send_request: (required)
|
|
212
|
+
:type v1_send_request: V1SendRequest
|
|
213
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
214
|
+
number provided, it will be total request
|
|
215
|
+
timeout. It can also be a pair (tuple) of
|
|
216
|
+
(connection, read) timeouts.
|
|
217
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
218
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
219
|
+
request; this effectively ignores the
|
|
220
|
+
authentication in the spec for a single request.
|
|
221
|
+
:type _request_auth: dict, optional
|
|
222
|
+
:param _content_type: force content-type for the request.
|
|
223
|
+
:type _content_type: str, Optional
|
|
224
|
+
:param _headers: set to override the headers for a single
|
|
225
|
+
request; this effectively ignores the headers
|
|
226
|
+
in the spec for a single request.
|
|
227
|
+
:type _headers: dict, optional
|
|
228
|
+
:param _host_index: set to override the host_index for a single
|
|
229
|
+
request; this effectively ignores the host_index
|
|
230
|
+
in the spec for a single request.
|
|
231
|
+
:type _host_index: int, optional
|
|
232
|
+
:return: Returns the result object.
|
|
233
|
+
""" # noqa: E501
|
|
234
|
+
|
|
235
|
+
_param = self._send_email_serialize(
|
|
236
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
237
|
+
v1_send_request=v1_send_request,
|
|
238
|
+
_request_auth=_request_auth,
|
|
239
|
+
_content_type=_content_type,
|
|
240
|
+
_headers=_headers,
|
|
241
|
+
_host_index=_host_index
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
245
|
+
'204': None,
|
|
246
|
+
'401': "Error",
|
|
247
|
+
'403': "Error",
|
|
248
|
+
'422': "Error",
|
|
249
|
+
'500': "Error",
|
|
250
|
+
'502': "Error",
|
|
251
|
+
}
|
|
252
|
+
response_data = self.api_client.call_api(
|
|
253
|
+
*_param,
|
|
254
|
+
_request_timeout=_request_timeout
|
|
255
|
+
)
|
|
256
|
+
return response_data.response
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def _send_email_serialize(
|
|
260
|
+
self,
|
|
261
|
+
mailbox_resource_id,
|
|
262
|
+
v1_send_request,
|
|
263
|
+
_request_auth,
|
|
264
|
+
_content_type,
|
|
265
|
+
_headers,
|
|
266
|
+
_host_index,
|
|
267
|
+
) -> RequestSerialized:
|
|
268
|
+
|
|
269
|
+
_host = None
|
|
270
|
+
|
|
271
|
+
_collection_formats: Dict[str, str] = {
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
_path_params: Dict[str, str] = {}
|
|
275
|
+
_query_params: List[Tuple[str, str]] = []
|
|
276
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
277
|
+
_form_params: List[Tuple[str, str]] = []
|
|
278
|
+
_files: Dict[
|
|
279
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
280
|
+
] = {}
|
|
281
|
+
_body_params: Optional[bytes] = None
|
|
282
|
+
|
|
283
|
+
# process the path parameters
|
|
284
|
+
if mailbox_resource_id is not None:
|
|
285
|
+
_path_params['mailboxResourceId'] = mailbox_resource_id
|
|
286
|
+
# process the query parameters
|
|
287
|
+
# process the header parameters
|
|
288
|
+
# process the form parameters
|
|
289
|
+
# process the body parameter
|
|
290
|
+
if v1_send_request is not None:
|
|
291
|
+
_body_params = v1_send_request
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
# set the HTTP header `Accept`
|
|
295
|
+
if 'Accept' not in _header_params:
|
|
296
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
297
|
+
[
|
|
298
|
+
'application/json'
|
|
299
|
+
]
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
# set the HTTP header `Content-Type`
|
|
303
|
+
if _content_type:
|
|
304
|
+
_header_params['Content-Type'] = _content_type
|
|
305
|
+
else:
|
|
306
|
+
_default_content_type = (
|
|
307
|
+
self.api_client.select_header_content_type(
|
|
308
|
+
[
|
|
309
|
+
'application/json'
|
|
310
|
+
]
|
|
311
|
+
)
|
|
312
|
+
)
|
|
313
|
+
if _default_content_type is not None:
|
|
314
|
+
_header_params['Content-Type'] = _default_content_type
|
|
315
|
+
|
|
316
|
+
# authentication setting
|
|
317
|
+
_auth_settings: List[str] = [
|
|
318
|
+
'BearerAuth'
|
|
319
|
+
]
|
|
320
|
+
|
|
321
|
+
return self.api_client.param_serialize(
|
|
322
|
+
method='POST',
|
|
323
|
+
resource_path='/api/v1/mailboxes/{mailboxResourceId}/send',
|
|
324
|
+
path_params=_path_params,
|
|
325
|
+
query_params=_query_params,
|
|
326
|
+
header_params=_header_params,
|
|
327
|
+
body=_body_params,
|
|
328
|
+
post_params=_form_params,
|
|
329
|
+
files=_files,
|
|
330
|
+
auth_settings=_auth_settings,
|
|
331
|
+
collection_formats=_collection_formats,
|
|
332
|
+
_host=_host,
|
|
333
|
+
_request_auth=_request_auth
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
|