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

Added CloudSQL.Client.patch_instance/2 #18

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
10 changes: 5 additions & 5 deletions lib/auth.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GCloudex.Auth do

# Compute Engine scopes
@compute_read_only "https://www.googleapis.com/auth/compute.readonly"
@compute "https://www.googleapis.com/auth/compute"
@compute "https://www.googleapis.com/auth/compute"

@doc """
Retrieves an authentication token for the Google Cloud Storage service.
Expand Down Expand Up @@ -49,7 +49,7 @@ defmodule GCloudex.Auth do
get_token_response |> Map.get(:token)

:sql_admin ->
{:ok, get_token_response} =
{:ok, get_token_response} =
GoogleAuth.for_scope @sql_scope_admin

get_token_response |> Map.get(:token)
Expand All @@ -66,16 +66,16 @@ defmodule GCloudex.Auth do
get_token_response |> Map.get(:token)

:compute_read_only ->
{:ok, get_token_response} =
{:ok, get_token_response} =
GoogleAuth.for_scope @compute_read_only

get_token_response |> Map.get(:token)

:compute ->
{:ok, get_token_response} =
{:ok, get_token_response} =
GoogleAuth.for_scope @compute

get_token_response |> Map.get(:token)
end
end
end
end
3 changes: 1 addition & 2 deletions lib/cloud_speech/request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ defmodule GCloudex.CloudSpeech.Request do
quote do

@endpoint "speech.googleapis.com"
@project GCloudex.get_project_id

@doc"""
Sends an HTTP request without any query parameters.
Expand All @@ -23,7 +22,7 @@ defmodule GCloudex.CloudSpeech.Request do
"https://" <> Path.join(@endpoint, path),
body,
headers ++ [{"Authorization", "Bearer #{Auth.get_token_storage(:cs)}"},
{"x-goog-project-id", @project}],
{"x-goog-project-id", GCloudex.get_project_id()}],
[timeout: 50_000, recv_timeout: 50_000]
)
end
Expand Down
Loading