Package com.atlan.model.admin
Class ApiToken
java.lang.Object
com.atlan.model.core.AtlanObject
com.atlan.model.admin.ApiToken
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static class
ApiToken.ApiTokenBuilder<C extends ApiToken,
B extends ApiToken.ApiTokenBuilder<C, B>> static final class
Nested classes/interfaces inherited from class com.atlan.model.core.AtlanObject
AtlanObject.AtlanObjectBuilder<C extends AtlanObject,
B extends AtlanObject.AtlanObjectBuilder<C, B>> -
Field Summary
Fields inherited from class com.atlan.model.core.AtlanObject
rawJsonObject
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ApiToken.ApiTokenBuilder<?,
?> builder()
protected boolean
static ApiToken
create
(AtlanClient client, String displayName) Create a new API token that never expires and is not assigned to any personas.static ApiToken
create
(AtlanClient client, String displayName, String description, Set<String> personas, Long validity) Create a new API token with the provided details.static ApiToken
Create a new API token that never expires and is not assigned to any personas.static ApiToken
Create a new API token with the provided details.static void
delete
(AtlanClient client, String guid) Delete (purge) the API token with the provided GUID.static void
Delete (purge) the API token with the provided GUID.boolean
Retrieve the username that represents this API token.Detailed characteristics of the API token.getId()
Unique identifier (GUID) of the API token.int
hashCode()
static ApiToken
retrieveByName
(AtlanClient client, String displayName) Retrieves the API token with a name that exactly matches the provided string.static ApiToken
retrieveByName
(String displayName) Retrieves the API token with a name that exactly matches the provided string.toString()
update()
Sends this API token to Atlan to update it in Atlan.update
(AtlanClient client) Sends this API token to Atlan to update it in Atlan.Methods inherited from class com.atlan.model.core.AtlanObject
getRawJsonObject, setRawJsonObject, toJson
-
Field Details
-
API_USERNAME_PREFIX
- See Also:
-
-
Constructor Details
-
ApiToken
-
-
Method Details
-
getClientId
-
getDisplayName
-
getApiTokenUsername
Retrieve the username that represents this API token. This name can be used to assign the token as a user to objects that require a user, such as policies.- Returns:
- a username for this API token
-
create
Create a new API token that never expires and is not assigned to any personas.- Parameters:
displayName
- readable name for the API token- Returns:
- the API token details
- Throws:
AtlanException
- on any API communication issues
-
create
Create a new API token that never expires and is not assigned to any personas.- Parameters:
client
- connectivity to the Atlan tenant on which to create the new API tokendisplayName
- readable name for the API token- Returns:
- the API token details
- Throws:
AtlanException
- on any API communication issues
-
create
public static ApiToken create(String displayName, String description, Set<String> personas, Long validity) throws AtlanException Create a new API token with the provided details.- Parameters:
displayName
- readable name for the API tokendescription
- explanation of the API tokenpersonas
- unique names (qualifiedNames) of personas that should be linked to the tokenvalidity
- time in seconds after which the token should expire (negative numbers are treated as a token should never expire)- Returns:
- the API token details
- Throws:
AtlanException
- on any API communication issues
-
create
public static ApiToken create(AtlanClient client, String displayName, String description, Set<String> personas, Long validity) throws AtlanException Create a new API token with the provided details.- Parameters:
client
- connectivity to the Atlan tenant on which to create the new API tokendisplayName
- readable name for the API tokendescription
- explanation of the API tokenpersonas
- unique names (qualifiedNames) of personas that should be linked to the tokenvalidity
- time in seconds after which the token should expire (negative numbers are treated as a token should never expire)- Returns:
- the API token details
- Throws:
AtlanException
- on any API communication issues
-
retrieveByName
Retrieves the API token with a name that exactly matches the provided string.- Parameters:
displayName
- name (as it appears in the UI) by which to retrieve the API token- Returns:
- the API token whose name (in the UI) contains the provided string, or null if there is none
- Throws:
AtlanException
- on any error during API invocation
-
retrieveByName
Retrieves the API token with a name that exactly matches the provided string.- Parameters:
client
- connectivity to the Atlan tenant from which to retrieve the API tokendisplayName
- name (as it appears in the UI) by which to retrieve the API token- Returns:
- the API token whose name (in the UI) contains the provided string, or null if there is none
- Throws:
AtlanException
- on any error during API invocation
-
update
Sends this API token to Atlan to update it in Atlan.- Returns:
- the updated API token
- Throws:
AtlanException
- on any error during API invocation
-
update
Sends this API token to Atlan to update it in Atlan.- Parameters:
client
- connectivity to the Atlan tenant on which to update the API token- Returns:
- the updated API token
- Throws:
AtlanException
- on any error during API invocation
-
delete
Delete (purge) the API token with the provided GUID.- Parameters:
guid
- unique identifier (GUID) of the API token to hard-delete- Throws:
AtlanException
- on any API communication issues
-
delete
Delete (purge) the API token with the provided GUID.- Parameters:
client
- connectivity to the Atlan tenant from which to remove the API tokenguid
- unique identifier (GUID) of the API token to hard-delete- Throws:
AtlanException
- on any API communication issues
-
builder
-
toBuilder
-
equals
- Overrides:
equals
in classAtlanObject
-
canEqual
- Overrides:
canEqual
in classAtlanObject
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAtlanObject
-
toString
Description copied from class:AtlanObject
- Overrides:
toString
in classAtlanObject
-
getId
Unique identifier (GUID) of the API token. -
getAttributes
Detailed characteristics of the API token.
-