A binding binds one or more members to a single role. Member strings can describe user accounts, service
accounts, Google groups, and domains. A role is a named list of permissions; each role can be an IAM
predefined role or a user-created custom role.
Specifies the identities requesting access for a Cloud Platform resource.
members can have the following values. Required.
allUsers: A special identifier that represents anyone who is on the internet; with or without a Google
account.
allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google
account or a service account.
user:<emailid>: An email address that represents a specific Google account. For example,
alice@example.com.
serviceAccount:<emailid>: An email address that represents a service account. For example,
my-other-app@appspot.gserviceaccount.com.
group:<emailid>: An email address that represents a Google group. For example, admins@example.com.
deleted:user:<emailid>?uid=<uniqueid>: An email address (plus unique identifier) representing a user
that has been recently deleted. For example, alice@example.com?uid=123456789012345678901. If the user
is recovered, this value reverts to user:<emailid> and the recovered user retains the role in the
binding.
deleted: serviceAccount:<emailid>?uid=<uniqueid>: An email address (plus unique identifier) representing
a service account that has been recently deleted. For example,
my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901. If the service account is undeleted,
this value reverts to serviceAccount:<emailid> and the undeleted service account retains the role in
the binding.
deleted:group:<emailid>?uid=<uniqueid>: An email address (plus unique identifier) representing a Google
group that has been recently deleted. For example, admins@example.com?uid=123456789012345678901. If the
group is recovered, this value reverts to group:<emailid> and the recovered group retains the role in
the binding.
domain:<domain>: The G Suite domain (primary) that represents all the users of that domain. For example,
google.com or example.com.
Returns
(Array<String>) — the current value of members
#members=
defmembers=(new_members)
Sets the binding members.
#role
defrole()->String
The role that is assigned to members. For example, roles/viewer, roles/editor, or
roles/owner. Required.
Returns
(String) — the current value of role
#role=
defrole=(value)->String
The role that is assigned to members. For example, roles/viewer, roles/editor, or
roles/owner. Required.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# BigQuery API - Class Google::Cloud::Bigquery::Policy::Binding (v1.55.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.55.0 (latest)](/ruby/docs/reference/google-cloud-bigquery/latest/Google-Cloud-Bigquery-Policy-Binding)\n- [1.54.0](/ruby/docs/reference/google-cloud-bigquery/1.54.0/Google-Cloud-Bigquery-Policy-Binding)\n- [1.53.0](/ruby/docs/reference/google-cloud-bigquery/1.53.0/Google-Cloud-Bigquery-Policy-Binding)\n- [1.52.1](/ruby/docs/reference/google-cloud-bigquery/1.52.1/Google-Cloud-Bigquery-Policy-Binding)\n- [1.51.1](/ruby/docs/reference/google-cloud-bigquery/1.51.1/Google-Cloud-Bigquery-Policy-Binding)\n- [1.50.0](/ruby/docs/reference/google-cloud-bigquery/1.50.0/Google-Cloud-Bigquery-Policy-Binding)\n- [1.49.1](/ruby/docs/reference/google-cloud-bigquery/1.49.1/Google-Cloud-Bigquery-Policy-Binding)\n- [1.48.1](/ruby/docs/reference/google-cloud-bigquery/1.48.1/Google-Cloud-Bigquery-Policy-Binding)\n- [1.47.0](/ruby/docs/reference/google-cloud-bigquery/1.47.0/Google-Cloud-Bigquery-Policy-Binding)\n- [1.46.1](/ruby/docs/reference/google-cloud-bigquery/1.46.1/Google-Cloud-Bigquery-Policy-Binding)\n- [1.45.0](/ruby/docs/reference/google-cloud-bigquery/1.45.0/Google-Cloud-Bigquery-Policy-Binding)\n- [1.44.2](/ruby/docs/reference/google-cloud-bigquery/1.44.2/Google-Cloud-Bigquery-Policy-Binding)\n- [1.43.1](/ruby/docs/reference/google-cloud-bigquery/1.43.1/Google-Cloud-Bigquery-Policy-Binding)\n- [1.42.0](/ruby/docs/reference/google-cloud-bigquery/1.42.0/Google-Cloud-Bigquery-Policy-Binding)\n- [1.41.0](/ruby/docs/reference/google-cloud-bigquery/1.41.0/Google-Cloud-Bigquery-Policy-Binding)\n- [1.40.0](/ruby/docs/reference/google-cloud-bigquery/1.40.0/Google-Cloud-Bigquery-Policy-Binding)\n- [1.39.0](/ruby/docs/reference/google-cloud-bigquery/1.39.0/Google-Cloud-Bigquery-Policy-Binding)\n- [1.38.1](/ruby/docs/reference/google-cloud-bigquery/1.38.1/Google-Cloud-Bigquery-Policy-Binding) \nReference documentation and code samples for the BigQuery API class Google::Cloud::Bigquery::Policy::Binding.\n\nPolicy::Binding\n---------------\n\nRepresents a Cloud IAM Binding for BigQuery resources within the context of a [Google::Cloud::Bigquery::Policy](/ruby/docs/reference/google-cloud-bigquery/latest/Google-Cloud-Bigquery-Policy \"Google::Cloud::Bigquery::Policy (class)\").\n\nA binding binds one or more members to a single role. Member strings can describe user accounts, service\naccounts, Google groups, and domains. A role is a named list of permissions; each role can be an IAM\npredefined role or a user-created custom role. \n\nInherits\n--------\n\n- Object\n\nExamples\n--------\n\n```ruby\nrequire \"google/cloud/bigquery\"\n\nbigquery = Google::Cloud::Bigquery.new\ndataset = bigquery.dataset \"my_dataset\"\ntable = dataset.table \"my_table\"\n\npolicy = table.policy\nbinding_owner = policy.bindings.find { |b| b.role == \"roles/owner\" }\n\nbinding_owner.role #=\u003e \"roles/owner\"\nbinding_owner.members #=\u003e [\"user:owner@example.com\"]\n\nbinding_owner.frozen? #=\u003e true\nbinding_owner.members.frozen? #=\u003e true\n```\n\nUpdate mutable bindings. \n\n```ruby\nrequire \"google/cloud/bigquery\"\n\nbigquery = Google::Cloud::Bigquery.new\ndataset = bigquery.dataset \"my_dataset\"\ntable = dataset.table \"my_table\"\n\ntable.update_policy do |p|\n binding_owner = p.bindings.find { |b| b.role == \"roles/owner\" }\n binding_owner.members.delete_if { |m| m.include? \"@example.com\" }\nend\n```\n\nMethods\n-------\n\n### #members\n\n def members() -\u003e Array\u003cString\u003e\n\nSpecifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values. Required.\n\n- `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n- `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n- `user:\u003cemailid\u003e`: An email address that represents a specific Google account. For example, `alice@example.com`.\n- `serviceAccount:\u003cemailid\u003e`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n- `group:\u003cemailid\u003e`: An email address that represents a Google group. For example, `admins@example.com`.\n- `deleted:user:\u003cemailid\u003e?uid=\u003cuniqueid\u003e`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:\u003cemailid\u003e` and the recovered user retains the role in the binding.\n- `deleted: serviceAccount:\u003cemailid\u003e?uid=\u003cuniqueid\u003e`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:\u003cemailid\u003e` and the undeleted service account retains the role in the binding.\n- `deleted:group:\u003cemailid\u003e?uid=\u003cuniqueid\u003e`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:\u003cemailid\u003e` and the recovered group retains the role in the binding.\n- `domain:\u003cdomain\u003e`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. \n**Returns**\n\n- (Array\\\u003cString\\\u003e) --- the current value of members\n\n### #members=\n\n def members=(new_members)\n\nSets the binding members.\n\n### #role\n\n def role() -\u003e String\n\nThe role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or\n`roles/owner`. Required. \n**Returns**\n\n- (String) --- the current value of role\n\n### #role=\n\n def role=(value) -\u003e String\n\nThe role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or\n`roles/owner`. Required. \n**Parameter**\n\n- **value** (String) --- the newly set value \n**Returns**\n\n- (String) --- the newly set value"]]