Class IAMClientImpl (1.1.0)

public sealed class IAMClientImpl : IAMClient

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 member has for the service account
  • IAM custom roles, which help you limit the number of permissions that you grant to members

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

Constructors

IAMClientImpl(IAM.IAMClient, IAMSettings)

public IAMClientImpl(IAM.IAMClient grpcClient, IAMSettings settings)

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

Parameters
NameDescription
grpcClientIAM.IAMClient

The underlying gRPC client.

settingsIAMSettings

The base IAMSettings used within this client.

Properties

GrpcClient

public override IAM.IAMClient GrpcClient { get; }

The underlying gRPC IAM client

Property Value
TypeDescription
IAM.IAMClient
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
Task<Role>

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
Task<ServiceAccount>

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
Task<ServiceAccountKey>

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 member 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 member 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
Task<Role>

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

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

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 members 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 members 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
Task<Policy>

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
Task<Role>

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
Task<ServiceAccount>

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
Task<ServiceAccountKey>

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
Task<LintPolicyResponse>

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
PagedEnumerable<ListRolesResponse, Role>

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
PagedAsyncEnumerable<ListRolesResponse, Role>

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
Task<ListServiceAccountKeysResponse>

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
PagedEnumerable<ListServiceAccountsResponse, ServiceAccount>

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
PagedAsyncEnumerable<ListServiceAccountsResponse, ServiceAccount>

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
Task<ServiceAccount>

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
Task<QueryAuditableServicesResponse>

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
PagedEnumerable<QueryGrantableRolesResponse, Role>

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
PagedAsyncEnumerable<QueryGrantableRolesResponse, Role>

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 member 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
PagedEnumerable<QueryTestablePermissionsResponse, Permission>

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 member 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
PagedAsyncEnumerable<QueryTestablePermissionsResponse, Permission>

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 member 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 Granting roles to a service account for specific 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 member 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 Granting roles to a service account for specific 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
Task<Policy>

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
Task<SignBlobResponse>

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
Task<SignJwtResponse>

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
Task<TestIamPermissionsResponse>

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
Task<Role>

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
Task<UndeleteServiceAccountResponse>

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
Task<Role>

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 and description fields.

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 and description fields.

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
Task<ServiceAccount>

A Task containing the RPC response.

Overrides

UploadServiceAccountKey(UploadServiceAccountKeyRequest, CallSettings)

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

Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey], using a public key that you provide.

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)

Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey], using a public key that you provide.

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
Task<ServiceAccountKey>

A Task containing the RPC response.

Overrides