# Identity and Access Management (IAM) v1 API - Class IAM.IAMBase (2.5.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.5.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.IAM.IAMBase)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/2.4.0/Google.Cloud.Iam.Admin.V1.IAM.IAMBase)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/2.3.0/Google.Cloud.Iam.Admin.V1.IAM.IAMBase)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/2.2.0/Google.Cloud.Iam.Admin.V1.IAM.IAMBase)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/2.1.0/Google.Cloud.Iam.Admin.V1.IAM.IAMBase)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/2.0.0/Google.Cloud.Iam.Admin.V1.IAM.IAMBase)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/1.2.0/Google.Cloud.Iam.Admin.V1.IAM.IAMBase)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/1.1.0/Google.Cloud.Iam.Admin.V1.IAM.IAMBase)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/1.0.0/Google.Cloud.Iam.Admin.V1.IAM.IAMBase)

    [BindServiceMethod(typeof(IAM), "BindService")]
    public abstract class IAM.IAMBase

Reference documentation and code samples for the Identity and Access Management (IAM) v1 API class IAM.IAMBase.

Base class for server-side implementations of IAM

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> IAM.IAMBase

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Iam.Admin.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1)

## Assembly

Google.Cloud.Iam.Admin.V1.dll

## Methods

### CreateRole(CreateRoleRequest, ServerCallContext)

    public virtual Task<Role> CreateRole(CreateRoleRequest request, ServerCallContext context)

Creates a new custom \[Role\]\[google.iam.admin.v1.Role\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.CreateRoleRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.Role` | The response to send back to the client (wrapped by a task). |

### CreateServiceAccount(CreateServiceAccountRequest, ServerCallContext)

    public virtual Task<ServiceAccount> CreateServiceAccount(CreateServiceAccountRequest request, ServerCallContext context)

Creates a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.CreateServiceAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ServiceAccount` | The response to send back to the client (wrapped by a task). |

### CreateServiceAccountKey(CreateServiceAccountKeyRequest, ServerCallContext)

    public virtual Task<ServiceAccountKey> CreateServiceAccountKey(CreateServiceAccountKeyRequest request, ServerCallContext context)

Creates a \[ServiceAccountKey\]\[google.iam.admin.v1.ServiceAccountKey\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.CreateServiceAccountKeyRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ServiceAccountKey` | The response to send back to the client (wrapped by a task). |

### DeleteRole(DeleteRoleRequest, ServerCallContext)

    public virtual Task<Role> DeleteRole(DeleteRoleRequest request, ServerCallContext context)

Deletes a custom \[Role\]\[google.iam.admin.v1.Role\].

When you delete a custom role, the following changes occur immediately:

- You cannot bind a principal to the custom role in an IAM \[Policy\]\[google.iam.v1.Policy\].
- Existing bindings to the custom role are not changed, but they have no effect.
- By default, the response from \[ListRoles\]\[google.iam.admin.v1.IAM.ListRoles\] 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.DeleteRoleRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.Role` | The response to send back to the client (wrapped by a task). |

### DeleteServiceAccount(DeleteServiceAccountRequest, ServerCallContext)

    public virtual Task<Empty> DeleteServiceAccount(DeleteServiceAccountRequest request, ServerCallContext context)

Deletes a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

**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\]\[google.iam.admin.v1.IAM.DisableServiceAccount\] 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\]\[google.iam.admin.v1.IAM.DisableServiceAccount\] 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.DeleteServiceAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Empty.html` | The response to send back to the client (wrapped by a task). |

### DeleteServiceAccountKey(DeleteServiceAccountKeyRequest, ServerCallContext)

    public virtual Task<Empty> DeleteServiceAccountKey(DeleteServiceAccountKeyRequest request, ServerCallContext context)

Deletes a \[ServiceAccountKey\]\[google.iam.admin.v1.ServiceAccountKey\]. 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.DeleteServiceAccountKeyRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Empty.html` | The response to send back to the client (wrapped by a task). |

### DisableServiceAccount(DisableServiceAccountRequest, ServerCallContext)

    public virtual Task<Empty> DisableServiceAccount(DisableServiceAccountRequest request, ServerCallContext context)

Disables a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\] 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\]\[google.iam.admin.v1.IAM.EnableServiceAccount\]. 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\]\[google.iam.admin.v1.IAM.DeleteServiceAccount\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.DisableServiceAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Empty.html` | The response to send back to the client (wrapped by a task). |

### DisableServiceAccountKey(DisableServiceAccountKeyRequest, ServerCallContext)

    public virtual Task<Empty> DisableServiceAccountKey(DisableServiceAccountKeyRequest request, ServerCallContext context)

Disable a \[ServiceAccountKey\]\[google.iam.admin.v1.ServiceAccountKey\]. A disabled service account key can be
re-enabled with \[EnableServiceAccountKey\]\[google.iam.admin.v1.IAM.EnableServiceAccountKey\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.DisableServiceAccountKeyRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Empty.html` | The response to send back to the client (wrapped by a task). |

### EnableServiceAccount(EnableServiceAccountRequest, ServerCallContext)

    public virtual Task<Empty> EnableServiceAccount(EnableServiceAccountRequest request, ServerCallContext context)

Enables a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\] that was disabled by
\[DisableServiceAccount\]\[google.iam.admin.v1.IAM.DisableServiceAccount\].

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.EnableServiceAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Empty.html` | The response to send back to the client (wrapped by a task). |

### EnableServiceAccountKey(EnableServiceAccountKeyRequest, ServerCallContext)

    public virtual Task<Empty> EnableServiceAccountKey(EnableServiceAccountKeyRequest request, ServerCallContext context)

Enable a \[ServiceAccountKey\]\[google.iam.admin.v1.ServiceAccountKey\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.EnableServiceAccountKeyRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Empty.html` | The response to send back to the client (wrapped by a task). |

### GetIamPolicy(GetIamPolicyRequest, ServerCallContext)

    public virtual Task<Policy> GetIamPolicy(GetIamPolicyRequest request, ServerCallContext context)

Gets the IAM policy that is attached to a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\]. 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.GetIamPolicyRequest.html` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.Policy.html` | The response to send back to the client (wrapped by a task). |

### GetRole(GetRoleRequest, ServerCallContext)

    public virtual Task<Role> GetRole(GetRoleRequest request, ServerCallContext context)

Gets the definition of a \[Role\]\[google.iam.admin.v1.Role\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.GetRoleRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.Role` | The response to send back to the client (wrapped by a task). |

### GetServiceAccount(GetServiceAccountRequest, ServerCallContext)

    public virtual Task<ServiceAccount> GetServiceAccount(GetServiceAccountRequest request, ServerCallContext context)

Gets a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.GetServiceAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ServiceAccount` | The response to send back to the client (wrapped by a task). |

### GetServiceAccountKey(GetServiceAccountKeyRequest, ServerCallContext)

    public virtual Task<ServiceAccountKey> GetServiceAccountKey(GetServiceAccountKeyRequest request, ServerCallContext context)

Gets a \[ServiceAccountKey\]\[google.iam.admin.v1.ServiceAccountKey\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.GetServiceAccountKeyRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ServiceAccountKey` | The response to send back to the client (wrapped by a task). |

### LintPolicy(LintPolicyRequest, ServerCallContext)

    public virtual Task<LintPolicyResponse> LintPolicy(LintPolicyRequest request, ServerCallContext context)

Lints, or validates, an IAM policy. Currently checks the
\[google.iam.v1.Binding.condition\]\[google.iam.v1.Binding.condition\] 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.LintPolicyRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.LintPolicyResponse` | The response to send back to the client (wrapped by a task). |

### ListRoles(ListRolesRequest, ServerCallContext)

    public virtual Task<ListRolesResponse> ListRoles(ListRolesRequest request, ServerCallContext context)

Lists every predefined \[Role\]\[google.iam.admin.v1.Role\] that IAM supports, or every custom role
that is defined for an organization or project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ListRolesRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ListRolesResponse` | The response to send back to the client (wrapped by a task). |

### ListServiceAccountKeys(ListServiceAccountKeysRequest, ServerCallContext)

    public virtual Task<ListServiceAccountKeysResponse> ListServiceAccountKeys(ListServiceAccountKeysRequest request, ServerCallContext context)

Lists every \[ServiceAccountKey\]\[google.iam.admin.v1.ServiceAccountKey\] for a service account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ListServiceAccountKeysRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ListServiceAccountKeysResponse` | The response to send back to the client (wrapped by a task). |

### ListServiceAccounts(ListServiceAccountsRequest, ServerCallContext)

    public virtual Task<ListServiceAccountsResponse> ListServiceAccounts(ListServiceAccountsRequest request, ServerCallContext context)

Lists every \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\] that belongs to a specific project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ListServiceAccountsRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ListServiceAccountsResponse` | The response to send back to the client (wrapped by a task). |

### PatchServiceAccount(PatchServiceAccountRequest, ServerCallContext)

    public virtual Task<ServiceAccount> PatchServiceAccount(PatchServiceAccountRequest request, ServerCallContext context)

Patches a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.PatchServiceAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ServiceAccount` | The response to send back to the client (wrapped by a task). |

### QueryAuditableServices(QueryAuditableServicesRequest, ServerCallContext)

    public virtual Task<QueryAuditableServicesResponse> QueryAuditableServices(QueryAuditableServicesRequest request, ServerCallContext context)

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.QueryAuditableServicesRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.QueryAuditableServicesResponse` | The response to send back to the client (wrapped by a task). |

### QueryGrantableRoles(QueryGrantableRolesRequest, ServerCallContext)

    public virtual Task<QueryGrantableRolesResponse> QueryGrantableRoles(QueryGrantableRolesRequest request, ServerCallContext context)

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.QueryGrantableRolesRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.QueryGrantableRolesResponse` | The response to send back to the client (wrapped by a task). |

### QueryTestablePermissions(QueryTestablePermissionsRequest, ServerCallContext)

    public virtual Task<QueryTestablePermissionsResponse> QueryTestablePermissions(QueryTestablePermissionsRequest request, ServerCallContext context)

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.QueryTestablePermissionsRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.QueryTestablePermissionsResponse` | The response to send back to the client (wrapped by a task). |

### SetIamPolicy(SetIamPolicyRequest, ServerCallContext)

    public virtual Task<Policy> SetIamPolicy(SetIamPolicyRequest request, ServerCallContext context)

Sets the IAM policy that is attached to a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.SetIamPolicyRequest.html` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.Policy.html` | The response to send back to the client (wrapped by a task). |

### SignBlob(SignBlobRequest, ServerCallContext)

    [Obsolete]
    public virtual Task<SignBlobResponse> SignBlob(SignBlobRequest request, ServerCallContext context)

**Note:** This method is deprecated. Use the
[`signBlob`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signBlob)
method in the IAM Service Account Credentials API instead. If you currently
use this method, see the [migration
guide](https://cloud.google.com/iam/help/credentials/migrate-api) for
instructions.

Signs a blob using the system-managed private key for a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.SignBlobRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.SignBlobResponse` | The response to send back to the client (wrapped by a task). |

### SignJwt(SignJwtRequest, ServerCallContext)

    [Obsolete]
    public virtual Task<SignJwtResponse> SignJwt(SignJwtRequest request, ServerCallContext context)

**Note:** This method is deprecated. Use the
[`signJwt`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signJwt)
method in the IAM Service Account Credentials API instead. If you currently
use this method, see the [migration
guide](https://cloud.google.com/iam/help/credentials/migrate-api) for
instructions.

Signs a JSON Web Token (JWT) using the system-managed private key for a
\[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.SignJwtRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.SignJwtResponse` | The response to send back to the client (wrapped by a task). |

### TestIamPermissions(TestIamPermissionsRequest, ServerCallContext)

    public virtual Task<TestIamPermissionsResponse> TestIamPermissions(TestIamPermissionsRequest request, ServerCallContext context)

Tests whether the caller has the specified permissions on a
\[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.TestIamPermissionsRequest.html` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.TestIamPermissionsResponse.html` | The response to send back to the client (wrapped by a task). |

### UndeleteRole(UndeleteRoleRequest, ServerCallContext)

    public virtual Task<Role> UndeleteRole(UndeleteRoleRequest request, ServerCallContext context)

Undeletes a custom \[Role\]\[google.iam.admin.v1.Role\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.UndeleteRoleRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.Role` | The response to send back to the client (wrapped by a task). |

### UndeleteServiceAccount(UndeleteServiceAccountRequest, ServerCallContext)

    public virtual Task<UndeleteServiceAccountResponse> UndeleteServiceAccount(UndeleteServiceAccountRequest request, ServerCallContext context)

Restores a deleted \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

**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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.UndeleteServiceAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.UndeleteServiceAccountResponse` | The response to send back to the client (wrapped by a task). |

### UpdateRole(UpdateRoleRequest, ServerCallContext)

    public virtual Task<Role> UpdateRole(UpdateRoleRequest request, ServerCallContext context)

Updates the definition of a custom \[Role\]\[google.iam.admin.v1.Role\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.UpdateRoleRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.Role` | The response to send back to the client (wrapped by a task). |

### UpdateServiceAccount(ServiceAccount, ServerCallContext)

    public virtual Task<ServiceAccount> UpdateServiceAccount(ServiceAccount request, ServerCallContext context)

**Note:** We are in the process of deprecating this method. Use
\[PatchServiceAccount\]\[google.iam.admin.v1.IAM.PatchServiceAccount\] instead.

Updates a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

You can update only the `display_name` field.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ServiceAccount` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ServiceAccount` | The response to send back to the client (wrapped by a task). |

### UploadServiceAccountKey(UploadServiceAccountKeyRequest, ServerCallContext)

    public virtual Task<ServiceAccountKey> UploadServiceAccountKey(UploadServiceAccountKeyRequest request, ServerCallContext context)

Uploads the public key portion of a key pair that you manage, and
associates the public key with a \[ServiceAccount\]\[google.iam.admin.v1.ServiceAccount\].

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.UploadServiceAccountKeyRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.ServiceAccountKey` | The response to send back to the client (wrapped by a task). |