3.14.0-rc 3.13.0 (latest) 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 2.48.0-rc 2.47.1 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.1 2.24.0 2.23.0 2.22.1 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.1 2.14.0 2.13.0 2.12.0 2.11.0 Creates and manages Identity and Access Management (IAM) resources.
You can use this service to work with all of the following resources:

- **Service accounts**, which identify an application or a virtual machine (VM) instance rather than a person
- **Service account keys**, which service accounts use to authenticate with Google APIs
- **IAM policies for service accounts**, which specify the roles that a principal has for the service account
- **IAM custom roles**, which help you limit the number of permissions that you grant to principals

In addition, you can use this service to complete the following tasks, among others:

- Test whether a service account can use specific permissions
- Check which roles you can grant for a specific resource
- Lint, or validate, condition expressions in an IAM policy

When you read data from the IAM API, each read is eventually consistent. In other words, if you write data with the IAM API, then immediately read that data, the read operation might return an older version of the data. To deal with this behavior, your application can retry the request with truncated exponential backoff.

In contrast, writing data to the IAM API is sequentially consistent. In other words, write operations are always processed in the order in which they were received.

###### Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal `std::shared_ptr<*Connection>` objects compare equal. Objects that compare equal share the same underlying resources.

###### Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

###### Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

## Constructors

### IAMClient(IAMClient const \&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `IAMClient const &` |

### IAMClient(IAMClient \&\&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `IAMClient &&` |

### IAMClient(std::shared_ptr\< IAMConnection \>, Options)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `connection` | `std::shared_ptr< IAMConnection >` |
| `opts` | `Options` |

## Operators

### operator=(IAMClient const \&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `IAMClient const &` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IAMClient &` |   |

### operator=(IAMClient \&\&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `IAMClient &&` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IAMClient &` |   |

## Functions

### ListServiceAccounts(std::string const \&, Options)

Lists every [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493) that belongs to a specific project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::iam::admin::v1::ServiceAccount >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.iam.admin.v1.ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### ListServiceAccounts(google::iam::admin::v1::ListServiceAccountsRequest, Options)

Lists every [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493) that belongs to a specific project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::ListServiceAccountsRequest` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.ListServiceAccountsRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L576). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::iam::admin::v1::ServiceAccount >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.iam.admin.v1.ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### GetServiceAccount(std::string const \&, Options)

Gets a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ServiceAccount >` | the result of the RPC. The response message type ([google.iam.admin.v1.ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetServiceAccount(google::iam::admin::v1::GetServiceAccountRequest const \&, Options)

Gets a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::GetServiceAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.GetServiceAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L611). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ServiceAccount >` | the result of the RPC. The response message type ([google.iam.admin.v1.ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateServiceAccount(std::string const \&, std::string const \&, google::iam::admin::v1::ServiceAccount const \&, Options)

Creates a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`. |
| `account_id` | `std::string const &` Required. The account id that is used to generate the service account email address and a stable unique id. It is unique within a project, must be 6-30 characters long, and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035. |
| `service_account` | `google::iam::admin::v1::ServiceAccount const &` The [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493) resource to create. Currently, only the following values are user assignable: `display_name` and `description`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ServiceAccount >` | the result of the RPC. The response message type ([google.iam.admin.v1.ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateServiceAccount(google::iam::admin::v1::CreateServiceAccountRequest const \&, Options)

Creates a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::CreateServiceAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.CreateServiceAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L553). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ServiceAccount >` | the result of the RPC. The response message type ([google.iam.admin.v1.ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### PatchServiceAccount(google::iam::admin::v1::PatchServiceAccountRequest const \&, Options)

Patches a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::PatchServiceAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.PatchServiceAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L647). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ServiceAccount >` | the result of the RPC. The response message type ([google.iam.admin.v1.ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### DeleteServiceAccount(std::string const \&, Options)

Deletes a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).
**Warning:** After you delete a service account, you might not be able to undelete it. If you know that you need to re-enable the service account in the future, use [DisableServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L184) instead.

If you delete a service account, IAM permanently removes the service account 30 days later. Google Cloud cannot recover the service account after it is permanently removed, even if you file a support request.

To help avoid unplanned outages, we recommend that you disable the service account before you delete it. Use [DisableServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L184) to disable the service account, then wait at least 24 hours and watch for unintended consequences. If there are no unintended consequences, you can delete the service account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### DeleteServiceAccount(google::iam::admin::v1::DeleteServiceAccountRequest const \&, Options)

Deletes a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).
**Warning:** After you delete a service account, you might not be able to undelete it. If you know that you need to re-enable the service account in the future, use [DisableServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L184) instead.

If you delete a service account, IAM permanently removes the service account 30 days later. Google Cloud cannot recover the service account after it is permanently removed, even if you file a support request.

To help avoid unplanned outages, we recommend that you disable the service account before you delete it. Use [DisableServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L184) to disable the service account, then wait at least 24 hours and watch for unintended consequences. If there are no unintended consequences, you can delete the service account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::DeleteServiceAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.DeleteServiceAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L626). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### UndeleteServiceAccount(google::iam::admin::v1::UndeleteServiceAccountRequest const \&, Options)

Restores a deleted [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).
**Important:** It is not always possible to restore a deleted service account. Use this method only as a last resort.

After you delete a service account, IAM permanently removes the service account 30 days later. There is no way to restore a deleted service account that has been permanently removed.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::UndeleteServiceAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.UndeleteServiceAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L654). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::UndeleteServiceAccountResponse >` | the result of the RPC. The response message type ([google.iam.admin.v1.UndeleteServiceAccountResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L662)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### EnableServiceAccount(google::iam::admin::v1::EnableServiceAccountRequest const \&, Options)

Enables a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493) that was disabled by [DisableServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L184).
If the service account is already enabled, then this method has no effect.

If the service account was disabled by other means---for example, if Google disabled the service account because it was compromised---you cannot use this method to enable the service account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::EnableServiceAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.EnableServiceAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L668). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### DisableServiceAccount(google::iam::admin::v1::DisableServiceAccountRequest const \&, Options)

Disables a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493) immediately.
If an application uses the service account to authenticate, that application can no longer call Google APIs or access Google Cloud resources. Existing access tokens for the service account are rejected, and requests for new access tokens will fail.

To re-enable the service account, use [EnableServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L161). After you re-enable the service account, its existing access tokens will be accepted, and you can request new access tokens.

To help avoid unplanned outages, we recommend that you disable the service account before you delete it. Use this method to disable the service account, then wait at least 24 hours and watch for unintended consequences. If there are no unintended consequences, you can delete the service account with [DeleteServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L131).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::DisableServiceAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.DisableServiceAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L678). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### ListServiceAccountKeys(std::string const \&, std::vector\< google::iam::admin::v1::ListServiceAccountKeysRequest::KeyType \> const \&, Options)

Lists every [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822) for a service account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID`, will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. |
| `key_types` | `std::vector< google::iam::admin::v1::ListServiceAccountKeysRequest::KeyType > const &` Filters the types of keys the user wants to include in the list response. Duplicate key types are not allowed. If no key type is provided, all keys are returned. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ListServiceAccountKeysResponse >` | the result of the RPC. The response message type ([google.iam.admin.v1.ListServiceAccountKeysResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L723)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### ListServiceAccountKeys(google::iam::admin::v1::ListServiceAccountKeysRequest const \&, Options)

Lists every [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822) for a service account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::ListServiceAccountKeysRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.ListServiceAccountKeysRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L688). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ListServiceAccountKeysResponse >` | the result of the RPC. The response message type ([google.iam.admin.v1.ListServiceAccountKeysResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L723)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetServiceAccountKey(std::string const \&, google::iam::admin::v1::ServiceAccountPublicKeyType, Options)

Gets a [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. |
| `public_key_type` | `google::iam::admin::v1::ServiceAccountPublicKeyType` Optional. The output format of the public key. The default is `TYPE_NONE`, which means that the public key is not returned. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ServiceAccountKey >` | the result of the RPC. The response message type ([google.iam.admin.v1.ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetServiceAccountKey(google::iam::admin::v1::GetServiceAccountKeyRequest const \&, Options)

Gets a [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::GetServiceAccountKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.GetServiceAccountKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L729). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ServiceAccountKey >` | the result of the RPC. The response message type ([google.iam.admin.v1.ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateServiceAccountKey(std::string const \&, google::iam::admin::v1::ServiceAccountPrivateKeyType, google::iam::admin::v1::ServiceAccountKeyAlgorithm, Options)

Creates a [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. |
| `private_key_type` | `google::iam::admin::v1::ServiceAccountPrivateKeyType` The output format of the private key. The default value is `TYPE_GOOGLE_CREDENTIALS_FILE`, which is the Google [Credentials](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Credentials.html) File format. |
| `key_algorithm` | `google::iam::admin::v1::ServiceAccountKeyAlgorithm` Which type of key and algorithm to use for the key. The default is currently a 2K RSA key. However this may change in the future. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ServiceAccountKey >` | the result of the RPC. The response message type ([google.iam.admin.v1.ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateServiceAccountKey(google::iam::admin::v1::CreateServiceAccountKeyRequest const \&, Options)

Creates a [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::CreateServiceAccountKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.CreateServiceAccountKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L875). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ServiceAccountKey >` | the result of the RPC. The response message type ([google.iam.admin.v1.ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UploadServiceAccountKey(google::iam::admin::v1::UploadServiceAccountKeyRequest const \&, Options)

Uploads the public key portion of a key pair that you manage, and associates the public key with a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).
After you upload the public key, you can use the private key from the key pair as a service account key.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::UploadServiceAccountKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.UploadServiceAccountKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L900). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::ServiceAccountKey >` | the result of the RPC. The response message type ([google.iam.admin.v1.ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### DeleteServiceAccountKey(std::string const \&, Options)

Deletes a [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822).
Deleting a service account key does not revoke short-lived credentials that have been issued based on the service account key.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### DeleteServiceAccountKey(google::iam::admin::v1::DeleteServiceAccountKeyRequest const \&, Options)

Deletes a [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822).
Deleting a service account key does not revoke short-lived credentials that have been issued based on the service account key.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::DeleteServiceAccountKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.DeleteServiceAccountKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L916). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### DisableServiceAccountKey(std::string const \&, Options)

Disable a [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822).
A disabled service account key can be re-enabled with [EnableServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L249).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### DisableServiceAccountKey(google::iam::admin::v1::DisableServiceAccountKeyRequest const \&, Options)

Disable a [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822).
A disabled service account key can be re-enabled with [EnableServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L249).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::DisableServiceAccountKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.DisableServiceAccountKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L931). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### EnableServiceAccountKey(std::string const \&, Options)

Enable a [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### EnableServiceAccountKey(google::iam::admin::v1::EnableServiceAccountKeyRequest const \&, Options)

Enable a [ServiceAccountKey](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L822).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::EnableServiceAccountKeyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.EnableServiceAccountKeyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L947). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` | a [`Status`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status.html) object. If the request failed, the status contains the details of the failure. |

### GetIamPolicy(std::string const \&, Options)

Gets the IAM policy that is attached to a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).
This IAM policy specifies which principals have access to the service account.

This method does not tell you whether the service account has been granted any roles on other resources. To check whether a service account has role grants on a resource, use the `getIamPolicy` method for that resource. For example, to view the role grants for a project, call the Resource Manager API's [`projects.getIamPolicy`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy) method.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `std::string const &` REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | the result of the RPC. The response message type ([google.iam.v1.Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetIamPolicy(google::iam::v1::GetIamPolicyRequest const \&, Options)

Gets the IAM policy that is attached to a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).
This IAM policy specifies which principals have access to the service account.

This method does not tell you whether the service account has been granted any roles on other resources. To check whether a service account has role grants on a resource, use the `getIamPolicy` method for that resource. For example, to view the role grants for a project, call the Resource Manager API's [`projects.getIamPolicy`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy) method.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::v1::GetIamPolicyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.v1.GetIamPolicyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L123). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | the result of the RPC. The response message type ([google.iam.v1.Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### SetIamPolicy(std::string const \&, google::iam::v1::Policy const \&, Options)

Sets the IAM policy that is attached to a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).
Use this method to grant or revoke access to the service account. For example, you could grant a principal the ability to impersonate the service account.

This method does not enable the service account to access other resources. To grant roles to a service account on a resource, follow these steps:

1. Call the resource's `getIamPolicy` method to get its current IAM policy.
2. Edit the policy so that it binds the service account to an IAM role for the resource.
3. Call the resource's `setIamPolicy` method to update its IAM policy.

For detailed instructions, see [Manage access to project, folders, and organizations](https://cloud.google.com/iam/help/service-accounts/granting-access-to-service-accounts) or [Manage access to other resources](https://cloud.google.com/iam/help/access/manage-other-resources).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `std::string const &` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `policy` | `google::iam::v1::Policy const &` REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | the result of the RPC. The response message type ([google.iam.v1.Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### SetIamPolicy(std::string const \&, IamUpdater const \&, Options)

Updates the IAM policy for `resource` using an optimistic concurrency control loop.
The loop fetches the current policy for `resource`, and passes it to `updater`, which should return the new policy. This new policy should use the current etag so that the read-modify-write cycle can detect races and rerun the update when there is a mismatch. If the new policy does not have an etag, the existing policy will be blindly overwritten. If `updater` does not yield a policy, the control loop is terminated and kCancelled is returned.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `std::string const &` Required. The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `updater` | `IamUpdater const &` Required. Functor to map the current policy to a new one. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | google::iam::v1::Policy |

### SetIamPolicy(google::iam::v1::SetIamPolicyRequest const \&, Options)

Sets the IAM policy that is attached to a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).
Use this method to grant or revoke access to the service account. For example, you could grant a principal the ability to impersonate the service account.

This method does not enable the service account to access other resources. To grant roles to a service account on a resource, follow these steps:

1. Call the resource's `getIamPolicy` method to get its current IAM policy.
2. Edit the policy so that it binds the service account to an IAM role for the resource.
3. Call the resource's `setIamPolicy` method to update its IAM policy.

For detailed instructions, see [Manage access to project, folders, and organizations](https://cloud.google.com/iam/help/service-accounts/granting-access-to-service-accounts) or [Manage access to other resources](https://cloud.google.com/iam/help/access/manage-other-resources).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::v1::SetIamPolicyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.v1.SetIamPolicyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L100). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | the result of the RPC. The response message type ([google.iam.v1.Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### TestIamPermissions(std::string const \&, std::vector\< std::string \> const \&, Options)

Tests whether the caller has the specified permissions on a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `std::string const &` REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
| `permissions` | `std::vector< std::string > const &` The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.* ') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::TestIamPermissionsResponse >` | the result of the RPC. The response message type ([google.iam.v1.TestIamPermissionsResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L153)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const \&, Options)

Tests whether the caller has the specified permissions on a [ServiceAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L493).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::v1::TestIamPermissionsRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.v1.TestIamPermissionsRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L137). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::TestIamPermissionsResponse >` | the result of the RPC. The response message type ([google.iam.v1.TestIamPermissionsResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L153)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### QueryGrantableRoles(std::string const \&, Options)

Lists roles that can be granted on a Google Cloud resource.
A role is grantable if the IAM policy for the resource can contain bindings to the role.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `full_resource_name` | `std::string const &` Required. The full resource name to query from the list of grantable roles. The name follows the Google Cloud Platform resource format. For example, a Cloud Platform project with id `my-project` will be named `//cloudresourcemanager.googleapis.com/projects/my-project`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::iam::admin::v1::Role >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.iam.admin.v1.Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### QueryGrantableRoles(google::iam::admin::v1::QueryGrantableRolesRequest, Options)

Lists roles that can be granted on a Google Cloud resource.
A role is grantable if the IAM policy for the resource can contain bindings to the role.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::QueryGrantableRolesRequest` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.QueryGrantableRolesRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1128). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::iam::admin::v1::Role >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.iam.admin.v1.Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### ListRoles(google::iam::admin::v1::ListRolesRequest, Options)

Lists every predefined [Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070) that IAM supports, or every custom role that is defined for an organization or project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::ListRolesRequest` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.ListRolesRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1169). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::iam::admin::v1::Role >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.iam.admin.v1.Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### GetRole(google::iam::admin::v1::GetRoleRequest const \&, Options)

Gets the definition of a [Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::GetRoleRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.GetRoleRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1233). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::Role >` | the result of the RPC. The response message type ([google.iam.admin.v1.Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateRole(google::iam::admin::v1::CreateRoleRequest const \&, Options)

Creates a new custom [Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::CreateRoleRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.CreateRoleRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1271). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::Role >` | the result of the RPC. The response message type ([google.iam.admin.v1.Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateRole(google::iam::admin::v1::UpdateRoleRequest const \&, Options)

Updates the definition of a custom [Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::UpdateRoleRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.UpdateRoleRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1311). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::Role >` | the result of the RPC. The response message type ([google.iam.admin.v1.Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### DeleteRole(google::iam::admin::v1::DeleteRoleRequest const \&, Options)

Deletes a custom [Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070).
When you delete a custom role, the following changes occur immediately:

- You cannot bind a principal to the custom role in an IAM [Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102).
- Existing bindings to the custom role are not changed, but they have no effect.
- By default, the response from [ListRoles](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L359) does not include the custom role.

You have 7 days to undelete the custom role. After 7 days, the following changes occur:

- The custom role is permanently deleted and cannot be recovered.
- If an IAM policy contains a binding to the custom role, the binding is permanently removed.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::DeleteRoleRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.DeleteRoleRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1347). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::Role >` | the result of the RPC. The response message type ([google.iam.admin.v1.Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UndeleteRole(google::iam::admin::v1::UndeleteRoleRequest const \&, Options)

Undeletes a custom [Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::UndeleteRoleRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.UndeleteRoleRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1380). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::Role >` | the result of the RPC. The response message type ([google.iam.admin.v1.Role](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1070)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### QueryTestablePermissions(google::iam::admin::v1::QueryTestablePermissionsRequest, Options)

Lists every permission that you can test on a resource.
A permission is testable if you can check whether a principal has that permission on the resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::QueryTestablePermissionsRequest` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.QueryTestablePermissionsRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1468). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::iam::admin::v1::Permission >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.iam.admin.v1.Permission](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1413), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### QueryAuditableServices(google::iam::admin::v1::QueryAuditableServicesRequest const \&, Options)

Returns a list of services that allow you to opt into audit logs that are not generated by default.
To learn more about audit logs, see the [Logging documentation](https://cloud.google.com/logging/docs/audit).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::QueryAuditableServicesRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.QueryAuditableServicesRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1498). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::QueryAuditableServicesResponse >` | the result of the RPC. The response message type ([google.iam.admin.v1.QueryAuditableServicesResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1509)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### LintPolicy(google::iam::admin::v1::LintPolicyRequest const \&, Options)

Lints, or validates, an IAM policy.
Currently checks the [google.iam.v1.Binding.condition](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L224) field, which contains a condition expression for a role binding.

Successful calls to this method always return an HTTP `200 OK` status code, even if the linter detects an issue in the IAM policy.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::admin::v1::LintPolicyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.admin.v1.LintPolicyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1522). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::admin::v1::LintPolicyResponse >` | the result of the RPC. The response message type ([google.iam.admin.v1.LintPolicyResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/admin/v1/iam.proto#L1620)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |