GoogleApi.Gax.Request (ega_gax v0.5.0)

Copy Markdown View Source

This module is used to build an HTTP request

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

Types

method()

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

param_location()

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

t()

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

Functions

add_optional_params(request, definitions, list)

@spec 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

add_param(request, location, key, values)

@spec 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

library_version(request)

@spec library_version(t()) :: {:ok, String.t()} | :error

library_version(request, version)

@spec 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

method(request)

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

method(request, m)

@spec 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

new()

@spec new() :: t()

url(request)

@spec url(t()) :: {:ok, String.t()} | :error

url(request, u)

url(request, u, replacements)

@spec 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