Google Cloud Identity and Access Management (IAM) v2 API - Class Policies.PoliciesClient (1.1.0)

public class Policies.PoliciesClient : ClientBase<Policies.PoliciesClient>

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

Client for Policies

Inheritance

object > ClientBase > ClientBasePoliciesPoliciesClient > Policies.PoliciesClient

Namespace

Google.Cloud.Iam.V2

Assembly

Google.Cloud.Iam.V2.dll

Constructors

PoliciesClient()

protected PoliciesClient()

Protected parameterless constructor to allow creation of test doubles.

PoliciesClient(CallInvoker)

public PoliciesClient(CallInvoker callInvoker)

Creates a new client for Policies that uses a custom CallInvoker.

Parameter
NameDescription
callInvokerCallInvoker

The callInvoker to use to make remote calls.

PoliciesClient(ChannelBase)

public PoliciesClient(ChannelBase channel)

Creates a new client for Policies

Parameter
NameDescription
channelChannelBase

The channel to use to make remote calls.

PoliciesClient(ClientBaseConfiguration)

protected PoliciesClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration

The client configuration.

Methods

CreateOperationsClient()

public virtual Operations.OperationsClient CreateOperationsClient()

Creates a new instance of Operations.OperationsClient using the same call invoker as this client.

Returns
TypeDescription
OperationsOperationsClient

A new Operations client for the same target as this client.

CreatePolicy(CreatePolicyRequest, CallOptions)

public virtual Operation CreatePolicy(CreatePolicyRequest request, CallOptions options)

Creates a policy.

Parameters
NameDescription
requestCreatePolicyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

CreatePolicy(CreatePolicyRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation CreatePolicy(CreatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Creates a policy.

Parameters
NameDescription
requestCreatePolicyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

CreatePolicyAsync(CreatePolicyRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> CreatePolicyAsync(CreatePolicyRequest request, CallOptions options)

Creates a policy.

Parameters
NameDescription
requestCreatePolicyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

CreatePolicyAsync(CreatePolicyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> CreatePolicyAsync(CreatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Creates a policy.

Parameters
NameDescription
requestCreatePolicyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

DeletePolicy(DeletePolicyRequest, CallOptions)

public virtual Operation DeletePolicy(DeletePolicyRequest request, CallOptions options)

Deletes a policy. This action is permanent.

Parameters
NameDescription
requestDeletePolicyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

DeletePolicy(DeletePolicyRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation DeletePolicy(DeletePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes a policy. This action is permanent.

Parameters
NameDescription
requestDeletePolicyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

DeletePolicyAsync(DeletePolicyRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> DeletePolicyAsync(DeletePolicyRequest request, CallOptions options)

Deletes a policy. This action is permanent.

Parameters
NameDescription
requestDeletePolicyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

DeletePolicyAsync(DeletePolicyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> DeletePolicyAsync(DeletePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes a policy. This action is permanent.

Parameters
NameDescription
requestDeletePolicyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

GetPolicy(GetPolicyRequest, CallOptions)

public virtual Policy GetPolicy(GetPolicyRequest request, CallOptions options)

Gets a policy.

Parameters
NameDescription
requestGetPolicyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Policy

The response received from the server.

GetPolicy(GetPolicyRequest, Metadata, DateTime?, CancellationToken)

public virtual Policy GetPolicy(GetPolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets a policy.

Parameters
NameDescription
requestGetPolicyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Policy

The response received from the server.

GetPolicyAsync(GetPolicyRequest, CallOptions)

public virtual AsyncUnaryCall<Policy> GetPolicyAsync(GetPolicyRequest request, CallOptions options)

Gets a policy.

Parameters
NameDescription
requestGetPolicyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallPolicy

The call object.

GetPolicyAsync(GetPolicyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Policy> GetPolicyAsync(GetPolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets a policy.

Parameters
NameDescription
requestGetPolicyRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallPolicy

The call object.

ListPolicies(ListPoliciesRequest, CallOptions)

public virtual ListPoliciesResponse ListPolicies(ListPoliciesRequest request, CallOptions options)

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
ListPoliciesResponse

The response received from the server.

ListPolicies(ListPoliciesRequest, Metadata, DateTime?, CancellationToken)

public virtual ListPoliciesResponse ListPolicies(ListPoliciesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
ListPoliciesResponse

The response received from the server.

ListPoliciesAsync(ListPoliciesRequest, CallOptions)

public virtual AsyncUnaryCall<ListPoliciesResponse> ListPoliciesAsync(ListPoliciesRequest request, CallOptions options)

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallListPoliciesResponse

The call object.

ListPoliciesAsync(ListPoliciesRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListPoliciesResponse> ListPoliciesAsync(ListPoliciesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallListPoliciesResponse

The call object.

NewInstance(ClientBaseConfiguration)

protected override Policies.PoliciesClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration
Returns
TypeDescription
PoliciesPoliciesClient
Overrides

UpdatePolicy(UpdatePolicyRequest, CallOptions)

public virtual Operation UpdatePolicy(UpdatePolicyRequest request, CallOptions options)

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

UpdatePolicy(UpdatePolicyRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation UpdatePolicy(UpdatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

UpdatePolicyAsync(UpdatePolicyRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> UpdatePolicyAsync(UpdatePolicyRequest request, CallOptions options)

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

UpdatePolicyAsync(UpdatePolicyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> UpdatePolicyAsync(UpdatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.