# Policy Simulator V1 API - Module Google::Cloud::PolicySimulator::V1::OrgPolicyViolationsPreviewService (v1.9.0)

1.9.0 (latest) 1.8.1 1.7.0 1.6.1 1.5.0 1.4.0 1.3.0 1.2.1 1.1.0 1.0.1 0.4.0 0.3.2 0.2.0 0.1.1 Reference documentation and code samples for the Policy Simulator V1 API module Google::Cloud::PolicySimulator::V1::OrgPolicyViolationsPreviewService.

Violations Preview API service for OrgPolicy.

An
[OrgPolicyViolationsPreview](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-PolicySimulator-V1-OrgPolicyViolationsPreview "Google::Cloud::PolicySimulator::V1::OrgPolicyViolationsPreview (class)")
is a preview of the violations that will exist as soon as a proposed
OrgPolicy change is submitted. To create an
[OrgPolicyViolationsPreview](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-PolicySimulator-V1-OrgPolicyViolationsPreview "Google::Cloud::PolicySimulator::V1::OrgPolicyViolationsPreview (class)"),
the API user specifies the changes they wish to make and requests the
generation of a preview via \[GenerateViolationsPreview\]\[\]. the OrgPolicy
Simulator service then scans the API user's currently existing resources to
determine these resources violate the newly set OrgPolicy.

To load this service and instantiate a REST client:

    require "google/cloud/policy_simulator/v1/org_policy_violations_preview_service/rest"
    client = ::Google::Cloud::PolicySimulator::V1::OrgPolicyViolationsPreviewService::Rest::Client.new