diff --git a/clients/cloud_kms/README.md b/clients/cloud_kms/README.md index 703ca5ac71..9139026eb7 100644 --- a/clients/cloud_kms/README.md +++ b/clients/cloud_kms/README.md @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding ```elixir def deps do - [{:google_api_cloud_kms, "~> 0.39"}] + [{:google_api_cloud_kms, "~> 0.40"}] end ``` diff --git a/clients/cloud_kms/lib/google_api/cloud_kms/v1/api/folders.ex b/clients/cloud_kms/lib/google_api/cloud_kms/v1/api/folders.ex new file mode 100644 index 0000000000..afc9738a16 --- /dev/null +++ b/clients/cloud_kms/lib/google_api/cloud_kms/v1/api/folders.ex @@ -0,0 +1,166 @@ +# 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.CloudKMS.V1.Api.Folders do + @moduledoc """ + API calls for all endpoints tagged `Folders`. + """ + + alias GoogleApi.CloudKMS.V1.Connection + alias GoogleApi.Gax.{Request, Response} + + @library_version Mix.Project.config() |> Keyword.get(:version, "") + + @doc """ + Returns the AutokeyConfig for a folder. + + ## Parameters + + * `connection` (*type:* `GoogleApi.CloudKMS.V1.Connection.t`) - Connection to server + * `folders_id` (*type:* `String.t`) - Part of `name`. Required. Name of the AutokeyConfig resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * `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"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.CloudKMS.V1.Model.AutokeyConfig{}}` on success + * `{:error, info}` on failure + """ + @spec cloudkms_folders_get_autokey_config(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.CloudKMS.V1.Model.AutokeyConfig.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def cloudkms_folders_get_autokey_config( + connection, + folders_id, + 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 + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/folders/{foldersId}/autokeyConfig", %{ + "foldersId" => URI.encode(folders_id, &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.CloudKMS.V1.Model.AutokeyConfig{}]) + end + + @doc """ + Updates the AutokeyConfig for a folder. The caller must have both `cloudkms.autokeyConfigs.update` permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` permission on the provided key project. An empty key project may be provided to clear the configuration. + + ## Parameters + + * `connection` (*type:* `GoogleApi.CloudKMS.V1.Connection.t`) - Connection to server + * `folders_id` (*type:* `String.t`) - Part of `autokeyConfig.name`. Identifier. Name of the AutokeyConfig resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + * `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"). + * `:updateMask` (*type:* `String.t`) - Required. Masks which fields of the AutokeyConfig to update, e.g. `keyProject`. + * `:body` (*type:* `GoogleApi.CloudKMS.V1.Model.AutokeyConfig.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.CloudKMS.V1.Model.AutokeyConfig{}}` on success + * `{:error, info}` on failure + """ + @spec cloudkms_folders_update_autokey_config( + Tesla.Env.client(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.CloudKMS.V1.Model.AutokeyConfig.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def cloudkms_folders_update_autokey_config( + connection, + folders_id, + 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, + :updateMask => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:patch) + |> Request.url("/v1/folders/{foldersId}/autokeyConfig", %{ + "foldersId" => URI.encode(folders_id, &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.CloudKMS.V1.Model.AutokeyConfig{}]) + end +end diff --git a/clients/cloud_kms/lib/google_api/cloud_kms/v1/api/projects.ex b/clients/cloud_kms/lib/google_api/cloud_kms/v1/api/projects.ex index 1fdd199967..7905d71a2b 100644 --- a/clients/cloud_kms/lib/google_api/cloud_kms/v1/api/projects.ex +++ b/clients/cloud_kms/lib/google_api/cloud_kms/v1/api/projects.ex @@ -25,6 +25,78 @@ defmodule GoogleApi.CloudKMS.V1.Api.Projects do @library_version Mix.Project.config() |> Keyword.get(:version, "") + @doc """ + Returns the effective Cloud KMS Autokey configuration for a given project. + + ## Parameters + + * `connection` (*type:* `GoogleApi.CloudKMS.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `parent`. Required. Name of the resource project to the show effective Cloud KMS Autokey configuration for. This may be helpful for interrogating the effect of nested folder configurations on a given resource project. + * `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"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.CloudKMS.V1.Model.ShowEffectiveAutokeyConfigResponse{}}` on success + * `{:error, info}` on failure + """ + @spec cloudkms_projects_show_effective_autokey_config( + Tesla.Env.client(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.CloudKMS.V1.Model.ShowEffectiveAutokeyConfigResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def cloudkms_projects_show_effective_autokey_config( + connection, + projects_id, + 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 + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/projects/{projectsId}:showEffectiveAutokeyConfig", %{ + "projectsId" => URI.encode(projects_id, &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.CloudKMS.V1.Model.ShowEffectiveAutokeyConfigResponse{}] + ) + end + @doc """ Generate random bytes using the Cloud KMS randomness source in the provided location. @@ -1298,6 +1370,241 @@ defmodule GoogleApi.CloudKMS.V1.Api.Projects do ) end + @doc """ + Creates a new KeyHandle, triggering the provisioning of a new CryptoKey for CMEK use with the given resource type in the configured key project and the same location. GetOperation should be used to resolve the resulting long-running operation and get the resulting KeyHandle and CryptoKey. + + ## Parameters + + * `connection` (*type:* `GoogleApi.CloudKMS.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `parent`. Required. Name of the resource project and location to create the KeyHandle in, e.g. `projects/{PROJECT_ID}/locations/{LOCATION}`. + * `locations_id` (*type:* `String.t`) - Part of `parent`. See documentation of `projectsId`. + * `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"). + * `:keyHandleId` (*type:* `String.t`) - Optional. Id of the KeyHandle. Must be unique to the resource project and location. If not provided by the caller, a new UUID is used. + * `:body` (*type:* `GoogleApi.CloudKMS.V1.Model.KeyHandle.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.CloudKMS.V1.Model.Operation{}}` on success + * `{:error, info}` on failure + """ + @spec cloudkms_projects_locations_key_handles_create( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.CloudKMS.V1.Model.Operation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def cloudkms_projects_locations_key_handles_create( + connection, + projects_id, + locations_id, + 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, + :keyHandleId => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/projects/{projectsId}/locations/{locationsId}/keyHandles", %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &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.CloudKMS.V1.Model.Operation{}]) + end + + @doc """ + Returns the KeyHandle. + + ## Parameters + + * `connection` (*type:* `GoogleApi.CloudKMS.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `name`. Required. Name of the KeyHandle resource, e.g. `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * `locations_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `key_handles_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `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"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.CloudKMS.V1.Model.KeyHandle{}}` on success + * `{:error, info}` on failure + """ + @spec cloudkms_projects_locations_key_handles_get( + Tesla.Env.client(), + String.t(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.CloudKMS.V1.Model.KeyHandle.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def cloudkms_projects_locations_key_handles_get( + connection, + projects_id, + locations_id, + key_handles_id, + 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 + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url( + "/v1/projects/{projectsId}/locations/{locationsId}/keyHandles/{keyHandlesId}", + %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &URI.char_unreserved?/1), + "keyHandlesId" => URI.encode(key_handles_id, &(URI.char_unreserved?(&1) || &1 == ?/)) + } + ) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.CloudKMS.V1.Model.KeyHandle{}]) + end + + @doc """ + Lists KeyHandles. + + ## Parameters + + * `connection` (*type:* `GoogleApi.CloudKMS.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `parent`. Required. Name of the resource project and location from which to list KeyHandles, e.g. `projects/{PROJECT_ID}/locations/{LOCATION}`. + * `locations_id` (*type:* `String.t`) - Part of `parent`. See documentation of `projectsId`. + * `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"). + * `:filter` (*type:* `String.t`) - Optional. Filter to apply when listing KeyHandles, e.g. `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.CloudKMS.V1.Model.ListKeyHandlesResponse{}}` on success + * `{:error, info}` on failure + """ + @spec cloudkms_projects_locations_key_handles_list( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.CloudKMS.V1.Model.ListKeyHandlesResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def cloudkms_projects_locations_key_handles_list( + connection, + projects_id, + locations_id, + 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, + :filter => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/projects/{projectsId}/locations/{locationsId}/keyHandles", %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &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.CloudKMS.V1.Model.ListKeyHandlesResponse{}]) + end + @doc """ Create a new KeyRing in a given Project and Location. @@ -4456,4 +4763,85 @@ defmodule GoogleApi.CloudKMS.V1.Api.Projects do opts ++ [struct: %GoogleApi.CloudKMS.V1.Model.TestIamPermissionsResponse{}] ) end + + @doc """ + Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + + ## Parameters + + * `connection` (*type:* `GoogleApi.CloudKMS.V1.Connection.t`) - Connection to server + * `projects_id` (*type:* `String.t`) - Part of `name`. The name of the operation resource. + * `locations_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `operations_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`. + * `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"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.CloudKMS.V1.Model.Operation{}}` on success + * `{:error, info}` on failure + """ + @spec cloudkms_projects_locations_operations_get( + Tesla.Env.client(), + String.t(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.CloudKMS.V1.Model.Operation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def cloudkms_projects_locations_operations_get( + connection, + projects_id, + locations_id, + operations_id, + 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 + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url( + "/v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", + %{ + "projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1), + "locationsId" => URI.encode(locations_id, &URI.char_unreserved?/1), + "operationsId" => URI.encode(operations_id, &(URI.char_unreserved?(&1) || &1 == ?/)) + } + ) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.CloudKMS.V1.Model.Operation{}]) + end end diff --git a/clients/cloud_kms/lib/google_api/cloud_kms/v1/metadata.ex b/clients/cloud_kms/lib/google_api/cloud_kms/v1/metadata.ex index 97a248088f..e6f15ab643 100644 --- a/clients/cloud_kms/lib/google_api/cloud_kms/v1/metadata.ex +++ b/clients/cloud_kms/lib/google_api/cloud_kms/v1/metadata.ex @@ -20,7 +20,7 @@ defmodule GoogleApi.CloudKMS.V1 do API client metadata for GoogleApi.CloudKMS.V1. """ - @discovery_revision "20240314" + @discovery_revision "20240425" def discovery_revision(), do: @discovery_revision end diff --git a/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/autokey_config.ex b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/autokey_config.ex new file mode 100644 index 0000000000..4036c5b196 --- /dev/null +++ b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/autokey_config.ex @@ -0,0 +1,49 @@ +# 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.CloudKMS.V1.Model.AutokeyConfig do + @moduledoc """ + Cloud KMS Autokey configuration for a folder. + + ## Attributes + + * `keyProject` (*type:* `String.t`, *default:* `nil`) - Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or `projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision new CryptoKeys. On UpdateAutokeyConfig, the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on this key project. Once configured, for Cloud KMS Autokey to function properly, this key project must have the Cloud KMS API activated and the Cloud KMS Service Agent for this key project must be granted the `cloudkms.admin` role (or pertinent permissions). + * `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Name of the AutokeyConfig resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :keyProject => String.t() | nil, + :name => String.t() | nil + } + + field(:keyProject) + field(:name) +end + +defimpl Poison.Decoder, for: GoogleApi.CloudKMS.V1.Model.AutokeyConfig do + def decode(value, options) do + GoogleApi.CloudKMS.V1.Model.AutokeyConfig.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.CloudKMS.V1.Model.AutokeyConfig do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/key_handle.ex b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/key_handle.ex new file mode 100644 index 0000000000..c317d4d018 --- /dev/null +++ b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/key_handle.ex @@ -0,0 +1,52 @@ +# 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.CloudKMS.V1.Model.KeyHandle do + @moduledoc """ + Resource-oriented representation of a request to Cloud KMS Autokey and the resulting provisioning of a CryptoKey. + + ## Attributes + + * `kmsKey` (*type:* `String.t`, *default:* `nil`) - Output only. Name of a CryptoKey that has been provisioned for Customer Managed Encryption Key (CMEK) use in the KeyHandle's project and location for the requested resource type. + * `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. Name of the [KeyHandle] resource, e.g. `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + * `resourceTypeSelector` (*type:* `String.t`, *default:* `nil`) - Required. Indicates the resource type that the resulting CryptoKey is meant to protect, e.g. `{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource types. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :kmsKey => String.t() | nil, + :name => String.t() | nil, + :resourceTypeSelector => String.t() | nil + } + + field(:kmsKey) + field(:name) + field(:resourceTypeSelector) +end + +defimpl Poison.Decoder, for: GoogleApi.CloudKMS.V1.Model.KeyHandle do + def decode(value, options) do + GoogleApi.CloudKMS.V1.Model.KeyHandle.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.CloudKMS.V1.Model.KeyHandle do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/list_key_handles_response.ex b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/list_key_handles_response.ex new file mode 100644 index 0000000000..30ae94dbca --- /dev/null +++ b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/list_key_handles_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.CloudKMS.V1.Model.ListKeyHandlesResponse do + @moduledoc """ + Response message for Autokey.ListKeyHandles. + + ## Attributes + + * `keyHandles` (*type:* `list(GoogleApi.CloudKMS.V1.Model.KeyHandle.t)`, *default:* `nil`) - Resulting KeyHandles. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :keyHandles => list(GoogleApi.CloudKMS.V1.Model.KeyHandle.t()) | nil + } + + field(:keyHandles, as: GoogleApi.CloudKMS.V1.Model.KeyHandle, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.CloudKMS.V1.Model.ListKeyHandlesResponse do + def decode(value, options) do + GoogleApi.CloudKMS.V1.Model.ListKeyHandlesResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.CloudKMS.V1.Model.ListKeyHandlesResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/operation.ex b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/operation.ex new file mode 100644 index 0000000000..8beff9b586 --- /dev/null +++ b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/operation.ex @@ -0,0 +1,58 @@ +# 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.CloudKMS.V1.Model.Operation do + @moduledoc """ + This resource represents a long-running operation that is the result of a network API call. + + ## Attributes + + * `done` (*type:* `boolean()`, *default:* `nil`) - If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. + * `error` (*type:* `GoogleApi.CloudKMS.V1.Model.Status.t`, *default:* `nil`) - The error result of the operation in case of failure or cancellation. + * `metadata` (*type:* `map()`, *default:* `nil`) - Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + * `name` (*type:* `String.t`, *default:* `nil`) - The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. + * `response` (*type:* `map()`, *default:* `nil`) - The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :done => boolean() | nil, + :error => GoogleApi.CloudKMS.V1.Model.Status.t() | nil, + :metadata => map() | nil, + :name => String.t() | nil, + :response => map() | nil + } + + field(:done) + field(:error, as: GoogleApi.CloudKMS.V1.Model.Status) + field(:metadata, type: :map) + field(:name) + field(:response, type: :map) +end + +defimpl Poison.Decoder, for: GoogleApi.CloudKMS.V1.Model.Operation do + def decode(value, options) do + GoogleApi.CloudKMS.V1.Model.Operation.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.CloudKMS.V1.Model.Operation do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/show_effective_autokey_config_response.ex b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/show_effective_autokey_config_response.ex new file mode 100644 index 0000000000..a30b69a045 --- /dev/null +++ b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/show_effective_autokey_config_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.CloudKMS.V1.Model.ShowEffectiveAutokeyConfigResponse do + @moduledoc """ + Response message for ShowEffectiveAutokeyConfig. + + ## Attributes + + * `keyProject` (*type:* `String.t`, *default:* `nil`) - Name of the key project configured in the resource project's folder ancestry. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :keyProject => String.t() | nil + } + + field(:keyProject) +end + +defimpl Poison.Decoder, for: GoogleApi.CloudKMS.V1.Model.ShowEffectiveAutokeyConfigResponse do + def decode(value, options) do + GoogleApi.CloudKMS.V1.Model.ShowEffectiveAutokeyConfigResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.CloudKMS.V1.Model.ShowEffectiveAutokeyConfigResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/status.ex b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/status.ex new file mode 100644 index 0000000000..02109837e5 --- /dev/null +++ b/clients/cloud_kms/lib/google_api/cloud_kms/v1/model/status.ex @@ -0,0 +1,52 @@ +# 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.CloudKMS.V1.Model.Status do + @moduledoc """ + The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + + ## Attributes + + * `code` (*type:* `integer()`, *default:* `nil`) - The status code, which should be an enum value of google.rpc.Code. + * `details` (*type:* `list(map())`, *default:* `nil`) - A list of messages that carry the error details. There is a common set of message types for APIs to use. + * `message` (*type:* `String.t`, *default:* `nil`) - A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :code => integer() | nil, + :details => list(map()) | nil, + :message => String.t() | nil + } + + field(:code) + field(:details, type: :list) + field(:message) +end + +defimpl Poison.Decoder, for: GoogleApi.CloudKMS.V1.Model.Status do + def decode(value, options) do + GoogleApi.CloudKMS.V1.Model.Status.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.CloudKMS.V1.Model.Status do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/cloud_kms/mix.exs b/clients/cloud_kms/mix.exs index 06c703c16f..8a48a51e7c 100644 --- a/clients/cloud_kms/mix.exs +++ b/clients/cloud_kms/mix.exs @@ -18,7 +18,7 @@ defmodule GoogleApi.CloudKMS.Mixfile do use Mix.Project - @version "0.39.1" + @version "0.40.0" def project() do [