Class ApiKey
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<ApiKey.Builder,ApiKey>
Describes an API key.
Customers invoke AppSync GraphQL API operations with API keys as an identity mechanism. There are two key versions:
da1: We introduced this version at launch in November 2017. These keys always expire after 7 days. Amazon DynamoDB TTL manages key expiration. These keys ceased to be valid after February 21, 2018, and they should no longer be used.
-
ListApiKeysreturns the expiration time in milliseconds. -
CreateApiKeyreturns the expiration time in milliseconds. -
UpdateApiKeyis not available for this key version. -
DeleteApiKeydeletes the item from the table. -
Expiration is stored in 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 deleted these keys from the table on February 21, 2018.
da2: We introduced this version in February 2018 when AppSync added support to extend key expiration.
-
ListApiKeysreturns the expiration time and deletion time in seconds. -
CreateApiKeyreturns the expiration time and deletion time in seconds and accepts a user-provided expiration time in seconds. -
UpdateApiKeyreturns 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. You can update the key expiration time as long as the key isn't deleted. -
DeleteApiKeydeletes the item from the table. -
Expiration is stored in DynamoDB as seconds. After the expiration time, using the key to authenticate will fail. However, you can reinstate the key before deletion.
-
Deletion is stored in DynamoDB as seconds. The key is deleted after deletion time.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ApiKey.Builderbuilder()final Longdeletes()The time after which the API key is deleted.final StringA description of the purpose of the API key.final booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final Longexpires()The time after which the API key expires.final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) final inthashCode()final Stringid()The API key ID.static Class<? extends ApiKey.Builder> Take this object and create a builder that contains all of the current property values of this object.final StringtoString()Returns a string representation of this object.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
id
-
description
A description of the purpose of the API key.
- Returns:
- A description of the purpose of the API key.
-
expires
The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
- Returns:
- The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
-
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.
- Returns:
- The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<ApiKey.Builder,ApiKey> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin interfaceSdkPojo- Parameters:
obj- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
sdkFields
-