# Class Policy.Builder (1.67.0)

1.67.0 (latest) 1.65.0 1.62.0 1.61.0 1.60.1 1.59.1 1.58.2 1.57.0 1.56.3 1.55.0 1.54.2 1.53.0 1.52.0 1.51.0 1.49.1 1.48.0 1.47.0 1.46.0 1.45.1 1.44.0 1.43.0 1.41.0 1.40.1 1.39.0 1.38.0 1.37.0 1.36.0 1.35.0 1.34.1 1.33.0 1.32.1 1.31.0 1.29.0 1.28.0 1.27.0 1.25.0 1.24.0 1.23.0 1.22.0 1.21.0 1.20.1 1.19.0 1.18.1 1.17.1 1.16.1 1.10.0 1.9.3 1.8.0 1.7.0 1.6.23 1.5.1 1.4.1 1.3.4 1.2.12

    public static final class Policy.Builder extends GeneratedMessage.Builder<Policy.Builder> implements PolicyOrBuilder

An Identity and Access Management (IAM) policy, which specifies access
controls for Google Cloud resources.

A `Policy` is a collection of `bindings`. A `binding` binds one or more
`members`, or principals, to a single `role`. Principals can be user
accounts, service accounts, Google groups, and domains (such as G Suite). A
`role` is a named list of permissions; each `role` can be an IAM predefined
role or a user-created custom role.

For some types of Google Cloud resources, a `binding` can also specify a
`condition`, which is a logical expression that allows access to a resource
only if the expression evaluates to `true`. A condition can add constraints
based on attributes of the request, the resource, or both. To learn which
resources support conditions in their IAM policies, see the
[IAM
documentation](https://cloud.google.com/iam/help/conditions/resource-policies).

**JSON example:**

\``` `
{
"bindings": [
{
"role": "roles/resourcemanager.organizationAdmin",
"members": [
"user:mike@example.com",
"group:admins@example.com",
"domain:google.com",
"serviceAccount:my-project-id@appspot.gserviceaccount.com"
]
},
{
"role": "roles/resourcemanager.organizationViewer",
"members": [
"user:eve@example.com"
],
"condition": {
"title": "expirable access",
"description": "Does not grant access after Sep 2020",
"expression": "request.time <
timestamp('2020-10-01T00:00:00.000Z')",
}
}
],
"etag": "BwWWja0YfJA=",
"version": 3
}
` ``

`
`

` YAML example:`
`
`

` ``` `
bindings:` ``

`` `
` ``

`` `

- members:


- user:mike@example.com


- group:admins@example.com


- domain:google.com


- serviceAccount:my-project-id@appspot.gserviceaccount.com
role: roles/resourcemanager.organizationAdmin


- members:


- user:eve@example.com
role: roles/resourcemanager.organizationViewer
condition:
title: expirable access
description: Does not grant access after Sep 2020
expression: request.time \< timestamp('2020-10-01T00:00:00.000Z')
etag: BwWWja0YfJA=
version: 3


` ``

\`

<br />

For a description of IAM and its features, see the
[IAM documentation](https://cloud.google.com/iam/docs/).

Protobuf type `google.iam.v1.Policy`

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [AbstractMessageLite.Builder\<MessageType,BuilderType\>](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html) \> [AbstractMessage.Builder\<BuilderType\>](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html) \> [GeneratedMessage.Builder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html) \> Policy.Builder

## Implements

[PolicyOrBuilder](https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.PolicyOrBuilder)

## Inherited Members

[AbstractMessage.Builder.findInitializationErrors()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_findInitializationErrors__) [AbstractMessage.Builder.getInitializationErrorString()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_getInitializationErrorString__) [AbstractMessage.Builder.internalMergeFrom(AbstractMessageLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_internalMergeFrom_com_google_protobuf_AbstractMessageLite_) [AbstractMessage.Builder.mergeFrom(byte\[\])](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_byte___) [AbstractMessage.Builder.mergeFrom(byte\[\],ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_byte___com_google_protobuf_ExtensionRegistryLite_) [AbstractMessage.Builder.mergeFrom(byte\[\],int,int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_byte___int_int_) [AbstractMessage.Builder.mergeFrom(byte\[\],int,int,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_byte___int_int_com_google_protobuf_ExtensionRegistryLite_) [AbstractMessage.Builder.mergeFrom(ByteString)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_ByteString_) [AbstractMessage.Builder.mergeFrom(ByteString,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_ByteString_com_google_protobuf_ExtensionRegistryLite_) [AbstractMessage.Builder.mergeFrom(CodedInputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_CodedInputStream_) [AbstractMessage.Builder.mergeFrom(CodedInputStream,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_CodedInputStream_com_google_protobuf_ExtensionRegistryLite_) [AbstractMessage.Builder.mergeFrom(Message)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_Message_) [AbstractMessage.Builder.mergeFrom(InputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_java_io_InputStream_) [AbstractMessage.Builder.mergeFrom(InputStream,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_java_io_InputStream_com_google_protobuf_ExtensionRegistryLite_) [AbstractMessage.Builder.newUninitializedMessageException(Message)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_newUninitializedMessageException_com_google_protobuf_Message_) [AbstractMessage.Builder.toString()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_toString__) [AbstractMessageLite.Builder.\<T\>addAll(Iterable\<T\>,Collection\<? super T\>)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder__T_addAll_java_lang_Iterable_T__java_util_Collection___super_T__) [AbstractMessageLite.Builder.\<T\>addAll(Iterable\<T\>,List\<? super T\>)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder__T_addAll_java_lang_Iterable_T__java_util_List___super_T__) [AbstractMessageLite.Builder.internalMergeFrom(MessageType)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder_internalMergeFrom_MessageType_) [AbstractMessageLite.Builder.mergeDelimitedFrom(InputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder_mergeDelimitedFrom_java_io_InputStream_) [AbstractMessageLite.Builder.mergeDelimitedFrom(InputStream,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder_mergeDelimitedFrom_java_io_InputStream_com_google_protobuf_ExtensionRegistryLite_) [AbstractMessageLite.Builder.mergeFrom(MessageLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder_mergeFrom_com_google_protobuf_MessageLite_) [AbstractMessageLite.Builder.newUninitializedMessageException(MessageLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder_newUninitializedMessageException_com_google_protobuf_MessageLite_) [GeneratedMessage.Builder.addRepeatedField(Descriptors.FieldDescriptor,Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_addRepeatedField_com_google_protobuf_Descriptors_FieldDescriptor_java_lang_Object_) [GeneratedMessage.Builder.clear()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_clear__) [GeneratedMessage.Builder.clearField(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_clearField_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.Builder.clearOneof(Descriptors.OneofDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_clearOneof_com_google_protobuf_Descriptors_OneofDescriptor_) [GeneratedMessage.Builder.clone()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_clone__) [GeneratedMessage.Builder.getAllFields()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getAllFields__) [GeneratedMessage.Builder.getDescriptorForType()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getDescriptorForType__) [GeneratedMessage.Builder.getField(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getField_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.Builder.getFieldBuilder(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getFieldBuilder_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.Builder.getOneofFieldDescriptor(Descriptors.OneofDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getOneofFieldDescriptor_com_google_protobuf_Descriptors_OneofDescriptor_) [GeneratedMessage.Builder.getParentForChildren()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getParentForChildren__) [GeneratedMessage.Builder.getRepeatedField(Descriptors.FieldDescriptor,int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getRepeatedField_com_google_protobuf_Descriptors_FieldDescriptor_int_) [GeneratedMessage.Builder.getRepeatedFieldBuilder(Descriptors.FieldDescriptor,int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getRepeatedFieldBuilder_com_google_protobuf_Descriptors_FieldDescriptor_int_) [GeneratedMessage.Builder.getRepeatedFieldCount(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getRepeatedFieldCount_com_google_protobuf_Descriptors_FieldDescriptor_) com.google.protobuf.GeneratedMessage.Builder.getUnknownFieldSetBuilder() [GeneratedMessage.Builder.getUnknownFields()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getUnknownFields__) [GeneratedMessage.Builder.hasField(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_hasField_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.Builder.hasOneof(Descriptors.OneofDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_hasOneof_com_google_protobuf_Descriptors_OneofDescriptor_) [GeneratedMessage.Builder.internalGetFieldAccessorTable()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_internalGetFieldAccessorTable__) [GeneratedMessage.Builder.internalGetMapField(int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_internalGetMapField_int_) com.google.protobuf.GeneratedMessage.Builder.internalGetMapFieldReflection(int) [GeneratedMessage.Builder.internalGetMutableMapField(int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_internalGetMutableMapField_int_) com.google.protobuf.GeneratedMessage.Builder.internalGetMutableMapFieldReflection(int) [GeneratedMessage.Builder.isClean()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_isClean__) [GeneratedMessage.Builder.isInitialized()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_isInitialized__) [GeneratedMessage.Builder.markClean()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_markClean__) [GeneratedMessage.Builder.mergeUnknownFields(UnknownFieldSet)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_mergeUnknownFields_com_google_protobuf_UnknownFieldSet_) com.google.protobuf.GeneratedMessage.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString) com.google.protobuf.GeneratedMessage.Builder.mergeUnknownVarintField(int,int) [GeneratedMessage.Builder.newBuilderForField(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_newBuilderForField_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.Builder.onBuilt()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_onBuilt__) [GeneratedMessage.Builder.onChanged()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_onChanged__) com.google.protobuf.GeneratedMessage.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int) [GeneratedMessage.Builder.setField(Descriptors.FieldDescriptor,Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_setField_com_google_protobuf_Descriptors_FieldDescriptor_java_lang_Object_) [GeneratedMessage.Builder.setRepeatedField(Descriptors.FieldDescriptor,int,Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_setRepeatedField_com_google_protobuf_Descriptors_FieldDescriptor_int_java_lang_Object_) com.google.protobuf.GeneratedMessage.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder) [GeneratedMessage.Builder.setUnknownFields(UnknownFieldSet)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_setUnknownFields_com_google_protobuf_UnknownFieldSet_) com.google.protobuf.GeneratedMessage.Builder.setUnknownFieldsProto3(com.google.protobuf.UnknownFieldSet) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### getDescriptor()

    public static final Descriptors.Descriptor getDescriptor()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.Descriptor.html` |   |

## Methods

### addAllAuditConfigs(Iterable\<? extends AuditConfig\> values)

    public Policy.Builder addAllAuditConfigs(Iterable<? extends AuditConfig> values)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `values` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html<? extends com.google.iam.v1.AuditConfig>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### addAllBindings(Iterable\<? extends Binding\> values)

    public Policy.Builder addAllBindings(Iterable<? extends Binding> values)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `values` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html<? extends com.google.iam.v1.Binding>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### addAuditConfigs(AuditConfig value)

    public Policy.Builder addAuditConfigs(AuditConfig value)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### addAuditConfigs(AuditConfig.Builder builderForValue)

    public Policy.Builder addAuditConfigs(AuditConfig.Builder builderForValue)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### addAuditConfigs(int index, AuditConfig value)

    public Policy.Builder addAuditConfigs(int index, AuditConfig value)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `value` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### addAuditConfigs(int index, AuditConfig.Builder builderForValue)

    public Policy.Builder addAuditConfigs(int index, AuditConfig.Builder builderForValue)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### addAuditConfigsBuilder()

    public AuditConfig.Builder addAuditConfigsBuilder()

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig.Builder` |   |

### addAuditConfigsBuilder(int index)

    public AuditConfig.Builder addAuditConfigsBuilder(int index)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig.Builder` |   |

### addBindings(Binding value)

    public Policy.Builder addBindings(Binding value)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### addBindings(Binding.Builder builderForValue)

    public Policy.Builder addBindings(Binding.Builder builderForValue)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### addBindings(int index, Binding value)

    public Policy.Builder addBindings(int index, Binding value)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `value` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### addBindings(int index, Binding.Builder builderForValue)

    public Policy.Builder addBindings(int index, Binding.Builder builderForValue)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### addBindingsBuilder()

    public Binding.Builder addBindingsBuilder()

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding.Builder` |   |

### addBindingsBuilder(int index)

    public Binding.Builder addBindingsBuilder(int index)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding.Builder` |   |

### build()

    public Policy build()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy` |   |

### buildPartial()

    public Policy buildPartial()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy` |   |

### clear()

    public Policy.Builder clear()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

**Overrides** [GeneratedMessage.Builder\<BuilderType\>.clear()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_clear__)

### clearAuditConfigs()

    public Policy.Builder clearAuditConfigs()

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### clearBindings()

    public Policy.Builder clearBindings()

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### clearEtag()

    public Policy.Builder clearEtag()

`etag` is used for optimistic concurrency control as a way to help
prevent simultaneous updates of a policy from overwriting each other.
It is strongly suggested that systems make use of the `etag` in the
read-modify-write cycle to perform policy updates in order to avoid race
conditions: An `etag` is returned in the response to `getIamPolicy`, and
systems are expected to put that etag in the request to `setIamPolicy` to
ensure that their change will be applied to the same version of the policy.

**Important:** If you use IAM Conditions, you must include the `etag` field
whenever you call `setIamPolicy`. If you omit this field, then IAM allows
you to overwrite a version `3` policy with a version `1` policy, and all of
the conditions in the version `3` policy are lost.

`bytes etag = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` | This builder for chaining. |

### clearVersion()

    public Policy.Builder clearVersion()

Specifies the format of the policy.

Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
are rejected.

Any operation that affects conditional role bindings must specify version
`3`. This requirement applies to the following operations:

- Getting a policy that includes a conditional role binding
- Adding a conditional role binding to a policy
- Changing a conditional role binding in a policy
- Removing any role binding, with or without a condition, from a policy
  that includes conditions

  **Important:** If you use IAM Conditions, you must include the `etag` field
  whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  you to overwrite a version `3` policy with a version `1` policy, and all of
  the conditions in the version `3` policy are lost.

  If a policy does not include any conditions, operations on that policy may
  specify any valid version or leave the field unset.

  To learn which resources support conditions in their IAM policies, see the
  [IAM
  documentation](https://cloud.google.com/iam/help/conditions/resource-policies).

`int32 version = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` | This builder for chaining. |

### getAuditConfigs(int index)

    public AuditConfig getAuditConfigs(int index)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig` |   |

### getAuditConfigsBuilder(int index)

    public AuditConfig.Builder getAuditConfigsBuilder(int index)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig.Builder` |   |

### getAuditConfigsBuilderList()

    public List<AuditConfig.Builder> getAuditConfigsBuilderList()

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig.Builder>` |   |

### getAuditConfigsCount()

    public int getAuditConfigsCount()

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getAuditConfigsList()

    public List<AuditConfig> getAuditConfigsList()

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig>` |   |

### getAuditConfigsOrBuilder(int index)

    public AuditConfigOrBuilder getAuditConfigsOrBuilder(int index)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfigOrBuilder` |   |

### getAuditConfigsOrBuilderList()

    public List<? extends AuditConfigOrBuilder> getAuditConfigsOrBuilderList()

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.iam.v1.AuditConfigOrBuilder>` |   |

### getBindings(int index)

    public Binding getBindings(int index)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding` |   |

### getBindingsBuilder(int index)

    public Binding.Builder getBindingsBuilder(int index)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding.Builder` |   |

### getBindingsBuilderList()

    public List<Binding.Builder> getBindingsBuilderList()

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding.Builder>` |   |

### getBindingsCount()

    public int getBindingsCount()

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getBindingsList()

    public List<Binding> getBindingsList()

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding>` |   |

### getBindingsOrBuilder(int index)

    public BindingOrBuilder getBindingsOrBuilder(int index)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.BindingOrBuilder` |   |

### getBindingsOrBuilderList()

    public List<? extends BindingOrBuilder> getBindingsOrBuilderList()

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.iam.v1.BindingOrBuilder>` |   |

### getDefaultInstanceForType()

    public Policy getDefaultInstanceForType()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy` |   |

### getDescriptorForType()

    public Descriptors.Descriptor getDescriptorForType()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.Descriptor.html` |   |

**Overrides** [GeneratedMessage.Builder\<BuilderType\>.getDescriptorForType()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getDescriptorForType__)

### getEtag()

    public ByteString getEtag()

`etag` is used for optimistic concurrency control as a way to help
prevent simultaneous updates of a policy from overwriting each other.
It is strongly suggested that systems make use of the `etag` in the
read-modify-write cycle to perform policy updates in order to avoid race
conditions: An `etag` is returned in the response to `getIamPolicy`, and
systems are expected to put that etag in the request to `setIamPolicy` to
ensure that their change will be applied to the same version of the policy.

**Important:** If you use IAM Conditions, you must include the `etag` field
whenever you call `setIamPolicy`. If you omit this field, then IAM allows
you to overwrite a version `3` policy with a version `1` policy, and all of
the conditions in the version `3` policy are lost.

`bytes etag = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The etag. |

### getVersion()

    public int getVersion()

Specifies the format of the policy.

Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
are rejected.

Any operation that affects conditional role bindings must specify version
`3`. This requirement applies to the following operations:

- Getting a policy that includes a conditional role binding
- Adding a conditional role binding to a policy
- Changing a conditional role binding in a policy
- Removing any role binding, with or without a condition, from a policy
  that includes conditions

  **Important:** If you use IAM Conditions, you must include the `etag` field
  whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  you to overwrite a version `3` policy with a version `1` policy, and all of
  the conditions in the version `3` policy are lost.

  If a policy does not include any conditions, operations on that policy may
  specify any valid version or leave the field unset.

  To learn which resources support conditions in their IAM policies, see the
  [IAM
  documentation](https://cloud.google.com/iam/help/conditions/resource-policies).

`int32 version = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The version. |

### internalGetFieldAccessorTable()

    protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.FieldAccessorTable.html` |   |

**Overrides** [GeneratedMessage.Builder\<BuilderType\>.internalGetFieldAccessorTable()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_internalGetFieldAccessorTable__)

### isInitialized()

    public final boolean isInitialized()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [GeneratedMessage.Builder\<BuilderType\>.isInitialized()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_isInitialized__)

### mergeFrom(Policy other)

    public Policy.Builder mergeFrom(Policy other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

    public Policy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `input` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.CodedInputStream.html` |
| `extensionRegistry` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ExtensionRegistryLite.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

**Overrides** [AbstractMessage.Builder\<BuilderType\>.mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_CodedInputStream_com_google_protobuf_ExtensionRegistryLite_)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### mergeFrom(Message other)

    public Policy.Builder mergeFrom(Message other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Message.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

**Overrides** [AbstractMessage.Builder\<BuilderType\>.mergeFrom(Message other)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_Message_)

### removeAuditConfigs(int index)

    public Policy.Builder removeAuditConfigs(int index)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### removeBindings(int index)

    public Policy.Builder removeBindings(int index)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### setAuditConfigs(int index, AuditConfig value)

    public Policy.Builder setAuditConfigs(int index, AuditConfig value)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `value` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### setAuditConfigs(int index, AuditConfig.Builder builderForValue)

    public Policy.Builder setAuditConfigs(int index, AuditConfig.Builder builderForValue)

Specifies cloud audit logging configuration for this policy.

`repeated .google.iam.v1.AuditConfig audit_configs = 6;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.AuditConfig.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### setBindings(int index, Binding value)

    public Policy.Builder setBindings(int index, Binding value)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `value` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### setBindings(int index, Binding.Builder builderForValue)

    public Policy.Builder setBindings(int index, Binding.Builder builderForValue)

Associates a list of `members`, or principals, with a `role`. Optionally,
may specify a `condition` that determines how and when the `bindings` are
applied. Each of the `bindings` must contain at least one principal.

The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
of these principals can be Google groups. Each occurrence of a principal
counts towards these limits. For example, if the `bindings` grant 50
different roles to `user:alice@example.com`, and not to any other
principal, then you can add another 1,450 principals to the `bindings` in
the `Policy`.

`repeated .google.iam.v1.Binding bindings = 4;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Binding.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` |   |

### setEtag(ByteString value)

    public Policy.Builder setEtag(ByteString value)

`etag` is used for optimistic concurrency control as a way to help
prevent simultaneous updates of a policy from overwriting each other.
It is strongly suggested that systems make use of the `etag` in the
read-modify-write cycle to perform policy updates in order to avoid race
conditions: An `etag` is returned in the response to `getIamPolicy`, and
systems are expected to put that etag in the request to `setIamPolicy` to
ensure that their change will be applied to the same version of the policy.

**Important:** If you use IAM Conditions, you must include the `etag` field
whenever you call `setIamPolicy`. If you omit this field, then IAM allows
you to overwrite a version `3` policy with a version `1` policy, and all of
the conditions in the version `3` policy are lost.

`bytes etag = 3;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The etag to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` | This builder for chaining. |

### setVersion(int value)

    public Policy.Builder setVersion(int value)

Specifies the format of the policy.

Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
are rejected.

Any operation that affects conditional role bindings must specify version
`3`. This requirement applies to the following operations:

- Getting a policy that includes a conditional role binding
- Adding a conditional role binding to a policy
- Changing a conditional role binding in a policy
- Removing any role binding, with or without a condition, from a policy
  that includes conditions

  **Important:** If you use IAM Conditions, you must include the `etag` field
  whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  you to overwrite a version `3` policy with a version `1` policy, and all of
  the conditions in the version `3` policy are lost.

  If a policy does not include any conditions, operations on that policy may
  specify any valid version or leave the field unset.

  To learn which resources support conditions in their IAM policies, see the
  [IAM
  documentation](https://cloud.google.com/iam/help/conditions/resource-policies).

`int32 version = 1;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The version to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/com.google.iam.v1.Policy.Builder` | This builder for chaining. |