# `GoogleApi.Gax.Request`
[🔗](https://github.com/Live-Circle-Inc/ega/tree/main/clients/gax/blob/main/lib/google_api/gax/request.ex#L15)

This module is used to build an HTTP request

# `method`

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

# `param_location`

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

# `t`

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

# `add_optional_params`

```elixir
@spec add_optional_params(t(), %{optional(atom()) =&gt; 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`

```elixir
@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`

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

# `library_version`

```elixir
@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`

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

# `method`

```elixir
@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`

```elixir
@spec new() :: t()
```

# `url`

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

# `url`

# `url`

```elixir
@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`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
