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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mailbox-org-api
3
- Version: 0.2
3
+ Version: 0.2.2
4
4
  Summary: A library to access the mailbox.org Business API.
5
5
  Author: Hendrik Schlange
6
6
  Author-email: Hendrik Schlange <mail@heshsum.de>
@@ -118,30 +118,30 @@ class APIClient:
118
118
  """
119
119
  return self.api_request('hello.innerworld', {})
120
120
 
121
- def account_add(self, account_name: str) -> dict:
121
+ def account_add(self, account: str) -> dict:
122
122
  """
123
123
  Function to create a new account
124
- :param account_name: the account name to create
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', {'account_name':account_name})
127
+ return self.api_request('account.add', {'account':account})
128
128
 
129
- def account_get(self, account_name: str) -> dict:
129
+ def account_get(self, account: str) -> dict:
130
130
  """
131
131
  Function to get a specific account
132
- :param account_name: the account name to get
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', {'account_name':account_name})
135
+ return self.api_request('account.get', {'account':account})
136
136
 
137
- def account_set(self, account_name: str, attributes: dict) -> dict:
137
+ def account_set(self, account: str, attributes: dict) -> dict:
138
138
  """
139
139
  Function to update a specific account
140
- :param account_name: the account name to update
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':account_name}
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, account_name: str) -> dict:
156
+ def account_del(self, account: str) -> dict:
157
157
  """
158
158
  Function to delete a specific account
159
- :param account_name: the account name to delete
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', {'account_name':account_name})
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mailbox-org-api
3
- Version: 0.2
3
+ Version: 0.2.2
4
4
  Summary: A library to access the mailbox.org Business API.
5
5
  Author: Hendrik Schlange
6
6
  Author-email: Hendrik Schlange <mail@heshsum.de>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mailbox-org-api"
3
- version = "0.2"
3
+ version = "0.2.2"
4
4
  authors = [
5
5
  { name="Hendrik Schlange", email="mail@heshsum.de" },
6
6
  ]
@@ -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