Identity and Access Management (IAM) v1 API - Class IAMClientImpl (2.3.0)

public sealed class IAMClientImpl : IAMClient

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

IAM client wrapper implementation, for convenient use.

Inheritance

object > IAMClient > IAMClientImpl

Namespace

Google.Cloud.Iam.Admin.V1

Assembly

Google.Cloud.Iam.Admin.V1.dll

Remarks

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.

Constructors

IAMClientImpl(IAMClient, IAMSettings, ILogger)

public IAMClientImpl(IAM.IAMClient grpcClient, IAMSettings settings, ILogger logger)

Constructs a client wrapper for the IAM service, with the specified gRPC client and settings.

Parameters
NameDescription
grpcClientIAMIAMClient

The underlying gRPC client.

settingsIAMSettings

The base IAMSettings used within this client.

loggerILogger

Optional ILogger to use within this client.

Properties

GrpcClient

public override IAM.IAMClient GrpcClient { get; }

The underlying gRPC IAM client

Property Value
TypeDescription
IAMIAMClient
Overrides

Methods

CreateRole(CreateRoleRequest, CallSettings)

public override Role CreateRole(CreateRoleRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestCreateRoleRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Role

The RPC response.

Overrides

CreateRoleAsync(CreateRoleRequest, CallSettings)

public override Task<Role> CreateRoleAsync(CreateRoleRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestCreateRoleRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskRole

A Task containing the RPC response.

Overrides

CreateServiceAccount(CreateServiceAccountRequest, CallSettings)

public override ServiceAccount CreateServiceAccount(CreateServiceAccountRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestCreateServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServiceAccount

The RPC response.

Overrides

CreateServiceAccountAsync(CreateServiceAccountRequest, CallSettings)

public override Task<ServiceAccount> CreateServiceAccountAsync(CreateServiceAccountRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestCreateServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskServiceAccount

A Task containing the RPC response.

Overrides

CreateServiceAccountKey(CreateServiceAccountKeyRequest, CallSettings)

public override ServiceAccountKey CreateServiceAccountKey(CreateServiceAccountKeyRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestCreateServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServiceAccountKey

The RPC response.

Overrides

CreateServiceAccountKeyAsync(CreateServiceAccountKeyRequest, CallSettings)

public override Task<ServiceAccountKey> CreateServiceAccountKeyAsync(CreateServiceAccountKeyRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestCreateServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskServiceAccountKey

A Task containing the RPC response.

Overrides

DeleteRole(DeleteRoleRequest, CallSettings)

public override Role DeleteRole(DeleteRoleRequest request, CallSettings callSettings = null)

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
NameDescription
requestDeleteRoleRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Role

The RPC response.

Overrides

DeleteRoleAsync(DeleteRoleRequest, CallSettings)

public override Task<Role> DeleteRoleAsync(DeleteRoleRequest request, CallSettings callSettings = null)

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
NameDescription
requestDeleteRoleRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskRole

A Task containing the RPC response.

Overrides

DeleteServiceAccount(DeleteServiceAccountRequest, CallSettings)

public override void DeleteServiceAccount(DeleteServiceAccountRequest request, CallSettings callSettings = null)

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
NameDescription
requestDeleteServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Overrides

DeleteServiceAccountAsync(DeleteServiceAccountRequest, CallSettings)

public override Task DeleteServiceAccountAsync(DeleteServiceAccountRequest request, CallSettings callSettings = null)

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
NameDescription
requestDeleteServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Overrides

DeleteServiceAccountKey(DeleteServiceAccountKeyRequest, CallSettings)

public override void DeleteServiceAccountKey(DeleteServiceAccountKeyRequest request, CallSettings callSettings = null)

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
NameDescription
requestDeleteServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Overrides

DeleteServiceAccountKeyAsync(DeleteServiceAccountKeyRequest, CallSettings)

public override Task DeleteServiceAccountKeyAsync(DeleteServiceAccountKeyRequest request, CallSettings callSettings = null)

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
NameDescription
requestDeleteServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Overrides

DisableServiceAccount(DisableServiceAccountRequest, CallSettings)

public override void DisableServiceAccount(DisableServiceAccountRequest request, CallSettings callSettings = null)

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
NameDescription
requestDisableServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Overrides

DisableServiceAccountAsync(DisableServiceAccountRequest, CallSettings)

public override Task DisableServiceAccountAsync(DisableServiceAccountRequest request, CallSettings callSettings = null)

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
NameDescription
requestDisableServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Overrides

DisableServiceAccountKey(DisableServiceAccountKeyRequest, CallSettings)

public override void DisableServiceAccountKey(DisableServiceAccountKeyRequest request, CallSettings callSettings = null)

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
NameDescription
requestDisableServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Overrides

DisableServiceAccountKeyAsync(DisableServiceAccountKeyRequest, CallSettings)

public override Task DisableServiceAccountKeyAsync(DisableServiceAccountKeyRequest request, CallSettings callSettings = null)

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
NameDescription
requestDisableServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Overrides

EnableServiceAccount(EnableServiceAccountRequest, CallSettings)

public override void EnableServiceAccount(EnableServiceAccountRequest request, CallSettings callSettings = null)

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
NameDescription
requestEnableServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Overrides

EnableServiceAccountAsync(EnableServiceAccountRequest, CallSettings)

public override Task EnableServiceAccountAsync(EnableServiceAccountRequest request, CallSettings callSettings = null)

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
NameDescription
requestEnableServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Overrides

EnableServiceAccountKey(EnableServiceAccountKeyRequest, CallSettings)

public override void EnableServiceAccountKey(EnableServiceAccountKeyRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestEnableServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Overrides

EnableServiceAccountKeyAsync(EnableServiceAccountKeyRequest, CallSettings)

public override Task EnableServiceAccountKeyAsync(EnableServiceAccountKeyRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestEnableServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Overrides

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public override Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

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 method.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Overrides

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public override Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

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 method.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Overrides

GetRole(GetRoleRequest, CallSettings)

public override Role GetRole(GetRoleRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetRoleRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Role

The RPC response.

Overrides

GetRoleAsync(GetRoleRequest, CallSettings)

public override Task<Role> GetRoleAsync(GetRoleRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetRoleRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskRole

A Task containing the RPC response.

Overrides

GetServiceAccount(GetServiceAccountRequest, CallSettings)

public override ServiceAccount GetServiceAccount(GetServiceAccountRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServiceAccount

The RPC response.

Overrides

GetServiceAccountAsync(GetServiceAccountRequest, CallSettings)

public override Task<ServiceAccount> GetServiceAccountAsync(GetServiceAccountRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskServiceAccount

A Task containing the RPC response.

Overrides

GetServiceAccountKey(GetServiceAccountKeyRequest, CallSettings)

public override ServiceAccountKey GetServiceAccountKey(GetServiceAccountKeyRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServiceAccountKey

The RPC response.

Overrides

GetServiceAccountKeyAsync(GetServiceAccountKeyRequest, CallSettings)

public override Task<ServiceAccountKey> GetServiceAccountKeyAsync(GetServiceAccountKeyRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskServiceAccountKey

A Task containing the RPC response.

Overrides

LintPolicy(LintPolicyRequest, CallSettings)

public override LintPolicyResponse LintPolicy(LintPolicyRequest request, CallSettings callSettings = null)

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
NameDescription
requestLintPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
LintPolicyResponse

The RPC response.

Overrides

LintPolicyAsync(LintPolicyRequest, CallSettings)

public override Task<LintPolicyResponse> LintPolicyAsync(LintPolicyRequest request, CallSettings callSettings = null)

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
NameDescription
requestLintPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskLintPolicyResponse

A Task containing the RPC response.

Overrides

ListRoles(ListRolesRequest, CallSettings)

public override PagedEnumerable<ListRolesResponse, Role> ListRoles(ListRolesRequest request, CallSettings callSettings = null)

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
NameDescription
requestListRolesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListRolesResponseRole

A pageable sequence of Role resources.

Overrides

ListRolesAsync(ListRolesRequest, CallSettings)

public override PagedAsyncEnumerable<ListRolesResponse, Role> ListRolesAsync(ListRolesRequest request, CallSettings callSettings = null)

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
NameDescription
requestListRolesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListRolesResponseRole

A pageable asynchronous sequence of Role resources.

Overrides

ListServiceAccountKeys(ListServiceAccountKeysRequest, CallSettings)

public override ListServiceAccountKeysResponse ListServiceAccountKeys(ListServiceAccountKeysRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListServiceAccountKeysRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ListServiceAccountKeysResponse

The RPC response.

Overrides

ListServiceAccountKeysAsync(ListServiceAccountKeysRequest, CallSettings)

public override Task<ListServiceAccountKeysResponse> ListServiceAccountKeysAsync(ListServiceAccountKeysRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListServiceAccountKeysRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskListServiceAccountKeysResponse

A Task containing the RPC response.

Overrides

ListServiceAccounts(ListServiceAccountsRequest, CallSettings)

public override PagedEnumerable<ListServiceAccountsResponse, ServiceAccount> ListServiceAccounts(ListServiceAccountsRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListServiceAccountsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListServiceAccountsResponseServiceAccount

A pageable sequence of ServiceAccount resources.

Overrides

ListServiceAccountsAsync(ListServiceAccountsRequest, CallSettings)

public override PagedAsyncEnumerable<ListServiceAccountsResponse, ServiceAccount> ListServiceAccountsAsync(ListServiceAccountsRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListServiceAccountsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListServiceAccountsResponseServiceAccount

A pageable asynchronous sequence of ServiceAccount resources.

Overrides

PatchServiceAccount(PatchServiceAccountRequest, CallSettings)

public override ServiceAccount PatchServiceAccount(PatchServiceAccountRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestPatchServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServiceAccount

The RPC response.

Overrides

PatchServiceAccountAsync(PatchServiceAccountRequest, CallSettings)

public override Task<ServiceAccount> PatchServiceAccountAsync(PatchServiceAccountRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestPatchServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskServiceAccount

A Task containing the RPC response.

Overrides

QueryAuditableServices(QueryAuditableServicesRequest, CallSettings)

public override QueryAuditableServicesResponse QueryAuditableServices(QueryAuditableServicesRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestQueryAuditableServicesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
QueryAuditableServicesResponse

The RPC response.

Overrides

QueryAuditableServicesAsync(QueryAuditableServicesRequest, CallSettings)

public override Task<QueryAuditableServicesResponse> QueryAuditableServicesAsync(QueryAuditableServicesRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestQueryAuditableServicesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueryAuditableServicesResponse

A Task containing the RPC response.

Overrides

QueryGrantableRoles(QueryGrantableRolesRequest, CallSettings)

public override PagedEnumerable<QueryGrantableRolesResponse, Role> QueryGrantableRoles(QueryGrantableRolesRequest request, CallSettings callSettings = null)

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
NameDescription
requestQueryGrantableRolesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableQueryGrantableRolesResponseRole

A pageable sequence of Role resources.

Overrides

QueryGrantableRolesAsync(QueryGrantableRolesRequest, CallSettings)

public override PagedAsyncEnumerable<QueryGrantableRolesResponse, Role> QueryGrantableRolesAsync(QueryGrantableRolesRequest request, CallSettings callSettings = null)

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
NameDescription
requestQueryGrantableRolesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableQueryGrantableRolesResponseRole

A pageable asynchronous sequence of Role resources.

Overrides

QueryTestablePermissions(QueryTestablePermissionsRequest, CallSettings)

public override PagedEnumerable<QueryTestablePermissionsResponse, Permission> QueryTestablePermissions(QueryTestablePermissionsRequest request, CallSettings callSettings = null)

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
NameDescription
requestQueryTestablePermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableQueryTestablePermissionsResponsePermission

A pageable sequence of Permission resources.

Overrides

QueryTestablePermissionsAsync(QueryTestablePermissionsRequest, CallSettings)

public override PagedAsyncEnumerable<QueryTestablePermissionsResponse, Permission> QueryTestablePermissionsAsync(QueryTestablePermissionsRequest request, CallSettings callSettings = null)

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
NameDescription
requestQueryTestablePermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableQueryTestablePermissionsResponsePermission

A pageable asynchronous sequence of Permission resources.

Overrides

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public override Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

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 or Manage access to other resources.

Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Overrides

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public override Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

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 or Manage access to other resources.

Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Overrides

SignBlob(SignBlobRequest, CallSettings)

[Obsolete]
public override SignBlobResponse SignBlob(SignBlobRequest request, CallSettings callSettings = null)

Note: This method is deprecated. Use the signBlob method in the IAM Service Account Credentials API instead. If you currently use this method, see the migration guide for instructions.

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

Parameters
NameDescription
requestSignBlobRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SignBlobResponse

The RPC response.

Overrides

SignBlobAsync(SignBlobRequest, CallSettings)

[Obsolete]
public override Task<SignBlobResponse> SignBlobAsync(SignBlobRequest request, CallSettings callSettings = null)

Note: This method is deprecated. Use the signBlob method in the IAM Service Account Credentials API instead. If you currently use this method, see the migration guide for instructions.

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

Parameters
NameDescription
requestSignBlobRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSignBlobResponse

A Task containing the RPC response.

Overrides

SignJwt(SignJwtRequest, CallSettings)

[Obsolete]
public override SignJwtResponse SignJwt(SignJwtRequest request, CallSettings callSettings = null)

Note: This method is deprecated. Use the signJwt method in the IAM Service Account Credentials API instead. If you currently use this method, see the migration guide for instructions.

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

Parameters
NameDescription
requestSignJwtRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SignJwtResponse

The RPC response.

Overrides

SignJwtAsync(SignJwtRequest, CallSettings)

[Obsolete]
public override Task<SignJwtResponse> SignJwtAsync(SignJwtRequest request, CallSettings callSettings = null)

Note: This method is deprecated. Use the signJwt method in the IAM Service Account Credentials API instead. If you currently use this method, see the migration guide for instructions.

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

Parameters
NameDescription
requestSignJwtRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSignJwtResponse

A Task containing the RPC response.

Overrides

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public override TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Overrides

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public override Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Overrides

UndeleteRole(UndeleteRoleRequest, CallSettings)

public override Role UndeleteRole(UndeleteRoleRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestUndeleteRoleRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Role

The RPC response.

Overrides

UndeleteRoleAsync(UndeleteRoleRequest, CallSettings)

public override Task<Role> UndeleteRoleAsync(UndeleteRoleRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestUndeleteRoleRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskRole

A Task containing the RPC response.

Overrides

UndeleteServiceAccount(UndeleteServiceAccountRequest, CallSettings)

public override UndeleteServiceAccountResponse UndeleteServiceAccount(UndeleteServiceAccountRequest request, CallSettings callSettings = null)

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
NameDescription
requestUndeleteServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
UndeleteServiceAccountResponse

The RPC response.

Overrides

UndeleteServiceAccountAsync(UndeleteServiceAccountRequest, CallSettings)

public override Task<UndeleteServiceAccountResponse> UndeleteServiceAccountAsync(UndeleteServiceAccountRequest request, CallSettings callSettings = null)

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
NameDescription
requestUndeleteServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskUndeleteServiceAccountResponse

A Task containing the RPC response.

Overrides

UpdateRole(UpdateRoleRequest, CallSettings)

public override Role UpdateRole(UpdateRoleRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestUpdateRoleRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Role

The RPC response.

Overrides

UpdateRoleAsync(UpdateRoleRequest, CallSettings)

public override Task<Role> UpdateRoleAsync(UpdateRoleRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestUpdateRoleRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskRole

A Task containing the RPC response.

Overrides

UpdateServiceAccount(ServiceAccount, CallSettings)

public override ServiceAccount UpdateServiceAccount(ServiceAccount request, CallSettings callSettings = null)

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
NameDescription
requestServiceAccount

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServiceAccount

The RPC response.

Overrides

UpdateServiceAccountAsync(ServiceAccount, CallSettings)

public override Task<ServiceAccount> UpdateServiceAccountAsync(ServiceAccount request, CallSettings callSettings = null)

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
NameDescription
requestServiceAccount

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskServiceAccount

A Task containing the RPC response.

Overrides

UploadServiceAccountKey(UploadServiceAccountKeyRequest, CallSettings)

public override ServiceAccountKey UploadServiceAccountKey(UploadServiceAccountKeyRequest request, CallSettings callSettings = null)

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
NameDescription
requestUploadServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServiceAccountKey

The RPC response.

Overrides

UploadServiceAccountKeyAsync(UploadServiceAccountKeyRequest, CallSettings)

public override Task<ServiceAccountKey> UploadServiceAccountKeyAsync(UploadServiceAccountKeyRequest request, CallSettings callSettings = null)

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
NameDescription
requestUploadServiceAccountKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskServiceAccountKey

A Task containing the RPC response.

Overrides