Service Client: Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyViolationsPreviewServiceClient

Client stub representing the remote OrgPolicyViolationsPreviewService gRPC service. Delegates call dispatching to Google::gRPC::Client.

target

The endpoint target address. Defaults to policysimulator.googleapis.com:443.

credentials

The authentication credentials provider. Defaults to application default credentials via Google::Auth.

NAME

Google::Cloud::Policysimulator::V1::Orgpolicy - Compiled Protocol Buffers messages for google/cloud/policysimulator/v1/orgpolicy.proto

SYNOPSIS

use Google::Cloud::Policysimulator::V1::Orgpolicy;

my $msg = Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyViolationsPreview->new({
    name => $name,
    state => $state,
    overlay => $overlay,
    violations_count => $violations_count,
});

# Read or update a field
my $val = $msg->name();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyViolationsPreview->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/cloud/policysimulator/v1/orgpolicy.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyViolationsPreview

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.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    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`

  • $msg->state() / $msg->state($value)

    Type: Enum (Google::Cloud::Policysimulator::V1::PreviewState)

    Output only. The state of the `OrgPolicyViolationsPreview`.

  • $msg->overlay() / $msg->overlay($value)

    Type: Message (Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyOverlay)

    Required. The proposed changes we are previewing violations for.

  • $msg->violations_count() / $msg->violations_count($value)

    Type: Int32

    Output only. The number of [OrgPolicyViolations][] in this `OrgPolicyViolationsPreview`. This count may differ from `resource_summary.noncompliant_count` because each [OrgPolicyViolation][google.cloud.policysimulator.v1.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.

  • $msg->resource_counts() / $msg->resource_counts($value)

    Type: Message (Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyViolationsPreview::ResourceCounts)

    Output only. A summary of the state of all resources scanned for compliance with the changed OrgPolicy.

  • $msg->custom_constraints() / $msg->custom_constraints($value)

    Type: String

    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`

  • $msg->create_time() / $msg->create_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Output only. Time when this `OrgPolicyViolationsPreview` was created.

Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyViolation

OrgPolicyViolation is a resource representing a single resource violating a single OrgPolicy constraint.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Policysimulator::V1::Orgpolicy::ResourceContext

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.

Inherits from Protobuf::Message.

Accessors

  • $msg->resource() / $msg->resource($value)

    Type: String

    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.

  • $msg->asset_type() / $msg->asset_type($value)

    Type: String

    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.

  • $msg->ancestors() / $msg->ancestors($value)

    Type: String

    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"]`

Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyOverlay

The proposed changes to OrgPolicy.

Inherits from Protobuf::Message.

Accessors

  • $msg->policies() / $msg->policies($value)

    Type: Message (Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyOverlay::PolicyOverlay)

    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.

  • $msg->custom_constraints() / $msg->custom_constraints($value)

    Type: Message (Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyOverlay::CustomConstraintOverlay)

    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.

Google::Cloud::Policysimulator::V1::Orgpolicy::CreateOrgPolicyViolationsPreviewOperationMetadata

CreateOrgPolicyViolationsPreviewOperationMetadata is metadata about an OrgPolicyViolationsPreview generations operation.

Inherits from Protobuf::Message.

Accessors

  • $msg->request_time() / $msg->request_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Time when the request was received.

  • $msg->start_time() / $msg->start_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Time when the request started processing, i.e., when the state was set to RUNNING.

  • $msg->state() / $msg->state($value)

    Type: Enum (Google::Cloud::Policysimulator::V1::PreviewState)

    Output only. The current state of the operation.

  • $msg->resources_found() / $msg->resources_found($value)

    Type: Int32

    Total number of resources that need scanning. Should equal resource_scanned + resources_pending

  • $msg->resources_scanned() / $msg->resources_scanned($value)

    Type: Int32

    Number of resources already scanned.

  • $msg->resources_pending() / $msg->resources_pending($value)

    Type: Int32

    Number of resources still to scan.

Google::Cloud::Policysimulator::V1::Orgpolicy::ListOrgPolicyViolationsPreviewsRequest

ListOrgPolicyViolationsPreviewsRequest is the request message for [OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews][google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The parent the violations are scoped to. Format: `organizations/{organization}/locations/{location}`

    Example: `organizations/my-example-org/locations/global`

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    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.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    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.

Google::Cloud::Policysimulator::V1::Orgpolicy::ListOrgPolicyViolationsPreviewsResponse

ListOrgPolicyViolationsPreviewsResponse is the response message for [OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews][google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews].

Inherits from Protobuf::Message.

Accessors

  • $msg->org_policy_violations_previews() / $msg->org_policy_violations_previews($value)

    Type: Message (Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyViolationsPreview)

    The list of OrgPolicyViolationsPreview

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    A token that you can use to retrieve the next page of results. If this field is omitted, there are no subsequent pages.

Google::Cloud::Policysimulator::V1::Orgpolicy::GetOrgPolicyViolationsPreviewRequest

GetOrgPolicyViolationsPreviewRequest is the request message for [OrgPolicyViolationsPreviewService.GetOrgPolicyViolationsPreview][google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewService.GetOrgPolicyViolationsPreview].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the OrgPolicyViolationsPreview to get.

Google::Cloud::Policysimulator::V1::Orgpolicy::CreateOrgPolicyViolationsPreviewRequest

CreateOrgPolicyViolationsPreviewRequest is the request message for [OrgPolicyViolationsPreviewService.CreateOrgPolicyViolationsPreview][google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewService.CreateOrgPolicyViolationsPreview].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The organization under which this [OrgPolicyViolationsPreview][google.cloud.policysimulator.v1.OrgPolicyViolationsPreview] will be created.

    Example: `organizations/my-example-org/locations/global`

  • $msg->org_policy_violations_preview() / $msg->org_policy_violations_preview($value)

    Type: Message (Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyViolationsPreview)

    Required. The [OrgPolicyViolationsPreview][google.cloud.policysimulator.v1.OrgPolicyViolationsPreview] to generate.

  • $msg->org_policy_violations_preview_id() / $msg->org_policy_violations_preview_id($value)

    Type: String

    Optional. An optional user-specified ID for the [OrgPolicyViolationsPreview][google.cloud.policysimulator.v1.OrgPolicyViolationsPreview]. If not provided, a random ID will be generated.

Google::Cloud::Policysimulator::V1::Orgpolicy::ListOrgPolicyViolationsRequest

ListOrgPolicyViolationsRequest is the request message for [OrgPolicyViolationsPreviewService.ListOrgPolicyViolations][google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewService.ListOrgPolicyViolations].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The OrgPolicyViolationsPreview to get OrgPolicyViolations from. Format: organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreview}

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    Optional. The maximum number of items to return. The service may return fewer than this value. If unspecified, at most 1000 items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    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.

Google::Cloud::Policysimulator::V1::Orgpolicy::ListOrgPolicyViolationsResponse

ListOrgPolicyViolationsResponse is the response message for [OrgPolicyViolationsPreviewService.ListOrgPolicyViolations][google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewService.ListOrgPolicyViolations]

Inherits from Protobuf::Message.

Accessors

  • $msg->org_policy_violations() / $msg->org_policy_violations($value)

    Type: Message (Google::Cloud::Policysimulator::V1::Orgpolicy::OrgPolicyViolation)

    The list of OrgPolicyViolations

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    A token that you can use to retrieve the next page of results. If this field is omitted, there are no subsequent pages.

SEE ALSO

Protobuf, Protobuf::Message, Google::Cloud::Policysimulator::V1::Orgpolicy::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.