# `ExAws.Location`

Amazon Location Service support for ExAws.

The API is split up by service, with one module for each:

  * `ExAws.Location.Maps` - map tiles, styles, sprites, glyphs and static maps (`geo-maps`)
  * `ExAws.Location.Places` - geocoding and place search (`geo-places`)
  * `ExAws.Location.Routes` - routes, route matrices, isolines and more (`geo-routes`)
  * `ExAws.Location.Geofences` - geofence collections and geofences
  * `ExAws.Location.Trackers` - trackers and device positions
  * `ExAws.Location.Keys` - API keys
  * `ExAws.Location.Jobs` - bulk processing jobs
  * `ExAws.Location.Tags` - resource tagging

Each function builds an operation which is then passed to `ExAws.request/2`:

    "my-tracker"
    |> ExAws.Location.Trackers.create_tracker(description: "Delivery vans")
    |> ExAws.request(region: "eu-west-1")

Required parameters are positional. Optional parameters are passed as a keyword
list, using the snake_case form of the name given in the AWS API reference (so
`KmsKeyId` becomes `:kms_key_id`). Passing an option the operation doesn't know
about raises an `ArgumentError`.

Nested request data types each have their own struct, for example
`ExAws.Location.DevicePositionUpdate`. Timestamps may be given as `DateTime`
structs or as ISO 8601 strings.

This module holds the helpers shared by the service modules.

# `spec`

```elixir
@type spec() :: [
  required_body: %{optional(String.t()) =&gt; term()},
  required_query: [{String.t(), term()}],
  body: [atom()],
  query: [{atom(), String.t()}],
  idempotency_token: atom()
]
```

Describes how the arguments of an operation map on to the request.

  * `:required_body` - map of wire name to value for required body members
  * `:required_query` - list of `{wire name, value}` for required query string parameters
  * `:body` - names of the options sent in the request body
  * `:query` - keyword list of option name to query string parameter name
  * `:idempotency_token` - name of a body option that is generated when not supplied

# `encode_path`

```elixir
@spec encode_path(term()) :: String.t()
```

Percent-encodes a value for use as a single segment of a request path.

# `json_request`

```elixir
@spec json_request(atom(), atom(), String.t(), keyword(), spec()) ::
  ExAws.Operation.JSON.t()
```

Builds an operation that sends a JSON body and expects a JSON response.

# `normalise_data`

```elixir
@spec normalise_data(term()) :: term()
```

Converts request data in to the form expected by the AWS API.

Structs and maps with atom keys have their keys converted from `:snake_case` to
`"CamelCase"` and any `nil` values dropped. String keys (for example in tags) are
left untouched. `DateTime` values are converted to ISO 8601 strings.

# `raw_request`

```elixir
@spec raw_request(atom(), atom(), String.t(), keyword(), spec()) ::
  ExAws.Operation.RestQuery.t()
```

Builds a body-less operation whose response is returned as is.

This is used for operations that return something other than a JSON document,
such as map tiles.

# `rest_request`

```elixir
@spec rest_request(atom(), atom(), String.t(), keyword(), spec()) ::
  ExAws.Operation.RestQuery.t()
```

Builds a body-less operation (`GET` or `DELETE`) that expects a JSON response.

---

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