# Policy Troubleshooter V3 API - Class Google::Iam::V2::Policy (v0.12.0)

0.12.0 (latest) 0.11.1 0.10.0 0.9.1 0.8.0 0.7.0 0.6.1 0.5.0 0.4.1 0.3.2 0.2.0 0.1.0 Reference documentation and code samples for the Policy Troubleshooter V3 API class Google::Iam::V2::Policy.

Data for an IAM policy.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #annotations

    def annotations() -> ::Google::Protobuf::Map{::String => ::String}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- A key-value map to store arbitrary metadata for the `Policy`. Keys can be up to 63 characters. Values can be up to 255 characters.

### #annotations=

    def annotations=(value) -> ::Google::Protobuf::Map{::String => ::String}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::String}) --- A key-value map to store arbitrary metadata for the `Policy`. Keys can be up to 63 characters. Values can be up to 255 characters.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- A key-value map to store arbitrary metadata for the `Policy`. Keys can be up to 63 characters. Values can be up to 255 characters.

### #create_time

    def create_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest/Google-Protobuf-Timestamp)) --- Output only. The time when the `Policy` was created.

### #delete_time

    def delete_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest/Google-Protobuf-Timestamp)) --- Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.

### #display_name

    def display_name() -> ::String

**Returns**

- (::String) --- A user-specified description of the `Policy`. This value can be up to 63 characters.

### #display_name=

    def display_name=(value) -> ::String

**Parameter**

- **value** (::String) --- A user-specified description of the `Policy`. This value can be up to 63 characters.
**Returns**

- (::String) --- A user-specified description of the `Policy`. This value can be up to 63 characters.

### #etag

    def etag() -> ::String

**Returns**

- (::String) --- An opaque tag that identifies the current version of the `Policy`. IAM uses this value to help manage concurrent updates, so they do not cause one update to be overwritten by another.


  If this field is present in a \[CreatePolicy\]\[\] request, the value is
  ignored.

### #etag=

    def etag=(value) -> ::String

**Parameter**

- **value** (::String) --- An opaque tag that identifies the current version of the `Policy`. IAM uses this value to help manage concurrent updates, so they do not cause one update to be overwritten by another.


  If this field is present in a \[CreatePolicy\]\[\] request, the value is
  ignored.
**Returns**

- (::String) --- An opaque tag that identifies the current version of the `Policy`. IAM uses this value to help manage concurrent updates, so they do not cause one update to be overwritten by another.


  If this field is present in a \[CreatePolicy\]\[\] request, the value is
  ignored.

### #kind

    def kind() -> ::String

**Returns**

- (::String) --- Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`.

### #managing_authority

    def managing_authority() -> ::String

**Returns**

- (::String) --- Immutable. Specifies that this policy is managed by an authority and can only be modified by that authority. Usage is restricted.

### #managing_authority=

    def managing_authority=(value) -> ::String

**Parameter**

- **value** (::String) --- Immutable. Specifies that this policy is managed by an authority and can only be modified by that authority. Usage is restricted.
**Returns**

- (::String) --- Immutable. Specifies that this policy is managed by an authority and can only be modified by that authority. Usage is restricted.

### #name

    def name() -> ::String

**Returns**

- (::String) --- Immutable. The resource name of the `Policy`, which must be unique. Format: `policies/{attachment_point}/denypolicies/{policy_id}`


  The attachment point is identified by its URL-encoded full resource name,
  which means that the forward-slash character, `/`, must be written as
  `%2F`. For example,
  `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.

  For organizations and folders, use the numeric ID in the full resource
  name. For projects, requests can use the alphanumeric or the numeric ID.
  Responses always contain the numeric ID.

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::String) --- Immutable. The resource name of the `Policy`, which must be unique. Format: `policies/{attachment_point}/denypolicies/{policy_id}`


  The attachment point is identified by its URL-encoded full resource name,
  which means that the forward-slash character, `/`, must be written as
  `%2F`. For example,
  `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.

  For organizations and folders, use the numeric ID in the full resource
  name. For projects, requests can use the alphanumeric or the numeric ID.
  Responses always contain the numeric ID.
**Returns**

- (::String) --- Immutable. The resource name of the `Policy`, which must be unique. Format: `policies/{attachment_point}/denypolicies/{policy_id}`


  The attachment point is identified by its URL-encoded full resource name,
  which means that the forward-slash character, `/`, must be written as
  `%2F`. For example,
  `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.

  For organizations and folders, use the numeric ID in the full resource
  name. For projects, requests can use the alphanumeric or the numeric ID.
  Responses always contain the numeric ID.

### #rules

    def rules() -> ::Array<::Google::Iam::V2::PolicyRule>

**Returns**

- (::Array\<[::Google::Iam::V2::PolicyRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest/Google-Iam-V2-PolicyRule)\>) --- A list of rules that specify the behavior of the `Policy`. All of the rules should be of the `kind` specified in the `Policy`.

### #rules=

    def rules=(value) -> ::Array<::Google::Iam::V2::PolicyRule>

**Parameter**

- **value** (::Array\<[::Google::Iam::V2::PolicyRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest/Google-Iam-V2-PolicyRule)\>) --- A list of rules that specify the behavior of the `Policy`. All of the rules should be of the `kind` specified in the `Policy`.
**Returns**

- (::Array\<[::Google::Iam::V2::PolicyRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest/Google-Iam-V2-PolicyRule)\>) --- A list of rules that specify the behavior of the `Policy`. All of the rules should be of the `kind` specified in the `Policy`.

### #uid

    def uid() -> ::String

**Returns**

- (::String) --- Immutable. The globally unique ID of the `Policy`. Assigned automatically when the `Policy` is created.

### #uid=

    def uid=(value) -> ::String

**Parameter**

- **value** (::String) --- Immutable. The globally unique ID of the `Policy`. Assigned automatically when the `Policy` is created.
**Returns**

- (::String) --- Immutable. The globally unique ID of the `Policy`. Assigned automatically when the `Policy` is created.

### #update_time

    def update_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest/Google-Protobuf-Timestamp)) --- Output only. The time when the `Policy` was last updated.