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
Namespace
Google.Cloud.Iam.V2Assembly
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 | |
|---|---|
| Name | Description |
callInvoker |
CallInvokerThe callInvoker to use to make remote calls. |
PoliciesClient(ChannelBase)
public PoliciesClient(ChannelBase channel)Creates a new client for Policies
| Parameter | |
|---|---|
| Name | Description |
channel |
ChannelBaseThe channel to use to make remote calls. |
PoliciesClient(ClientBaseConfiguration)
protected PoliciesClient(ClientBase.ClientBaseConfiguration configuration)Protected constructor to allow creation of configured clients.
| Parameter | |
|---|---|
| Name | Description |
configuration |
ClientBaseClientBaseConfigurationThe 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 | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
CreatePolicyRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
CreatePolicyRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
DateTimeAn optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
Operation |
The response received from the server. |
CreatePolicyAsync(CreatePolicyRequest, CallOptions)
public virtual AsyncUnaryCall<Operation> CreatePolicyAsync(CreatePolicyRequest request, CallOptions options)Creates a policy.
| Parameters | |
|---|---|
| Name | Description |
request |
CreatePolicyRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
CreatePolicyRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
DateTimeAn optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
AsyncUnaryCallOperation |
The call object. |
DeletePolicy(DeletePolicyRequest, CallOptions)
public virtual Operation DeletePolicy(DeletePolicyRequest request, CallOptions options)Deletes a policy. This action is permanent.
| Parameters | |
|---|---|
| Name | Description |
request |
DeletePolicyRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
DeletePolicyRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
DateTimeAn optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
DeletePolicyRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
DeletePolicyRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
DateTimeAn optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
AsyncUnaryCallOperation |
The call object. |
GetPolicy(GetPolicyRequest, CallOptions)
public virtual Policy GetPolicy(GetPolicyRequest request, CallOptions options)Gets a policy.
| Parameters | |
|---|---|
| Name | Description |
request |
GetPolicyRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
GetPolicyRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
DateTimeAn optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
Policy |
The response received from the server. |
GetPolicyAsync(GetPolicyRequest, CallOptions)
public virtual AsyncUnaryCall<Policy> GetPolicyAsync(GetPolicyRequest request, CallOptions options)Gets a policy.
| Parameters | |
|---|---|
| Name | Description |
request |
GetPolicyRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
GetPolicyRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
DateTimeAn optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
ListPoliciesRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
ListPoliciesRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
DateTimeAn optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
ListPoliciesRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
ListPoliciesRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
DateTimeAn optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
AsyncUnaryCallListPoliciesResponse |
The call object. |
NewInstance(ClientBaseConfiguration)
protected override Policies.PoliciesClient NewInstance(ClientBase.ClientBaseConfiguration configuration)Creates a new instance of client from given ClientBaseConfiguration.
| Parameter | |
|---|---|
| Name | Description |
configuration |
ClientBaseClientBaseConfiguration |
| Returns | |
|---|---|
| Type | Description |
PoliciesPoliciesClient |
|
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:
- Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy.
- Modify the policy as needed.
- Use
UpdatePolicyto write the updated policy.
This pattern helps prevent conflicts between concurrent updates.
| Parameters | |
|---|---|
| Name | Description |
request |
UpdatePolicyRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
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:
- Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy.
- Modify the policy as needed.
- Use
UpdatePolicyto write the updated policy.
This pattern helps prevent conflicts between concurrent updates.
| Parameters | |
|---|---|
| Name | Description |
request |
UpdatePolicyRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
DateTimeAn optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
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:
- Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy.
- Modify the policy as needed.
- Use
UpdatePolicyto write the updated policy.
This pattern helps prevent conflicts between concurrent updates.
| Parameters | |
|---|---|
| Name | Description |
request |
UpdatePolicyRequestThe request to send to the server. |
options |
CallOptionsThe options for the call. |
| Returns | |
|---|---|
| Type | Description |
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:
- Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy.
- Modify the policy as needed.
- Use
UpdatePolicyto write the updated policy.
This pattern helps prevent conflicts between concurrent updates.
| Parameters | |
|---|---|
| Name | Description |
request |
UpdatePolicyRequestThe request to send to the server. |
headers |
MetadataThe initial metadata to send with the call. This parameter is optional. |
deadline |
DateTimeAn optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken |
CancellationTokenAn optional token for canceling the call. |
| Returns | |
|---|---|
| Type | Description |
AsyncUnaryCallOperation |
The call object. |