From 15a5ad52d59a991e879d19ad7eeacc429d441f2a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 12 Mar 2024 02:40:28 +0000 Subject: [PATCH] feat: Automated regeneration of OSLogin client --- clients/os_login/README.md | 2 +- .../lib/google_api/os_login/v1/api/users.ex | 2 + .../lib/google_api/os_login/v1/metadata.ex | 2 +- .../google_api/os_login/v1alpha/api/users.ex | 150 ++++++++++++++++++ .../google_api/os_login/v1alpha/metadata.ex | 2 +- .../os_login/v1alpha/model/security_key.ex | 3 + .../model/sign_ssh_public_key_request.ex | 46 ++++++ .../model/sign_ssh_public_key_response.ex | 46 ++++++ clients/os_login/mix.exs | 2 +- 9 files changed, 251 insertions(+), 4 deletions(-) create mode 100644 clients/os_login/lib/google_api/os_login/v1alpha/model/sign_ssh_public_key_request.ex create mode 100644 clients/os_login/lib/google_api/os_login/v1alpha/model/sign_ssh_public_key_response.ex diff --git a/clients/os_login/README.md b/clients/os_login/README.md index 37e7945156..20373a8313 100644 --- a/clients/os_login/README.md +++ b/clients/os_login/README.md @@ -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 ``` diff --git a/clients/os_login/lib/google_api/os_login/v1/api/users.ex b/clients/os_login/lib/google_api/os_login/v1/api/users.ex index fc5ca5ab5e..3d766cca30 100644 --- a/clients/os_login/lib/google_api/os_login/v1/api/users.ex +++ b/clients/os_login/lib/google_api/os_login/v1/api/users.ex @@ -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 @@ -136,6 +137,7 @@ defmodule GoogleApi.OSLogin.V1.Api.Users do :uploadType => :query, :upload_protocol => :query, :projectId => :query, + :regions => :query, :body => :body } diff --git a/clients/os_login/lib/google_api/os_login/v1/metadata.ex b/clients/os_login/lib/google_api/os_login/v1/metadata.ex index a6ed1a8e1c..cbc4a15942 100644 --- a/clients/os_login/lib/google_api/os_login/v1/metadata.ex +++ b/clients/os_login/lib/google_api/os_login/v1/metadata.ex @@ -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 diff --git a/clients/os_login/lib/google_api/os_login/v1alpha/api/users.ex b/clients/os_login/lib/google_api/os_login/v1alpha/api/users.ex index ea3e970388..e00a5204f7 100644 --- a/clients/os_login/lib/google_api/os_login/v1alpha/api/users.ex +++ b/clients/os_login/lib/google_api/os_login/v1alpha/api/users.ex @@ -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 @@ -141,6 +142,7 @@ defmodule GoogleApi.OSLogin.V1alpha.Api.Users do :uploadType => :query, :upload_protocol => :query, :projectId => :query, + :regions => :query, :view => :query, :body => :body } @@ -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 diff --git a/clients/os_login/lib/google_api/os_login/v1alpha/metadata.ex b/clients/os_login/lib/google_api/os_login/v1alpha/metadata.ex index 0576f8bebe..494aaed607 100644 --- a/clients/os_login/lib/google_api/os_login/v1alpha/metadata.ex +++ b/clients/os_login/lib/google_api/os_login/v1alpha/metadata.ex @@ -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 diff --git a/clients/os_login/lib/google_api/os_login/v1alpha/model/security_key.ex b/clients/os_login/lib/google_api/os_login/v1alpha/model/security_key.ex index 1364ed3597..1ef8512e1d 100644 --- a/clients/os_login/lib/google_api/os_login/v1alpha/model/security_key.ex +++ b/clients/os_login/lib/google_api/os_login/v1alpha/model/security_key.ex @@ -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. @@ -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) diff --git a/clients/os_login/lib/google_api/os_login/v1alpha/model/sign_ssh_public_key_request.ex b/clients/os_login/lib/google_api/os_login/v1alpha/model/sign_ssh_public_key_request.ex new file mode 100644 index 0000000000..9b8c8177f1 --- /dev/null +++ b/clients/os_login/lib/google_api/os_login/v1alpha/model/sign_ssh_public_key_request.ex @@ -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 diff --git a/clients/os_login/lib/google_api/os_login/v1alpha/model/sign_ssh_public_key_response.ex b/clients/os_login/lib/google_api/os_login/v1alpha/model/sign_ssh_public_key_response.ex new file mode 100644 index 0000000000..ac6ff19ccf --- /dev/null +++ b/clients/os_login/lib/google_api/os_login/v1alpha/model/sign_ssh_public_key_response.ex @@ -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 diff --git a/clients/os_login/mix.exs b/clients/os_login/mix.exs index 101588d0fc..28a09e308f 100644 --- a/clients/os_login/mix.exs +++ b/clients/os_login/mix.exs @@ -18,7 +18,7 @@ defmodule GoogleApi.OSLogin.Mixfile do use Mix.Project - @version "0.27.1" + @version "0.28.0" def project() do [