kloudless.account - Account

class kloudless.account.Account(token=None, api_key=None, account_id=None)

Bases: kloudless.client.Client

Account class that represents one Kloudless account.

Instance attributes

Variables:url (str) – Base url which would be used as prefix for all http method calls
__init__(token=None, api_key=None, account_id=None)

Either token or api_key is needed for instantiation. account_id is needed if api_key is specified.

Parameters:
  • token – Bearer token
  • api_key – API key
  • account_id – Account ID
raw(raw_method, raw_uri, **kwargs)

Method for Pass-Through API

Parameters:
  • raw_method (str) – The value stand for X-Kloudless-Raw-Method header
  • raw_uri – The value stand for X-Kloudless-Raw-URI header
  • kwargs – kwargs passed to kloudless.client.Client.post()
Returns:

requests.Response

kloudless.account.get_verified_account(app_id, token)

Verify the token belongs to an Application with app_id and return an kloudless.account.Account instance.

Parameters:
  • app_id (str) – Application ID
  • token (str) – Account’s Bearer token
Returns:

kloudless.account.Account

Raise:

kloudless.exceptions.TokenVerificationFailed