Package io.mailtrap.api.apitokens
Class ApiTokensImpl
java.lang.Object
io.mailtrap.api.apiresource.ApiResource
io.mailtrap.api.apitokens.ApiTokensImpl
- All Implemented Interfaces:
ApiTokens
-
Field Summary
Fields inherited from class io.mailtrap.api.apiresource.ApiResource
apiHost, httpClient, token -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateApiToken(long accountId, CreateApiTokenRequest request) Create a new API token for the account with the given name and resource permissions.voiddeleteApiToken(long accountId, long id) Permanently delete an API token.getAllApiTokens(long accountId) List all API tokens visible to the current API token.getApiToken(long accountId, long id) Get a single API token by id.resetApiToken(long accountId, long id) Reset an API token.
-
Constructor Details
-
ApiTokensImpl
-
-
Method Details
-
getAllApiTokens
Description copied from interface:ApiTokensList all API tokens visible to the current API token.- Specified by:
getAllApiTokensin interfaceApiTokens- Parameters:
accountId- unique account ID- Returns:
- list of API tokens
-
createApiToken
Description copied from interface:ApiTokensCreate a new API token for the account with the given name and resource permissions. The full token value is returned only on creation.- Specified by:
createApiTokenin interfaceApiTokens- Parameters:
accountId- unique account IDrequest- token name and resource permissions- Returns:
- created token, including the full token value
-
getApiToken
Description copied from interface:ApiTokensGet a single API token by id.- Specified by:
getApiTokenin interfaceApiTokens- Parameters:
accountId- unique account IDid- API token ID- Returns:
- API token
-
deleteApiToken
public void deleteApiToken(long accountId, long id) Description copied from interface:ApiTokensPermanently delete an API token.- Specified by:
deleteApiTokenin interfaceApiTokens- Parameters:
accountId- unique account IDid- API token ID
-
resetApiToken
Description copied from interface:ApiTokensReset an API token. Expires the requested token and creates a new one with the same permissions; the new token value is returned only once.- Specified by:
resetApiTokenin interfaceApiTokens- Parameters:
accountId- unique account IDid- API token ID- Returns:
- new token, including the full token value
-