hostinger-email-api 0.1.0__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_email_api/__init__.py +76 -0
- hostinger_email_api/api/__init__.py +10 -0
- hostinger_email_api/api/account_api.py +284 -0
- hostinger_email_api/api/folders_api.py +1271 -0
- hostinger_email_api/api/messages_api.py +4237 -0
- hostinger_email_api/api/quota_api.py +304 -0
- hostinger_email_api/api/send_api.py +336 -0
- hostinger_email_api/api/webhooks_api.py +2154 -0
- hostinger_email_api/api_client.py +795 -0
- hostinger_email_api/api_response.py +21 -0
- hostinger_email_api/configuration.py +579 -0
- hostinger_email_api/exceptions.py +214 -0
- hostinger_email_api/models/__init__.py +54 -0
- hostinger_email_api/models/error.py +89 -0
- hostinger_email_api/models/pagination.py +91 -0
- hostinger_email_api/models/v1_folder_messages_collection.py +99 -0
- hostinger_email_api/models/v1_folder_messages_delete_bulk_request.py +86 -0
- hostinger_email_api/models/v1_folder_messages_flags_bulk_request.py +90 -0
- hostinger_email_api/models/v1_folder_messages_flags_request.py +88 -0
- hostinger_email_api/models/v1_folder_messages_message.py +165 -0
- hostinger_email_api/models/v1_folder_messages_message_address.py +87 -0
- hostinger_email_api/models/v1_folder_messages_message_attachment.py +105 -0
- hostinger_email_api/models/v1_folder_messages_message_text.py +87 -0
- hostinger_email_api/models/v1_folder_messages_message_text_resource.py +89 -0
- hostinger_email_api/models/v1_folder_messages_move_bulk_request.py +88 -0
- hostinger_email_api/models/v1_folder_messages_move_request.py +86 -0
- hostinger_email_api/models/v1_folder_messages_resource.py +89 -0
- hostinger_email_api/models/v1_folder_messages_search_request.py +111 -0
- hostinger_email_api/models/v1_folder_messages_update_flags_result.py +89 -0
- hostinger_email_api/models/v1_folder_messages_update_flags_result_data.py +95 -0
- hostinger_email_api/models/v1_folder_messages_update_flags_result_data_failed_inner.py +87 -0
- hostinger_email_api/models/v1_folders_collection.py +99 -0
- hostinger_email_api/models/v1_folders_create_request.py +86 -0
- hostinger_email_api/models/v1_folders_folder.py +100 -0
- hostinger_email_api/models/v1_folders_resource.py +89 -0
- hostinger_email_api/models/v1_folders_update_request.py +86 -0
- hostinger_email_api/models/v1_me_mailbox.py +95 -0
- hostinger_email_api/models/v1_me_resource.py +89 -0
- hostinger_email_api/models/v1_me_resource_data.py +103 -0
- hostinger_email_api/models/v1_quota_quota.py +101 -0
- hostinger_email_api/models/v1_quota_quota_resource.py +91 -0
- hostinger_email_api/models/v1_quota_resource.py +89 -0
- hostinger_email_api/models/v1_send_attachment.py +93 -0
- hostinger_email_api/models/v1_send_request.py +92 -0
- hostinger_email_api/models/v1_webhooks_collection.py +99 -0
- hostinger_email_api/models/v1_webhooks_create_request.py +117 -0
- hostinger_email_api/models/v1_webhooks_resource.py +89 -0
- hostinger_email_api/models/v1_webhooks_resource_with_secret.py +89 -0
- hostinger_email_api/models/v1_webhooks_test_result.py +89 -0
- hostinger_email_api/models/v1_webhooks_test_result_data.py +94 -0
- hostinger_email_api/models/v1_webhooks_update_request.py +120 -0
- hostinger_email_api/models/v1_webhooks_webhook.py +132 -0
- hostinger_email_api/models/v1_webhooks_webhook_with_secret.py +134 -0
- hostinger_email_api/py.typed +0 -0
- hostinger_email_api/rest.py +256 -0
- hostinger_email_api-0.1.0.dist-info/METADATA +180 -0
- hostinger_email_api-0.1.0.dist-info/RECORD +59 -0
- hostinger_email_api-0.1.0.dist-info/WHEEL +5 -0
- hostinger_email_api-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1271 @@
|
|
|
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_email_api.models.v1_folders_collection import V1FoldersCollection
|
|
21
|
+
from hostinger_email_api.models.v1_folders_create_request import V1FoldersCreateRequest
|
|
22
|
+
from hostinger_email_api.models.v1_folders_resource import V1FoldersResource
|
|
23
|
+
from hostinger_email_api.models.v1_folders_update_request import V1FoldersUpdateRequest
|
|
24
|
+
|
|
25
|
+
from hostinger_email_api.api_client import ApiClient, RequestSerialized
|
|
26
|
+
from hostinger_email_api.api_response import ApiResponse
|
|
27
|
+
from hostinger_email_api.rest import RESTResponseType
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class FoldersApi:
|
|
31
|
+
|
|
32
|
+
def __init__(self, api_client=None) -> None:
|
|
33
|
+
if api_client is None:
|
|
34
|
+
api_client = ApiClient.get_default()
|
|
35
|
+
self.api_client = api_client
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@validate_call
|
|
39
|
+
def create_folder(
|
|
40
|
+
self,
|
|
41
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
42
|
+
v1_folders_create_request: V1FoldersCreateRequest,
|
|
43
|
+
_request_timeout: Union[
|
|
44
|
+
None,
|
|
45
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
46
|
+
Tuple[
|
|
47
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
48
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
49
|
+
]
|
|
50
|
+
] = None,
|
|
51
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
52
|
+
_content_type: Optional[StrictStr] = None,
|
|
53
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
54
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
55
|
+
) -> V1FoldersResource:
|
|
56
|
+
"""Create folder
|
|
57
|
+
|
|
58
|
+
Create a new folder in the managed mailbox.
|
|
59
|
+
|
|
60
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
61
|
+
:type mailbox_resource_id: str
|
|
62
|
+
:param v1_folders_create_request: (required)
|
|
63
|
+
:type v1_folders_create_request: V1FoldersCreateRequest
|
|
64
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
65
|
+
number provided, it will be total request
|
|
66
|
+
timeout. It can also be a pair (tuple) of
|
|
67
|
+
(connection, read) timeouts.
|
|
68
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
69
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
70
|
+
request; this effectively ignores the
|
|
71
|
+
authentication in the spec for a single request.
|
|
72
|
+
:type _request_auth: dict, optional
|
|
73
|
+
:param _content_type: force content-type for the request.
|
|
74
|
+
:type _content_type: str, Optional
|
|
75
|
+
:param _headers: set to override the headers for a single
|
|
76
|
+
request; this effectively ignores the headers
|
|
77
|
+
in the spec for a single request.
|
|
78
|
+
:type _headers: dict, optional
|
|
79
|
+
:param _host_index: set to override the host_index for a single
|
|
80
|
+
request; this effectively ignores the host_index
|
|
81
|
+
in the spec for a single request.
|
|
82
|
+
:type _host_index: int, optional
|
|
83
|
+
:return: Returns the result object.
|
|
84
|
+
""" # noqa: E501
|
|
85
|
+
|
|
86
|
+
_param = self._create_folder_serialize(
|
|
87
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
88
|
+
v1_folders_create_request=v1_folders_create_request,
|
|
89
|
+
_request_auth=_request_auth,
|
|
90
|
+
_content_type=_content_type,
|
|
91
|
+
_headers=_headers,
|
|
92
|
+
_host_index=_host_index
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
96
|
+
'201': "V1FoldersResource",
|
|
97
|
+
'401': "Error",
|
|
98
|
+
'403': "Error",
|
|
99
|
+
'409': "Error",
|
|
100
|
+
'422': "Error",
|
|
101
|
+
'500': "Error",
|
|
102
|
+
'502': "Error",
|
|
103
|
+
}
|
|
104
|
+
response_data = self.api_client.call_api(
|
|
105
|
+
*_param,
|
|
106
|
+
_request_timeout=_request_timeout
|
|
107
|
+
)
|
|
108
|
+
response_data.read()
|
|
109
|
+
return self.api_client.response_deserialize(
|
|
110
|
+
response_data=response_data,
|
|
111
|
+
response_types_map=_response_types_map,
|
|
112
|
+
).data
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
@validate_call
|
|
116
|
+
def create_folder_with_http_info(
|
|
117
|
+
self,
|
|
118
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
119
|
+
v1_folders_create_request: V1FoldersCreateRequest,
|
|
120
|
+
_request_timeout: Union[
|
|
121
|
+
None,
|
|
122
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
123
|
+
Tuple[
|
|
124
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
125
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
126
|
+
]
|
|
127
|
+
] = None,
|
|
128
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
129
|
+
_content_type: Optional[StrictStr] = None,
|
|
130
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
131
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
132
|
+
) -> ApiResponse[V1FoldersResource]:
|
|
133
|
+
"""Create folder
|
|
134
|
+
|
|
135
|
+
Create a new folder in the managed mailbox.
|
|
136
|
+
|
|
137
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
138
|
+
:type mailbox_resource_id: str
|
|
139
|
+
:param v1_folders_create_request: (required)
|
|
140
|
+
:type v1_folders_create_request: V1FoldersCreateRequest
|
|
141
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
142
|
+
number provided, it will be total request
|
|
143
|
+
timeout. It can also be a pair (tuple) of
|
|
144
|
+
(connection, read) timeouts.
|
|
145
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
146
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
147
|
+
request; this effectively ignores the
|
|
148
|
+
authentication in the spec for a single request.
|
|
149
|
+
:type _request_auth: dict, optional
|
|
150
|
+
:param _content_type: force content-type for the request.
|
|
151
|
+
:type _content_type: str, Optional
|
|
152
|
+
:param _headers: set to override the headers for a single
|
|
153
|
+
request; this effectively ignores the headers
|
|
154
|
+
in the spec for a single request.
|
|
155
|
+
:type _headers: dict, optional
|
|
156
|
+
:param _host_index: set to override the host_index for a single
|
|
157
|
+
request; this effectively ignores the host_index
|
|
158
|
+
in the spec for a single request.
|
|
159
|
+
:type _host_index: int, optional
|
|
160
|
+
:return: Returns the result object.
|
|
161
|
+
""" # noqa: E501
|
|
162
|
+
|
|
163
|
+
_param = self._create_folder_serialize(
|
|
164
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
165
|
+
v1_folders_create_request=v1_folders_create_request,
|
|
166
|
+
_request_auth=_request_auth,
|
|
167
|
+
_content_type=_content_type,
|
|
168
|
+
_headers=_headers,
|
|
169
|
+
_host_index=_host_index
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
173
|
+
'201': "V1FoldersResource",
|
|
174
|
+
'401': "Error",
|
|
175
|
+
'403': "Error",
|
|
176
|
+
'409': "Error",
|
|
177
|
+
'422': "Error",
|
|
178
|
+
'500': "Error",
|
|
179
|
+
'502': "Error",
|
|
180
|
+
}
|
|
181
|
+
response_data = self.api_client.call_api(
|
|
182
|
+
*_param,
|
|
183
|
+
_request_timeout=_request_timeout
|
|
184
|
+
)
|
|
185
|
+
response_data.read()
|
|
186
|
+
return self.api_client.response_deserialize(
|
|
187
|
+
response_data=response_data,
|
|
188
|
+
response_types_map=_response_types_map,
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
@validate_call
|
|
193
|
+
def create_folder_without_preload_content(
|
|
194
|
+
self,
|
|
195
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
196
|
+
v1_folders_create_request: V1FoldersCreateRequest,
|
|
197
|
+
_request_timeout: Union[
|
|
198
|
+
None,
|
|
199
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
200
|
+
Tuple[
|
|
201
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
202
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
203
|
+
]
|
|
204
|
+
] = None,
|
|
205
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
206
|
+
_content_type: Optional[StrictStr] = None,
|
|
207
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
208
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
209
|
+
) -> RESTResponseType:
|
|
210
|
+
"""Create folder
|
|
211
|
+
|
|
212
|
+
Create a new folder in the managed mailbox.
|
|
213
|
+
|
|
214
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
215
|
+
:type mailbox_resource_id: str
|
|
216
|
+
:param v1_folders_create_request: (required)
|
|
217
|
+
:type v1_folders_create_request: V1FoldersCreateRequest
|
|
218
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
219
|
+
number provided, it will be total request
|
|
220
|
+
timeout. It can also be a pair (tuple) of
|
|
221
|
+
(connection, read) timeouts.
|
|
222
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
223
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
224
|
+
request; this effectively ignores the
|
|
225
|
+
authentication in the spec for a single request.
|
|
226
|
+
:type _request_auth: dict, optional
|
|
227
|
+
:param _content_type: force content-type for the request.
|
|
228
|
+
:type _content_type: str, Optional
|
|
229
|
+
:param _headers: set to override the headers for a single
|
|
230
|
+
request; this effectively ignores the headers
|
|
231
|
+
in the spec for a single request.
|
|
232
|
+
:type _headers: dict, optional
|
|
233
|
+
:param _host_index: set to override the host_index for a single
|
|
234
|
+
request; this effectively ignores the host_index
|
|
235
|
+
in the spec for a single request.
|
|
236
|
+
:type _host_index: int, optional
|
|
237
|
+
:return: Returns the result object.
|
|
238
|
+
""" # noqa: E501
|
|
239
|
+
|
|
240
|
+
_param = self._create_folder_serialize(
|
|
241
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
242
|
+
v1_folders_create_request=v1_folders_create_request,
|
|
243
|
+
_request_auth=_request_auth,
|
|
244
|
+
_content_type=_content_type,
|
|
245
|
+
_headers=_headers,
|
|
246
|
+
_host_index=_host_index
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
250
|
+
'201': "V1FoldersResource",
|
|
251
|
+
'401': "Error",
|
|
252
|
+
'403': "Error",
|
|
253
|
+
'409': "Error",
|
|
254
|
+
'422': "Error",
|
|
255
|
+
'500': "Error",
|
|
256
|
+
'502': "Error",
|
|
257
|
+
}
|
|
258
|
+
response_data = self.api_client.call_api(
|
|
259
|
+
*_param,
|
|
260
|
+
_request_timeout=_request_timeout
|
|
261
|
+
)
|
|
262
|
+
return response_data.response
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def _create_folder_serialize(
|
|
266
|
+
self,
|
|
267
|
+
mailbox_resource_id,
|
|
268
|
+
v1_folders_create_request,
|
|
269
|
+
_request_auth,
|
|
270
|
+
_content_type,
|
|
271
|
+
_headers,
|
|
272
|
+
_host_index,
|
|
273
|
+
) -> RequestSerialized:
|
|
274
|
+
|
|
275
|
+
_host = None
|
|
276
|
+
|
|
277
|
+
_collection_formats: Dict[str, str] = {
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
_path_params: Dict[str, str] = {}
|
|
281
|
+
_query_params: List[Tuple[str, str]] = []
|
|
282
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
283
|
+
_form_params: List[Tuple[str, str]] = []
|
|
284
|
+
_files: Dict[
|
|
285
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
286
|
+
] = {}
|
|
287
|
+
_body_params: Optional[bytes] = None
|
|
288
|
+
|
|
289
|
+
# process the path parameters
|
|
290
|
+
if mailbox_resource_id is not None:
|
|
291
|
+
_path_params['mailboxResourceId'] = mailbox_resource_id
|
|
292
|
+
# process the query parameters
|
|
293
|
+
# process the header parameters
|
|
294
|
+
# process the form parameters
|
|
295
|
+
# process the body parameter
|
|
296
|
+
if v1_folders_create_request is not None:
|
|
297
|
+
_body_params = v1_folders_create_request
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
# set the HTTP header `Accept`
|
|
301
|
+
if 'Accept' not in _header_params:
|
|
302
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
303
|
+
[
|
|
304
|
+
'application/json'
|
|
305
|
+
]
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
# set the HTTP header `Content-Type`
|
|
309
|
+
if _content_type:
|
|
310
|
+
_header_params['Content-Type'] = _content_type
|
|
311
|
+
else:
|
|
312
|
+
_default_content_type = (
|
|
313
|
+
self.api_client.select_header_content_type(
|
|
314
|
+
[
|
|
315
|
+
'application/json'
|
|
316
|
+
]
|
|
317
|
+
)
|
|
318
|
+
)
|
|
319
|
+
if _default_content_type is not None:
|
|
320
|
+
_header_params['Content-Type'] = _default_content_type
|
|
321
|
+
|
|
322
|
+
# authentication setting
|
|
323
|
+
_auth_settings: List[str] = [
|
|
324
|
+
'BearerAuth'
|
|
325
|
+
]
|
|
326
|
+
|
|
327
|
+
return self.api_client.param_serialize(
|
|
328
|
+
method='POST',
|
|
329
|
+
resource_path='/api/v1/mailboxes/{mailboxResourceId}/folders',
|
|
330
|
+
path_params=_path_params,
|
|
331
|
+
query_params=_query_params,
|
|
332
|
+
header_params=_header_params,
|
|
333
|
+
body=_body_params,
|
|
334
|
+
post_params=_form_params,
|
|
335
|
+
files=_files,
|
|
336
|
+
auth_settings=_auth_settings,
|
|
337
|
+
collection_formats=_collection_formats,
|
|
338
|
+
_host=_host,
|
|
339
|
+
_request_auth=_request_auth
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
@validate_call
|
|
346
|
+
def delete_folder(
|
|
347
|
+
self,
|
|
348
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
349
|
+
folder: Annotated[StrictStr, Field(description="Folder path to delete (URL-encoded).")],
|
|
350
|
+
_request_timeout: Union[
|
|
351
|
+
None,
|
|
352
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
353
|
+
Tuple[
|
|
354
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
355
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
356
|
+
]
|
|
357
|
+
] = None,
|
|
358
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
359
|
+
_content_type: Optional[StrictStr] = None,
|
|
360
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
361
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
362
|
+
) -> None:
|
|
363
|
+
"""Delete folder
|
|
364
|
+
|
|
365
|
+
Delete a folder and all of its subfolders.
|
|
366
|
+
|
|
367
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
368
|
+
:type mailbox_resource_id: str
|
|
369
|
+
:param folder: Folder path to delete (URL-encoded). (required)
|
|
370
|
+
:type folder: str
|
|
371
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
372
|
+
number provided, it will be total request
|
|
373
|
+
timeout. It can also be a pair (tuple) of
|
|
374
|
+
(connection, read) timeouts.
|
|
375
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
376
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
377
|
+
request; this effectively ignores the
|
|
378
|
+
authentication in the spec for a single request.
|
|
379
|
+
:type _request_auth: dict, optional
|
|
380
|
+
:param _content_type: force content-type for the request.
|
|
381
|
+
:type _content_type: str, Optional
|
|
382
|
+
:param _headers: set to override the headers for a single
|
|
383
|
+
request; this effectively ignores the headers
|
|
384
|
+
in the spec for a single request.
|
|
385
|
+
:type _headers: dict, optional
|
|
386
|
+
:param _host_index: set to override the host_index for a single
|
|
387
|
+
request; this effectively ignores the host_index
|
|
388
|
+
in the spec for a single request.
|
|
389
|
+
:type _host_index: int, optional
|
|
390
|
+
:return: Returns the result object.
|
|
391
|
+
""" # noqa: E501
|
|
392
|
+
|
|
393
|
+
_param = self._delete_folder_serialize(
|
|
394
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
395
|
+
folder=folder,
|
|
396
|
+
_request_auth=_request_auth,
|
|
397
|
+
_content_type=_content_type,
|
|
398
|
+
_headers=_headers,
|
|
399
|
+
_host_index=_host_index
|
|
400
|
+
)
|
|
401
|
+
|
|
402
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
403
|
+
'204': None,
|
|
404
|
+
'401': "Error",
|
|
405
|
+
'403': "Error",
|
|
406
|
+
'404': "Error",
|
|
407
|
+
'409': "Error",
|
|
408
|
+
'422': "Error",
|
|
409
|
+
'500': "Error",
|
|
410
|
+
'502': "Error",
|
|
411
|
+
}
|
|
412
|
+
response_data = self.api_client.call_api(
|
|
413
|
+
*_param,
|
|
414
|
+
_request_timeout=_request_timeout
|
|
415
|
+
)
|
|
416
|
+
response_data.read()
|
|
417
|
+
return self.api_client.response_deserialize(
|
|
418
|
+
response_data=response_data,
|
|
419
|
+
response_types_map=_response_types_map,
|
|
420
|
+
).data
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
@validate_call
|
|
424
|
+
def delete_folder_with_http_info(
|
|
425
|
+
self,
|
|
426
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
427
|
+
folder: Annotated[StrictStr, Field(description="Folder path to delete (URL-encoded).")],
|
|
428
|
+
_request_timeout: Union[
|
|
429
|
+
None,
|
|
430
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
431
|
+
Tuple[
|
|
432
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
433
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
434
|
+
]
|
|
435
|
+
] = None,
|
|
436
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
437
|
+
_content_type: Optional[StrictStr] = None,
|
|
438
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
439
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
440
|
+
) -> ApiResponse[None]:
|
|
441
|
+
"""Delete folder
|
|
442
|
+
|
|
443
|
+
Delete a folder and all of its subfolders.
|
|
444
|
+
|
|
445
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
446
|
+
:type mailbox_resource_id: str
|
|
447
|
+
:param folder: Folder path to delete (URL-encoded). (required)
|
|
448
|
+
:type folder: str
|
|
449
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
450
|
+
number provided, it will be total request
|
|
451
|
+
timeout. It can also be a pair (tuple) of
|
|
452
|
+
(connection, read) timeouts.
|
|
453
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
454
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
455
|
+
request; this effectively ignores the
|
|
456
|
+
authentication in the spec for a single request.
|
|
457
|
+
:type _request_auth: dict, optional
|
|
458
|
+
:param _content_type: force content-type for the request.
|
|
459
|
+
:type _content_type: str, Optional
|
|
460
|
+
:param _headers: set to override the headers for a single
|
|
461
|
+
request; this effectively ignores the headers
|
|
462
|
+
in the spec for a single request.
|
|
463
|
+
:type _headers: dict, optional
|
|
464
|
+
:param _host_index: set to override the host_index for a single
|
|
465
|
+
request; this effectively ignores the host_index
|
|
466
|
+
in the spec for a single request.
|
|
467
|
+
:type _host_index: int, optional
|
|
468
|
+
:return: Returns the result object.
|
|
469
|
+
""" # noqa: E501
|
|
470
|
+
|
|
471
|
+
_param = self._delete_folder_serialize(
|
|
472
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
473
|
+
folder=folder,
|
|
474
|
+
_request_auth=_request_auth,
|
|
475
|
+
_content_type=_content_type,
|
|
476
|
+
_headers=_headers,
|
|
477
|
+
_host_index=_host_index
|
|
478
|
+
)
|
|
479
|
+
|
|
480
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
481
|
+
'204': None,
|
|
482
|
+
'401': "Error",
|
|
483
|
+
'403': "Error",
|
|
484
|
+
'404': "Error",
|
|
485
|
+
'409': "Error",
|
|
486
|
+
'422': "Error",
|
|
487
|
+
'500': "Error",
|
|
488
|
+
'502': "Error",
|
|
489
|
+
}
|
|
490
|
+
response_data = self.api_client.call_api(
|
|
491
|
+
*_param,
|
|
492
|
+
_request_timeout=_request_timeout
|
|
493
|
+
)
|
|
494
|
+
response_data.read()
|
|
495
|
+
return self.api_client.response_deserialize(
|
|
496
|
+
response_data=response_data,
|
|
497
|
+
response_types_map=_response_types_map,
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
@validate_call
|
|
502
|
+
def delete_folder_without_preload_content(
|
|
503
|
+
self,
|
|
504
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
505
|
+
folder: Annotated[StrictStr, Field(description="Folder path to delete (URL-encoded).")],
|
|
506
|
+
_request_timeout: Union[
|
|
507
|
+
None,
|
|
508
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
509
|
+
Tuple[
|
|
510
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
511
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
512
|
+
]
|
|
513
|
+
] = None,
|
|
514
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
515
|
+
_content_type: Optional[StrictStr] = None,
|
|
516
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
517
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
518
|
+
) -> RESTResponseType:
|
|
519
|
+
"""Delete folder
|
|
520
|
+
|
|
521
|
+
Delete a folder and all of its subfolders.
|
|
522
|
+
|
|
523
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
524
|
+
:type mailbox_resource_id: str
|
|
525
|
+
:param folder: Folder path to delete (URL-encoded). (required)
|
|
526
|
+
:type folder: str
|
|
527
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
528
|
+
number provided, it will be total request
|
|
529
|
+
timeout. It can also be a pair (tuple) of
|
|
530
|
+
(connection, read) timeouts.
|
|
531
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
532
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
533
|
+
request; this effectively ignores the
|
|
534
|
+
authentication in the spec for a single request.
|
|
535
|
+
:type _request_auth: dict, optional
|
|
536
|
+
:param _content_type: force content-type for the request.
|
|
537
|
+
:type _content_type: str, Optional
|
|
538
|
+
:param _headers: set to override the headers for a single
|
|
539
|
+
request; this effectively ignores the headers
|
|
540
|
+
in the spec for a single request.
|
|
541
|
+
:type _headers: dict, optional
|
|
542
|
+
:param _host_index: set to override the host_index for a single
|
|
543
|
+
request; this effectively ignores the host_index
|
|
544
|
+
in the spec for a single request.
|
|
545
|
+
:type _host_index: int, optional
|
|
546
|
+
:return: Returns the result object.
|
|
547
|
+
""" # noqa: E501
|
|
548
|
+
|
|
549
|
+
_param = self._delete_folder_serialize(
|
|
550
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
551
|
+
folder=folder,
|
|
552
|
+
_request_auth=_request_auth,
|
|
553
|
+
_content_type=_content_type,
|
|
554
|
+
_headers=_headers,
|
|
555
|
+
_host_index=_host_index
|
|
556
|
+
)
|
|
557
|
+
|
|
558
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
559
|
+
'204': None,
|
|
560
|
+
'401': "Error",
|
|
561
|
+
'403': "Error",
|
|
562
|
+
'404': "Error",
|
|
563
|
+
'409': "Error",
|
|
564
|
+
'422': "Error",
|
|
565
|
+
'500': "Error",
|
|
566
|
+
'502': "Error",
|
|
567
|
+
}
|
|
568
|
+
response_data = self.api_client.call_api(
|
|
569
|
+
*_param,
|
|
570
|
+
_request_timeout=_request_timeout
|
|
571
|
+
)
|
|
572
|
+
return response_data.response
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
def _delete_folder_serialize(
|
|
576
|
+
self,
|
|
577
|
+
mailbox_resource_id,
|
|
578
|
+
folder,
|
|
579
|
+
_request_auth,
|
|
580
|
+
_content_type,
|
|
581
|
+
_headers,
|
|
582
|
+
_host_index,
|
|
583
|
+
) -> RequestSerialized:
|
|
584
|
+
|
|
585
|
+
_host = None
|
|
586
|
+
|
|
587
|
+
_collection_formats: Dict[str, str] = {
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
_path_params: Dict[str, str] = {}
|
|
591
|
+
_query_params: List[Tuple[str, str]] = []
|
|
592
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
593
|
+
_form_params: List[Tuple[str, str]] = []
|
|
594
|
+
_files: Dict[
|
|
595
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
596
|
+
] = {}
|
|
597
|
+
_body_params: Optional[bytes] = None
|
|
598
|
+
|
|
599
|
+
# process the path parameters
|
|
600
|
+
if mailbox_resource_id is not None:
|
|
601
|
+
_path_params['mailboxResourceId'] = mailbox_resource_id
|
|
602
|
+
if folder is not None:
|
|
603
|
+
_path_params['folder'] = folder
|
|
604
|
+
# process the query parameters
|
|
605
|
+
# process the header parameters
|
|
606
|
+
# process the form parameters
|
|
607
|
+
# process the body parameter
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
# set the HTTP header `Accept`
|
|
611
|
+
if 'Accept' not in _header_params:
|
|
612
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
613
|
+
[
|
|
614
|
+
'application/json'
|
|
615
|
+
]
|
|
616
|
+
)
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
# authentication setting
|
|
620
|
+
_auth_settings: List[str] = [
|
|
621
|
+
'BearerAuth'
|
|
622
|
+
]
|
|
623
|
+
|
|
624
|
+
return self.api_client.param_serialize(
|
|
625
|
+
method='DELETE',
|
|
626
|
+
resource_path='/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}',
|
|
627
|
+
path_params=_path_params,
|
|
628
|
+
query_params=_query_params,
|
|
629
|
+
header_params=_header_params,
|
|
630
|
+
body=_body_params,
|
|
631
|
+
post_params=_form_params,
|
|
632
|
+
files=_files,
|
|
633
|
+
auth_settings=_auth_settings,
|
|
634
|
+
collection_formats=_collection_formats,
|
|
635
|
+
_host=_host,
|
|
636
|
+
_request_auth=_request_auth
|
|
637
|
+
)
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
@validate_call
|
|
643
|
+
def list_folders(
|
|
644
|
+
self,
|
|
645
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
646
|
+
page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-based).")] = None,
|
|
647
|
+
per_page: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Items per page (max 100).")] = None,
|
|
648
|
+
_request_timeout: Union[
|
|
649
|
+
None,
|
|
650
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
651
|
+
Tuple[
|
|
652
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
653
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
654
|
+
]
|
|
655
|
+
] = None,
|
|
656
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
657
|
+
_content_type: Optional[StrictStr] = None,
|
|
658
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
659
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
660
|
+
) -> V1FoldersCollection:
|
|
661
|
+
"""List folders
|
|
662
|
+
|
|
663
|
+
Retrieve a paginated list of folders in the managed mailbox.
|
|
664
|
+
|
|
665
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
666
|
+
:type mailbox_resource_id: str
|
|
667
|
+
:param page: Page number (1-based).
|
|
668
|
+
:type page: int
|
|
669
|
+
:param per_page: Items per page (max 100).
|
|
670
|
+
:type per_page: int
|
|
671
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
672
|
+
number provided, it will be total request
|
|
673
|
+
timeout. It can also be a pair (tuple) of
|
|
674
|
+
(connection, read) timeouts.
|
|
675
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
676
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
677
|
+
request; this effectively ignores the
|
|
678
|
+
authentication in the spec for a single request.
|
|
679
|
+
:type _request_auth: dict, optional
|
|
680
|
+
:param _content_type: force content-type for the request.
|
|
681
|
+
:type _content_type: str, Optional
|
|
682
|
+
:param _headers: set to override the headers for a single
|
|
683
|
+
request; this effectively ignores the headers
|
|
684
|
+
in the spec for a single request.
|
|
685
|
+
:type _headers: dict, optional
|
|
686
|
+
:param _host_index: set to override the host_index for a single
|
|
687
|
+
request; this effectively ignores the host_index
|
|
688
|
+
in the spec for a single request.
|
|
689
|
+
:type _host_index: int, optional
|
|
690
|
+
:return: Returns the result object.
|
|
691
|
+
""" # noqa: E501
|
|
692
|
+
|
|
693
|
+
_param = self._list_folders_serialize(
|
|
694
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
695
|
+
page=page,
|
|
696
|
+
per_page=per_page,
|
|
697
|
+
_request_auth=_request_auth,
|
|
698
|
+
_content_type=_content_type,
|
|
699
|
+
_headers=_headers,
|
|
700
|
+
_host_index=_host_index
|
|
701
|
+
)
|
|
702
|
+
|
|
703
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
704
|
+
'200': "V1FoldersCollection",
|
|
705
|
+
'401': "Error",
|
|
706
|
+
'403': "Error",
|
|
707
|
+
'422': "Error",
|
|
708
|
+
'500': "Error",
|
|
709
|
+
'502': "Error",
|
|
710
|
+
}
|
|
711
|
+
response_data = self.api_client.call_api(
|
|
712
|
+
*_param,
|
|
713
|
+
_request_timeout=_request_timeout
|
|
714
|
+
)
|
|
715
|
+
response_data.read()
|
|
716
|
+
return self.api_client.response_deserialize(
|
|
717
|
+
response_data=response_data,
|
|
718
|
+
response_types_map=_response_types_map,
|
|
719
|
+
).data
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
@validate_call
|
|
723
|
+
def list_folders_with_http_info(
|
|
724
|
+
self,
|
|
725
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
726
|
+
page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-based).")] = None,
|
|
727
|
+
per_page: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Items per page (max 100).")] = None,
|
|
728
|
+
_request_timeout: Union[
|
|
729
|
+
None,
|
|
730
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
731
|
+
Tuple[
|
|
732
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
733
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
734
|
+
]
|
|
735
|
+
] = None,
|
|
736
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
737
|
+
_content_type: Optional[StrictStr] = None,
|
|
738
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
739
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
740
|
+
) -> ApiResponse[V1FoldersCollection]:
|
|
741
|
+
"""List folders
|
|
742
|
+
|
|
743
|
+
Retrieve a paginated list of folders in the managed mailbox.
|
|
744
|
+
|
|
745
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
746
|
+
:type mailbox_resource_id: str
|
|
747
|
+
:param page: Page number (1-based).
|
|
748
|
+
:type page: int
|
|
749
|
+
:param per_page: Items per page (max 100).
|
|
750
|
+
:type per_page: int
|
|
751
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
752
|
+
number provided, it will be total request
|
|
753
|
+
timeout. It can also be a pair (tuple) of
|
|
754
|
+
(connection, read) timeouts.
|
|
755
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
756
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
757
|
+
request; this effectively ignores the
|
|
758
|
+
authentication in the spec for a single request.
|
|
759
|
+
:type _request_auth: dict, optional
|
|
760
|
+
:param _content_type: force content-type for the request.
|
|
761
|
+
:type _content_type: str, Optional
|
|
762
|
+
:param _headers: set to override the headers for a single
|
|
763
|
+
request; this effectively ignores the headers
|
|
764
|
+
in the spec for a single request.
|
|
765
|
+
:type _headers: dict, optional
|
|
766
|
+
:param _host_index: set to override the host_index for a single
|
|
767
|
+
request; this effectively ignores the host_index
|
|
768
|
+
in the spec for a single request.
|
|
769
|
+
:type _host_index: int, optional
|
|
770
|
+
:return: Returns the result object.
|
|
771
|
+
""" # noqa: E501
|
|
772
|
+
|
|
773
|
+
_param = self._list_folders_serialize(
|
|
774
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
775
|
+
page=page,
|
|
776
|
+
per_page=per_page,
|
|
777
|
+
_request_auth=_request_auth,
|
|
778
|
+
_content_type=_content_type,
|
|
779
|
+
_headers=_headers,
|
|
780
|
+
_host_index=_host_index
|
|
781
|
+
)
|
|
782
|
+
|
|
783
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
784
|
+
'200': "V1FoldersCollection",
|
|
785
|
+
'401': "Error",
|
|
786
|
+
'403': "Error",
|
|
787
|
+
'422': "Error",
|
|
788
|
+
'500': "Error",
|
|
789
|
+
'502': "Error",
|
|
790
|
+
}
|
|
791
|
+
response_data = self.api_client.call_api(
|
|
792
|
+
*_param,
|
|
793
|
+
_request_timeout=_request_timeout
|
|
794
|
+
)
|
|
795
|
+
response_data.read()
|
|
796
|
+
return self.api_client.response_deserialize(
|
|
797
|
+
response_data=response_data,
|
|
798
|
+
response_types_map=_response_types_map,
|
|
799
|
+
)
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
@validate_call
|
|
803
|
+
def list_folders_without_preload_content(
|
|
804
|
+
self,
|
|
805
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
806
|
+
page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-based).")] = None,
|
|
807
|
+
per_page: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Items per page (max 100).")] = None,
|
|
808
|
+
_request_timeout: Union[
|
|
809
|
+
None,
|
|
810
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
811
|
+
Tuple[
|
|
812
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
813
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
814
|
+
]
|
|
815
|
+
] = None,
|
|
816
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
817
|
+
_content_type: Optional[StrictStr] = None,
|
|
818
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
819
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
820
|
+
) -> RESTResponseType:
|
|
821
|
+
"""List folders
|
|
822
|
+
|
|
823
|
+
Retrieve a paginated list of folders in the managed mailbox.
|
|
824
|
+
|
|
825
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
826
|
+
:type mailbox_resource_id: str
|
|
827
|
+
:param page: Page number (1-based).
|
|
828
|
+
:type page: int
|
|
829
|
+
:param per_page: Items per page (max 100).
|
|
830
|
+
:type per_page: int
|
|
831
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
832
|
+
number provided, it will be total request
|
|
833
|
+
timeout. It can also be a pair (tuple) of
|
|
834
|
+
(connection, read) timeouts.
|
|
835
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
836
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
837
|
+
request; this effectively ignores the
|
|
838
|
+
authentication in the spec for a single request.
|
|
839
|
+
:type _request_auth: dict, optional
|
|
840
|
+
:param _content_type: force content-type for the request.
|
|
841
|
+
:type _content_type: str, Optional
|
|
842
|
+
:param _headers: set to override the headers for a single
|
|
843
|
+
request; this effectively ignores the headers
|
|
844
|
+
in the spec for a single request.
|
|
845
|
+
:type _headers: dict, optional
|
|
846
|
+
:param _host_index: set to override the host_index for a single
|
|
847
|
+
request; this effectively ignores the host_index
|
|
848
|
+
in the spec for a single request.
|
|
849
|
+
:type _host_index: int, optional
|
|
850
|
+
:return: Returns the result object.
|
|
851
|
+
""" # noqa: E501
|
|
852
|
+
|
|
853
|
+
_param = self._list_folders_serialize(
|
|
854
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
855
|
+
page=page,
|
|
856
|
+
per_page=per_page,
|
|
857
|
+
_request_auth=_request_auth,
|
|
858
|
+
_content_type=_content_type,
|
|
859
|
+
_headers=_headers,
|
|
860
|
+
_host_index=_host_index
|
|
861
|
+
)
|
|
862
|
+
|
|
863
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
864
|
+
'200': "V1FoldersCollection",
|
|
865
|
+
'401': "Error",
|
|
866
|
+
'403': "Error",
|
|
867
|
+
'422': "Error",
|
|
868
|
+
'500': "Error",
|
|
869
|
+
'502': "Error",
|
|
870
|
+
}
|
|
871
|
+
response_data = self.api_client.call_api(
|
|
872
|
+
*_param,
|
|
873
|
+
_request_timeout=_request_timeout
|
|
874
|
+
)
|
|
875
|
+
return response_data.response
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
def _list_folders_serialize(
|
|
879
|
+
self,
|
|
880
|
+
mailbox_resource_id,
|
|
881
|
+
page,
|
|
882
|
+
per_page,
|
|
883
|
+
_request_auth,
|
|
884
|
+
_content_type,
|
|
885
|
+
_headers,
|
|
886
|
+
_host_index,
|
|
887
|
+
) -> RequestSerialized:
|
|
888
|
+
|
|
889
|
+
_host = None
|
|
890
|
+
|
|
891
|
+
_collection_formats: Dict[str, str] = {
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
_path_params: Dict[str, str] = {}
|
|
895
|
+
_query_params: List[Tuple[str, str]] = []
|
|
896
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
897
|
+
_form_params: List[Tuple[str, str]] = []
|
|
898
|
+
_files: Dict[
|
|
899
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
900
|
+
] = {}
|
|
901
|
+
_body_params: Optional[bytes] = None
|
|
902
|
+
|
|
903
|
+
# process the path parameters
|
|
904
|
+
if mailbox_resource_id is not None:
|
|
905
|
+
_path_params['mailboxResourceId'] = mailbox_resource_id
|
|
906
|
+
# process the query parameters
|
|
907
|
+
if page is not None:
|
|
908
|
+
|
|
909
|
+
_query_params.append(('page', page))
|
|
910
|
+
|
|
911
|
+
if per_page is not None:
|
|
912
|
+
|
|
913
|
+
_query_params.append(('perPage', per_page))
|
|
914
|
+
|
|
915
|
+
# process the header parameters
|
|
916
|
+
# process the form parameters
|
|
917
|
+
# process the body parameter
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
# set the HTTP header `Accept`
|
|
921
|
+
if 'Accept' not in _header_params:
|
|
922
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
923
|
+
[
|
|
924
|
+
'application/json'
|
|
925
|
+
]
|
|
926
|
+
)
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
# authentication setting
|
|
930
|
+
_auth_settings: List[str] = [
|
|
931
|
+
'BearerAuth'
|
|
932
|
+
]
|
|
933
|
+
|
|
934
|
+
return self.api_client.param_serialize(
|
|
935
|
+
method='GET',
|
|
936
|
+
resource_path='/api/v1/mailboxes/{mailboxResourceId}/folders',
|
|
937
|
+
path_params=_path_params,
|
|
938
|
+
query_params=_query_params,
|
|
939
|
+
header_params=_header_params,
|
|
940
|
+
body=_body_params,
|
|
941
|
+
post_params=_form_params,
|
|
942
|
+
files=_files,
|
|
943
|
+
auth_settings=_auth_settings,
|
|
944
|
+
collection_formats=_collection_formats,
|
|
945
|
+
_host=_host,
|
|
946
|
+
_request_auth=_request_auth
|
|
947
|
+
)
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
@validate_call
|
|
953
|
+
def update_folder(
|
|
954
|
+
self,
|
|
955
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
956
|
+
folder: Annotated[StrictStr, Field(description="Current folder path (URL-encoded).")],
|
|
957
|
+
v1_folders_update_request: V1FoldersUpdateRequest,
|
|
958
|
+
_request_timeout: Union[
|
|
959
|
+
None,
|
|
960
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
961
|
+
Tuple[
|
|
962
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
963
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
964
|
+
]
|
|
965
|
+
] = None,
|
|
966
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
967
|
+
_content_type: Optional[StrictStr] = None,
|
|
968
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
969
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
970
|
+
) -> V1FoldersResource:
|
|
971
|
+
"""Update folder
|
|
972
|
+
|
|
973
|
+
Rename an existing folder.
|
|
974
|
+
|
|
975
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
976
|
+
:type mailbox_resource_id: str
|
|
977
|
+
:param folder: Current folder path (URL-encoded). (required)
|
|
978
|
+
:type folder: str
|
|
979
|
+
:param v1_folders_update_request: (required)
|
|
980
|
+
:type v1_folders_update_request: V1FoldersUpdateRequest
|
|
981
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
982
|
+
number provided, it will be total request
|
|
983
|
+
timeout. It can also be a pair (tuple) of
|
|
984
|
+
(connection, read) timeouts.
|
|
985
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
986
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
987
|
+
request; this effectively ignores the
|
|
988
|
+
authentication in the spec for a single request.
|
|
989
|
+
:type _request_auth: dict, optional
|
|
990
|
+
:param _content_type: force content-type for the request.
|
|
991
|
+
:type _content_type: str, Optional
|
|
992
|
+
:param _headers: set to override the headers for a single
|
|
993
|
+
request; this effectively ignores the headers
|
|
994
|
+
in the spec for a single request.
|
|
995
|
+
:type _headers: dict, optional
|
|
996
|
+
:param _host_index: set to override the host_index for a single
|
|
997
|
+
request; this effectively ignores the host_index
|
|
998
|
+
in the spec for a single request.
|
|
999
|
+
:type _host_index: int, optional
|
|
1000
|
+
:return: Returns the result object.
|
|
1001
|
+
""" # noqa: E501
|
|
1002
|
+
|
|
1003
|
+
_param = self._update_folder_serialize(
|
|
1004
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
1005
|
+
folder=folder,
|
|
1006
|
+
v1_folders_update_request=v1_folders_update_request,
|
|
1007
|
+
_request_auth=_request_auth,
|
|
1008
|
+
_content_type=_content_type,
|
|
1009
|
+
_headers=_headers,
|
|
1010
|
+
_host_index=_host_index
|
|
1011
|
+
)
|
|
1012
|
+
|
|
1013
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1014
|
+
'200': "V1FoldersResource",
|
|
1015
|
+
'401': "Error",
|
|
1016
|
+
'403': "Error",
|
|
1017
|
+
'409': "Error",
|
|
1018
|
+
'422': "Error",
|
|
1019
|
+
'500': "Error",
|
|
1020
|
+
'502': "Error",
|
|
1021
|
+
}
|
|
1022
|
+
response_data = self.api_client.call_api(
|
|
1023
|
+
*_param,
|
|
1024
|
+
_request_timeout=_request_timeout
|
|
1025
|
+
)
|
|
1026
|
+
response_data.read()
|
|
1027
|
+
return self.api_client.response_deserialize(
|
|
1028
|
+
response_data=response_data,
|
|
1029
|
+
response_types_map=_response_types_map,
|
|
1030
|
+
).data
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
@validate_call
|
|
1034
|
+
def update_folder_with_http_info(
|
|
1035
|
+
self,
|
|
1036
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
1037
|
+
folder: Annotated[StrictStr, Field(description="Current folder path (URL-encoded).")],
|
|
1038
|
+
v1_folders_update_request: V1FoldersUpdateRequest,
|
|
1039
|
+
_request_timeout: Union[
|
|
1040
|
+
None,
|
|
1041
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1042
|
+
Tuple[
|
|
1043
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1044
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1045
|
+
]
|
|
1046
|
+
] = None,
|
|
1047
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1048
|
+
_content_type: Optional[StrictStr] = None,
|
|
1049
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1050
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1051
|
+
) -> ApiResponse[V1FoldersResource]:
|
|
1052
|
+
"""Update folder
|
|
1053
|
+
|
|
1054
|
+
Rename an existing folder.
|
|
1055
|
+
|
|
1056
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
1057
|
+
:type mailbox_resource_id: str
|
|
1058
|
+
:param folder: Current folder path (URL-encoded). (required)
|
|
1059
|
+
:type folder: str
|
|
1060
|
+
:param v1_folders_update_request: (required)
|
|
1061
|
+
:type v1_folders_update_request: V1FoldersUpdateRequest
|
|
1062
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1063
|
+
number provided, it will be total request
|
|
1064
|
+
timeout. It can also be a pair (tuple) of
|
|
1065
|
+
(connection, read) timeouts.
|
|
1066
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1067
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1068
|
+
request; this effectively ignores the
|
|
1069
|
+
authentication in the spec for a single request.
|
|
1070
|
+
:type _request_auth: dict, optional
|
|
1071
|
+
:param _content_type: force content-type for the request.
|
|
1072
|
+
:type _content_type: str, Optional
|
|
1073
|
+
:param _headers: set to override the headers for a single
|
|
1074
|
+
request; this effectively ignores the headers
|
|
1075
|
+
in the spec for a single request.
|
|
1076
|
+
:type _headers: dict, optional
|
|
1077
|
+
:param _host_index: set to override the host_index for a single
|
|
1078
|
+
request; this effectively ignores the host_index
|
|
1079
|
+
in the spec for a single request.
|
|
1080
|
+
:type _host_index: int, optional
|
|
1081
|
+
:return: Returns the result object.
|
|
1082
|
+
""" # noqa: E501
|
|
1083
|
+
|
|
1084
|
+
_param = self._update_folder_serialize(
|
|
1085
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
1086
|
+
folder=folder,
|
|
1087
|
+
v1_folders_update_request=v1_folders_update_request,
|
|
1088
|
+
_request_auth=_request_auth,
|
|
1089
|
+
_content_type=_content_type,
|
|
1090
|
+
_headers=_headers,
|
|
1091
|
+
_host_index=_host_index
|
|
1092
|
+
)
|
|
1093
|
+
|
|
1094
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1095
|
+
'200': "V1FoldersResource",
|
|
1096
|
+
'401': "Error",
|
|
1097
|
+
'403': "Error",
|
|
1098
|
+
'409': "Error",
|
|
1099
|
+
'422': "Error",
|
|
1100
|
+
'500': "Error",
|
|
1101
|
+
'502': "Error",
|
|
1102
|
+
}
|
|
1103
|
+
response_data = self.api_client.call_api(
|
|
1104
|
+
*_param,
|
|
1105
|
+
_request_timeout=_request_timeout
|
|
1106
|
+
)
|
|
1107
|
+
response_data.read()
|
|
1108
|
+
return self.api_client.response_deserialize(
|
|
1109
|
+
response_data=response_data,
|
|
1110
|
+
response_types_map=_response_types_map,
|
|
1111
|
+
)
|
|
1112
|
+
|
|
1113
|
+
|
|
1114
|
+
@validate_call
|
|
1115
|
+
def update_folder_without_preload_content(
|
|
1116
|
+
self,
|
|
1117
|
+
mailbox_resource_id: Annotated[StrictStr, Field(description="Resource ID of the managed mailbox the bearer token is authorized for.")],
|
|
1118
|
+
folder: Annotated[StrictStr, Field(description="Current folder path (URL-encoded).")],
|
|
1119
|
+
v1_folders_update_request: V1FoldersUpdateRequest,
|
|
1120
|
+
_request_timeout: Union[
|
|
1121
|
+
None,
|
|
1122
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1123
|
+
Tuple[
|
|
1124
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1125
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1126
|
+
]
|
|
1127
|
+
] = None,
|
|
1128
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1129
|
+
_content_type: Optional[StrictStr] = None,
|
|
1130
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1131
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1132
|
+
) -> RESTResponseType:
|
|
1133
|
+
"""Update folder
|
|
1134
|
+
|
|
1135
|
+
Rename an existing folder.
|
|
1136
|
+
|
|
1137
|
+
:param mailbox_resource_id: Resource ID of the managed mailbox the bearer token is authorized for. (required)
|
|
1138
|
+
:type mailbox_resource_id: str
|
|
1139
|
+
:param folder: Current folder path (URL-encoded). (required)
|
|
1140
|
+
:type folder: str
|
|
1141
|
+
:param v1_folders_update_request: (required)
|
|
1142
|
+
:type v1_folders_update_request: V1FoldersUpdateRequest
|
|
1143
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1144
|
+
number provided, it will be total request
|
|
1145
|
+
timeout. It can also be a pair (tuple) of
|
|
1146
|
+
(connection, read) timeouts.
|
|
1147
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1148
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1149
|
+
request; this effectively ignores the
|
|
1150
|
+
authentication in the spec for a single request.
|
|
1151
|
+
:type _request_auth: dict, optional
|
|
1152
|
+
:param _content_type: force content-type for the request.
|
|
1153
|
+
:type _content_type: str, Optional
|
|
1154
|
+
:param _headers: set to override the headers for a single
|
|
1155
|
+
request; this effectively ignores the headers
|
|
1156
|
+
in the spec for a single request.
|
|
1157
|
+
:type _headers: dict, optional
|
|
1158
|
+
:param _host_index: set to override the host_index for a single
|
|
1159
|
+
request; this effectively ignores the host_index
|
|
1160
|
+
in the spec for a single request.
|
|
1161
|
+
:type _host_index: int, optional
|
|
1162
|
+
:return: Returns the result object.
|
|
1163
|
+
""" # noqa: E501
|
|
1164
|
+
|
|
1165
|
+
_param = self._update_folder_serialize(
|
|
1166
|
+
mailbox_resource_id=mailbox_resource_id,
|
|
1167
|
+
folder=folder,
|
|
1168
|
+
v1_folders_update_request=v1_folders_update_request,
|
|
1169
|
+
_request_auth=_request_auth,
|
|
1170
|
+
_content_type=_content_type,
|
|
1171
|
+
_headers=_headers,
|
|
1172
|
+
_host_index=_host_index
|
|
1173
|
+
)
|
|
1174
|
+
|
|
1175
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1176
|
+
'200': "V1FoldersResource",
|
|
1177
|
+
'401': "Error",
|
|
1178
|
+
'403': "Error",
|
|
1179
|
+
'409': "Error",
|
|
1180
|
+
'422': "Error",
|
|
1181
|
+
'500': "Error",
|
|
1182
|
+
'502': "Error",
|
|
1183
|
+
}
|
|
1184
|
+
response_data = self.api_client.call_api(
|
|
1185
|
+
*_param,
|
|
1186
|
+
_request_timeout=_request_timeout
|
|
1187
|
+
)
|
|
1188
|
+
return response_data.response
|
|
1189
|
+
|
|
1190
|
+
|
|
1191
|
+
def _update_folder_serialize(
|
|
1192
|
+
self,
|
|
1193
|
+
mailbox_resource_id,
|
|
1194
|
+
folder,
|
|
1195
|
+
v1_folders_update_request,
|
|
1196
|
+
_request_auth,
|
|
1197
|
+
_content_type,
|
|
1198
|
+
_headers,
|
|
1199
|
+
_host_index,
|
|
1200
|
+
) -> RequestSerialized:
|
|
1201
|
+
|
|
1202
|
+
_host = None
|
|
1203
|
+
|
|
1204
|
+
_collection_formats: Dict[str, str] = {
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
_path_params: Dict[str, str] = {}
|
|
1208
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1209
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1210
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1211
|
+
_files: Dict[
|
|
1212
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1213
|
+
] = {}
|
|
1214
|
+
_body_params: Optional[bytes] = None
|
|
1215
|
+
|
|
1216
|
+
# process the path parameters
|
|
1217
|
+
if mailbox_resource_id is not None:
|
|
1218
|
+
_path_params['mailboxResourceId'] = mailbox_resource_id
|
|
1219
|
+
if folder is not None:
|
|
1220
|
+
_path_params['folder'] = folder
|
|
1221
|
+
# process the query parameters
|
|
1222
|
+
# process the header parameters
|
|
1223
|
+
# process the form parameters
|
|
1224
|
+
# process the body parameter
|
|
1225
|
+
if v1_folders_update_request is not None:
|
|
1226
|
+
_body_params = v1_folders_update_request
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
# set the HTTP header `Accept`
|
|
1230
|
+
if 'Accept' not in _header_params:
|
|
1231
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1232
|
+
[
|
|
1233
|
+
'application/json'
|
|
1234
|
+
]
|
|
1235
|
+
)
|
|
1236
|
+
|
|
1237
|
+
# set the HTTP header `Content-Type`
|
|
1238
|
+
if _content_type:
|
|
1239
|
+
_header_params['Content-Type'] = _content_type
|
|
1240
|
+
else:
|
|
1241
|
+
_default_content_type = (
|
|
1242
|
+
self.api_client.select_header_content_type(
|
|
1243
|
+
[
|
|
1244
|
+
'application/json'
|
|
1245
|
+
]
|
|
1246
|
+
)
|
|
1247
|
+
)
|
|
1248
|
+
if _default_content_type is not None:
|
|
1249
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1250
|
+
|
|
1251
|
+
# authentication setting
|
|
1252
|
+
_auth_settings: List[str] = [
|
|
1253
|
+
'BearerAuth'
|
|
1254
|
+
]
|
|
1255
|
+
|
|
1256
|
+
return self.api_client.param_serialize(
|
|
1257
|
+
method='PUT',
|
|
1258
|
+
resource_path='/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}',
|
|
1259
|
+
path_params=_path_params,
|
|
1260
|
+
query_params=_query_params,
|
|
1261
|
+
header_params=_header_params,
|
|
1262
|
+
body=_body_params,
|
|
1263
|
+
post_params=_form_params,
|
|
1264
|
+
files=_files,
|
|
1265
|
+
auth_settings=_auth_settings,
|
|
1266
|
+
collection_formats=_collection_formats,
|
|
1267
|
+
_host=_host,
|
|
1268
|
+
_request_auth=_request_auth
|
|
1269
|
+
)
|
|
1270
|
+
|
|
1271
|
+
|