Account

class coto.clients.account.ReauthException[source]
class coto.clients.account.Client(session)[source]

A low-level client representing Account:

import coto

session = coto.Session()
client = session.client('account')

These are the available methods:

get_account_info()[source]

Gets the account name and email address.

Request Syntax:
response = client.get_auth_state()
Returns:Response Syntax
{
    'accountEmail': str,
    'Message': str,
    'accountName': str,
    'Title': str,
}
Return type:dict
Raises:coto.clients.decoupled_account.ReauthException – You have to reauthenticate, then try again.
update_account_email(Password, AccountEmail)[source]

Sets a new account email address.

Request Syntax:
response = client.update_account_email(
    Password=str,
    AccountEmail=str,
)
Parameters:
  • Password (str) – Current account password.
  • AccountEmail (str) – New account email.
Returns:

Response Syntax

{
    'Message': str,
    'Title': str,
    'updatedAccountEmail': str
}

Return type:

dict

Raises:

coto.clients.decoupled_account.ReauthException – You have to reauthenticate, then try again.

update_account_name(AccountName)[source]

Sets a new account name.

Request Syntax:
response = client.update_account_name(
    AccountName=str,
)
Returns:Response Syntax
{
    'Message': str,
    'Title': str,
    'updatedAccountName': str
}
Return type:dict
Raises:coto.clients.decoupled_account.ReauthException – You have to reauthenticate, then try again.
update_account_password(Password, NewPassword)[source]

Sets a new account password.

Request Syntax:
response = client.update_account_password(
    Password=str,
    NewPassword=str,
)
Parameters:
  • Password (str) – Current account password.
  • NewPassword (str) – New account password.
Returns:

Response Syntax

{
    'Message': str,
    'Title': str,
}

Return type:

dict

Raises:

coto.clients.decoupled_account.ReauthException – You have to reauthenticate, then try again.