Skip to content

Commit

Permalink
feat: Automated regeneration of OSLogin client (#10959)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 02:40:27 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent 2278a57 commit 0a376aa
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clients/os_login/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_os_login, "~> 0.27"}]
[{:google_api_os_login, "~> 0.28"}]
end
```

Expand Down
2 changes: 2 additions & 0 deletions clients/os_login/lib/google_api/os_login/v1/api/users.ex
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ defmodule GoogleApi.OSLogin.V1.Api.Users do
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:projectId` (*type:* `String.t`) - The project ID of the Google Cloud Platform project.
* `:regions` (*type:* `list(String.t)`) - Optional. The regions to which to assert that the key was written. If unspecified, defaults to all regions. Regions are listed at https://cloud.google.com/about/locations#region.
* `:body` (*type:* `GoogleApi.OSLogin.V1.Model.SshPublicKey.t`) -
* `opts` (*type:* `keyword()`) - Call options
Expand Down Expand Up @@ -136,6 +137,7 @@ defmodule GoogleApi.OSLogin.V1.Api.Users do
:uploadType => :query,
:upload_protocol => :query,
:projectId => :query,
:regions => :query,
:body => :body
}

Expand Down
2 changes: 1 addition & 1 deletion clients/os_login/lib/google_api/os_login/v1/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.OSLogin.V1 do
API client metadata for GoogleApi.OSLogin.V1.
"""

@discovery_revision "20220319"
@discovery_revision "20240303"

def discovery_revision(), do: @discovery_revision
end
150 changes: 150 additions & 0 deletions clients/os_login/lib/google_api/os_login/v1alpha/api/users.ex
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ defmodule GoogleApi.OSLogin.V1alpha.Api.Users do
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:projectId` (*type:* `String.t`) - The project ID of the Google Cloud Platform project.
* `:regions` (*type:* `list(String.t)`) - Optional. The regions to which to assert that the key was written. If unspecified, defaults to all regions. Regions are listed at https://cloud.google.com/about/locations#region.
* `:view` (*type:* `String.t`) - The view configures whether to retrieve security keys information.
* `:body` (*type:* `GoogleApi.OSLogin.V1alpha.Model.SshPublicKey.t`) -
* `opts` (*type:* `keyword()`) - Call options
Expand Down Expand Up @@ -141,6 +142,7 @@ defmodule GoogleApi.OSLogin.V1alpha.Api.Users do
:uploadType => :query,
:upload_protocol => :query,
:projectId => :query,
:regions => :query,
:view => :query,
:body => :body
}
Expand Down Expand Up @@ -223,6 +225,154 @@ defmodule GoogleApi.OSLogin.V1alpha.Api.Users do
|> Response.decode(opts ++ [struct: %GoogleApi.OSLogin.V1alpha.Model.Empty{}])
end

@doc """
Signs an SSH public key for a user to authenticate to a virtual machine on Google Compute Engine.
## Parameters
* `connection` (*type:* `GoogleApi.OSLogin.V1alpha.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - The parent project and zone for the signing request. This is needed to properly ensure per-organization ISS processing and potentially to provide for the possibility of zone-specific certificates used in the signing process.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyResponse{}}` on success
* `{:error, info}` on failure
"""
@spec oslogin_users_projects_locations_sign_ssh_public_key(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def oslogin_users_projects_locations_sign_ssh_public_key(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1alpha/{+parent}:signSshPublicKey", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(
opts ++ [struct: %GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyResponse{}]
)
end

@doc """
Signs an SSH public key for a user to authenticate to a virtual machine on Google Compute Engine.
## Parameters
* `connection` (*type:* `GoogleApi.OSLogin.V1alpha.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - The parent project and zone for the signing request. This is needed to properly ensure per-organization ISS processing and potentially to provide for the possibility of zone-specific certificates used in the signing process.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyResponse{}}` on success
* `{:error, info}` on failure
"""
@spec oslogin_users_projects_zones_sign_ssh_public_key(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def oslogin_users_projects_zones_sign_ssh_public_key(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1alpha/{+parent}:signSshPublicKey", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(
opts ++ [struct: %GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyResponse{}]
)
end

@doc """
Create an SSH public key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.OSLogin.V1alpha do
API client metadata for GoogleApi.OSLogin.V1alpha.
"""

@discovery_revision "20220319"
@discovery_revision "20240303"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ defmodule GoogleApi.OSLogin.V1alpha.Model.SecurityKey do
## Attributes
* `deviceNickname` (*type:* `String.t`, *default:* `nil`) - The security key nickname explicitly set by the user.
* `privateKey` (*type:* `String.t`, *default:* `nil`) - Hardware-backed private key text in SSH format.
* `publicKey` (*type:* `String.t`, *default:* `nil`) - Public key text in SSH format, defined by [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6.
* `universalTwoFactor` (*type:* `GoogleApi.OSLogin.V1alpha.Model.UniversalTwoFactor.t`, *default:* `nil`) - The U2F protocol type.
Expand All @@ -30,12 +31,14 @@ defmodule GoogleApi.OSLogin.V1alpha.Model.SecurityKey do
use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:deviceNickname => String.t() | nil,
:privateKey => String.t() | nil,
:publicKey => String.t() | nil,
:universalTwoFactor => GoogleApi.OSLogin.V1alpha.Model.UniversalTwoFactor.t() | nil,
:webAuthn => GoogleApi.OSLogin.V1alpha.Model.WebAuthn.t() | nil
}

field(:deviceNickname)
field(:privateKey)
field(:publicKey)
field(:universalTwoFactor, as: GoogleApi.OSLogin.V1alpha.Model.UniversalTwoFactor)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyRequest do
@moduledoc """
## Attributes
* `sshPublicKey` (*type:* `String.t`, *default:* `nil`) - The SSH public key to sign.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:sshPublicKey => String.t() | nil
}

field(:sshPublicKey)
end

defimpl Poison.Decoder, for: GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyRequest do
def decode(value, options) do
GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyRequest.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyRequest do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyResponse do
@moduledoc """
## Attributes
* `signedSshPublicKey` (*type:* `String.t`, *default:* `nil`) - The signed SSH public key to use in the SSH handshake.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:signedSshPublicKey => String.t() | nil
}

field(:signedSshPublicKey)
end

defimpl Poison.Decoder, for: GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyResponse do
def decode(value, options) do
GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyResponse.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.OSLogin.V1alpha.Model.SignSshPublicKeyResponse do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
2 changes: 1 addition & 1 deletion clients/os_login/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
defmodule GoogleApi.OSLogin.Mixfile do
use Mix.Project

@version "0.27.1"
@version "0.28.0"

def project() do
[
Expand Down

0 comments on commit 0a376aa

Please sign in to comment.