# `ExAws.Location.Keys`

API calls for Amazon Location Service API keys.

API key resources, used to grant unauthenticated access to maps, places and routes.

Every function returns an operation struct to be passed to `ExAws.request/2`.

## Operations

* `create_key` - CreateKey
* `delete_key` - DeleteKey
* `describe_key` - DescribeKey
* `list_keys` - ListKeys
* `update_key` - UpdateKey

See https://docs.aws.amazon.com/location/previous/APIReference/API_Operations.html

# `create_key_opts`

```elixir
@type create_key_opts() :: [
  description: String.t(),
  expire_time: DateTime.t() | String.t(),
  no_expiry: boolean(),
  tags: %{optional(String.t()) =&gt; String.t()}
]
```

# `delete_key_opts`

```elixir
@type delete_key_opts() :: [{:force_delete, boolean()}]
```

# `list_keys_opts`

```elixir
@type list_keys_opts() :: [
  filter: ExAws.Location.Keys.ApiKeyFilter.t(),
  max_results: integer(),
  next_token: String.t()
]
```

# `update_key_opts`

```elixir
@type update_key_opts() :: [
  description: String.t(),
  expire_time: DateTime.t() | String.t(),
  force_update: boolean(),
  no_expiry: boolean(),
  restrictions: ExAws.Location.Keys.ApiKeyRestrictions.t()
]
```

# `create_key`

```elixir
@spec create_key(
  String.t(),
  ExAws.Location.Keys.ApiKeyRestrictions.t(),
  create_key_opts()
) ::
  ExAws.Operation.JSON.t()
```

Creates an API key resource in your Amazon Web Services account, which lets you grant actions
for Amazon Location resources to the API key bearer.

For more information, see [Use API keys to
authenticate](https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html)
in the Amazon Location Service Developer Guide.

## Parameters

* `key_name` - A custom name for the API key resource.

* `restrictions` - The API key restrictions for the API key resource.

## Options

* `:description` - An optional description for the API key resource.

* `:expire_time` - The optional timestamp for when the API key resource will expire in [ISO
  8601](https://www.iso.org/iso-8601-date-and-time-format.html) format:
  `YYYY-MM-DDThh:mm:ss.sssZ`. One of `NoExpiry` or `ExpireTime` must be set.

* `:no_expiry` - Optionally set to `true` to set no expiration time for the API key. One of
  `NoExpiry` or `ExpireTime` must be set.

* `:tags` - Applies one or more tags to the map resource. A tag is a key-value pair that helps
  manage, identify, search, and filter your resources by labelling them.

See https://docs.aws.amazon.com/location/previous/APIReference/API_CreateKey.html

# `delete_key`

```elixir
@spec delete_key(String.t(), delete_key_opts()) :: ExAws.Operation.RestQuery.t()
```

Deletes the specified API key. The API key must have been deactivated more than 90 days
previously.

For more information, see [Use API keys to
authenticate](https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html)
in the Amazon Location Service Developer Guide.

## Parameters

* `key_name` - The name of the API key to delete.

## Options

* `:force_delete` - ForceDelete bypasses an API key's expiry conditions and deletes the key.
  Set the parameter `true` to delete the key or to `false` to not preemptively delete the API
  key.

See https://docs.aws.amazon.com/location/previous/APIReference/API_DeleteKey.html

# `describe_key`

```elixir
@spec describe_key(String.t()) :: ExAws.Operation.RestQuery.t()
```

Retrieves the API key resource details.

For more information, see [Use API keys to
authenticate](https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html)
in the Amazon Location Service Developer Guide.

## Parameters

* `key_name` - The name of the API key resource.

See https://docs.aws.amazon.com/location/previous/APIReference/API_DescribeKey.html

# `list_keys`

```elixir
@spec list_keys(list_keys_opts()) :: ExAws.Operation.JSON.t()
```

Lists API key resources in your Amazon Web Services account.

For more information, see [Use API keys to
authenticate](https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html)
in the Amazon Location Service Developer Guide.

## Options

* `:filter` - Optionally filter the list to only `Active` or `Expired` API keys.

* `:max_results` - An optional limit for the number of resources returned in a single call.

* `:next_token` - The pagination token specifying which page of results to return in the
  response. If no token is provided, the default page is the first page.

See https://docs.aws.amazon.com/location/previous/APIReference/API_ListKeys.html

# `update_key`

```elixir
@spec update_key(String.t(), update_key_opts()) :: ExAws.Operation.JSON.t()
```

Updates the specified properties of a given API key resource.

## Parameters

* `key_name` - The name of the API key resource to update.

## Options

* `:description` - Updates the description for the API key resource.

* `:expire_time` - Updates the timestamp for when the API key resource will expire in [ISO
  8601](https://www.iso.org/iso-8601-date-and-time-format.html) format:
  `YYYY-MM-DDThh:mm:ss.sssZ`.

* `:force_update` - The boolean flag to be included for updating `ExpireTime` or
  `Restrictions` details.

* `:no_expiry` - Whether the API key should expire. Set to `true` to set the API key to have
  no expiration time.

* `:restrictions` - Updates the API key restrictions for the API key resource.

See https://docs.aws.amazon.com/location/previous/APIReference/API_UpdateKey.html

---

*Consult [api-reference.md](api-reference.md) for complete listing*
