google_gax v0.4.0 GoogleApi.Gax.Request View Source

This module is used to build an HTTP request

Link to this section Summary

Functions

Add optional parameters to the request

Add optional parameters to the request

Specify the library version when building a request

Specify the request method when building a request

Specify the request URL when building a request

Link to this section Types

Specs

method() :: :head | :get | :delete | :trace | :options | :post | :put | :patch

Specs

param_location() :: :body | :query | :header | :file

Specs

t() :: %GoogleApi.Gax.Request{
  body: keyword(),
  file: keyword(),
  header: keyword(),
  library_version: String.t(),
  method: method(),
  query: keyword(),
  url: String.t()
}

Link to this section Functions

Link to this function

add_optional_params(request, definitions, list)

View Source

Specs

add_optional_params(t(), %{optional(atom()) => param_location()}, keyword()) ::
  t()

Add optional parameters to the request

Parameters

  • request (type: GoogleApi.Gax.Request.t) - Collected request options
  • definitions (type: Map) - Map of parameter name to parameter location
  • options (type: keyword()) - The provided optional parameters

Returns

  • GoogleApi.Gax.Request.t
Link to this function

add_param(request, location, key, values)

View Source

Specs

add_param(t(), param_location(), atom(), any()) :: t()

Add optional parameters to the request

Parameters

  • request (type: GoogleApi.Gax.Request.t) - Collected request options
  • location (type: atom()) - Where to put the parameter
  • key (type: atom()) - The name of the parameter
  • value (type: any()) - The value of the parameter

Returns

  • GoogleApi.Gax.Request.t
Link to this function

library_version(request)

View Source

Specs

library_version(t()) :: {:ok, String.t()} | :error
Link to this function

library_version(request, version)

View Source

Specs

library_version(t(), String.t()) :: t()

Specify the library version when building a request

Parameters

  • request (type: GoogleApi.Gax.Request.t) - Collected request options
  • version (type: String) - Library version

Returns

  • GoogleApi.Gax.Request.t

Specs

method(t()) :: {:ok, atom()} | :error

Specs

method(t(), atom()) :: t()

Specify the request method when building a request

Parameters

  • request (type: GoogleApi.Gax.Request.t) - Collected request options
  • m (type: String) - Request method

Returns

  • GoogleApi.Gax.Request.t

Specs

new() :: t()

Specs

url(t()) :: {:ok, String.t()} | :error
Link to this function

url(request, u, replacements)

View Source

Specs

url(t(), String.t(), map()) :: t()

Specify the request URL when building a request

Parameters

  • request (type: GoogleApi.Gax.Request.t) - Collected request options
  • u (type: String) - Request URL

Returns

  • GoogleApi.Gax.Request.t