google_gax v0.4.0 GoogleApi.Gax.Response View Source

This module helps decode Tesla responses

Link to this section Summary

Functions

Handle the response for a Tesla request

Link to this section Functions

Specs

decode({:ok, Tesla.Env.t()}, keyword()) ::
  {:ok, struct()} | {:error, Tesla.Env.t()}

Handle the response for a Tesla request

Parameters

  • response (type: {:ok, Tesla.Env.t} | {:error, reason}) - The response object
  • opts (type: keyword()) - [optional] Optional parameters
    • :dataWrapped (type: boolean()) - If true, the remove the wrapping "data" field. Defaults to false.
    • :decode (type: boolean()) - If false, returns the entire reponse. Defaults to true.
    • :struct (type: module)

Returns

  • {:ok, struct()} on success
  • {:error, Tesla.Env.t} on failure