Google Cloud Identity and Access Management (IAM) v2 API - Class PoliciesClientImpl (1.2.0)

public sealed class PoliciesClientImpl : PoliciesClient

Reference documentation and code samples for the Google Cloud Identity and Access Management (IAM) v2 API class PoliciesClientImpl.

Policies client wrapper implementation, for convenient use.

Inheritance

object > PoliciesClient > PoliciesClientImpl

Namespace

Google.Cloud.Iam.V2

Assembly

Google.Cloud.Iam.V2.dll

Remarks

An interface for managing Identity and Access Management (IAM) policies.

Constructors

PoliciesClientImpl(PoliciesClient, PoliciesSettings, ILogger)

public PoliciesClientImpl(Policies.PoliciesClient grpcClient, PoliciesSettings settings, ILogger logger)

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

Parameters
Name Description
grpcClient PoliciesPoliciesClient

The underlying gRPC client.

settings PoliciesSettings

The base PoliciesSettings used within this client.

logger ILogger

Optional ILogger to use within this client.

Properties

CreatePolicyOperationsClient

public override OperationsClient CreatePolicyOperationsClient { get; }

The long-running operations client for CreatePolicy.

Property Value
Type Description
OperationsClient
Overrides

DeletePolicyOperationsClient

public override OperationsClient DeletePolicyOperationsClient { get; }

The long-running operations client for DeletePolicy.

Property Value
Type Description
OperationsClient
Overrides

GrpcClient

public override Policies.PoliciesClient GrpcClient { get; }

The underlying gRPC Policies client

Property Value
Type Description
PoliciesPoliciesClient
Overrides

UpdatePolicyOperationsClient

public override OperationsClient UpdatePolicyOperationsClient { get; }

The long-running operations client for UpdatePolicy.

Property Value
Type Description
OperationsClient
Overrides

Methods

CreatePolicy(CreatePolicyRequest, CallSettings)

public override Operation<Policy, PolicyOperationMetadata> CreatePolicy(CreatePolicyRequest request, CallSettings callSettings = null)

Creates a policy.

Parameters
Name Description
request CreatePolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationPolicyPolicyOperationMetadata

The RPC response.

Overrides

CreatePolicyAsync(CreatePolicyRequest, CallSettings)

public override Task<Operation<Policy, PolicyOperationMetadata>> CreatePolicyAsync(CreatePolicyRequest request, CallSettings callSettings = null)

Creates a policy.

Parameters
Name Description
request CreatePolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationPolicyPolicyOperationMetadata

A Task containing the RPC response.

Overrides

DeletePolicy(DeletePolicyRequest, CallSettings)

public override Operation<Policy, PolicyOperationMetadata> DeletePolicy(DeletePolicyRequest request, CallSettings callSettings = null)

Deletes a policy. This action is permanent.

Parameters
Name Description
request DeletePolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationPolicyPolicyOperationMetadata

The RPC response.

Overrides

DeletePolicyAsync(DeletePolicyRequest, CallSettings)

public override Task<Operation<Policy, PolicyOperationMetadata>> DeletePolicyAsync(DeletePolicyRequest request, CallSettings callSettings = null)

Deletes a policy. This action is permanent.

Parameters
Name Description
request DeletePolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationPolicyPolicyOperationMetadata

A Task containing the RPC response.

Overrides

GetPolicy(GetPolicyRequest, CallSettings)

public override Policy GetPolicy(GetPolicyRequest request, CallSettings callSettings = null)

Gets a policy.

Parameters
Name Description
request GetPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Overrides

GetPolicyAsync(GetPolicyRequest, CallSettings)

public override Task<Policy> GetPolicyAsync(GetPolicyRequest request, CallSettings callSettings = null)

Gets a policy.

Parameters
Name Description
request GetPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Overrides

ListPolicies(ListPoliciesRequest, CallSettings)

public override PagedEnumerable<ListPoliciesResponse, Policy> ListPolicies(ListPoliciesRequest request, CallSettings callSettings = null)

Retrieves the policies of the specified kind that are attached to a resource.

The response lists only policy metadata. In particular, policy rules are omitted.

Parameters
Name Description
request ListPoliciesRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListPoliciesResponsePolicy

A pageable sequence of Policy resources.

Overrides

ListPoliciesAsync(ListPoliciesRequest, CallSettings)

public override PagedAsyncEnumerable<ListPoliciesResponse, Policy> ListPoliciesAsync(ListPoliciesRequest request, CallSettings callSettings = null)

Retrieves the policies of the specified kind that are attached to a resource.

The response lists only policy metadata. In particular, policy rules are omitted.

Parameters
Name Description
request ListPoliciesRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListPoliciesResponsePolicy

A pageable asynchronous sequence of Policy resources.

Overrides

UpdatePolicy(UpdatePolicyRequest, CallSettings)

public override Operation<Policy, PolicyOperationMetadata> UpdatePolicy(UpdatePolicyRequest request, CallSettings callSettings = null)

Updates the specified policy.

You can update only the rules and the display name for the policy.

To update a policy, you should use a read-modify-write loop:

  1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy.
  2. Modify the policy as needed.
  3. Use UpdatePolicy to write the updated policy.

This pattern helps prevent conflicts between concurrent updates.

Parameters
Name Description
request UpdatePolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationPolicyPolicyOperationMetadata

The RPC response.

Overrides

UpdatePolicyAsync(UpdatePolicyRequest, CallSettings)

public override Task<Operation<Policy, PolicyOperationMetadata>> UpdatePolicyAsync(UpdatePolicyRequest request, CallSettings callSettings = null)

Updates the specified policy.

You can update only the rules and the display name for the policy.

To update a policy, you should use a read-modify-write loop:

  1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy.
  2. Modify the policy as needed.
  3. Use UpdatePolicy to write the updated policy.

This pattern helps prevent conflicts between concurrent updates.

Parameters
Name Description
request UpdatePolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationPolicyPolicyOperationMetadata

A Task containing the RPC response.

Overrides