public class Account
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Account.Role
A user role to use in the user management API (create/update user).
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACCESS_KEYS |
static java.lang.String |
ACCOUNTS |
static java.lang.String |
PROVISIONING |
static java.lang.String |
SUB_ACCOUNTS |
static java.lang.String |
USER_GROUPS |
static java.lang.String |
USERS |
| Constructor and Description |
|---|
Account(AccountConfiguration accountConfiguration,
Cloudinary cloudinary)
Create a new instance to use the account API.
|
Account(Cloudinary cloudinary)
Create a new instance to use the account API.
|
| Modifier and Type | Method and Description |
|---|---|
ApiResponse |
addUserToGroup(java.lang.String groupId,
java.lang.String userId)
Add an existing user to a group.
|
ApiResponse |
addUserToGroup(java.lang.String groupId,
java.lang.String userId,
java.util.Map<java.lang.String,java.lang.Object> options)
Add an existing user to a group.
|
ApiResponse |
createAccessKey(java.lang.String subAccountId,
java.lang.String name,
java.lang.Boolean enabled,
java.util.Map<java.lang.String,java.lang.Object> options)
Creates a new access key for this sub account id.
|
ApiResponse |
createSubAccount(java.lang.String name,
java.lang.String cloudName,
java.util.Map customAttributes,
boolean enabled,
java.lang.String baseAccount) |
ApiResponse |
createSubAccount(java.lang.String name,
java.lang.String cloudName,
java.util.Map customAttributes,
boolean enabled,
java.lang.String baseAccount,
java.util.Map<java.lang.String,java.lang.Object> options) |
ApiResponse |
createUser(java.lang.String name,
java.lang.String email,
Account.Role role,
java.lang.Boolean enabled,
java.util.List<java.lang.String> subAccountsIds,
java.util.Map<java.lang.String,java.lang.Object> options)
Create a new user.
|
ApiResponse |
createUser(java.lang.String name,
java.lang.String email,
Account.Role role,
java.util.List<java.lang.String> subAccountsIds)
Create a new user.
|
ApiResponse |
createUser(java.lang.String name,
java.lang.String email,
Account.Role role,
java.util.List<java.lang.String> subAccountsIds,
java.util.Map<java.lang.String,java.lang.Object> options)
Create a new user.
|
ApiResponse |
createUserGroup(java.lang.String name)
Create a new user group
|
ApiResponse |
createUserGroup(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> options)
Create a new user group
|
ApiResponse |
deleteAccessKey(java.lang.String subAccountId,
java.lang.String accessKey,
java.util.Map<java.lang.String,java.lang.Object> options)
Deletes an existing access key for this sub account id.
|
ApiResponse |
deleteSubAccount(java.lang.String subAccountId)
Deletes the sub-account.
|
ApiResponse |
deleteSubAccount(java.lang.String subAccountId,
java.util.Map<java.lang.String,java.lang.Object> options)
Deletes the sub-account.
|
ApiResponse |
deleteUser(java.lang.String userId)
Delete a user.
|
ApiResponse |
deleteUser(java.lang.String userId,
java.util.Map<java.lang.String,java.lang.Object> options)
Delete a user.
|
ApiResponse |
deleteUserGroup(java.lang.String groupId)
Delete a user group
|
ApiResponse |
deleteUserGroup(java.lang.String groupId,
java.util.Map<java.lang.String,java.lang.Object> options)
Delete a user group
|
ApiResponse |
getAccessKeys(java.lang.String subAccountId,
java.util.Map<java.lang.String,java.lang.Object> options)
Lists the access keys belonging to this sub account id.
|
protected java.lang.String |
getAuthorizationHeaderValue(java.lang.String apiKey,
java.lang.String apiSecret,
java.lang.String oauthToken) |
ApiResponse |
removeUserFromGroup(java.lang.String groupId,
java.lang.String userId)
Removes a user from a group.
|
ApiResponse |
removeUserFromGroup(java.lang.String groupId,
java.lang.String userId,
java.util.Map<java.lang.String,java.lang.Object> options)
Removes a user from a group.
|
ApiResponse |
subAccount(java.lang.String subAccountId)
Get details of a specific sub account
|
ApiResponse |
subAccount(java.lang.String subAccountId,
java.util.Map<java.lang.String,java.lang.Object> options)
Get details of a specific sub account
|
ApiResponse |
subAccounts(java.lang.Boolean enabled,
java.util.List<java.lang.String> ids,
java.lang.String prefix)
Get a list of sub accounts.
|
ApiResponse |
subAccounts(java.lang.Boolean enabled,
java.util.List<java.lang.String> ids,
java.lang.String prefix,
java.util.Map<java.lang.String,java.lang.Object> options)
Get a list of sub accounts.
|
ApiResponse |
updateAccessKey(java.lang.String subAccountId,
java.lang.String accessKey,
java.lang.String name,
java.lang.Boolean enabled,
java.util.Map<java.lang.String,java.lang.Object> options)
Updates an existing access key for this sub account id.
|
ApiResponse |
updateSubAccount(java.lang.String subAccountId,
java.lang.String name,
java.lang.String cloudName,
java.util.Map<java.lang.String,java.lang.String> customAttributes,
java.lang.Boolean enabled) |
ApiResponse |
updateSubAccount(java.lang.String subAccountId,
java.lang.String name,
java.lang.String cloudName,
java.util.Map<java.lang.String,java.lang.String> customAttributes,
java.lang.Boolean enabled,
java.util.Map<java.lang.String,java.lang.Object> options) |
ApiResponse |
updateUser(java.lang.String userId,
java.lang.String name,
java.lang.String email,
Account.Role role,
java.lang.Boolean enabled,
java.util.List<java.lang.String> subAccountsIds,
java.util.Map<java.lang.String,java.lang.Object> options)
Update an existing user.
|
ApiResponse |
updateUser(java.lang.String userId,
java.lang.String name,
java.lang.String email,
Account.Role role,
java.util.List<java.lang.String> subAccountsIds)
Update an existing user.
|
ApiResponse |
updateUser(java.lang.String userId,
java.lang.String name,
java.lang.String email,
Account.Role role,
java.util.List<java.lang.String> subAccountsIds,
java.util.Map<java.lang.String,java.lang.Object> options)
Update an existing user.
|
ApiResponse |
updateUserGroup(java.lang.String groupId,
java.lang.String name)
Update an existing user group
|
ApiResponse |
updateUserGroup(java.lang.String groupId,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> options)
Update an existing user group
|
ApiResponse |
user(java.lang.String userId)
Get details of a specific user.
|
ApiResponse |
user(java.lang.String userId,
java.util.Map<java.lang.String,java.lang.Object> options)
Get details of a specific user.
|
ApiResponse |
userGroup(java.lang.String groupId)
Get details of a group.
|
ApiResponse |
userGroup(java.lang.String groupId,
java.util.Map<java.lang.String,java.lang.Object> options)
Get details of a group.
|
ApiResponse |
userGroups()
Gets a list of all the user groups.
|
ApiResponse |
userGroups(java.util.Map<java.lang.String,java.lang.Object> options)
Gets a list of all the user groups.
|
ApiResponse |
userGroupUsers(java.lang.String groupId)
Lists the users belonging to this user group.
|
ApiResponse |
userGroupUsers(java.lang.String groupId,
java.util.Map<java.lang.String,java.lang.Object> options)
Lists the users belonging to this user group.
|
ApiResponse |
users(java.lang.Boolean pending,
java.util.List<java.lang.String> userIds,
java.lang.String prefix,
java.lang.String subAccountId)
Get a list of the users according to filters.
|
ApiResponse |
users(java.lang.Boolean pending,
java.util.List<java.lang.String> userIds,
java.lang.String prefix,
java.lang.String subAccountId,
java.util.Map<java.lang.String,java.lang.Object> options)
Get a list of the users according to filters.
|
public static final java.lang.String PROVISIONING
public static final java.lang.String ACCOUNTS
public static final java.lang.String SUB_ACCOUNTS
public static final java.lang.String USERS
public static final java.lang.String USER_GROUPS
public static final java.lang.String ACCESS_KEYS
public Account(Cloudinary cloudinary)
cloudinary - A cloudinary instance. This is used to fetch the correct network configuration.public Account(AccountConfiguration accountConfiguration, Cloudinary cloudinary)
accountConfiguration - Account configuration to use in requests.cloudinary - A cloudinary instance. This is used to fetch the correct network configuration.public ApiResponse subAccount(java.lang.String subAccountId) throws java.lang.Exception
subAccountId - The id of the sub accountjava.lang.Exception - If the request failspublic ApiResponse subAccount(java.lang.String subAccountId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
subAccountId - The id of the sub accountoptions - Generic advanced options map, see online documentation.java.lang.Exception - If the request failspublic ApiResponse subAccounts(java.lang.Boolean enabled, java.util.List<java.lang.String> ids, java.lang.String prefix) throws java.lang.Exception
enabled - Optional. Whether to fetch enabled or disabled accounts. Default is all.ids - Optional. List of sub-account IDs. Up to 100. When provided, other filters are ignored.prefix - Optional. Search by prefix of the sub-account name. Case-insensitive.java.lang.Exception - If the request failspublic ApiResponse subAccounts(java.lang.Boolean enabled, java.util.List<java.lang.String> ids, java.lang.String prefix, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
enabled - Optional. Whether to fetch enabled or disabled accounts. Default is all.ids - Optional. List of sub-account IDs. Up to 100. When provided, other filters are ignored.prefix - Optional. Search by prefix of the sub-account name. Case-insensitive.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request failspublic ApiResponse createSubAccount(java.lang.String name, java.lang.String cloudName, java.util.Map customAttributes, boolean enabled, java.lang.String baseAccount) throws java.lang.Exception
name - Required. The name displayed in the management console.cloudName - Optional, unique (case insensitive)customAttributes - Custom attributes associated with the sub-account, as a map of key/value pairs.enabled - Optional. Whether to create the account as enabled (default is enabled).baseAccount - Optional. ID of sub-account from which to copy settingsjava.lang.Exception - If the request failspublic ApiResponse createSubAccount(java.lang.String name, java.lang.String cloudName, java.util.Map customAttributes, boolean enabled, java.lang.String baseAccount, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
name - Required. The name displayed in the management console.cloudName - Optional, unique (case insensitive)customAttributes - Custom attributes associated with the sub-account, as a map of key/value pairs.enabled - Optional. Whether to create the account as enabled (default is enabled).baseAccount - Optional. ID of sub-account from which to copy settingsoptions - Generic advanced options map, see online documentation.java.lang.Exception - If the request failspublic ApiResponse updateSubAccount(java.lang.String subAccountId, java.lang.String name, java.lang.String cloudName, java.util.Map<java.lang.String,java.lang.String> customAttributes, java.lang.Boolean enabled) throws java.lang.Exception
subAccountId - The id of the sub-account to updatename - The name displayed in the management console.cloudName - The cloud name to set.customAttributes - ACustom attributes associated with the sub-account, as a map of key/value pairs.enabled - Set the sub-account as enabled or not.java.lang.Exception - If the request failspublic ApiResponse updateSubAccount(java.lang.String subAccountId, java.lang.String name, java.lang.String cloudName, java.util.Map<java.lang.String,java.lang.String> customAttributes, java.lang.Boolean enabled, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
subAccountId - The id of the sub-account to updatename - The name displayed in the management console.cloudName - The cloud name to set.customAttributes - ACustom attributes associated with the sub-account, as a map of key/value pairs.enabled - Set the sub-account as enabled or not.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request failspublic ApiResponse deleteSubAccount(java.lang.String subAccountId) throws java.lang.Exception
subAccountId - The id of the sub-account to deletejava.lang.Exception - If the request fails.public ApiResponse deleteSubAccount(java.lang.String subAccountId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
subAccountId - The id of the sub-account to deleteoptions - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse user(java.lang.String userId) throws java.lang.Exception
userId - The id of the user to fetchjava.lang.Exception - If the request fails.public ApiResponse user(java.lang.String userId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
userId - The id of the user to fetchoptions - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse users(java.lang.Boolean pending, java.util.List<java.lang.String> userIds, java.lang.String prefix, java.lang.String subAccountId) throws java.lang.Exception
pending - Optional. Limit results to pending users (true), users that are not pending (false), or all users (null)userIds - Optionals. List of user IDs. Up to 100prefix - Optional. Search by prefix of the user's name or email. Case-insensitivesubAccountId - Optional. Return only users who have access to the given sub-accountjava.lang.Exception - If the request fails.public ApiResponse users(java.lang.Boolean pending, java.util.List<java.lang.String> userIds, java.lang.String prefix, java.lang.String subAccountId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
pending - Optional. Limit results to pending users (true), users that are not pending (false), or all users (null)userIds - Optionals. List of user IDs. Up to 100prefix - Optional. Search by prefix of the user's name or email. Case-insensitivesubAccountId - Optional. Return only users who have access to the given sub-accountoptions - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse createUser(java.lang.String name, java.lang.String email, Account.Role role, java.util.List<java.lang.String> subAccountsIds) throws java.lang.Exception
name - Required. Username.email - Required. User's email.role - Required. User's role.subAccountsIds - Optional. Sub-accounts for which the user should have access.
If not provided or empty, user should have access to all accounts.java.lang.Exception - If the request fails.public ApiResponse createUser(java.lang.String name, java.lang.String email, Account.Role role, java.util.List<java.lang.String> subAccountsIds, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
name - Required. Username.email - Required. User's email.role - Required. User's role.subAccountsIds - Optional. Sub-accounts for which the user should have access.
If not provided or empty, user should have access to all accounts.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse createUser(java.lang.String name, java.lang.String email, Account.Role role, java.lang.Boolean enabled, java.util.List<java.lang.String> subAccountsIds, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
name - Required. Username.email - Required. User's email.role - Required. User's role.enabled - Optional. User's status (enabled or disabled).subAccountsIds - Optional. Sub-accounts for which the user should have access.
If not provided or empty, user should have access to all accounts.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse updateUser(java.lang.String userId, java.lang.String name, java.lang.String email, Account.Role role, java.util.List<java.lang.String> subAccountsIds) throws java.lang.Exception
userId - The id of the user to update.name - Username.email - User's email.role - User's role.subAccountsIds - Sub-accounts for which the user should have access.
If not provided or empty, user should have access to all accounts.java.lang.Exception - If the request fails.public ApiResponse updateUser(java.lang.String userId, java.lang.String name, java.lang.String email, Account.Role role, java.util.List<java.lang.String> subAccountsIds, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
userId - The id of the user to update.name - Username.email - User's email.role - User's role.subAccountsIds - Sub-accounts for which the user should have access.
If not provided or empty, user should have access to all accounts.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse updateUser(java.lang.String userId, java.lang.String name, java.lang.String email, Account.Role role, java.lang.Boolean enabled, java.util.List<java.lang.String> subAccountsIds, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
userId - The id of the user to update.name - Username.email - User's email.role - User's role.enabled - User's status (enabled or disabled)subAccountsIds - Sub-accounts for which the user should have access.
If not provided or empty, user should have access to all accounts.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse deleteUser(java.lang.String userId) throws java.lang.Exception
userId - Id of the user to delete.java.lang.Exceptionpublic ApiResponse deleteUser(java.lang.String userId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
userId - Id of the user to delete.options - Generic advanced options map, see online documentation.java.lang.Exceptionpublic ApiResponse createUserGroup(java.lang.String name) throws java.lang.Exception
name - Required. Name for the group.java.lang.Exception - If the request failspublic ApiResponse createUserGroup(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
name - Required. Name for the group.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request failspublic ApiResponse updateUserGroup(java.lang.String groupId, java.lang.String name) throws java.lang.Exception
groupId - The id of the group to updatename - The name of the group.java.lang.Exception - If the request failspublic ApiResponse updateUserGroup(java.lang.String groupId, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
groupId - The id of the group to updatename - The name of the group.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request failspublic ApiResponse deleteUserGroup(java.lang.String groupId) throws java.lang.Exception
groupId - The group id to deletejava.lang.Exception - if the request fails.public ApiResponse deleteUserGroup(java.lang.String groupId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
groupId - The group id to deleteoptions - Generic advanced options map, see online documentation.java.lang.Exception - if the request fails.public ApiResponse addUserToGroup(java.lang.String groupId, java.lang.String userId) throws java.lang.Exception
groupId - The group id.userId - The user id to add.java.lang.Exception - If the request failspublic ApiResponse addUserToGroup(java.lang.String groupId, java.lang.String userId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
groupId - The group id.userId - The user id to add.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request failspublic ApiResponse removeUserFromGroup(java.lang.String groupId, java.lang.String userId) throws java.lang.Exception
groupId - The group id.userId - The id of the user to removejava.lang.Exception - If the request fails.public ApiResponse removeUserFromGroup(java.lang.String groupId, java.lang.String userId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
groupId - The group id.userId - The id of the user to removeoptions - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse userGroup(java.lang.String groupId) throws java.lang.Exception
groupId - The group id to fetchjava.lang.Exception - If the request fails.public ApiResponse userGroup(java.lang.String groupId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
groupId - The group id to fetchoptions - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse userGroups() throws java.lang.Exception
java.lang.Exception - If the request fails.public ApiResponse userGroups(java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
options - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse userGroupUsers(java.lang.String groupId) throws java.lang.Exception
groupId - The id of the user group.java.lang.Exception - If the request fails.public ApiResponse userGroupUsers(java.lang.String groupId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
groupId - The id of the user group.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse getAccessKeys(java.lang.String subAccountId, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
subAccountId - The id of the user group.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse createAccessKey(java.lang.String subAccountId, java.lang.String name, java.lang.Boolean enabled, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
subAccountId - The id of the user group.name - The name for the access key.enabled - Access key's status (enabled or disabled).options - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse updateAccessKey(java.lang.String subAccountId, java.lang.String accessKey, java.lang.String name, java.lang.Boolean enabled, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
subAccountId - The id of the user group.accessKey - The key of the access key.name - The name for the access key.enabled - Access key's status (enabled or disabled).options - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.public ApiResponse deleteAccessKey(java.lang.String subAccountId, java.lang.String accessKey, java.util.Map<java.lang.String,java.lang.Object> options) throws java.lang.Exception
subAccountId - The id of the user group.accessKey - The key of the access key.options - Generic advanced options map, see online documentation.java.lang.Exception - If the request fails.protected java.lang.String getAuthorizationHeaderValue(java.lang.String apiKey,
java.lang.String apiSecret,
java.lang.String oauthToken)