google_gax v0.1.1 GoogleApi.Gax.DataWrapper View Source

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"

} }

Link to this section Summary

Functions

Unwrap a data-wrapped JSON response

Link to this section Types

Link to this type t() View Source
t() :: %GoogleApi.Gax.DataWrapper{data: any()}

Link to this section Functions

Link to this function decode(data_wrapper, options) View Source

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"}