diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/folders.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/folders.ex index 0d4de4655f..469c0597d7 100644 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/folders.ex +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/folders.ex @@ -25,6 +25,78 @@ defmodule GoogleApi.PolicySimulator.V1.Api.Folders do @library_version Mix.Project.config() |> Keyword.get(:version, "") + @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.PolicySimulator.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - The name of the operation resource. + * `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.GoogleLongrunningOperation{}}` on success + * `{:error, info}` on failure + """ + @spec policysimulator_folders_locations_org_policy_violations_previews_operations_get( + Tesla.Env.client(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.PolicySimulator.V1.Model.GoogleLongrunningOperation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def policysimulator_folders_locations_org_policy_violations_previews_operations_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.GoogleLongrunningOperation{}] + ) + end + @doc """ Creates and starts a Replay using the given ReplayConfig. @@ -244,7 +316,7 @@ defmodule GoogleApi.PolicySimulator.V1.Api.Folders 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 diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/operations.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/operations.ex index 30d3ece626..c978e96288 100644 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/operations.ex +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/operations.ex @@ -88,7 +88,7 @@ defmodule GoogleApi.PolicySimulator.V1.Api.Operations 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 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 864319702f..3bf703dcab 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,6 +25,393 @@ 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. + + ## Parameters + + * `connection` (*type:* `GoogleApi.PolicySimulator.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - The name of the operation resource. + * `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.GoogleLongrunningOperation{}}` on success + * `{:error, info}` on failure + """ + @spec policysimulator_organizations_locations_org_policy_violations_previews_operations_get( + 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_operations_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.GoogleLongrunningOperation{}] + ) + 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. @@ -244,7 +631,7 @@ defmodule GoogleApi.PolicySimulator.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 diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/projects.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/projects.ex index 2aa590ee98..3f86df874c 100644 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/projects.ex +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/api/projects.ex @@ -25,6 +25,78 @@ defmodule GoogleApi.PolicySimulator.V1.Api.Projects do @library_version Mix.Project.config() |> Keyword.get(:version, "") + @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.PolicySimulator.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - The name of the operation resource. + * `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.GoogleLongrunningOperation{}}` on success + * `{:error, info}` on failure + """ + @spec policysimulator_projects_locations_org_policy_violations_previews_operations_get( + Tesla.Env.client(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.PolicySimulator.V1.Model.GoogleLongrunningOperation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def policysimulator_projects_locations_org_policy_violations_previews_operations_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.GoogleLongrunningOperation{}] + ) + end + @doc """ Creates and starts a Replay using the given ReplayConfig. @@ -244,7 +316,7 @@ defmodule GoogleApi.PolicySimulator.V1.Api.Projects 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 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 df1bae2b8f..436fa13d36 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 "20221112" + @discovery_revision "20240303" def discovery_revision(), do: @discovery_revision end diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_alternate_policy_spec.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_alternate_policy_spec.ex new file mode 100644 index 0000000000..de9843a984 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_alternate_policy_spec.ex @@ -0,0 +1,54 @@ +# 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.GoogleCloudOrgpolicyV2AlternatePolicySpec do + @moduledoc """ + Similar to PolicySpec but with an extra 'launch' field for launch reference. The PolicySpec here is specific for dry-run/darklaunch. + + ## Attributes + + * `launch` (*type:* `String.t`, *default:* `nil`) - Reference to the launch that will be used while audit logging and to control the launch. Should be set only in the alternate policy. + * `spec` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec.t`, *default:* `nil`) - Specify constraint for configurations of Google Cloud resources. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :launch => String.t() | nil, + :spec => GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec.t() | nil + } + + field(:launch) + field(:spec, as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec) +end + +defimpl Poison.Decoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2AlternatePolicySpec do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2AlternatePolicySpec.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2AlternatePolicySpec 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_orgpolicy_v2_custom_constraint.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_custom_constraint.ex new file mode 100644 index 0000000000..63f3e1d054 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_custom_constraint.ex @@ -0,0 +1,72 @@ +# 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.GoogleCloudOrgpolicyV2CustomConstraint do + @moduledoc """ + A custom constraint defined by customers which can *only* be applied to the given resource types and organization. By creating a custom constraint, customers can apply policies of this custom constraint. *Creating a custom constraint itself does NOT apply any policy enforcement*. + + ## Attributes + + * `actionType` (*type:* `String.t`, *default:* `nil`) - Allow or deny type. + * `condition` (*type:* `String.t`, *default:* `nil`) - Org policy condition/expression. For example: `resource.instanceName.matches("[production|test]_.*_(\\d)+")` or, `resource.management.auto_upgrade == true` The max length of the condition is 1000 characters. + * `description` (*type:* `String.t`, *default:* `nil`) - Detailed information about this custom policy constraint. The max length of the description is 2000 characters. + * `displayName` (*type:* `String.t`, *default:* `nil`) - One line display name for the UI. The max length of the display_name is 200 characters. + * `methodTypes` (*type:* `list(String.t)`, *default:* `nil`) - All the operations being applied for this constraint. + * `name` (*type:* `String.t`, *default:* `nil`) - Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms` The max length is 70 characters and the minimum length is 1. Note that the prefix `organizations/{organization_id}/customConstraints/` is not counted. + * `resourceTypes` (*type:* `list(String.t)`, *default:* `nil`) - Immutable. The resource instance type on which this policy applies. Format will be of the form : `/` Example: * `compute.googleapis.com/Instance`. + * `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The last time this custom constraint was updated. This represents the last time that the `CreateCustomConstraint` or `UpdateCustomConstraint` RPC was called + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :actionType => String.t() | nil, + :condition => String.t() | nil, + :description => String.t() | nil, + :displayName => String.t() | nil, + :methodTypes => list(String.t()) | nil, + :name => String.t() | nil, + :resourceTypes => list(String.t()) | nil, + :updateTime => DateTime.t() | nil + } + + field(:actionType) + field(:condition) + field(:description) + field(:displayName) + field(:methodTypes, type: :list) + field(:name) + field(:resourceTypes, type: :list) + field(:updateTime, as: DateTime) +end + +defimpl Poison.Decoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2CustomConstraint do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2CustomConstraint.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2CustomConstraint 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_orgpolicy_v2_policy.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_policy.ex new file mode 100644 index 0000000000..e32b07ca20 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_policy.ex @@ -0,0 +1,63 @@ +# 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.GoogleCloudOrgpolicyV2Policy do + @moduledoc """ + Defines an organization policy which is used to specify constraints for configurations of Google Cloud resources. + + ## Attributes + + * `alternate` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2AlternatePolicySpec.t`, *default:* `nil`) - Deprecated. + * `dryRunSpec` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec.t`, *default:* `nil`) - Dry-run policy. Audit-only policy, can be used to monitor how the policy would have impacted the existing and future resources if it's enforced. + * `etag` (*type:* `String.t`, *default:* `nil`) - Optional. An opaque tag indicating the current state of the policy, used for concurrency control. This 'etag' is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + * `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The resource name of the policy. Must be one of the following forms, where `constraint_name` is the name of the constraint which this policy configures: * `projects/{project_number}/policies/{constraint_name}` * `folders/{folder_id}/policies/{constraint_name}` * `organizations/{organization_id}/policies/{constraint_name}` For example, `projects/123/policies/compute.disableSerialPortAccess`. Note: `projects/{project_id}/policies/{constraint_name}` is also an acceptable name for API requests, but responses will return the name using the equivalent project number. + * `spec` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec.t`, *default:* `nil`) - Basic information about the Organization Policy. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :alternate => + GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2AlternatePolicySpec.t() | nil, + :dryRunSpec => + GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec.t() | nil, + :etag => String.t() | nil, + :name => String.t() | nil, + :spec => GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec.t() | nil + } + + field(:alternate, + as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2AlternatePolicySpec + ) + + field(:dryRunSpec, as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec) + field(:etag) + field(:name) + field(:spec, as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec) +end + +defimpl Poison.Decoder, for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2Policy do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2Policy.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2Policy 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_orgpolicy_v2_policy_spec.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_policy_spec.ex new file mode 100644 index 0000000000..dc537c7195 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_policy_spec.ex @@ -0,0 +1,67 @@ +# 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.GoogleCloudOrgpolicyV2PolicySpec do + @moduledoc """ + Defines a Google Cloud policy specification which is used to specify constraints for configurations of Google Cloud resources. + + ## Attributes + + * `etag` (*type:* `String.t`, *default:* `nil`) - An opaque tag indicating the current version of the policySpec, used for concurrency control. This field is ignored if used in a `CreatePolicy` request. When the policy is returned from either a `GetPolicy` or a `ListPolicies` request, this `etag` indicates the version of the current policySpec to use when executing a read-modify-write loop. When the policy is returned from a `GetEffectivePolicy` request, the `etag` will be unset. + * `inheritFromParent` (*type:* `boolean()`, *default:* `nil`) - Determines the inheritance behavior for this policy. If `inherit_from_parent` is true, policy rules set higher up in the hierarchy (up to the closest root) are inherited and present in the effective policy. If it is false, then no rules are inherited, and this policy becomes the new root for evaluation. This field can be set only for policies which configure list constraints. + * `reset` (*type:* `boolean()`, *default:* `nil`) - Ignores policies set above this resource and restores the `constraint_default` enforcement behavior of the specific constraint at this resource. This field can be set in policies for either list or boolean constraints. If set, `rules` must be empty and `inherit_from_parent` must be set to false. + * `rules` (*type:* `list(GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRule.t)`, *default:* `nil`) - In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence. + * `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time stamp this was previously updated. This represents the last time a call to `CreatePolicy` or `UpdatePolicy` was made for that policy. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :etag => String.t() | nil, + :inheritFromParent => boolean() | nil, + :reset => boolean() | nil, + :rules => + list( + GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRule.t() + ) + | nil, + :updateTime => DateTime.t() | nil + } + + field(:etag) + field(:inheritFromParent) + field(:reset) + + field(:rules, + as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRule, + type: :list + ) + + field(:updateTime, as: DateTime) +end + +defimpl Poison.Decoder, for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpec 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_orgpolicy_v2_policy_spec_policy_rule.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_policy_spec_policy_rule.ex new file mode 100644 index 0000000000..7c05e323e0 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_policy_spec_policy_rule.ex @@ -0,0 +1,68 @@ +# 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.GoogleCloudOrgpolicyV2PolicySpecPolicyRule do + @moduledoc """ + A rule used to express this policy. + + ## Attributes + + * `allowAll` (*type:* `boolean()`, *default:* `nil`) - Setting this to true means that all values are allowed. This field can be set only in policies for list constraints. + * `condition` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleTypeExpr.t`, *default:* `nil`) - A condition which determines whether this rule is used in the evaluation of the policy. When set, the `expression` field in the `Expr' must include from 1 to 10 subexpressions, joined by the "||" or "&&" operators. Each subexpression must be of the form "resource.matchTag('/tag_key_short_name, 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id', 'tagValues/value_id')". where key_name and value_name are the resource names for Label Keys and Values. These names are available from the Tag Manager Service. An example expression is: "resource.matchTag('123456789/environment, 'prod')". or "resource.matchTagId('tagKeys/123', 'tagValues/456')". + * `denyAll` (*type:* `boolean()`, *default:* `nil`) - Setting this to true means that all values are denied. This field can be set only in policies for list constraints. + * `enforce` (*type:* `boolean()`, *default:* `nil`) - If `true`, then the policy is enforced. If `false`, then any configuration is acceptable. This field can be set only in policies for boolean constraints. + * `values` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues.t`, *default:* `nil`) - List of values to be used for this policy rule. This field can be set only in policies for list constraints. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :allowAll => boolean() | nil, + :condition => GoogleApi.PolicySimulator.V1.Model.GoogleTypeExpr.t() | nil, + :denyAll => boolean() | nil, + :enforce => boolean() | nil, + :values => + GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues.t() + | nil + } + + field(:allowAll) + field(:condition, as: GoogleApi.PolicySimulator.V1.Model.GoogleTypeExpr) + field(:denyAll) + field(:enforce) + + field(:values, + as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues + ) +end + +defimpl Poison.Decoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRule do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRule.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRule 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_orgpolicy_v2_policy_spec_policy_rule_string_values.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_policy_spec_policy_rule_string_values.ex new file mode 100644 index 0000000000..3ac91adcd6 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_orgpolicy_v2_policy_spec_policy_rule_string_values.ex @@ -0,0 +1,54 @@ +# 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.GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues do + @moduledoc """ + A message that holds specific allowed and denied values. This message can define specific values and subtrees of the Resource Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that are allowed or denied. This is achieved by using the `under:` and optional `is:` prefixes. The `under:` prefix is used to denote resource subtree values. The `is:` prefix is used to denote specific values, and is required only if the value contains a ":". Values prefixed with "is:" are treated the same as values with no prefix. Ancestry subtrees must be in one of the following formats: - `projects/` (for example, `projects/tokyo-rain-123`) - `folders/` (for example, `folders/1234`) - `organizations/` (for example, `organizations/1234`) The `supports_under` field of the associated `Constraint` defines whether ancestry prefixes can be used. + + ## Attributes + + * `allowedValues` (*type:* `list(String.t)`, *default:* `nil`) - List of values allowed at this resource. + * `deniedValues` (*type:* `list(String.t)`, *default:* `nil`) - List of values denied at this resource. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :allowedValues => list(String.t()) | nil, + :deniedValues => list(String.t()) | nil + } + + field(:allowedValues, type: :list) + field(:deniedValues, type: :list) +end + +defimpl Poison.Decoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues 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_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 new file mode 100644 index 0000000000..a3ef41af8e --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_list_org_policy_violations_previews_response.ex @@ -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.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 new file mode 100644 index 0000000000..9dc04a3965 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_list_org_policy_violations_response.ex @@ -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.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 new file mode 100644 index 0000000000..64d0e65761 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay.ex @@ -0,0 +1,71 @@ +# 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 new file mode 100644 index 0000000000..da05984500 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay_custom_constraint_overlay.ex @@ -0,0 +1,60 @@ +# 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_v1beta1_replay_operation_metadata.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay_policy_overlay.ex similarity index 56% rename from clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta1_replay_operation_metadata.ex rename to clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay_policy_overlay.ex index 40c11d8987..4c98e61490 100644 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta1_replay_operation_metadata.ex +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_overlay_policy_overlay.ex @@ -15,28 +15,32 @@ # NOTE: This file is auto generated by the elixir code generator program. # Do not edit this file manually. -defmodule GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayOperationMetadata do +defmodule GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay do @moduledoc """ - Metadata about a Replay operation. + A change to an OrgPolicy. ## Attributes - * `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the request was received. + * `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__{ - :startTime => DateTime.t() | nil + :policy => GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2Policy.t() | nil, + :policyParent => String.t() | nil } - field(:startTime, as: DateTime) + field(:policy, as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudOrgpolicyV2Policy) + field(:policyParent) end defimpl Poison.Decoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayOperationMetadata do + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay do def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayOperationMetadata.decode( + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay.decode( value, options ) @@ -44,7 +48,8 @@ defimpl Poison.Decoder, end defimpl Poison.Encoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayOperationMetadata do + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay do def encode(value, options) do GoogleApi.Gax.ModelBase.encode(value, options) 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 new file mode 100644 index 0000000000..2a0941a26b --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violation.ex @@ -0,0 +1,69 @@ +# 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 new file mode 100644 index 0000000000..87b432292f --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violations_preview.ex @@ -0,0 +1,81 @@ +# 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 new file mode 100644 index 0000000000..a04b4eacbe --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_org_policy_violations_preview_resource_counts.ex @@ -0,0 +1,65 @@ +# 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 new file mode 100644 index 0000000000..48854c79f3 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1_resource_context.ex @@ -0,0 +1,57 @@ +# 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/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_create_org_policy_violations_preview_operation_metadata.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_create_org_policy_violations_preview_operation_metadata.ex new file mode 100644 index 0000000000..dd0ea245b3 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_create_org_policy_violations_preview_operation_metadata.ex @@ -0,0 +1,68 @@ +# 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.GoogleCloudPolicysimulatorV1alphaCreateOrgPolicyViolationsPreviewOperationMetadata do + @moduledoc """ + CreateOrgPolicyViolationsPreviewOperationMetadata is metadata about an OrgPolicyViolationsPreview generations operation. + + ## Attributes + + * `requestTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the request was received. + * `resourcesFound` (*type:* `integer()`, *default:* `nil`) - Total number of resources that need scanning. Should equal resource_scanned + resources_pending + * `resourcesPending` (*type:* `integer()`, *default:* `nil`) - Number of resources still to scan. + * `resourcesScanned` (*type:* `integer()`, *default:* `nil`) - Number of resources already scanned. + * `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the request started processing, i.e., when the state was set to RUNNING. + * `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the operation. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :requestTime => DateTime.t() | nil, + :resourcesFound => integer() | nil, + :resourcesPending => integer() | nil, + :resourcesScanned => integer() | nil, + :startTime => DateTime.t() | nil, + :state => String.t() | nil + } + + field(:requestTime, as: DateTime) + field(:resourcesFound) + field(:resourcesPending) + field(:resourcesScanned) + field(:startTime, as: DateTime) + field(:state) +end + +defimpl Poison.Decoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaCreateOrgPolicyViolationsPreviewOperationMetadata do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaCreateOrgPolicyViolationsPreviewOperationMetadata.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaCreateOrgPolicyViolationsPreviewOperationMetadata 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_v1alpha_generate_org_policy_violations_preview_operation_metadata.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_generate_org_policy_violations_preview_operation_metadata.ex new file mode 100644 index 0000000000..9cd6d9f71d --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_generate_org_policy_violations_preview_operation_metadata.ex @@ -0,0 +1,68 @@ +# 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.GoogleCloudPolicysimulatorV1alphaGenerateOrgPolicyViolationsPreviewOperationMetadata do + @moduledoc """ + GenerateOrgPolicyViolationsPreviewOperationMetadata is metadata about an OrgPolicyViolationsPreview generations operation. + + ## Attributes + + * `requestTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the request was received. + * `resourcesFound` (*type:* `integer()`, *default:* `nil`) - Total number of resources that need scanning. Should equal resource_scanned + resources_pending + * `resourcesPending` (*type:* `integer()`, *default:* `nil`) - Number of resources still to scan. + * `resourcesScanned` (*type:* `integer()`, *default:* `nil`) - Number of resources already scanned. + * `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the request started processing, i.e. when the state was set to RUNNING. + * `state` (*type:* `String.t`, *default:* `nil`) - The current state of the operation. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :requestTime => DateTime.t() | nil, + :resourcesFound => integer() | nil, + :resourcesPending => integer() | nil, + :resourcesScanned => integer() | nil, + :startTime => DateTime.t() | nil, + :state => String.t() | nil + } + + field(:requestTime, as: DateTime) + field(:resourcesFound) + field(:resourcesPending) + field(:resourcesScanned) + field(:startTime, as: DateTime) + field(:state) +end + +defimpl Poison.Decoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaGenerateOrgPolicyViolationsPreviewOperationMetadata do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaGenerateOrgPolicyViolationsPreviewOperationMetadata.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaGenerateOrgPolicyViolationsPreviewOperationMetadata 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_v1alpha_org_policy_overlay.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_org_policy_overlay.ex new file mode 100644 index 0000000000..fb69a52b47 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_org_policy_overlay.ex @@ -0,0 +1,71 @@ +# 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.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlay do + @moduledoc """ + The proposed changes to OrgPolicy. + + ## Attributes + + * `customConstraints` (*type:* `list(GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayCustomConstraintOverlay.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.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayPolicyOverlay.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.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayCustomConstraintOverlay.t() + ) + | nil, + :policies => + list( + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayPolicyOverlay.t() + ) + | nil + } + + field(:customConstraints, + as: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayCustomConstraintOverlay, + type: :list + ) + + field(:policies, + as: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayPolicyOverlay, + type: :list + ) +end + +defimpl Poison.Decoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlay do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlay.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlay 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_v1alpha_org_policy_overlay_custom_constraint_overlay.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_org_policy_overlay_custom_constraint_overlay.ex new file mode 100644 index 0000000000..d40156fa1d --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_org_policy_overlay_custom_constraint_overlay.ex @@ -0,0 +1,60 @@ +# 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.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayCustomConstraintOverlay 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.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayCustomConstraintOverlay do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayCustomConstraintOverlay.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayCustomConstraintOverlay 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_v1alpha_org_policy_overlay_policy_overlay.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_org_policy_overlay_policy_overlay.ex new file mode 100644 index 0000000000..1e0aab5ef1 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_org_policy_overlay_policy_overlay.ex @@ -0,0 +1,56 @@ +# 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.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayPolicyOverlay 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.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayPolicyOverlay do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayPolicyOverlay.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayPolicyOverlay 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_v1alpha_org_policy_violations_preview.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_org_policy_violations_preview.ex new file mode 100644 index 0000000000..e3f2f7cd33 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_org_policy_violations_preview.ex @@ -0,0 +1,83 @@ +# 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.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreview 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.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlay.t`, *default:* `nil`) - Required. The proposed changes we are previewing violations for. + * `resourceCounts` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreviewResourceCounts.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.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlay.t() + | nil, + :resourceCounts => + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreviewResourceCounts.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.GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlay + ) + + field(:resourceCounts, + as: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreviewResourceCounts + ) + + field(:state) + field(:violationsCount) +end + +defimpl Poison.Decoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreview do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreview.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreview 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_v1alpha_org_policy_violations_preview_resource_counts.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_org_policy_violations_preview_resource_counts.ex new file mode 100644 index 0000000000..e9829c8182 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1alpha_org_policy_violations_preview_resource_counts.ex @@ -0,0 +1,65 @@ +# 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.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreviewResourceCounts 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.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreviewResourceCounts do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreviewResourceCounts.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreviewResourceCounts 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_v1beta1_replay.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta1_replay.ex deleted file mode 100644 index dc2a4a6cbb..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta1_replay.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.GoogleCloudPolicysimulatorV1beta1Replay do - @moduledoc """ - A resource describing a `Replay`, or simulation. - - ## Attributes - - * `config` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayConfig.t`, *default:* `nil`) - Required. The configuration used for the `Replay`. - * `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the `Replay`, which has the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of the project, folder, or organization that owns the Replay. Example: `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` - * `resultsSummary` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary.t`, *default:* `nil`) - Output only. Summary statistics about the replayed log entries. - * `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the `Replay`. - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :config => - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayConfig.t() - | nil, - :name => String.t() | nil, - :resultsSummary => - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary.t() - | nil, - :state => String.t() | nil - } - - field(:config, - as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayConfig - ) - - field(:name) - - field(:resultsSummary, - as: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary - ) - - field(:state) -end - -defimpl Poison.Decoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1Replay do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1Replay.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1Replay 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_v1beta1_replay_config.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta1_replay_config.ex deleted file mode 100644 index 7c0cb6022b..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta1_replay_config.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.GoogleCloudPolicysimulatorV1beta1ReplayConfig do - @moduledoc """ - The configuration used for a Replay. - - ## Attributes - - * `logSource` (*type:* `String.t`, *default:* `nil`) - The logs to use as input for the Replay. - * `policyOverlay` (*type:* `%{optional(String.t) => GoogleApi.PolicySimulator.V1.Model.GoogleIamV1Policy.t}`, *default:* `nil`) - A mapping of the resources that you want to simulate policies for and the policies that you want to simulate. Keys are the full resource names for the resources. For example, `//cloudresourcemanager.googleapis.com/projects/my-project`. For examples of full resource names for Google Cloud services, see https://cloud.google.com/iam/help/troubleshooter/full-resource-names. Values are Policy objects representing the policies that you want to simulate. Replays automatically take into account any IAM policies inherited through the resource hierarchy, and any policies set on descendant resources. You do not need to include these policies in the policy overlay. - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :logSource => String.t() | nil, - :policyOverlay => - %{optional(String.t()) => GoogleApi.PolicySimulator.V1.Model.GoogleIamV1Policy.t()} - | nil - } - - field(:logSource) - field(:policyOverlay, as: GoogleApi.PolicySimulator.V1.Model.GoogleIamV1Policy, type: :map) -end - -defimpl Poison.Decoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayConfig do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayConfig.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayConfig 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_v1beta1_replay_results_summary.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta1_replay_results_summary.ex deleted file mode 100644 index 87bcb95340..0000000000 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta1_replay_results_summary.ex +++ /dev/null @@ -1,66 +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.GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary do - @moduledoc """ - Summary statistics about the replayed log entries. - - ## Attributes - - * `differenceCount` (*type:* `integer()`, *default:* `nil`) - The number of replayed log entries with a difference between baseline and simulated policies. - * `errorCount` (*type:* `integer()`, *default:* `nil`) - The number of log entries that could not be replayed. - * `logCount` (*type:* `integer()`, *default:* `nil`) - The total number of log entries replayed. - * `newestDate` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleTypeDate.t`, *default:* `nil`) - The date of the newest log entry replayed. - * `oldestDate` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleTypeDate.t`, *default:* `nil`) - The date of the oldest log entry replayed. - * `unchangedCount` (*type:* `integer()`, *default:* `nil`) - The number of replayed log entries with no difference between baseline and simulated policies. - """ - - use GoogleApi.Gax.ModelBase - - @type t :: %__MODULE__{ - :differenceCount => integer() | nil, - :errorCount => integer() | nil, - :logCount => integer() | nil, - :newestDate => GoogleApi.PolicySimulator.V1.Model.GoogleTypeDate.t() | nil, - :oldestDate => GoogleApi.PolicySimulator.V1.Model.GoogleTypeDate.t() | nil, - :unchangedCount => integer() | nil - } - - field(:differenceCount) - field(:errorCount) - field(:logCount) - field(:newestDate, as: GoogleApi.PolicySimulator.V1.Model.GoogleTypeDate) - field(:oldestDate, as: GoogleApi.PolicySimulator.V1.Model.GoogleTypeDate) - field(:unchangedCount) -end - -defimpl Poison.Decoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary do - def decode(value, options) do - GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary.decode( - value, - options - ) - end -end - -defimpl Poison.Encoder, - for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary 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_v1beta_create_org_policy_violations_preview_operation_metadata.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_create_org_policy_violations_preview_operation_metadata.ex new file mode 100644 index 0000000000..f3d9e98211 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_create_org_policy_violations_preview_operation_metadata.ex @@ -0,0 +1,68 @@ +# 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.GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMetadata do + @moduledoc """ + CreateOrgPolicyViolationsPreviewOperationMetadata is metadata about an OrgPolicyViolationsPreview generations operation. + + ## Attributes + + * `requestTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the request was received. + * `resourcesFound` (*type:* `integer()`, *default:* `nil`) - Total number of resources that need scanning. Should equal resource_scanned + resources_pending + * `resourcesPending` (*type:* `integer()`, *default:* `nil`) - Number of resources still to scan. + * `resourcesScanned` (*type:* `integer()`, *default:* `nil`) - Number of resources already scanned. + * `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the request started processing, i.e., when the state was set to RUNNING. + * `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the operation. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :requestTime => DateTime.t() | nil, + :resourcesFound => integer() | nil, + :resourcesPending => integer() | nil, + :resourcesScanned => integer() | nil, + :startTime => DateTime.t() | nil, + :state => String.t() | nil + } + + field(:requestTime, as: DateTime) + field(:resourcesFound) + field(:resourcesPending) + field(:resourcesScanned) + field(:startTime, as: DateTime) + field(:state) +end + +defimpl Poison.Decoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMetadata do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMetadata.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMetadata 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_v1beta_generate_org_policy_violations_preview_operation_metadata.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_generate_org_policy_violations_preview_operation_metadata.ex new file mode 100644 index 0000000000..3f260a9deb --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_generate_org_policy_violations_preview_operation_metadata.ex @@ -0,0 +1,68 @@ +# 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.GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata do + @moduledoc """ + GenerateOrgPolicyViolationsPreviewOperationMetadata is metadata about an OrgPolicyViolationsPreview generations operation. + + ## Attributes + + * `requestTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the request was received. + * `resourcesFound` (*type:* `integer()`, *default:* `nil`) - Total number of resources that need scanning. Should equal resource_scanned + resources_pending + * `resourcesPending` (*type:* `integer()`, *default:* `nil`) - Number of resources still to scan. + * `resourcesScanned` (*type:* `integer()`, *default:* `nil`) - Number of resources already scanned. + * `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when the request started processing, i.e. when the state was set to RUNNING. + * `state` (*type:* `String.t`, *default:* `nil`) - The current state of the operation. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :requestTime => DateTime.t() | nil, + :resourcesFound => integer() | nil, + :resourcesPending => integer() | nil, + :resourcesScanned => integer() | nil, + :startTime => DateTime.t() | nil, + :state => String.t() | nil + } + + field(:requestTime, as: DateTime) + field(:resourcesFound) + field(:resourcesPending) + field(:resourcesScanned) + field(:startTime, as: DateTime) + field(:state) +end + +defimpl Poison.Decoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata 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_v1beta_org_policy_overlay.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_org_policy_overlay.ex new file mode 100644 index 0000000000..cf4f987135 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_org_policy_overlay.ex @@ -0,0 +1,71 @@ +# 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.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay do + @moduledoc """ + The proposed changes to OrgPolicy. + + ## Attributes + + * `customConstraints` (*type:* `list(GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay.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.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay.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.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay.t() + ) + | nil, + :policies => + list( + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay.t() + ) + | nil + } + + field(:customConstraints, + as: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay, + type: :list + ) + + field(:policies, + as: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay, + type: :list + ) +end + +defimpl Poison.Decoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay 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_v1beta_org_policy_overlay_custom_constraint_overlay.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_org_policy_overlay_custom_constraint_overlay.ex new file mode 100644 index 0000000000..9b31396598 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_org_policy_overlay_custom_constraint_overlay.ex @@ -0,0 +1,60 @@ +# 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.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay 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.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay 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_v1beta_org_policy_overlay_policy_overlay.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_org_policy_overlay_policy_overlay.ex new file mode 100644 index 0000000000..60ba027182 --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_org_policy_overlay_policy_overlay.ex @@ -0,0 +1,56 @@ +# 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.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay 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.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay 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_v1beta_org_policy_violations_preview.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_org_policy_violations_preview.ex new file mode 100644 index 0000000000..075cacb4aa --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_org_policy_violations_preview.ex @@ -0,0 +1,83 @@ +# 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.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview 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.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay.t`, *default:* `nil`) - Required. The proposed changes we are previewing violations for. + * `resourceCounts` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts.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.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay.t() + | nil, + :resourceCounts => + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts.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.GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay + ) + + field(:resourceCounts, + as: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts + ) + + field(:state) + field(:violationsCount) +end + +defimpl Poison.Decoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview 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_v1beta_org_policy_violations_preview_resource_counts.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_org_policy_violations_preview_resource_counts.ex new file mode 100644 index 0000000000..c4b23b6faf --- /dev/null +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_cloud_policysimulator_v1beta_org_policy_violations_preview_resource_counts.ex @@ -0,0 +1,65 @@ +# 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.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts 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.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts do + def decode(value, options) do + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts.decode( + value, + options + ) + end +end + +defimpl Poison.Encoder, + for: + GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts 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_iam_v1_binding.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_iam_v1_binding.ex index b7b2006291..5dbfdc284a 100644 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_iam_v1_binding.ex +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_iam_v1_binding.ex @@ -22,8 +22,8 @@ defmodule GoogleApi.PolicySimulator.V1.Model.GoogleIamV1Binding do ## Attributes * `condition` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleTypeExpr.t`, *default:* `nil`) - The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - * `members` (*type:* `list(String.t)`, *default:* `nil`) - Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. - * `role` (*type:* `String.t`, *default:* `nil`) - Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * `members` (*type:* `list(String.t)`, *default:* `nil`) - Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. + * `role` (*type:* `String.t`, *default:* `nil`) - Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles). """ use GoogleApi.Gax.ModelBase diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_iam_v1_policy.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_iam_v1_policy.ex index 5c37810dc8..5a7345c1e6 100644 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_iam_v1_policy.ex +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_iam_v1_policy.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.PolicySimulator.V1.Model.GoogleIamV1Policy do @moduledoc """ - An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/). + An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** ``` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/). ## Attributes diff --git a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_longrunning_operation.ex b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_longrunning_operation.ex index ac28641c52..880ac94a98 100644 --- a/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_longrunning_operation.ex +++ b/clients/policy_simulator/lib/google_api/policy_simulator/v1/model/google_longrunning_operation.ex @@ -25,7 +25,7 @@ defmodule GoogleApi.PolicySimulator.V1.Model.GoogleLongrunningOperation do * `error` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleRpcStatus.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 response of the operation in case of success. 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`. + * `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