Skip to content

Commit

Permalink
feat: Automated regeneration of AssuredWorkloads client (#10994)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 02:52:39 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent 663b5ee commit f2bdce3
Show file tree
Hide file tree
Showing 19 changed files with 909 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ defmodule GoogleApi.AssuredWorkloads.V1.Api.Organizations do
end

@doc """
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
## Parameters
Expand Down Expand Up @@ -176,6 +176,91 @@ defmodule GoogleApi.AssuredWorkloads.V1.Api.Organizations do
)
end

@doc """
Analyzes a hypothetical move of a source resource to a target workload to surface compliance risks. The analysis is best effort and is not guaranteed to be exhaustive.
## Parameters
* `connection` (*type:* `GoogleApi.AssuredWorkloads.V1.Connection.t`) - Connection to server
* `target` (*type:* `String.t`) - Required. The resource ID of the folder-based destination workload. This workload is where the source resource will hypothetically be moved to. Specify the workload's relative resource name, formatted as: "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" For example: "organizations/123/locations/us-east1/workloads/assured-workload-2"
* `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").
* `:assetTypes` (*type:* `list(String.t)`) - Optional. List of asset types to be analyzed, including and under the source resource. If empty, all assets are analyzed. The complete list of asset types is available [here](https://cloud.google.com/asset-inventory/docs/supported-asset-types).
* `:pageSize` (*type:* `integer()`) - Optional. Page size. If a value is not specified, the default value of 10 is used.
* `:pageToken` (*type:* `String.t`) - Optional. The page token from the previous response. It needs to be passed in the second and following requests.
* `:project` (*type:* `String.t`) - The source type is a project. Specify the project's relative resource name, formatted as either a project number or a project ID: "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" For example: "projects/951040570662" when specifying a project number, or "projects/my-project-123" when specifying a project ID.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse{}}` on success
* `{:error, info}` on failure
"""
@spec assuredworkloads_organizations_locations_workloads_analyze_workload_move(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok,
GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def assuredworkloads_organizations_locations_workloads_analyze_workload_move(
connection,
target,
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,
:assetTypes => :query,
:pageSize => :query,
:pageToken => :query,
:project => :query
}

request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+target}:analyzeWorkloadMove", %{
"target" => URI.encode(target, &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.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse{}
]
)
end

@doc """
Creates Assured Workload.
Expand Down Expand Up @@ -253,7 +338,7 @@ defmodule GoogleApi.AssuredWorkloads.V1.Api.Organizations do
end

@doc """
Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.
Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error. In addition to assuredworkloads.workload.delete permission, the user should also have orgpolicy.policy.set permission on the deleted folder to remove Assured Workloads OrgPolicies.
## Parameters
Expand Down Expand Up @@ -326,13 +411,90 @@ defmodule GoogleApi.AssuredWorkloads.V1.Api.Organizations do
)
end

@doc """
Enable resource violation monitoring for a workload.
## Parameters
* `connection` (*type:* `GoogleApi.AssuredWorkloads.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. The `name` field is used to identify the workload. Format: organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
* `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.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1EnableResourceMonitoringResponse{}}` on success
* `{:error, info}` on failure
"""
@spec assuredworkloads_organizations_locations_workloads_enable_resource_monitoring(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok,
GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1EnableResourceMonitoringResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def assuredworkloads_organizations_locations_workloads_enable_resource_monitoring(
connection,
name,
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(:post)
|> Request.url("/v1/{+name}:enableResourceMonitoring", %{
"name" => URI.encode(name, &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.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1EnableResourceMonitoringResponse{}
]
)
end

@doc """
Gets Assured Workload associated with a CRM Node
## Parameters
* `connection` (*type:* `GoogleApi.AssuredWorkloads.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. The resource name of the Workload to fetch. This is the workload's relative path in the API, formatted as "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". For example, "organizations/123/locations/us-east1/workloads/assured-workload-1".
* `name` (*type:* `String.t`) - Required. The resource name of the Workload to fetch. This is the workloads's relative path in the API, formatted as "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". For example, "organizations/123/locations/us-east1/workloads/assured-workload-1".
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
Expand Down Expand Up @@ -482,6 +644,81 @@ defmodule GoogleApi.AssuredWorkloads.V1.Api.Organizations do
)
end

@doc """
Update the permissions settings for an existing partner workload. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.
## Parameters
* `connection` (*type:* `GoogleApi.AssuredWorkloads.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. The `name` field is used to identify the workload. Format: organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
* `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.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1MutatePartnerPermissionsRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1Workload{}}` on success
* `{:error, info}` on failure
"""
@spec assuredworkloads_organizations_locations_workloads_mutate_partner_permissions(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1Workload.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def assuredworkloads_organizations_locations_workloads_mutate_partner_permissions(
connection,
name,
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(:patch)
|> Request.url("/v1/{+name}:mutatePartnerPermissions", %{
"name" => URI.encode(name, &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.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1Workload{}]
)
end

@doc """
Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.AssuredWorkloads.V1 do
API client metadata for GoogleApi.AssuredWorkloads.V1.
"""

@discovery_revision "20221110"
@discovery_revision "20240229"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,24 @@

defmodule GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AcknowledgeViolationRequest do
@moduledoc """
Request for acknowledging the violation Next Id: 4
Request for acknowledging the violation
## Attributes
* `acknowledgeType` (*type:* `String.t`, *default:* `nil`) - Optional. Acknowledge type of specified violation.
* `comment` (*type:* `String.t`, *default:* `nil`) - Required. Business justification explaining the need for violation acknowledgement
* `nonCompliantOrgPolicy` (*type:* `String.t`, *default:* `nil`) - Optional. This field is deprecated and will be removed in future version of the API. Name of the OrgPolicy which was modified with non-compliant change and resulted in this violation. Format: projects/{project_number}/policies/{constraint_name} folders/{folder_id}/policies/{constraint_name} organizations/{organization_id}/policies/{constraint_name}
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:acknowledgeType => String.t() | nil,
:comment => String.t() | nil,
:nonCompliantOrgPolicy => String.t() | nil
}

field(:acknowledgeType)
field(:comment)
field(:nonCompliantOrgPolicy)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse do
@moduledoc """
Response containing the analysis results for the hypothetical resource move.
## Attributes
* `assetMoveAnalyses` (*type:* `list(GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AssetMoveAnalysis.t)`, *default:* `nil`) - List of analysis results for each asset in scope.
* `nextPageToken` (*type:* `String.t`, *default:* `nil`) - The next page token. Is empty if the last page is reached.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:assetMoveAnalyses =>
list(
GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AssetMoveAnalysis.t()
)
| nil,
:nextPageToken => String.t() | nil
}

field(:assetMoveAnalyses,
as: GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AssetMoveAnalysis,
type: :list
)

field(:nextPageToken)
end

defimpl Poison.Decoder,
for:
GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse do
def decode(value, options) do
GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse.decode(
value,
options
)
end
end

defimpl Poison.Encoder,
for:
GoogleApi.AssuredWorkloads.V1.Model.GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Loading

0 comments on commit f2bdce3

Please sign in to comment.