Service Client: Google::Cloud::Orgpolicy::V2::Orgpolicy::OrgPolicyClient

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

target

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

credentials

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

NAME

Google::Cloud::Orgpolicy::V2::Orgpolicy - Compiled Protocol Buffers messages for google/cloud/orgpolicy/v2/orgpolicy.proto

SYNOPSIS

use Google::Cloud::Orgpolicy::V2::Orgpolicy;

my $msg = Google::Cloud::Orgpolicy::V2::Orgpolicy::Policy->new({
    name => $name,
    spec => $spec,
    alternate => $alternate,
    dry_run_spec => $dry_run_spec,
});

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

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

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

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/cloud/orgpolicy/v2/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::Orgpolicy::V2::Orgpolicy::Policy

Defines an organization policy which is used to specify constraints for configurations of Google Cloud resources.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    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.

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

    Type: Message (Google::Cloud::Orgpolicy::V2::Orgpolicy::PolicySpec)

    Basic information about the organization policy.

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

    Type: Message (Google::Cloud::Orgpolicy::V2::Orgpolicy::AlternatePolicySpec)

    Deprecated.

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

    Type: Message (Google::Cloud::Orgpolicy::V2::Orgpolicy::PolicySpec)

    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.

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

    Type: String

    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.

Google::Cloud::Orgpolicy::V2::Orgpolicy::AlternatePolicySpec

Similar to PolicySpec but with an extra 'launch' field for launch reference. The PolicySpec here is specific for dry-run.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Reference to the launch that will be used while audit logging and to control the launch. Should be set only in the alternate policy.

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

    Type: Message (Google::Cloud::Orgpolicy::V2::Orgpolicy::PolicySpec)

    Specify constraint for configurations of Google Cloud resources.

Google::Cloud::Orgpolicy::V2::Orgpolicy::PolicySpec

Defines a Google Cloud policy specification which is used to specify constraints for configurations of Google Cloud resources.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    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.

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

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

    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.

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

    Type: Message (Google::Cloud::Orgpolicy::V2::Orgpolicy::PolicySpec::PolicyRule)

    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.
  • $msg->inherit_from_parent() / $msg->inherit_from_parent($value)

    Type: Bool

    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.

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

    Type: Bool

    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.

Google::Cloud::Orgpolicy::V2::Orgpolicy::ListConstraintsRequest

The request sent to the [ListConstraints] [google.cloud.orgpolicy.v2.OrgPolicy.ListConstraints] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. The Google Cloud resource that parents the constraint. Must be in one of the following forms:

    * `projects/{project_number}` * `projects/{project_id}` * `folders/{folder_id}` * `organizations/{organization_id}`

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

    Type: Int32

    Size of the pages to be returned. This is currently unsupported and will be ignored. The server may at any point start using this field to limit page size.

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

    Type: String

    Page token used to retrieve the next page. This is currently unsupported and will be ignored. The server may at any point start using this field.

Google::Cloud::Orgpolicy::V2::Orgpolicy::ListConstraintsResponse

The response returned from the [ListConstraints] [google.cloud.orgpolicy.v2.OrgPolicy.ListConstraints] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: Message (Google::Cloud::Orgpolicy::V2::Constraint::Constraint)

    The collection of constraints that are available on the targeted resource.

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

    Type: String

    Page token used to retrieve the next page. This is currently not used.

Google::Cloud::Orgpolicy::V2::Orgpolicy::ListPoliciesRequest

The request sent to the [ListPolicies] [google.cloud.orgpolicy.v2.OrgPolicy.ListPolicies] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. The target Google Cloud resource that parents the set of constraints and policies that will be returned from this call. Must be in one of the following forms:

    * `projects/{project_number}` * `projects/{project_id}` * `folders/{folder_id}` * `organizations/{organization_id}`

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

    Type: Int32

    Size of the pages to be returned. This is currently unsupported and will be ignored. The server may at any point start using this field to limit page size.

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

    Type: String

    Page token used to retrieve the next page. This is currently unsupported and will be ignored. The server may at any point start using this field.

Google::Cloud::Orgpolicy::V2::Orgpolicy::ListPoliciesResponse

The response returned from the [ListPolicies] [google.cloud.orgpolicy.v2.OrgPolicy.ListPolicies] method. It will be empty if no policies are set on the resource.

Inherits from Protobuf::Message.

Accessors

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

    Type: Message (Google::Cloud::Orgpolicy::V2::Orgpolicy::Policy)

    All policies that exist on the resource. It will be empty if no policies are set.

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

    Type: String

    Page token used to retrieve the next page. This is currently not used, but the server may at any point start supplying a valid token.

Google::Cloud::Orgpolicy::V2::Orgpolicy::GetPolicyRequest

The request sent to the [GetPolicy] [google.cloud.orgpolicy.v2.OrgPolicy.GetPolicy] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. Resource name of the policy. See [Policy][google.cloud.orgpolicy.v2.Policy] for naming requirements.

Google::Cloud::Orgpolicy::V2::Orgpolicy::GetEffectivePolicyRequest

The request sent to the [GetEffectivePolicy] [google.cloud.orgpolicy.v2.OrgPolicy.GetEffectivePolicy] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. The effective policy to compute. See [Policy][google.cloud.orgpolicy.v2.Policy] for naming requirements.

Google::Cloud::Orgpolicy::V2::Orgpolicy::CreatePolicyRequest

The request sent to the [CreatePolicyRequest] [google.cloud.orgpolicy.v2.OrgPolicy.CreatePolicy] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. The Google Cloud resource that will parent the new policy. Must be in one of the following forms:

    * `projects/{project_number}` * `projects/{project_id}` * `folders/{folder_id}` * `organizations/{organization_id}`

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

    Type: Message (Google::Cloud::Orgpolicy::V2::Orgpolicy::Policy)

    Required. Policy to create.

Google::Cloud::Orgpolicy::V2::Orgpolicy::UpdatePolicyRequest

The request sent to the [UpdatePolicyRequest] [google.cloud.orgpolicy.v2.OrgPolicy.UpdatePolicy] method.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Orgpolicy::V2::Orgpolicy::DeletePolicyRequest

The request sent to the [DeletePolicy] [google.cloud.orgpolicy.v2.OrgPolicy.DeletePolicy] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. Name of the policy to delete. See the policy entry for naming rules.

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

    Type: String

    Optional. The current etag of policy. If an etag is provided and does not match the current etag of the policy, deletion will be blocked and an ABORTED error will be returned.

Google::Cloud::Orgpolicy::V2::Orgpolicy::CreateCustomConstraintRequest

The request sent to the [CreateCustomConstraintRequest] [google.cloud.orgpolicy.v2.OrgPolicy.CreateCustomConstraint] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. Must be in the following form:

    * `organizations/{organization_id}`

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

    Type: Message (Google::Cloud::Orgpolicy::V2::Constraint::CustomConstraint)

    Required. Custom constraint to create.

Google::Cloud::Orgpolicy::V2::Orgpolicy::GetCustomConstraintRequest

The request sent to the [GetCustomConstraint] [google.cloud.orgpolicy.v2.OrgPolicy.GetCustomConstraint] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. Resource name of the custom or managed constraint. See the custom constraint entry for naming requirements.

Google::Cloud::Orgpolicy::V2::Orgpolicy::ListCustomConstraintsRequest

The request sent to the [ListCustomConstraints] [google.cloud.orgpolicy.v2.OrgPolicy.ListCustomConstraints] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. The target Google Cloud resource that parents the set of custom constraints that will be returned from this call. Must be in one of the following forms:

    * `organizations/{organization_id}`

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

    Type: Int32

    Size of the pages to be returned. This is currently unsupported and will be ignored. The server may at any point start using this field to limit page size.

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

    Type: String

    Page token used to retrieve the next page. This is currently unsupported and will be ignored. The server may at any point start using this field.

Google::Cloud::Orgpolicy::V2::Orgpolicy::ListCustomConstraintsResponse

The response returned from the [ListCustomConstraints] [google.cloud.orgpolicy.v2.OrgPolicy.ListCustomConstraints] method. It will be empty if no custom or managed constraints are set on the organization resource.

Inherits from Protobuf::Message.

Accessors

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

    Type: Message (Google::Cloud::Orgpolicy::V2::Constraint::CustomConstraint)

    All custom and managed constraints that exist on the organization resource. It will be empty if no custom constraints are set.

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

    Type: String

    Page token used to retrieve the next page. This is currently not used, but the server may at any point start supplying a valid token.

Google::Cloud::Orgpolicy::V2::Orgpolicy::UpdateCustomConstraintRequest

The request sent to the [UpdateCustomConstraintRequest] [google.cloud.orgpolicy.v2.OrgPolicy.UpdateCustomConstraint] method.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Orgpolicy::V2::Orgpolicy::DeleteCustomConstraintRequest

The request sent to the [DeleteCustomConstraint] [google.cloud.orgpolicy.v2.OrgPolicy.DeleteCustomConstraint] method.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. Name of the custom constraint to delete. See the custom constraint entry for naming rules.

SEE ALSO

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

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.