AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

ApiKey

import "github.com/aws/aws-sdk-go/service/appsync"

type ApiKey struct { Description *string `locationName:"description" type:"string"` Expires *int64 `locationName:"expires" type:"long"` Id *string `locationName:"id" type:"string"` }

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 in seconds.

  • CreateApiKey returns the expiration time in seconds and accepts a user-provided expiration time in seconds.

  • UpdateApiKey returns the expiration time in seconds and accepts a user-provided expiration time in seconds. Key expiration can only be updated while the key has not expired.

  • DeleteApiKey deletes the item from the table.

  • Expiration is stored in Amazon DynamoDB as seconds.

Description

Type: *string

A description of the purpose of the API key.

Expires

Type: *int64

The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.

Id

Type: *string

The API key ID.

Method

GoString

func (s ApiKey) GoString() string

GoString returns the string representation

SetDescription

func (s *ApiKey) SetDescription(v string) *ApiKey

SetDescription sets the Description field's value.

SetExpires

func (s *ApiKey) SetExpires(v int64) *ApiKey

SetExpires sets the Expires field's value.

SetId

func (s *ApiKey) SetId(v string) *ApiKey

SetId sets the Id field's value.

String

func (s ApiKey) String() string

String returns the string representation

On this page: