{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-iam/json-schema/google-cloud-iam-google-cloud-policysimulator-v1-list-org-policy-violations-previews-response-schema.json",
  "title": "GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse",
  "description": "ListOrgPolicyViolationsPreviewsResponse is the response message for OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-iam-policysimulator-organizations-api-openapi.yml#/components/schemas/GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse",
  "type": "object",
  "properties": {
    "orgPolicyViolationsPreviews": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview"
      },
      "description": "The list of OrgPolicyViolationsPreview"
    },
    "nextPageToken": {
      "description": "A token that you can use to retrieve the next page of results. If this field is omitted, there are no subsequent pages.",
      "type": "string"
    }
  },
  "$defs": {
    "GoogleCloudOrgpolicyV2AlternatePolicySpec": {
      "properties": {
        "launch": {
          "description": "Reference to the launch that will be used while audit logging and to control the launch. Set only in the alternate policy.",
          "type": "string"
        },
        "spec": {
          "$ref": "#/$defs/GoogleCloudOrgpolicyV2PolicySpec",
          "description": "Specify constraint for configurations of Google Cloud resources."
        }
      },
      "type": "object",
      "description": "Similar to PolicySpec but with an extra 'launch' field for launch reference. The PolicySpec here is specific for dry-run."
    },
    "GoogleCloudOrgpolicyV2CustomConstraint": {
      "description": "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*.",
      "properties": {
        "description": {
          "type": "string",
          "description": "Detailed information about this custom policy constraint. The max length of the description is 2000 characters."
        },
        "actionType": {
          "type": "string",
          "enum": [
            "ACTION_TYPE_UNSPECIFIED",
            "ALLOW",
            "DENY"
          ],
          "description": "Allow or deny type."
        },
        "resourceTypes": {
          "description": "Immutable. The resource instance type on which this policy applies. Format will be of the form : `/` Example: * `compute.googleapis.com/Instance`.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "condition": {
          "description": "A Common Expression Language (CEL) condition which is used in the evaluation of the constraint. For example: `resource.instanceName.matches(\"(production|test)_(.+_)?[\\d]+\")` or, `resource.management.auto_upgrade == true` The max length of the condition is 1000 characters.",
          "type": "string"
        },
        "updateTime": {
          "description": "Output only. The last time this custom constraint was updated. This represents the last time that the `CreateCustomConstraint` or `UpdateCustomConstraint` methods were called.",
          "format": "google-datetime",
          "readOnly": true,
          "type": "string"
        },
        "methodTypes": {
          "description": "All the operations being applied for this constraint.",
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "METHOD_TYPE_UNSPECIFIED",
              "CREATE",
              "UPDATE",
              "DELETE",
              "REMOVE_GRANT",
              "GOVERN_TAGS"
            ]
          }
        },
        "displayName": {
          "description": "One line display name for the UI. The max length of the display_name is 200 characters.",
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Immutable. Name of the constraint. This is unique within the organization. The name must be of the form: * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms` The max length is 71 characters and the minimum length is 1. Note that the prefix `organizations/{organization_id}/customConstraints/custom.` is not counted."
        }
      },
      "type": "object"
    },
    "GoogleCloudOrgpolicyV2Policy": {
      "properties": {
        "spec": {
          "$ref": "#/$defs/GoogleCloudOrgpolicyV2PolicySpec",
          "description": "Basic information about the organization policy."
        },
        "etag": {
          "description": "Optional. An opaque tag indicating the current state of the policy, used for concurrency control. This entity tag (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.",
          "type": "string"
        },
        "dryRunSpec": {
          "$ref": "#/$defs/GoogleCloudOrgpolicyV2PolicySpec",
          "description": "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."
        },
        "alternate": {
          "$ref": "#/$defs/GoogleCloudOrgpolicyV2AlternatePolicySpec",
          "description": "Deprecated."
        },
        "name": {
          "type": "string",
          "description": "Immutable. The resource name of the policy. Must be one of the following forms, where `constraint_name` is the name of the constraint that this policy configures: * `projects/{project_number}/policies/{constraint_name}` * `folders/{folder_number}/policies/{constraint_name}` * `organizations/{organization_number}/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."
        }
      },
      "description": "Defines an organization policy that is used to specify constraints for configurations of Google Cloud resources.",
      "type": "object"
    },
    "GoogleCloudOrgpolicyV2PolicySpec": {
      "description": "Defines a Google Cloud policy specification that is used to specify constraints for configurations of Google Cloud resources.",
      "type": "object",
      "properties": {
        "reset": {
          "type": "boolean",
          "description": "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."
        },
        "updateTime": {
          "description": "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.",
          "readOnly": true,
          "type": "string",
          "format": "google-datetime"
        },
        "etag": {
          "type": "string",
          "description": "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 entity tag (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."
        },
        "rules": {
          "type": "array",
          "description": "In policies for boolean constraints, the following requirements apply: - There must be exactly one policy rule where a 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.",
          "items": {
            "$ref": "#/$defs/GoogleCloudOrgpolicyV2PolicySpecPolicyRule"
          }
        },
        "inheritFromParent": {
          "type": "boolean",
          "description": "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 that configure list constraints."
        }
      }
    },
    "GoogleCloudOrgpolicyV2PolicySpecPolicyRule": {
      "type": "object",
      "properties": {
        "values": {
          "$ref": "#/$defs/GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues",
          "description": "List of values to be used for this policy rule. This field can be set only in policies for list constraints."
        },
        "condition": {
          "$ref": "#/$defs/GoogleTypeExpr",
          "description": "A condition that determines whether this rule is used to evaluate the policy. When set, the google.type.Expr.expression field must contain 1 to 10 subexpressions, joined by the `||` or `&&` operators. Each subexpression must use the `resource.matchTag()`, `resource.matchTagId()`, `resource.hasTagKey()`, or `resource.hasTagKeyId()` Common Expression Language (CEL) function. The `resource.matchTag()` function takes the following arguments: * `key_name`: the namespaced name of the tag key, with the organization ID and a slash (`/`) as a prefix; for example, `123456789012/environment` * `value_name`: the short name of the tag value For example: `resource.matchTag('123456789012/environment, 'prod')` The `resource.matchTagId()` function takes the following arguments: * `key_id`: the permanent ID of the tag key; for example, `tagKeys/123456789012` * `value_id`: the permanent ID of the tag value; for example, `tagValues/567890123456` For example: `resource.matchTagId('tagKeys/123456789012', 'tagValues/567890123456')` The `resource.hasTagKey()` function takes the following argument: * `key_name`: the namespaced name of the tag key, with the organization ID and a slash (`/`) as a prefix; for example, `123456789012/environment` For example: `resource.hasTagKey('123456789012/environment')` The `resource.hasTagKeyId()` function takes the following arguments: * `key_id`: the permanent ID of the tag key; for example, `tagKeys/123456789012` For example: `resource.hasTagKeyId('tagKeys/123456789012')`"
        },
        "enforce": {
          "description": "If `true`, then the policy is enforced. If `false`, then any configuration is acceptable. This field can be set in policies for boolean constraints, custom constraints and managed constraints.",
          "type": "boolean"
        },
        "denyAll": {
          "type": "boolean",
          "description": "Setting this to true means that all values are denied. This field can be set only in policies for list constraints."
        },
        "parameters": {
          "additionalProperties": {
            "description": "Properties of the object."
          },
          "description": "Optional. Required for managed constraints if parameters are defined. Passes parameter values when policy enforcement is enabled. Ensure that parameter value types match those defined in the constraint definition. For example: ``` { \"allowedLocations\" : [\"us-east1\", \"us-west1\"], \"allowAll\" : true } ```",
          "type": "object"
        },
        "allowAll": {
          "description": "Setting this to true means that all values are allowed. This field can be set only in policies for list constraints.",
          "type": "boolean"
        }
      },
      "description": "A rule used to express this policy."
    },
    "GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues": {
      "type": "object",
      "description": "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.",
      "properties": {
        "allowedValues": {
          "description": "List of values allowed at this resource.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "deniedValues": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "List of values denied at this resource."
        }
      }
    },
    "GoogleCloudPolicysimulatorV1OrgPolicyOverlay": {
      "properties": {
        "customConstraints": {
          "description": "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.",
          "items": {
            "$ref": "#/$defs/GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay"
          },
          "type": "array"
        },
        "policies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay"
          },
          "description": "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."
        }
      },
      "type": "object",
      "description": "The proposed changes to OrgPolicy."
    },
    "GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay": {
      "type": "object",
      "description": "A change to an OrgPolicy custom constraint.",
      "properties": {
        "customConstraintParent": {
          "description": "Optional. Resource the constraint is attached to. Example: \"organization/987654\"",
          "type": "string"
        },
        "customConstraint": {
          "$ref": "#/$defs/GoogleCloudOrgpolicyV2CustomConstraint",
          "description": "Optional. The new or updated custom constraint."
        }
      }
    },
    "GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay": {
      "properties": {
        "policy": {
          "$ref": "#/$defs/GoogleCloudOrgpolicyV2Policy",
          "description": "Optional. The new or updated OrgPolicy."
        },
        "policyParent": {
          "description": "Optional. The parent of the policy we are attaching to. Example: \"projects/123456\"",
          "type": "string"
        }
      },
      "description": "A change to an OrgPolicy.",
      "type": "object"
    },
    "GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview": {
      "type": "object",
      "properties": {
        "resourceCounts": {
          "$ref": "#/$defs/GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts",
          "description": "Output only. A summary of the state of all resources scanned for compliance with the changed OrgPolicy."
        },
        "state": {
          "type": "string",
          "enum": [
            "PREVIEW_STATE_UNSPECIFIED",
            "PREVIEW_PENDING",
            "PREVIEW_RUNNING",
            "PREVIEW_SUCCEEDED",
            "PREVIEW_FAILED"
          ],
          "description": "Output only. The state of the `OrgPolicyViolationsPreview`.",
          "readOnly": true
        },
        "createTime": {
          "readOnly": true,
          "format": "google-datetime",
          "type": "string",
          "description": "Output only. Time when this `OrgPolicyViolationsPreview` was created."
        },
        "name": {
          "description": "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`",
          "type": "string",
          "readOnly": true
        },
        "customConstraints": {
          "readOnly": true,
          "items": {
            "type": "string"
          },
          "description": "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`",
          "type": "array"
        },
        "overlay": {
          "$ref": "#/$defs/GoogleCloudPolicysimulatorV1OrgPolicyOverlay",
          "description": "Required. The proposed changes we are previewing violations for."
        },
        "violationsCount": {
          "format": "int32",
          "type": "integer",
          "readOnly": true,
          "description": "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."
        }
      },
      "description": "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."
    },
    "GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts": {
      "properties": {
        "noncompliant": {
          "format": "int32",
          "readOnly": true,
          "type": "integer",
          "description": "Output only. Number of scanned resources with at least one violation."
        },
        "errors": {
          "description": "Output only. Number of resources that returned an error when scanned.",
          "format": "int32",
          "readOnly": true,
          "type": "integer"
        },
        "unenforced": {
          "format": "int32",
          "description": "Output only. Number of resources where the constraint was not enforced, i.e. the Policy set `enforced: false` for that resource.",
          "readOnly": true,
          "type": "integer"
        },
        "compliant": {
          "format": "int32",
          "description": "Output only. Number of scanned resources with zero violations.",
          "readOnly": true,
          "type": "integer"
        },
        "scanned": {
          "format": "int32",
          "description": "Output only. Number of resources checked for compliance. Must equal: unenforced + noncompliant + compliant + error",
          "type": "integer",
          "readOnly": true
        }
      },
      "description": "A summary of the state of all resources scanned for compliance with the changed OrgPolicy.",
      "type": "object"
    },
    "GoogleTypeExpr": {
      "properties": {
        "description": {
          "type": "string",
          "description": "Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI."
        },
        "expression": {
          "description": "Textual representation of an expression in Common Expression Language syntax.",
          "type": "string"
        },
        "location": {
          "type": "string",
          "description": "Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file."
        },
        "title": {
          "description": "Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.",
          "type": "string"
        }
      },
      "description": "Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: \"Summary size limit\" description: \"Determines if a summary is less than 100 chars\" expression: \"document.summary.size() < 100\" Example (Equality): title: \"Requestor is owner\" description: \"Determines if requestor is the document owner\" expression: \"document.owner == request.auth.claims.email\" Example (Logic): title: \"Public documents\" description: \"Determine whether the document should be publicly visible\" expression: \"document.type != 'private' && document.type != 'internal'\" Example (Data Manipulation): title: \"Notification string\" description: \"Create a notification string with a timestamp.\" expression: \"'New message received at ' + string(document.create_time)\" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.",
      "type": "object"
    }
  }
}