google_gax v0.3.1 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

Link to this type

method()

View Source
method() :: :head | :get | :delete | :trace | :options | :post | :put | :patch
Link to this type

param_location()

View Source
param_location() :: :body | :query | :header | :file
Link to this type

t()

View Source
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
add_optional_params(
  GoogleApi.Gax.Request.t(),
  %{optional(atom()) => param_location()},
  keyword()
) :: GoogleApi.Gax.Request.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

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
library_version(GoogleApi.Gax.Request.t()) :: {:ok, String.t()} | :error
Link to this function

library_version(request, version)

View Source

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
Link to this function

method(request)

View Source
method(GoogleApi.Gax.Request.t()) :: {:ok, atom()} | :error

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

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