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.
Files changed (59) hide show
  1. hostinger_mail_api/__init__.py +76 -0
  2. hostinger_mail_api/api/__init__.py +10 -0
  3. hostinger_mail_api/api/account_api.py +284 -0
  4. hostinger_mail_api/api/folders_api.py +1271 -0
  5. hostinger_mail_api/api/messages_api.py +4237 -0
  6. hostinger_mail_api/api/quota_api.py +304 -0
  7. hostinger_mail_api/api/send_api.py +336 -0
  8. hostinger_mail_api/api/webhooks_api.py +2154 -0
  9. hostinger_mail_api/api_client.py +795 -0
  10. hostinger_mail_api/api_response.py +21 -0
  11. hostinger_mail_api/configuration.py +579 -0
  12. hostinger_mail_api/exceptions.py +214 -0
  13. hostinger_mail_api/models/__init__.py +54 -0
  14. hostinger_mail_api/models/error.py +89 -0
  15. hostinger_mail_api/models/pagination.py +91 -0
  16. hostinger_mail_api/models/v1_folder_messages_collection.py +99 -0
  17. hostinger_mail_api/models/v1_folder_messages_delete_bulk_request.py +86 -0
  18. hostinger_mail_api/models/v1_folder_messages_flags_bulk_request.py +90 -0
  19. hostinger_mail_api/models/v1_folder_messages_flags_request.py +88 -0
  20. hostinger_mail_api/models/v1_folder_messages_message.py +165 -0
  21. hostinger_mail_api/models/v1_folder_messages_message_address.py +87 -0
  22. hostinger_mail_api/models/v1_folder_messages_message_attachment.py +105 -0
  23. hostinger_mail_api/models/v1_folder_messages_message_text.py +87 -0
  24. hostinger_mail_api/models/v1_folder_messages_message_text_resource.py +89 -0
  25. hostinger_mail_api/models/v1_folder_messages_move_bulk_request.py +88 -0
  26. hostinger_mail_api/models/v1_folder_messages_move_request.py +86 -0
  27. hostinger_mail_api/models/v1_folder_messages_resource.py +89 -0
  28. hostinger_mail_api/models/v1_folder_messages_search_request.py +111 -0
  29. hostinger_mail_api/models/v1_folder_messages_update_flags_result.py +89 -0
  30. hostinger_mail_api/models/v1_folder_messages_update_flags_result_data.py +95 -0
  31. hostinger_mail_api/models/v1_folder_messages_update_flags_result_data_failed_inner.py +87 -0
  32. hostinger_mail_api/models/v1_folders_collection.py +99 -0
  33. hostinger_mail_api/models/v1_folders_create_request.py +86 -0
  34. hostinger_mail_api/models/v1_folders_folder.py +100 -0
  35. hostinger_mail_api/models/v1_folders_resource.py +89 -0
  36. hostinger_mail_api/models/v1_folders_update_request.py +86 -0
  37. hostinger_mail_api/models/v1_me_mailbox.py +95 -0
  38. hostinger_mail_api/models/v1_me_resource.py +89 -0
  39. hostinger_mail_api/models/v1_me_resource_data.py +103 -0
  40. hostinger_mail_api/models/v1_quota_quota.py +101 -0
  41. hostinger_mail_api/models/v1_quota_quota_resource.py +91 -0
  42. hostinger_mail_api/models/v1_quota_resource.py +89 -0
  43. hostinger_mail_api/models/v1_send_attachment.py +93 -0
  44. hostinger_mail_api/models/v1_send_request.py +92 -0
  45. hostinger_mail_api/models/v1_webhooks_collection.py +99 -0
  46. hostinger_mail_api/models/v1_webhooks_create_request.py +117 -0
  47. hostinger_mail_api/models/v1_webhooks_resource.py +89 -0
  48. hostinger_mail_api/models/v1_webhooks_resource_with_secret.py +89 -0
  49. hostinger_mail_api/models/v1_webhooks_test_result.py +89 -0
  50. hostinger_mail_api/models/v1_webhooks_test_result_data.py +94 -0
  51. hostinger_mail_api/models/v1_webhooks_update_request.py +120 -0
  52. hostinger_mail_api/models/v1_webhooks_webhook.py +132 -0
  53. hostinger_mail_api/models/v1_webhooks_webhook_with_secret.py +134 -0
  54. hostinger_mail_api/py.typed +0 -0
  55. hostinger_mail_api/rest.py +256 -0
  56. hostinger_mail_api-1.0.3.dist-info/METADATA +180 -0
  57. hostinger_mail_api-1.0.3.dist-info/RECORD +59 -0
  58. hostinger_mail_api-1.0.3.dist-info/WHEEL +5 -0
  59. hostinger_mail_api-1.0.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,76 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ Hostinger Email API Python SDK
7
+
8
+ API Version: 1.0.0
9
+
10
+ NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
11
+ If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
12
+ """ # noqa: E501
13
+
14
+
15
+ __version__ = "1.0.3"
16
+
17
+ # import apis into sdk package
18
+ from hostinger_mail_api.api.account_api import AccountApi
19
+ from hostinger_mail_api.api.folders_api import FoldersApi
20
+ from hostinger_mail_api.api.messages_api import MessagesApi
21
+ from hostinger_mail_api.api.quota_api import QuotaApi
22
+ from hostinger_mail_api.api.send_api import SendApi
23
+ from hostinger_mail_api.api.webhooks_api import WebhooksApi
24
+
25
+ # import ApiClient
26
+ from hostinger_mail_api.api_response import ApiResponse
27
+ from hostinger_mail_api.api_client import ApiClient
28
+ from hostinger_mail_api.configuration import Configuration
29
+ from hostinger_mail_api.exceptions import OpenApiException
30
+ from hostinger_mail_api.exceptions import ApiTypeError
31
+ from hostinger_mail_api.exceptions import ApiValueError
32
+ from hostinger_mail_api.exceptions import ApiKeyError
33
+ from hostinger_mail_api.exceptions import ApiAttributeError
34
+ from hostinger_mail_api.exceptions import ApiException
35
+
36
+ # import models into sdk package
37
+ from hostinger_mail_api.models.error import Error
38
+ from hostinger_mail_api.models.pagination import Pagination
39
+ from hostinger_mail_api.models.v1_folder_messages_collection import V1FolderMessagesCollection
40
+ from hostinger_mail_api.models.v1_folder_messages_delete_bulk_request import V1FolderMessagesDeleteBulkRequest
41
+ from hostinger_mail_api.models.v1_folder_messages_flags_bulk_request import V1FolderMessagesFlagsBulkRequest
42
+ from hostinger_mail_api.models.v1_folder_messages_flags_request import V1FolderMessagesFlagsRequest
43
+ from hostinger_mail_api.models.v1_folder_messages_message import V1FolderMessagesMessage
44
+ from hostinger_mail_api.models.v1_folder_messages_message_address import V1FolderMessagesMessageAddress
45
+ from hostinger_mail_api.models.v1_folder_messages_message_attachment import V1FolderMessagesMessageAttachment
46
+ from hostinger_mail_api.models.v1_folder_messages_message_text import V1FolderMessagesMessageText
47
+ from hostinger_mail_api.models.v1_folder_messages_message_text_resource import V1FolderMessagesMessageTextResource
48
+ from hostinger_mail_api.models.v1_folder_messages_move_bulk_request import V1FolderMessagesMoveBulkRequest
49
+ from hostinger_mail_api.models.v1_folder_messages_move_request import V1FolderMessagesMoveRequest
50
+ from hostinger_mail_api.models.v1_folder_messages_resource import V1FolderMessagesResource
51
+ from hostinger_mail_api.models.v1_folder_messages_search_request import V1FolderMessagesSearchRequest
52
+ from hostinger_mail_api.models.v1_folder_messages_update_flags_result import V1FolderMessagesUpdateFlagsResult
53
+ from hostinger_mail_api.models.v1_folder_messages_update_flags_result_data import V1FolderMessagesUpdateFlagsResultData
54
+ from hostinger_mail_api.models.v1_folder_messages_update_flags_result_data_failed_inner import V1FolderMessagesUpdateFlagsResultDataFailedInner
55
+ from hostinger_mail_api.models.v1_folders_collection import V1FoldersCollection
56
+ from hostinger_mail_api.models.v1_folders_create_request import V1FoldersCreateRequest
57
+ from hostinger_mail_api.models.v1_folders_folder import V1FoldersFolder
58
+ from hostinger_mail_api.models.v1_folders_resource import V1FoldersResource
59
+ from hostinger_mail_api.models.v1_folders_update_request import V1FoldersUpdateRequest
60
+ from hostinger_mail_api.models.v1_me_mailbox import V1MeMailbox
61
+ from hostinger_mail_api.models.v1_me_resource import V1MeResource
62
+ from hostinger_mail_api.models.v1_me_resource_data import V1MeResourceData
63
+ from hostinger_mail_api.models.v1_quota_quota import V1QuotaQuota
64
+ from hostinger_mail_api.models.v1_quota_quota_resource import V1QuotaQuotaResource
65
+ from hostinger_mail_api.models.v1_quota_resource import V1QuotaResource
66
+ from hostinger_mail_api.models.v1_send_attachment import V1SendAttachment
67
+ from hostinger_mail_api.models.v1_send_request import V1SendRequest
68
+ from hostinger_mail_api.models.v1_webhooks_collection import V1WebhooksCollection
69
+ from hostinger_mail_api.models.v1_webhooks_create_request import V1WebhooksCreateRequest
70
+ from hostinger_mail_api.models.v1_webhooks_resource import V1WebhooksResource
71
+ from hostinger_mail_api.models.v1_webhooks_resource_with_secret import V1WebhooksResourceWithSecret
72
+ from hostinger_mail_api.models.v1_webhooks_test_result import V1WebhooksTestResult
73
+ from hostinger_mail_api.models.v1_webhooks_test_result_data import V1WebhooksTestResultData
74
+ from hostinger_mail_api.models.v1_webhooks_update_request import V1WebhooksUpdateRequest
75
+ from hostinger_mail_api.models.v1_webhooks_webhook import V1WebhooksWebhook
76
+ from hostinger_mail_api.models.v1_webhooks_webhook_with_secret import V1WebhooksWebhookWithSecret
@@ -0,0 +1,10 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from hostinger_mail_api.api.account_api import AccountApi
5
+ from hostinger_mail_api.api.folders_api import FoldersApi
6
+ from hostinger_mail_api.api.messages_api import MessagesApi
7
+ from hostinger_mail_api.api.quota_api import QuotaApi
8
+ from hostinger_mail_api.api.send_api import SendApi
9
+ from hostinger_mail_api.api.webhooks_api import WebhooksApi
10
+
@@ -0,0 +1,284 @@
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 hostinger_mail_api.models.v1_me_resource import V1MeResource
18
+
19
+ from hostinger_mail_api.api_client import ApiClient, RequestSerialized
20
+ from hostinger_mail_api.api_response import ApiResponse
21
+ from hostinger_mail_api.rest import RESTResponseType
22
+
23
+
24
+ class AccountApi:
25
+
26
+ def __init__(self, api_client=None) -> None:
27
+ if api_client is None:
28
+ api_client = ApiClient.get_default()
29
+ self.api_client = api_client
30
+
31
+
32
+ @validate_call
33
+ def get_current_account(
34
+ self,
35
+ _request_timeout: Union[
36
+ None,
37
+ Annotated[StrictFloat, Field(gt=0)],
38
+ Tuple[
39
+ Annotated[StrictFloat, Field(gt=0)],
40
+ Annotated[StrictFloat, Field(gt=0)]
41
+ ]
42
+ ] = None,
43
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
44
+ _content_type: Optional[StrictStr] = None,
45
+ _headers: Optional[Dict[StrictStr, Any]] = None,
46
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
47
+ ) -> V1MeResource:
48
+ """Get the authenticated account
49
+
50
+ Returns the authenticated account and the mailboxes it can manage.
51
+
52
+ :param _request_timeout: timeout setting for this request. If one
53
+ number provided, it will be total request
54
+ timeout. It can also be a pair (tuple) of
55
+ (connection, read) timeouts.
56
+ :type _request_timeout: int, tuple(int, int), optional
57
+ :param _request_auth: set to override the auth_settings for an a single
58
+ request; this effectively ignores the
59
+ authentication in the spec for a single request.
60
+ :type _request_auth: dict, optional
61
+ :param _content_type: force content-type for the request.
62
+ :type _content_type: str, Optional
63
+ :param _headers: set to override the headers for a single
64
+ request; this effectively ignores the headers
65
+ in the spec for a single request.
66
+ :type _headers: dict, optional
67
+ :param _host_index: set to override the host_index for a single
68
+ request; this effectively ignores the host_index
69
+ in the spec for a single request.
70
+ :type _host_index: int, optional
71
+ :return: Returns the result object.
72
+ """ # noqa: E501
73
+
74
+ _param = self._get_current_account_serialize(
75
+ _request_auth=_request_auth,
76
+ _content_type=_content_type,
77
+ _headers=_headers,
78
+ _host_index=_host_index
79
+ )
80
+
81
+ _response_types_map: Dict[str, Optional[str]] = {
82
+ '200': "V1MeResource",
83
+ '401': "Error",
84
+ '500': "Error",
85
+ '502': "Error",
86
+ }
87
+ response_data = self.api_client.call_api(
88
+ *_param,
89
+ _request_timeout=_request_timeout
90
+ )
91
+ response_data.read()
92
+ return self.api_client.response_deserialize(
93
+ response_data=response_data,
94
+ response_types_map=_response_types_map,
95
+ ).data
96
+
97
+
98
+ @validate_call
99
+ def get_current_account_with_http_info(
100
+ self,
101
+ _request_timeout: Union[
102
+ None,
103
+ Annotated[StrictFloat, Field(gt=0)],
104
+ Tuple[
105
+ Annotated[StrictFloat, Field(gt=0)],
106
+ Annotated[StrictFloat, Field(gt=0)]
107
+ ]
108
+ ] = None,
109
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
110
+ _content_type: Optional[StrictStr] = None,
111
+ _headers: Optional[Dict[StrictStr, Any]] = None,
112
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
113
+ ) -> ApiResponse[V1MeResource]:
114
+ """Get the authenticated account
115
+
116
+ Returns the authenticated account and the mailboxes it can manage.
117
+
118
+ :param _request_timeout: timeout setting for this request. If one
119
+ number provided, it will be total request
120
+ timeout. It can also be a pair (tuple) of
121
+ (connection, read) timeouts.
122
+ :type _request_timeout: int, tuple(int, int), optional
123
+ :param _request_auth: set to override the auth_settings for an a single
124
+ request; this effectively ignores the
125
+ authentication in the spec for a single request.
126
+ :type _request_auth: dict, optional
127
+ :param _content_type: force content-type for the request.
128
+ :type _content_type: str, Optional
129
+ :param _headers: set to override the headers for a single
130
+ request; this effectively ignores the headers
131
+ in the spec for a single request.
132
+ :type _headers: dict, optional
133
+ :param _host_index: set to override the host_index for a single
134
+ request; this effectively ignores the host_index
135
+ in the spec for a single request.
136
+ :type _host_index: int, optional
137
+ :return: Returns the result object.
138
+ """ # noqa: E501
139
+
140
+ _param = self._get_current_account_serialize(
141
+ _request_auth=_request_auth,
142
+ _content_type=_content_type,
143
+ _headers=_headers,
144
+ _host_index=_host_index
145
+ )
146
+
147
+ _response_types_map: Dict[str, Optional[str]] = {
148
+ '200': "V1MeResource",
149
+ '401': "Error",
150
+ '500': "Error",
151
+ '502': "Error",
152
+ }
153
+ response_data = self.api_client.call_api(
154
+ *_param,
155
+ _request_timeout=_request_timeout
156
+ )
157
+ response_data.read()
158
+ return self.api_client.response_deserialize(
159
+ response_data=response_data,
160
+ response_types_map=_response_types_map,
161
+ )
162
+
163
+
164
+ @validate_call
165
+ def get_current_account_without_preload_content(
166
+ self,
167
+ _request_timeout: Union[
168
+ None,
169
+ Annotated[StrictFloat, Field(gt=0)],
170
+ Tuple[
171
+ Annotated[StrictFloat, Field(gt=0)],
172
+ Annotated[StrictFloat, Field(gt=0)]
173
+ ]
174
+ ] = None,
175
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
176
+ _content_type: Optional[StrictStr] = None,
177
+ _headers: Optional[Dict[StrictStr, Any]] = None,
178
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
179
+ ) -> RESTResponseType:
180
+ """Get the authenticated account
181
+
182
+ Returns the authenticated account and the mailboxes it can manage.
183
+
184
+ :param _request_timeout: timeout setting for this request. If one
185
+ number provided, it will be total request
186
+ timeout. It can also be a pair (tuple) of
187
+ (connection, read) timeouts.
188
+ :type _request_timeout: int, tuple(int, int), optional
189
+ :param _request_auth: set to override the auth_settings for an a single
190
+ request; this effectively ignores the
191
+ authentication in the spec for a single request.
192
+ :type _request_auth: dict, optional
193
+ :param _content_type: force content-type for the request.
194
+ :type _content_type: str, Optional
195
+ :param _headers: set to override the headers for a single
196
+ request; this effectively ignores the headers
197
+ in the spec for a single request.
198
+ :type _headers: dict, optional
199
+ :param _host_index: set to override the host_index for a single
200
+ request; this effectively ignores the host_index
201
+ in the spec for a single request.
202
+ :type _host_index: int, optional
203
+ :return: Returns the result object.
204
+ """ # noqa: E501
205
+
206
+ _param = self._get_current_account_serialize(
207
+ _request_auth=_request_auth,
208
+ _content_type=_content_type,
209
+ _headers=_headers,
210
+ _host_index=_host_index
211
+ )
212
+
213
+ _response_types_map: Dict[str, Optional[str]] = {
214
+ '200': "V1MeResource",
215
+ '401': "Error",
216
+ '500': "Error",
217
+ '502': "Error",
218
+ }
219
+ response_data = self.api_client.call_api(
220
+ *_param,
221
+ _request_timeout=_request_timeout
222
+ )
223
+ return response_data.response
224
+
225
+
226
+ def _get_current_account_serialize(
227
+ self,
228
+ _request_auth,
229
+ _content_type,
230
+ _headers,
231
+ _host_index,
232
+ ) -> RequestSerialized:
233
+
234
+ _host = None
235
+
236
+ _collection_formats: Dict[str, str] = {
237
+ }
238
+
239
+ _path_params: Dict[str, str] = {}
240
+ _query_params: List[Tuple[str, str]] = []
241
+ _header_params: Dict[str, Optional[str]] = _headers or {}
242
+ _form_params: List[Tuple[str, str]] = []
243
+ _files: Dict[
244
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
245
+ ] = {}
246
+ _body_params: Optional[bytes] = None
247
+
248
+ # process the path parameters
249
+ # process the query parameters
250
+ # process the header parameters
251
+ # process the form parameters
252
+ # process the body parameter
253
+
254
+
255
+ # set the HTTP header `Accept`
256
+ if 'Accept' not in _header_params:
257
+ _header_params['Accept'] = self.api_client.select_header_accept(
258
+ [
259
+ 'application/json'
260
+ ]
261
+ )
262
+
263
+
264
+ # authentication setting
265
+ _auth_settings: List[str] = [
266
+ 'BearerAuth'
267
+ ]
268
+
269
+ return self.api_client.param_serialize(
270
+ method='GET',
271
+ resource_path='/api/v1/me',
272
+ path_params=_path_params,
273
+ query_params=_query_params,
274
+ header_params=_header_params,
275
+ body=_body_params,
276
+ post_params=_form_params,
277
+ files=_files,
278
+ auth_settings=_auth_settings,
279
+ collection_formats=_collection_formats,
280
+ _host=_host,
281
+ _request_auth=_request_auth
282
+ )
283
+
284
+