public sealed class IAMClientImpl : IAMClientReference documentation and code samples for the Identity and Access Management (IAM) v1 API class IAMClientImpl.
IAM client wrapper implementation, for convenient use.
Namespace
Google.Cloud.Iam.Admin.V1Assembly
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 | |
|---|---|
| Name | Description |
grpcClient |
IAMIAMClientThe underlying gRPC client. |
settings |
IAMSettingsThe base IAMSettings used within this client. |
logger |
ILoggerOptional ILogger to use within this client. |
Properties
GrpcClient
public override IAM.IAMClient GrpcClient { get; }The underlying gRPC IAM client
| Property Value | |
|---|---|
| Type | Description |
IAMIAMClient |
|
Methods
CreateRole(CreateRoleRequest, CallSettings)
public override Role CreateRole(CreateRoleRequest request, CallSettings callSettings = null)Creates a new custom [Role][google.iam.admin.v1.Role].
| Parameters | |
|---|---|
| Name | Description |
request |
CreateRoleRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Role |
The RPC response. |
CreateRoleAsync(CreateRoleRequest, CallSettings)
public override Task<Role> CreateRoleAsync(CreateRoleRequest request, CallSettings callSettings = null)Creates a new custom [Role][google.iam.admin.v1.Role].
| Parameters | |
|---|---|
| Name | Description |
request |
CreateRoleRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskRole |
A Task containing the RPC response. |
CreateServiceAccount(CreateServiceAccountRequest, CallSettings)
public override ServiceAccount CreateServiceAccount(CreateServiceAccountRequest request, CallSettings callSettings = null)Creates a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
| Parameters | |
|---|---|
| Name | Description |
request |
CreateServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ServiceAccount |
The RPC response. |
CreateServiceAccountAsync(CreateServiceAccountRequest, CallSettings)
public override Task<ServiceAccount> CreateServiceAccountAsync(CreateServiceAccountRequest request, CallSettings callSettings = null)Creates a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
| Parameters | |
|---|---|
| Name | Description |
request |
CreateServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskServiceAccount |
A Task containing the RPC response. |
CreateServiceAccountKey(CreateServiceAccountKeyRequest, CallSettings)
public override ServiceAccountKey CreateServiceAccountKey(CreateServiceAccountKeyRequest request, CallSettings callSettings = null)Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
| Parameters | |
|---|---|
| Name | Description |
request |
CreateServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ServiceAccountKey |
The RPC response. |
CreateServiceAccountKeyAsync(CreateServiceAccountKeyRequest, CallSettings)
public override Task<ServiceAccountKey> CreateServiceAccountKeyAsync(CreateServiceAccountKeyRequest request, CallSettings callSettings = null)Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
| Parameters | |
|---|---|
| Name | Description |
request |
CreateServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskServiceAccountKey |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
DeleteRoleRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Role |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
DeleteRoleRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskRole |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
DeleteServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
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 | |
|---|---|
| Name | Description |
request |
DeleteServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
DeleteServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
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 | |
|---|---|
| Name | Description |
request |
DeleteServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
DisableServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
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 | |
|---|---|
| Name | Description |
request |
DisableServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
DisableServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
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 | |
|---|---|
| Name | Description |
request |
DisableServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
EnableServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
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 | |
|---|---|
| Name | Description |
request |
EnableServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
EnableServiceAccountKey(EnableServiceAccountKeyRequest, CallSettings)
public override void EnableServiceAccountKey(EnableServiceAccountKeyRequest request, CallSettings callSettings = null)Enable a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
| Parameters | |
|---|---|
| Name | Description |
request |
EnableServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
EnableServiceAccountKeyAsync(EnableServiceAccountKeyRequest, CallSettings)
public override Task EnableServiceAccountKeyAsync(EnableServiceAccountKeyRequest request, CallSettings callSettings = null)Enable a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
| Parameters | |
|---|---|
| Name | Description |
request |
EnableServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
GetIamPolicyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Policy |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
GetIamPolicyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskPolicy |
A Task containing the RPC response. |
GetRole(GetRoleRequest, CallSettings)
public override Role GetRole(GetRoleRequest request, CallSettings callSettings = null)Gets the definition of a [Role][google.iam.admin.v1.Role].
| Parameters | |
|---|---|
| Name | Description |
request |
GetRoleRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Role |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
GetRoleRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskRole |
A Task containing the RPC response. |
GetServiceAccount(GetServiceAccountRequest, CallSettings)
public override ServiceAccount GetServiceAccount(GetServiceAccountRequest request, CallSettings callSettings = null)Gets a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
| Parameters | |
|---|---|
| Name | Description |
request |
GetServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ServiceAccount |
The RPC response. |
GetServiceAccountAsync(GetServiceAccountRequest, CallSettings)
public override Task<ServiceAccount> GetServiceAccountAsync(GetServiceAccountRequest request, CallSettings callSettings = null)Gets a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
| Parameters | |
|---|---|
| Name | Description |
request |
GetServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskServiceAccount |
A Task containing the RPC response. |
GetServiceAccountKey(GetServiceAccountKeyRequest, CallSettings)
public override ServiceAccountKey GetServiceAccountKey(GetServiceAccountKeyRequest request, CallSettings callSettings = null)Gets a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
| Parameters | |
|---|---|
| Name | Description |
request |
GetServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ServiceAccountKey |
The RPC response. |
GetServiceAccountKeyAsync(GetServiceAccountKeyRequest, CallSettings)
public override Task<ServiceAccountKey> GetServiceAccountKeyAsync(GetServiceAccountKeyRequest request, CallSettings callSettings = null)Gets a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
| Parameters | |
|---|---|
| Name | Description |
request |
GetServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskServiceAccountKey |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
LintPolicyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
LintPolicyResponse |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
LintPolicyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskLintPolicyResponse |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
ListRolesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListRolesResponseRole |
A pageable sequence of Role resources. |
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 | |
|---|---|
| Name | Description |
request |
ListRolesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListRolesResponseRole |
A pageable asynchronous sequence of Role resources. |
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 | |
|---|---|
| Name | Description |
request |
ListServiceAccountKeysRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ListServiceAccountKeysResponse |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
ListServiceAccountKeysRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskListServiceAccountKeysResponse |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
ListServiceAccountsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListServiceAccountsResponseServiceAccount |
A pageable sequence of ServiceAccount resources. |
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 | |
|---|---|
| Name | Description |
request |
ListServiceAccountsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListServiceAccountsResponseServiceAccount |
A pageable asynchronous sequence of ServiceAccount resources. |
PatchServiceAccount(PatchServiceAccountRequest, CallSettings)
public override ServiceAccount PatchServiceAccount(PatchServiceAccountRequest request, CallSettings callSettings = null)Patches a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
| Parameters | |
|---|---|
| Name | Description |
request |
PatchServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ServiceAccount |
The RPC response. |
PatchServiceAccountAsync(PatchServiceAccountRequest, CallSettings)
public override Task<ServiceAccount> PatchServiceAccountAsync(PatchServiceAccountRequest request, CallSettings callSettings = null)Patches a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
| Parameters | |
|---|---|
| Name | Description |
request |
PatchServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskServiceAccount |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
QueryAuditableServicesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
QueryAuditableServicesResponse |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
QueryAuditableServicesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskQueryAuditableServicesResponse |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
QueryGrantableRolesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableQueryGrantableRolesResponseRole |
A pageable sequence of Role resources. |
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 | |
|---|---|
| Name | Description |
request |
QueryGrantableRolesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableQueryGrantableRolesResponseRole |
A pageable asynchronous sequence of Role resources. |
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 | |
|---|---|
| Name | Description |
request |
QueryTestablePermissionsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableQueryTestablePermissionsResponsePermission |
A pageable sequence of Permission resources. |
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 | |
|---|---|
| Name | Description |
request |
QueryTestablePermissionsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableQueryTestablePermissionsResponsePermission |
A pageable asynchronous sequence of Permission resources. |
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:
- Call the resource's
getIamPolicymethod to get its current IAM policy. - Edit the policy so that it binds the service account to an IAM role for the resource.
- Call the resource's
setIamPolicymethod to update its IAM policy.
For detailed instructions, see Manage access to project, folders, and organizations or Manage access to other resources.
| Parameters | |
|---|---|
| Name | Description |
request |
SetIamPolicyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Policy |
The RPC response. |
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:
- Call the resource's
getIamPolicymethod to get its current IAM policy. - Edit the policy so that it binds the service account to an IAM role for the resource.
- Call the resource's
setIamPolicymethod to update its IAM policy.
For detailed instructions, see Manage access to project, folders, and organizations or Manage access to other resources.
| Parameters | |
|---|---|
| Name | Description |
request |
SetIamPolicyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskPolicy |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
SignBlobRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
SignBlobResponse |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
SignBlobRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskSignBlobResponse |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
SignJwtRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
SignJwtResponse |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
SignJwtRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskSignJwtResponse |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
TestIamPermissionsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TestIamPermissionsResponse |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
TestIamPermissionsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskTestIamPermissionsResponse |
A Task containing the RPC response. |
UndeleteRole(UndeleteRoleRequest, CallSettings)
public override Role UndeleteRole(UndeleteRoleRequest request, CallSettings callSettings = null)Undeletes a custom [Role][google.iam.admin.v1.Role].
| Parameters | |
|---|---|
| Name | Description |
request |
UndeleteRoleRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Role |
The RPC response. |
UndeleteRoleAsync(UndeleteRoleRequest, CallSettings)
public override Task<Role> UndeleteRoleAsync(UndeleteRoleRequest request, CallSettings callSettings = null)Undeletes a custom [Role][google.iam.admin.v1.Role].
| Parameters | |
|---|---|
| Name | Description |
request |
UndeleteRoleRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskRole |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
UndeleteServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
UndeleteServiceAccountResponse |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
UndeleteServiceAccountRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskUndeleteServiceAccountResponse |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
UpdateRoleRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Role |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
UpdateRoleRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskRole |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
ServiceAccountThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ServiceAccount |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
ServiceAccountThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskServiceAccount |
A Task containing the RPC response. |
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 | |
|---|---|
| Name | Description |
request |
UploadServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ServiceAccountKey |
The RPC response. |
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 | |
|---|---|
| Name | Description |
request |
UploadServiceAccountKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskServiceAccountKey |
A Task containing the RPC response. |