Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gax): invalid spec in Connection/Response modules #11342

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clients/gax/lib/google_api/gax/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ defmodule GoogleApi.Gax.Connection do
* `{:ok, Tesla.Env.t}` - If the call was successful
* `{:error, reason}` - If the call failed
"""
@spec execute(Tesla.Client.t(), GoogleApi.Gax.Request.t()) :: {:ok, Tesla.Env.t()}
@spec execute(Tesla.Client.t(), GoogleApi.Gax.Request.t()) :: Tesla.Env.result()
def execute(connection, request) do
request
|> GoogleApi.Gax.Connection.build_request()
Expand Down
8 changes: 4 additions & 4 deletions clients/gax/lib/google_api/gax/response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ defmodule GoogleApi.Gax.Response do

## Parameters

* `response` (*type:* `{:ok, Tesla.Env.t} | {:error, reason}`) - The response object
* `response` (*type:* `Testla.Env.result()`) - 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
* `{:ok, nil | struct()}` on success
* `{:error, any() | Tesla.Env.t}` on failure
"""
@spec decode({:ok, Tesla.Env.t()}, keyword()) :: {:ok, struct()} | {:error, Tesla.Env.t()}
@spec decode(Tesla.Env.result(), keyword()) :: {:ok, nil | struct()} | {:error, any() | Tesla.Env.t()}
def decode(env, opts \\ [])

def decode({:error, reason}, _), do: {:error, reason}
Expand Down