mailbox-org-api 0.2__tar.gz → 0.2.2__tar.gz
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.
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/PKG-INFO +1 -1
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/mailbox_org_api/APIClient.py +69 -14
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/mailbox_org_api.egg-info/PKG-INFO +1 -1
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/pyproject.toml +1 -1
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/setup.py +1 -1
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/LICENSE +0 -0
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/README.md +0 -0
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/mailbox_org_api/__init__.py +0 -0
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/mailbox_org_api.egg-info/SOURCES.txt +0 -0
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/mailbox_org_api.egg-info/dependency_links.txt +0 -0
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/mailbox_org_api.egg-info/top_level.txt +0 -0
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/setup.cfg +0 -0
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/tests/__init__.py +0 -0
- {mailbox_org_api-0.2 → mailbox_org_api-0.2.2}/tests/tests.py +0 -0
|
@@ -118,30 +118,30 @@ class APIClient:
|
|
|
118
118
|
"""
|
|
119
119
|
return self.api_request('hello.innerworld', {})
|
|
120
120
|
|
|
121
|
-
def account_add(self,
|
|
121
|
+
def account_add(self, account: str) -> dict:
|
|
122
122
|
"""
|
|
123
123
|
Function to create a new account
|
|
124
|
-
:param
|
|
124
|
+
:param account: the account name to create
|
|
125
125
|
:return: the response from the mailbox.org Business API
|
|
126
126
|
"""
|
|
127
|
-
return self.api_request('account.add', {'
|
|
127
|
+
return self.api_request('account.add', {'account':account})
|
|
128
128
|
|
|
129
|
-
def account_get(self,
|
|
129
|
+
def account_get(self, account: str) -> dict:
|
|
130
130
|
"""
|
|
131
131
|
Function to get a specific account
|
|
132
|
-
:param
|
|
132
|
+
:param account: the account name to get
|
|
133
133
|
:return: the response from the mailbox.org Business API
|
|
134
134
|
"""
|
|
135
|
-
return self.api_request('account.get', {'
|
|
135
|
+
return self.api_request('account.get', {'account':account})
|
|
136
136
|
|
|
137
|
-
def account_set(self,
|
|
137
|
+
def account_set(self, account: str, attributes: dict) -> dict:
|
|
138
138
|
"""
|
|
139
139
|
Function to update a specific account
|
|
140
|
-
:param
|
|
140
|
+
:param account: the account name to update
|
|
141
141
|
:param attributes: the attributes to update
|
|
142
142
|
:return: the response from the mailbox.org Business API
|
|
143
143
|
"""
|
|
144
|
-
params = {'account':
|
|
144
|
+
params = {'account':account}
|
|
145
145
|
for attribute in attributes:
|
|
146
146
|
print('Attribute:', attribute)
|
|
147
147
|
if attribute not in account_set_arguments:
|
|
@@ -153,13 +153,13 @@ class APIClient:
|
|
|
153
153
|
params.update({attribute: attributes[attribute]})
|
|
154
154
|
return self.api_request('account.set', params)
|
|
155
155
|
|
|
156
|
-
def account_del(self,
|
|
156
|
+
def account_del(self, account: str) -> dict:
|
|
157
157
|
"""
|
|
158
158
|
Function to delete a specific account
|
|
159
|
-
:param
|
|
159
|
+
:param account: the account name to delete
|
|
160
160
|
:return: the response from the mailbox.org Business API
|
|
161
161
|
"""
|
|
162
|
-
return self.api_request('account.del', {'
|
|
162
|
+
return self.api_request('account.del', {'account':account})
|
|
163
163
|
|
|
164
164
|
def domain_list(self, account: str) -> dict:
|
|
165
165
|
"""
|
|
@@ -255,13 +255,14 @@ class APIClient:
|
|
|
255
255
|
'inboxsave':inboxsave, 'forwards':forwards, 'memo':memo,
|
|
256
256
|
'language':language, 'uid_extern':uid_extern})
|
|
257
257
|
|
|
258
|
-
def mail_get(self, mail: str):
|
|
258
|
+
def mail_get(self, mail: str, include_quota_usage: bool = False) -> dict:
|
|
259
259
|
"""
|
|
260
260
|
Function to retrieve a mail address
|
|
261
261
|
:param mail: the mail to retrieve
|
|
262
|
+
:param include_quota_usage: True if the quota usage should be included in the request
|
|
262
263
|
:return the response for the request
|
|
263
264
|
"""
|
|
264
|
-
return self.api_request('mail.get', {'mail':mail})
|
|
265
|
+
return self.api_request('mail.get', {'mail':mail, 'include_quota_usage':include_quota_usage})
|
|
265
266
|
|
|
266
267
|
def mail_set(self, mail: str, attributes: dict):
|
|
267
268
|
"""
|
|
@@ -282,6 +283,60 @@ class APIClient:
|
|
|
282
283
|
params.update({attribute: attributes[attribute]})
|
|
283
284
|
return self.api_request('mail.set', params)
|
|
284
285
|
|
|
286
|
+
def mail_set_password(self, mail: str, password: str) -> dict:
|
|
287
|
+
"""
|
|
288
|
+
Function to set a new password for a mail
|
|
289
|
+
:param mail: the mail to set the password for
|
|
290
|
+
:param password: the password to set
|
|
291
|
+
:return: the response for the request
|
|
292
|
+
"""
|
|
293
|
+
return self.api_request('mail.set', {'mail':mail, 'password':password})
|
|
294
|
+
|
|
295
|
+
def mail_set_password_require_reset(self, mail: str, password: str) -> dict:
|
|
296
|
+
"""
|
|
297
|
+
Function to set a new password for a mail and force the user to set a new password on the next login
|
|
298
|
+
:param mail: the mail to set the password for
|
|
299
|
+
:param password: the password to set
|
|
300
|
+
:return: the response for the request
|
|
301
|
+
"""
|
|
302
|
+
return self.api_request('mail.set', {'mail': mail, 'password': password, 'require_reset': True})
|
|
303
|
+
|
|
304
|
+
def mail_set_plan(self, mail: str, plan: str) -> dict:
|
|
305
|
+
"""
|
|
306
|
+
Function to set a new plan for a mail
|
|
307
|
+
:param mail: the mail to set the plan for
|
|
308
|
+
:param plan: the plan to set
|
|
309
|
+
:return: the response for the request
|
|
310
|
+
"""
|
|
311
|
+
return self.api_request('mail.set', {'mail':mail, 'plan':plan})
|
|
312
|
+
|
|
313
|
+
def mail_set_forwards(self, mail: str, forwards: list) -> dict:
|
|
314
|
+
"""
|
|
315
|
+
Function to set mail forwards
|
|
316
|
+
:param mail: the mail to set the forwards for
|
|
317
|
+
:param forwards: a list of addresses to forwards mails to
|
|
318
|
+
:return: the response for the request
|
|
319
|
+
"""
|
|
320
|
+
return self.api_request('mail.set', {'mail':mail, 'forwards':forwards})
|
|
321
|
+
|
|
322
|
+
def mail_set_aliases(self, mail: str, aliases: list) -> dict:
|
|
323
|
+
"""
|
|
324
|
+
Function to set mail aliases
|
|
325
|
+
:param mail: the mail to set the aliases for
|
|
326
|
+
:param aliases: a list of aliases to set
|
|
327
|
+
:return: the response for the request
|
|
328
|
+
"""
|
|
329
|
+
return self.api_request('mail.set', {'mail':mail, 'aliases':aliases})
|
|
330
|
+
|
|
331
|
+
def mail_set_state(self, mail: str, active: bool) -> dict:
|
|
332
|
+
"""
|
|
333
|
+
Function to activate or deactivate a mail
|
|
334
|
+
:param mail: the mail to set the status for
|
|
335
|
+
:param active: True if the mail should be active, False if it shall be deactivated
|
|
336
|
+
:return: the response for the request
|
|
337
|
+
"""
|
|
338
|
+
return self.api_request('mail.set', {'mail':mail, 'active':active})
|
|
339
|
+
|
|
285
340
|
def mail_capabilities_set(self, mail: str, capabilties: dict) -> dict:
|
|
286
341
|
"""
|
|
287
342
|
Function to set a domain capabilities
|
|
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
|
|
|
3
3
|
setup(
|
|
4
4
|
name='mailbox_org_api',
|
|
5
5
|
packages=find_packages(),
|
|
6
|
-
version='0.2',
|
|
6
|
+
version='0.2.2',
|
|
7
7
|
description='A library to access the mailbox.org Business API',
|
|
8
8
|
author='Hendrik Schlange',
|
|
9
9
|
install_requires=['requests'],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|