public class 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 | CallInvoker The callInvoker to use to make remote calls. |
PoliciesClient(ChannelBase)
public PoliciesClient(ChannelBase channel)
Creates a new client for Policies
Parameter | |
---|---|
Name | Description |
channel | ChannelBase The channel to use to make remote calls. |
PoliciesClient(ClientBase.ClientBaseConfiguration)
protected PoliciesClient(ClientBase.ClientBaseConfiguration configuration)
Protected constructor to allow creation of configured clients.
Parameter | |
---|---|
Name | Description |
configuration | ClientBase.ClientBaseConfiguration 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 | |
---|---|
Type | Description |
Operations.OperationsClient | 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 | CreatePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
Operation | The response received from the server. |
CreatePolicy(CreatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual Operation CreatePolicy(CreatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Creates a policy.
Parameters | |
---|---|
Name | Description |
request | CreatePolicyRequest The request to send to the server. |
headers | Metadata The initial metadata to send with the call. This parameter is optional. |
deadline | Nullable<DateTime> An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken | CancellationToken An 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 | CreatePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Operation> | The call object. |
CreatePolicyAsync(CreatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<Operation> CreatePolicyAsync(CreatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Creates a policy.
Parameters | |
---|---|
Name | Description |
request | CreatePolicyRequest The request to send to the server. |
headers | Metadata The initial metadata to send with the call. This parameter is optional. |
deadline | Nullable<DateTime> An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken | CancellationToken An optional token for canceling the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Operation> | 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 | DeletePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
Operation | The response received from the server. |
DeletePolicy(DeletePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual Operation DeletePolicy(DeletePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Deletes a policy. This action is permanent.
Parameters | |
---|---|
Name | Description |
request | DeletePolicyRequest The request to send to the server. |
headers | Metadata The initial metadata to send with the call. This parameter is optional. |
deadline | Nullable<DateTime> An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken | CancellationToken An 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 | DeletePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Operation> | The call object. |
DeletePolicyAsync(DeletePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<Operation> DeletePolicyAsync(DeletePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Deletes a policy. This action is permanent.
Parameters | |
---|---|
Name | Description |
request | DeletePolicyRequest The request to send to the server. |
headers | Metadata The initial metadata to send with the call. This parameter is optional. |
deadline | Nullable<DateTime> An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken | CancellationToken An optional token for canceling the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Operation> | The call object. |
GetPolicy(GetPolicyRequest, CallOptions)
public virtual Policy GetPolicy(GetPolicyRequest request, CallOptions options)
Gets a policy.
Parameters | |
---|---|
Name | Description |
request | GetPolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
Policy | The response received from the server. |
GetPolicy(GetPolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual Policy GetPolicy(GetPolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Gets a policy.
Parameters | |
---|---|
Name | Description |
request | GetPolicyRequest The request to send to the server. |
headers | Metadata The initial metadata to send with the call. This parameter is optional. |
deadline | Nullable<DateTime> An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken | CancellationToken An 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 | GetPolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Policy> | The call object. |
GetPolicyAsync(GetPolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<Policy> GetPolicyAsync(GetPolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Gets a policy.
Parameters | |
---|---|
Name | Description |
request | GetPolicyRequest The request to send to the server. |
headers | Metadata The initial metadata to send with the call. This parameter is optional. |
deadline | Nullable<DateTime> An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken | CancellationToken An optional token for canceling the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Policy> | 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 | ListPoliciesRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
ListPoliciesResponse | The response received from the server. |
ListPolicies(ListPoliciesRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual ListPoliciesResponse ListPolicies(ListPoliciesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
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 to send to the server. |
headers | Metadata The initial metadata to send with the call. This parameter is optional. |
deadline | Nullable<DateTime> An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken | CancellationToken An 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 | ListPoliciesRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<ListPoliciesResponse> | The call object. |
ListPoliciesAsync(ListPoliciesRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<ListPoliciesResponse> ListPoliciesAsync(ListPoliciesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
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 to send to the server. |
headers | Metadata The initial metadata to send with the call. This parameter is optional. |
deadline | Nullable<DateTime> An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken | CancellationToken An optional token for canceling the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<ListPoliciesResponse> | The call object. |
NewInstance(ClientBase.ClientBaseConfiguration)
protected override Policies.PoliciesClient NewInstance(ClientBase.ClientBaseConfiguration configuration)
Creates a new instance of client from given ClientBaseConfiguration
.
Parameter | |
---|---|
Name | Description |
configuration | ClientBase.ClientBaseConfiguration |
Returns | |
---|---|
Type | Description |
Policies.PoliciesClient |
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
UpdatePolicy
to write the updated policy.
This pattern helps prevent conflicts between concurrent updates.
Parameters | |
---|---|
Name | Description |
request | UpdatePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
Operation | The response received from the server. |
UpdatePolicy(UpdatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual Operation UpdatePolicy(UpdatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
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
UpdatePolicy
to write the updated policy.
This pattern helps prevent conflicts between concurrent updates.
Parameters | |
---|---|
Name | Description |
request | UpdatePolicyRequest The request to send to the server. |
headers | Metadata The initial metadata to send with the call. This parameter is optional. |
deadline | Nullable<DateTime> An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken | CancellationToken An 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
UpdatePolicy
to write the updated policy.
This pattern helps prevent conflicts between concurrent updates.
Parameters | |
---|---|
Name | Description |
request | UpdatePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Operation> | The call object. |
UpdatePolicyAsync(UpdatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<Operation> UpdatePolicyAsync(UpdatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
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
UpdatePolicy
to write the updated policy.
This pattern helps prevent conflicts between concurrent updates.
Parameters | |
---|---|
Name | Description |
request | UpdatePolicyRequest The request to send to the server. |
headers | Metadata The initial metadata to send with the call. This parameter is optional. |
deadline | Nullable<DateTime> An optional deadline for the call. The call will be cancelled if deadline is hit. |
cancellationToken | CancellationToken An optional token for canceling the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Operation> | The call object. |