# `GoogleApi.Gax.DataWrapper`
[🔗](https://github.com/Live-Circle-Inc/ega/tree/main/clients/gax/blob/main/lib/google_api/gax/data_wrapper.ex#L15)

Module and struct to help serialize/deserialize "data-wrapped" responses.

An endpoint response may be declared as type "Pet" and "data-wrapped" which
means the response would have an outer object with a single "data" key:

    {
      "data": { // real pet data
        "id": 123,
        "name": "Fido"
      }
    }

# `t`

```elixir
@type t() :: %GoogleApi.Gax.DataWrapper{data: any()}
```

# `decode`

```elixir
@spec decode(t(), keyword()) :: any()
```

Unwrap a data-wrapped JSON response.

## Examples

    iex> GoogleApi.Gax.DataWrapper.decode(%GoogleApi.Gax.DataWrapper{data: %{"id" => 123, "name" => "Fido"}}, struct: %TestClient.Model.Pet{})
    %TestClient.Model.Pet{id: 123, name: "Fido"}

---

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