malix package¶
Subpackages¶
Submodules¶
malix.client module¶
-
class
malix.client.Client(address: str, password: str)¶ Bases:
objectClient class for MalixMail.
- Parameters
address (str) – Address of the account.
password (str) – Passowrd of the account.
- Returns Client
Clientobject.
-
delete_account(Id: str)¶ Deletes the account resource of the given account id.
- Parameters
Id (str) – Id of the account.
- Returns
204 (int) - Successfully deleted.
- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no account resource associated with the given account id.
AccessDenied – When the client doesn’t have the rights to perform some specific operations.When you don’t have the rights to perform the specific operations.
-
delete_message(Id: str)¶ Deletes the message resource of the given message id.
- Parameters
Id (str) – Id of the message.
- Returns
204 (int) - Successfully deleted.
- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no message resource associated with the given message id.
-
download_message(Id: str)¶ Downloads the message.
- Parameters
Id (str) – Id of the message.
- Returns
200 (int) - Successfully downloaded.
- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no message resource associated with the given message id.
-
get_account(Id: str)¶ Returns an
Accountobject for the given account id.- Parameters
Id (str) – Id of the account.
- Returns
Accountobject.- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no account resource associated with the given account id.
-
get_message(Id: str)¶ Returns a
Messageobject for the given message id.- Parameters
Id (str) – Id of the account.
- Returns
Messageobject.- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no message resource associated with the given message id.
-
get_message_collection()¶ Returns collections of messages.
- Returns
dict - dictonary of inbox messages.
- Raises
NotAuthorized – When the client isn’t authorized.
-
get_my_account()¶ Returns an
Accountobject for the client.- Returns
Accountobject.- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no account resource associated with the client’s address.
AccessDenied – When the client doesn’t have the rights to perform some specific operations.
-
update_message(Id: str)¶ Updates seen status of the given message id.
- Parameters
Id (str) – Id of the account.
- Returns
response (dict) - Response of the patch request.
- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no account resource associated with the given account id.
InvalidInput – When no valid inputs are given.
UnprocessableEntity – When no valid inputs are given.
-
malix.client.get_domain(Id: str)¶ Returns
Domainobject of the given Id.- Parameters
Id (str) – Id of the domain.
- Returns
Domainobject.- Raises
ResourceNotFound – When there is no domain resource associated with the given domain id.
-
malix.client.get_domain_collection(domains_only: bool = False)¶ Returns collection of available domains.
- Parameters
domains_only (bool) – Set true if you want to get only the domains containing in a list.
- Returns
if
domains_only: bool = False: dictionary of available domains with other responses.if
domains_only: bool = True: list of available domains.
-
malix.client.get_token(address: str, password: str)¶ Returns a
Tokenobject for the given credentials.- Parameters
address (str) – Address of the account.
password (str) – Passowrd of the account.
- Returns
Tokenobject- Raises
InvalidCredentials – Raises when given credentials are invalid.
-
malix.client.make_account(address: str, password: str)¶ Creates an account resourse using the given credentials.
- Parameters
address (str) – Address of the account.
password (str) – Passowrd of the account.
- Returns
Accountobject.- Raises
InvalidInput – When no valid inputs are given.
UnprocessableEntity – When no valid inputs are given.