@Generated(value="software.amazon.awssdk:codegen") public final class ApiKey extends Object implements SdkPojo, Serializable, ToCopyableBuilder<ApiKey.Builder,ApiKey>
Describes an API key.
Customers invoke AWS AppSync GraphQL API operations with API keys as an identity mechanism. There are two key versions:
da1: This version was introduced at launch in November 2017. These keys always expire after 7 days. Key expiration is managed by Amazon DynamoDB TTL. The keys ceased to be valid after February 21, 2018 and should not be used after that date.
ListApiKeys
returns the expiration time in milliseconds.
CreateApiKey
returns the expiration time in milliseconds.
UpdateApiKey
is not available for this key version.
DeleteApiKey
deletes the item from the table.
Expiration is stored in Amazon DynamoDB as milliseconds. This results in a bug where keys are not automatically deleted because DynamoDB expects the TTL to be stored in seconds. As a one-time action, we will delete these keys from the table after February 21, 2018.
da2: This version was introduced in February 2018 when AppSync added support to extend key expiration.
ListApiKeys
returns the expiration time and deletion time in seconds.
CreateApiKey
returns the expiration time and deletion time in seconds and accepts a user-provided
expiration time in seconds.
UpdateApiKey
returns the expiration time and and deletion time in seconds and accepts a user-provided
expiration time in seconds. Expired API keys are kept for 60 days after the expiration time. Key expiration time can
be updated while the key is not deleted.
DeleteApiKey
deletes the item from the table.
Expiration is stored in Amazon DynamoDB as seconds. After the expiration time, using the key to authenticate will fail. But the key can be reinstated before deletion.
Deletion is stored in Amazon DynamoDB as seconds. The key will be deleted after deletion time.
Modifier and Type | Class and Description |
---|---|
static interface |
ApiKey.Builder |
Modifier and Type | Method and Description |
---|---|
static ApiKey.Builder |
builder() |
Long |
deletes()
The time after which the API key is deleted.
|
String |
description()
A description of the purpose of the API key.
|
boolean |
equals(Object obj) |
boolean |
equalsBySdkFields(Object obj)
Indicates whether some other object is "equal to" this one by SDK fields.
|
Long |
expires()
The time after which the API key expires.
|
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
int |
hashCode() |
String |
id()
The API key ID.
|
List<SdkField<?>> |
sdkFields() |
static Class<? extends ApiKey.Builder> |
serializableBuilderClass() |
ApiKey.Builder |
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.
|
String |
toString()
Returns a string representation of this object.
|
copy
public final String id()
The API key ID.
public final String description()
A description of the purpose of the API key.
public final Long expires()
The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
public final Long deletes()
The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.
public ApiKey.Builder toBuilder()
ToCopyableBuilder
toBuilder
in interface ToCopyableBuilder<ApiKey.Builder,ApiKey>
public static ApiKey.Builder builder()
public static Class<? extends ApiKey.Builder> serializableBuilderClass()
public final boolean equalsBySdkFields(Object obj)
SdkPojo
SdkPojo
class,
and is generated based on a service model.
If an SdkPojo
class does not have any inherited fields, equalsBySdkFields
and equals
are essentially the same.
equalsBySdkFields
in interface SdkPojo
obj
- the object to be compared withpublic final String toString()