diff --git a/clients/policy_simulator/README.md b/clients/policy_simulator/README.md index 43c3dba472..00e318fb69 100644 --- a/clients/policy_simulator/README.md +++ b/clients/policy_simulator/README.md @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding ```elixir def deps do - [{:google_api_policy_simulator, "~> 0.3"}] + [{:google_api_policy_simulator, "~> 0.4"}] end ``` diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/organizations.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/organizations.ex index 3bf703dcab..4c7223216b 100644 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/organizations.ex +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/organizations.ex @@ -25,240 +25,6 @@ defmodule GoogleApi.PolicySimulator.V1.Api.Organizations do @library_version Mix.Project.config() |> Keyword.get(:version, "") - @doc """ - CreateOrgPolicyViolationsPreview creates an OrgPolicyViolationsPreview for the proposed changes in the provided OrgPolicyViolationsPreview.OrgPolicyOverlay. The changes to OrgPolicy are specified by this `OrgPolicyOverlay`. The resources to scan are inferred from these specified changes. - - ## Parameters - - * `connection` (*type:* `GoogleApi.PolicySimulator.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The organization under which this OrgPolicyViolationsPreview will be created. Example: `organizations/my-example-org/locations/global` - * `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"). - * `:orgPolicyViolationsPreviewId` (*type:* `String.t`) - Optional. An optional user-specified ID for the OrgPolicyViolationsPreview. If not provided, a random ID will be generated. - * `:body` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview.t`) - - * `opts` (*type:* `keyword()`) - Call options - - ## Returns - - * `{:ok, %GoogleApi.PolicySimulator.V1.Model.GoogleLongrunningOperation{}}` on success - * `{:error, info}` on failure - """ - @spec policysimulator_organizations_locations_org_policy_violations_previews_create( - Tesla.Env.client(), - String.t(), - keyword(), - keyword() - ) :: - {:ok, GoogleApi.PolicySimulator.V1.Model.GoogleLongrunningOperation.t()} - | {:ok, Tesla.Env.t()} - | {:ok, list()} - | {:error, any()} - def policysimulator_organizations_locations_org_policy_violations_previews_create( - 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, - :orgPolicyViolationsPreviewId => :query, - :body => :body - } - - request = - Request.new() - |> Request.method(:post) - |> Request.url("/v1/{+parent}/orgPolicyViolationsPreviews", %{ - "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.PolicySimulator.V1.Model.GoogleLongrunningOperation{}] - ) - end - - @doc """ - GetOrgPolicyViolationsPreview gets the specified OrgPolicyViolationsPreview. Each OrgPolicyViolationsPreview is available for at least 7 days. - - ## Parameters - - * `connection` (*type:* `GoogleApi.PolicySimulator.V1.Connection.t`) - Connection to server - * `name` (*type:* `String.t`) - Required. The name of the OrgPolicyViolationsPreview to get. - * `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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview{}}` on success - * `{:error, info}` on failure - """ - @spec policysimulator_organizations_locations_org_policy_violations_previews_get( - Tesla.Env.client(), - String.t(), - keyword(), - keyword() - ) :: - {:ok, - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview.t()} - | {:ok, Tesla.Env.t()} - | {:ok, list()} - | {:error, any()} - def policysimulator_organizations_locations_org_policy_violations_previews_get( - 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(:get) - |> Request.url("/v1/{+name}", %{ - "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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview{} - ] - ) - end - - @doc """ - ListOrgPolicyViolationsPreviews lists each OrgPolicyViolationsPreview in an organization. Each OrgPolicyViolationsPreview is available for at least 7 days. - - ## Parameters - - * `connection` (*type:* `GoogleApi.PolicySimulator.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The parent the violations are scoped to. Format: `organizations/{organization}/locations/{location}` Example: `organizations/my-example-org/locations/global` - * `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"). - * `:pageSize` (*type:* `integer()`) - Optional. The maximum number of items to return. The service may return fewer than this value. If unspecified, at most 5 items will be returned. The maximum value is 10; values above 10 will be coerced to 10. - * `:pageToken` (*type:* `String.t`) - Optional. A page token, received from a previous call. Provide this to retrieve the subsequent page. When paginating, all other parameters must match the call that provided the page token. - * `opts` (*type:* `keyword()`) - Call options - - ## Returns - - * `{:ok, %GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse{}}` on success - * `{:error, info}` on failure - """ - @spec policysimulator_organizations_locations_org_policy_violations_previews_list( - Tesla.Env.client(), - String.t(), - keyword(), - keyword() - ) :: - {:ok, - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse.t()} - | {:ok, Tesla.Env.t()} - | {:ok, list()} - | {:error, any()} - def policysimulator_organizations_locations_org_policy_violations_previews_list( - 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, - :pageSize => :query, - :pageToken => :query - } - - request = - Request.new() - |> Request.method(:get) - |> Request.url("/v1/{+parent}/orgPolicyViolationsPreviews", %{ - "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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse{} - ] - ) - 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. @@ -331,87 +97,6 @@ defmodule GoogleApi.PolicySimulator.V1.Api.Organizations do ) end - @doc """ - ListOrgPolicyViolations lists the OrgPolicyViolations that are present in an OrgPolicyViolationsPreview. - - ## Parameters - - * `connection` (*type:* `GoogleApi.PolicySimulator.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The OrgPolicyViolationsPreview to get OrgPolicyViolations from. Format: organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreview} - * `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"). - * `:pageSize` (*type:* `integer()`) - Optional. The maximum number of items to return. The service may return fewer than this value. If unspecified, at most 50 items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. - * `:pageToken` (*type:* `String.t`) - Optional. A page token, received from a previous call. Provide this to retrieve the subsequent page. When paginating, all other parameters must match the call that provided the page token. - * `opts` (*type:* `keyword()`) - Call options - - ## Returns - - * `{:ok, %GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse{}}` on success - * `{:error, info}` on failure - """ - @spec policysimulator_organizations_locations_org_policy_violations_previews_org_policy_violations_list( - Tesla.Env.client(), - String.t(), - keyword(), - keyword() - ) :: - {:ok, - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse.t()} - | {:ok, Tesla.Env.t()} - | {:ok, list()} - | {:error, any()} - def policysimulator_organizations_locations_org_policy_violations_previews_org_policy_violations_list( - 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, - :pageSize => :query, - :pageToken => :query - } - - request = - Request.new() - |> Request.method(:get) - |> Request.url("/v1/{+parent}/orgPolicyViolations", %{ - "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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse{} - ] - ) - end - @doc """ Creates and starts a Replay using the given ReplayConfig. diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/metadata.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/metadata.ex index 436fa13d36..9d21a9c463 100644 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/metadata.ex +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/metadata.ex @@ -20,7 +20,7 @@ defmodule GoogleApi.PolicySimulator.V1 do API client metadata for GoogleApi.PolicySimulator.V1. """ - @discovery_revision "20240303" + @discovery_revision "20240617" def discovery_revision(), do: @discovery_revision end diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_list_org_policy_violations_previews_response.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_list_org_policy_violations_previews_response.ex deleted file mode 100644 index a3ef41af8e..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_list_org_policy_violations_previews_response.ex +++ /dev/null @@ -1,64 +0,0 @@ -# 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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse do - @moduledoc """ - ListOrgPolicyViolationsPreviewsResponse is the response message for OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews. - - ## Attributes - - * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token that you can use to retrieve the next page of results. If this field is omitted, there are no subsequent pages. - * `orgPolicyViolationsPreviews` (*type:* `list(GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview.t)`, *default:* `nil`) - The list of OrgPolicyViolationsPreview - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :nextPageToken => String.t() | nil, - :orgPolicyViolationsPreviews => - list( - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview.t() - ) - | nil - } - - field(:nextPageToken) - - field(:orgPolicyViolationsPreviews, - as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview, - type: :list - ) -end - -defimpl Poison.Decoder, - for: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse do - def encode(value, options) do - GoogleApi.Gax.ModelBase.encode(value, options) - end -end diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_list_org_policy_violations_response.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_list_org_policy_violations_response.ex deleted file mode 100644 index 9dc04a3965..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_list_org_policy_violations_response.ex +++ /dev/null @@ -1,64 +0,0 @@ -# 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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse do - @moduledoc """ - ListOrgPolicyViolationsResponse is the response message for OrgPolicyViolationsPreviewService.ListOrgPolicyViolations - - ## Attributes - - * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token that you can use to retrieve the next page of results. If this field is omitted, there are no subsequent pages. - * `orgPolicyViolations` (*type:* `list(GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolation.t)`, *default:* `nil`) - The list of OrgPolicyViolations - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :nextPageToken => String.t() | nil, - :orgPolicyViolations => - list( - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolation.t() - ) - | nil - } - - field(:nextPageToken) - - field(:orgPolicyViolations, - as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolation, - type: :list - ) -end - -defimpl Poison.Decoder, - for: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse do - def encode(value, options) do - GoogleApi.Gax.ModelBase.encode(value, options) - end -end diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay.ex deleted file mode 100644 index 64d0e65761..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay.ex +++ /dev/null @@ -1,71 +0,0 @@ -# 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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlay do - @moduledoc """ - The proposed changes to OrgPolicy. - - ## Attributes - - * `customConstraints` (*type:* `list(GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay.t)`, *default:* `nil`) - Optional. The OrgPolicy CustomConstraint changes to preview violations for. Any existing CustomConstraints with the same name will be overridden in the simulation. That is, violations will be determined as if all custom constraints in the overlay were instantiated. Only a single custom_constraint is supported in the overlay at a time. For evaluating multiple constraints, multiple `GenerateOrgPolicyViolationsPreview` requests are made, where each request evaluates a single constraint. - * `policies` (*type:* `list(GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay.t)`, *default:* `nil`) - Optional. The OrgPolicy changes to preview violations for. Any existing OrgPolicies with the same name will be overridden in the simulation. That is, violations will be determined as if all policies in the overlay were created or updated. - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :customConstraints => - list( - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay.t() - ) - | nil, - :policies => - list( - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay.t() - ) - | nil - } - - field(:customConstraints, - as: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay, - type: :list - ) - - field(:policies, - as: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay, - type: :list - ) -end - -defimpl Poison.Decoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlay do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlay.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlay do - def encode(value, options) do - GoogleApi.Gax.ModelBase.encode(value, options) - end -end diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay_custom_constraint_overlay.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay_custom_constraint_overlay.ex deleted file mode 100644 index da05984500..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay_custom_constraint_overlay.ex +++ /dev/null @@ -1,60 +0,0 @@ -# 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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay do - @moduledoc """ - A change to an OrgPolicy custom constraint. - - ## Attributes - - * `customConstraint` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2CustomConstraint.t`, *default:* `nil`) - Optional. The new or updated custom constraint. - * `customConstraintParent` (*type:* `String.t`, *default:* `nil`) - Optional. Resource the constraint is attached to. Example: "organization/987654" - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :customConstraint => - GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2CustomConstraint.t() | nil, - :customConstraintParent => String.t() | nil - } - - field(:customConstraint, - as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2CustomConstraint - ) - - field(:customConstraintParent) -end - -defimpl Poison.Decoder, - for: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay do - def encode(value, options) do - GoogleApi.Gax.ModelBase.encode(value, options) - end -end diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay_policy_overlay.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay_policy_overlay.ex deleted file mode 100644 index 4c98e61490..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay_policy_overlay.ex +++ /dev/null @@ -1,56 +0,0 @@ -# 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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay do - @moduledoc """ - A change to an OrgPolicy. - - ## Attributes - - * `policy` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2Policy.t`, *default:* `nil`) - Optional. The new or updated OrgPolicy. - * `policyParent` (*type:* `String.t`, *default:* `nil`) - Optional. The parent of the policy we are attaching to. Example: "projects/123456" - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :policy => GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2Policy.t() | nil, - :policyParent => String.t() | nil - } - - field(:policy, as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2Policy) - field(:policyParent) -end - -defimpl Poison.Decoder, - for: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay do - def encode(value, options) do - GoogleApi.Gax.ModelBase.encode(value, options) - end -end diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violation.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violation.ex deleted file mode 100644 index 2a0941a26b..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violation.ex +++ /dev/null @@ -1,69 +0,0 @@ -# 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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolation do - @moduledoc """ - OrgPolicyViolation is a resource representing a single resource violating a single OrgPolicy constraint. - - ## Attributes - - * `customConstraint` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2CustomConstraint.t`, *default:* `nil`) - The custom constraint being violated. - * `error` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleRpcStatus.t`, *default:* `nil`) - Any error encountered during the evaluation. - * `name` (*type:* `String.t`, *default:* `nil`) - The name of the `OrgPolicyViolation`. Example: organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/506a5f7f/orgPolicyViolations/38ce` - * `resource` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ResourceContext.t`, *default:* `nil`) - The resource violating the constraint. - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :customConstraint => - GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2CustomConstraint.t() | nil, - :error => GoogleApi.PolicySimulator.V1.Model.GoogleRpcStatus.t() | nil, - :name => String.t() | nil, - :resource => - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ResourceContext.t() - | nil - } - - field(:customConstraint, - as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2CustomConstraint - ) - - field(:error, as: GoogleApi.PolicySimulator.V1.Model.GoogleRpcStatus) - field(:name) - - field(:resource, - as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ResourceContext - ) -end - -defimpl Poison.Decoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolation do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolation.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolation do - def encode(value, options) do - GoogleApi.Gax.ModelBase.encode(value, options) - end -end diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violations_preview.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violations_preview.ex deleted file mode 100644 index 87b432292f..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violations_preview.ex +++ /dev/null @@ -1,81 +0,0 @@ -# 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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview do - @moduledoc """ - OrgPolicyViolationsPreview is a resource providing a preview of the violations that will exist if an OrgPolicy change is made. The list of violations are modeled as child resources and retrieved via a ListOrgPolicyViolations API call. There are potentially more OrgPolicyViolations than could fit in an embedded field. Thus, the use of a child resource instead of a field. - - ## Attributes - - * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when this `OrgPolicyViolationsPreview` was created. - * `customConstraints` (*type:* `list(String.t)`, *default:* `nil`) - Output only. The names of the constraints against which all `OrgPolicyViolations` were evaluated. If `OrgPolicyOverlay` only contains `PolicyOverlay` then it contains the name of the configured custom constraint, applicable to the specified policies. Otherwise it contains the name of the constraint specified in `CustomConstraintOverlay`. Format: `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms` - * `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the `OrgPolicyViolationsPreview`. It has the following format: `organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreview}` Example: `organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/506a5f7f` - * `overlay` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlay.t`, *default:* `nil`) - Required. The proposed changes we are previewing violations for. - * `resourceCounts` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts.t`, *default:* `nil`) - Output only. A summary of the state of all resources scanned for compliance with the changed OrgPolicy. - * `state` (*type:* `String.t`, *default:* `nil`) - Output only. The state of the `OrgPolicyViolationsPreview`. - * `violationsCount` (*type:* `integer()`, *default:* `nil`) - Output only. The number of OrgPolicyViolations in this `OrgPolicyViolationsPreview`. This count may differ from `resource_summary.noncompliant_count` because each OrgPolicyViolation is specific to a resource **and** constraint. If there are multiple constraints being evaluated (i.e. multiple policies in the overlay), a single resource may violate multiple constraints. - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :createTime => DateTime.t() | nil, - :customConstraints => list(String.t()) | nil, - :name => String.t() | nil, - :overlay => - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlay.t() - | nil, - :resourceCounts => - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts.t() - | nil, - :state => String.t() | nil, - :violationsCount => integer() | nil - } - - field(:createTime, as: DateTime) - field(:customConstraints, type: :list) - field(:name) - - field(:overlay, - as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlay - ) - - field(:resourceCounts, - as: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts - ) - - field(:state) - field(:violationsCount) -end - -defimpl Poison.Decoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview do - def encode(value, options) do - GoogleApi.Gax.ModelBase.encode(value, options) - end -end diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violations_preview_resource_counts.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violations_preview_resource_counts.ex deleted file mode 100644 index a04b4eacbe..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violations_preview_resource_counts.ex +++ /dev/null @@ -1,65 +0,0 @@ -# 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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts do - @moduledoc """ - A summary of the state of all resources scanned for compliance with the changed OrgPolicy. - - ## Attributes - - * `compliant` (*type:* `integer()`, *default:* `nil`) - Output only. Number of scanned resources with zero violations. - * `errors` (*type:* `integer()`, *default:* `nil`) - Output only. Number of resources that returned an error when scanned. - * `noncompliant` (*type:* `integer()`, *default:* `nil`) - Output only. Number of scanned resources with at least one violation. - * `scanned` (*type:* `integer()`, *default:* `nil`) - Output only. Number of resources checked for compliance. Must equal: unenforced + noncompliant + compliant + error - * `unenforced` (*type:* `integer()`, *default:* `nil`) - Output only. Number of resources where the constraint was not enforced, i.e. the Policy set `enforced: false` for that resource. - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :compliant => integer() | nil, - :errors => integer() | nil, - :noncompliant => integer() | nil, - :scanned => integer() | nil, - :unenforced => integer() | nil - } - - field(:compliant) - field(:errors) - field(:noncompliant) - field(:scanned) - field(:unenforced) -end - -defimpl Poison.Decoder, - for: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts do - def encode(value, options) do - GoogleApi.Gax.ModelBase.encode(value, options) - end -end diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_resource_context.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_resource_context.ex deleted file mode 100644 index 48854c79f3..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_resource_context.ex +++ /dev/null @@ -1,57 +0,0 @@ -# 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.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ResourceContext do - @moduledoc """ - ResourceContext provides the context we know about a resource. It is similar in concept to google.cloud.asset.v1.Resource, but focuses on the information specifically used by Simulator. - - ## Attributes - - * `ancestors` (*type:* `list(String.t)`, *default:* `nil`) - The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names. An ancestry path starts with the closest ancestor in the hierarchy and ends at root. If the resource is a project, folder, or organization, the ancestry path starts from the resource itself. Example: `["projects/123456789", "folders/5432", "organizations/1234"]` - * `assetType` (*type:* `String.t`, *default:* `nil`) - The asset type of the resource as defined by CAIS. Example: `compute.googleapis.com/Firewall` See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information. - * `resource` (*type:* `String.t`, *default:* `nil`) - The full name of the resource. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :ancestors => list(String.t()) | nil, - :assetType => String.t() | nil, - :resource => String.t() | nil - } - - field(:ancestors, type: :list) - field(:assetType) - field(:resource) -end - -defimpl Poison.Decoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ResourceContext do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ResourceContext.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ResourceContext do - def encode(value, options) do - GoogleApi.Gax.ModelBase.encode(value, options) - end -end diff --git a/clients/policy_simulator/mix.exs b/clients/policy_simulator/mix.exs index 1d7246fb11..85e3d8931f 100644 --- a/clients/policy_simulator/mix.exs +++ b/clients/policy_simulator/mix.exs @@ -18,7 +18,7 @@ defmodule GoogleApi.PolicySimulator.Mixfile do use Mix.Project - @version "0.3.0" + @version "0.4.0" def project() do [