Tokens¶
Related to the Token API
-
class
koordinates.tokens.
TokenManager
(client)¶ Bases:
koordinates.base.Manager
Accessor for querying Tokens.
Access via the
tokens
property of akoordinates.client.Client
instance.-
create
(token, email, password)¶ Create a new token
Parameters: - token (Token) – Token instance to create.
- email (str) – Email address of the Koordinates user account.
- password (str) – Koordinates user account password.
-
delete
(id)¶ Delete a token
-
expand
(*args, **kwargs)¶ Returns an expanded Query view of the model objects. Equivalent to calling
.list().expand()
. Using expansions may have significant performance implications for some API requests. Seekoordinates.base.Query.expand()
.
-
filter
(*args, **kwargs)¶ Returns a filtered Query view of the model objects. Equivalent to calling
.list().filter(...)
. Seekoordinates.base.Query.filter()
.
-
get
(id, expand=[])¶ Fetches a Model instance determined by the value of id.
Parameters: id – numeric ID for the Model.
-
list
()¶ Fetches a set of model objects
Return type: koordinates.base.Query
-
model
¶ alias of
Token
-
order_by
(*args, **kwargs)¶ Returns an ordered Query view of the model objects. Equivalent to calling
.list().order_by(...)
. Seekoordinates.base.Query.order_by()
.
-
-
class
koordinates.tokens.
Token
(**kwargs)¶ Bases:
koordinates.base.Model
Represents an API Token.
-
refresh
()¶ Refresh this model from the server.
Updates attributes with the server-defined values. This is useful where the Model instance came from a partial response (eg. a list query) and additional details are required.
Existing attribute values will be overwritten.
-
save
()¶ Saves changes to a token
-
scopes
¶ Read/Write accessor for the
scope
property as a list of scope strings.
-