public class OrgPolicyClient : ClientBase<OrgPolicy.OrgPolicyClient>
Reference documentation and code samples for the Organization Policy v2 API class OrgPolicy.OrgPolicyClient.
Client for OrgPolicy
Namespace
Google.Cloud.OrgPolicy.V2Assembly
Google.Cloud.OrgPolicy.V2.dll
Constructors
OrgPolicyClient()
protected OrgPolicyClient()
Protected parameterless constructor to allow creation of test doubles.
OrgPolicyClient(CallInvoker)
public OrgPolicyClient(CallInvoker callInvoker)
Creates a new client for OrgPolicy that uses a custom CallInvoker
.
Parameter | |
---|---|
Name | Description |
callInvoker | CallInvoker The callInvoker to use to make remote calls. |
OrgPolicyClient(ChannelBase)
public OrgPolicyClient(ChannelBase channel)
Creates a new client for OrgPolicy
Parameter | |
---|---|
Name | Description |
channel | ChannelBase The channel to use to make remote calls. |
OrgPolicyClient(ClientBase.ClientBaseConfiguration)
protected OrgPolicyClient(ClientBase.ClientBaseConfiguration configuration)
Protected constructor to allow creation of configured clients.
Parameter | |
---|---|
Name | Description |
configuration | ClientBase.ClientBaseConfiguration The client configuration. |
Methods
CreatePolicy(CreatePolicyRequest, CallOptions)
public virtual Policy CreatePolicy(CreatePolicyRequest request, CallOptions options)
Creates a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint does not exist.
Returns a google.rpc.Status
with google.rpc.Code.ALREADY_EXISTS
if the
policy already exists on the given Cloud resource.
Parameters | |
---|---|
Name | Description |
request | CreatePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
Policy | The response received from the server. |
CreatePolicy(CreatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual Policy CreatePolicy(CreatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Creates a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint does not exist.
Returns a google.rpc.Status
with google.rpc.Code.ALREADY_EXISTS
if the
policy already exists on the given Cloud resource.
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 |
Policy | The response received from the server. |
CreatePolicyAsync(CreatePolicyRequest, CallOptions)
public virtual AsyncUnaryCall<Policy> CreatePolicyAsync(CreatePolicyRequest request, CallOptions options)
Creates a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint does not exist.
Returns a google.rpc.Status
with google.rpc.Code.ALREADY_EXISTS
if the
policy already exists on the given Cloud resource.
Parameters | |
---|---|
Name | Description |
request | CreatePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Policy> | The call object. |
CreatePolicyAsync(CreatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<Policy> CreatePolicyAsync(CreatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Creates a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint does not exist.
Returns a google.rpc.Status
with google.rpc.Code.ALREADY_EXISTS
if the
policy already exists on the given Cloud resource.
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<Policy> | The call object. |
DeletePolicy(DeletePolicyRequest, CallOptions)
public virtual Empty DeletePolicy(DeletePolicyRequest request, CallOptions options)
Deletes a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint or Org Policy does not exist.
Parameters | |
---|---|
Name | Description |
request | DeletePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
Empty | The response received from the server. |
DeletePolicy(DeletePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual Empty DeletePolicy(DeletePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Deletes a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint or Org Policy does not exist.
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 |
Empty | The response received from the server. |
DeletePolicyAsync(DeletePolicyRequest, CallOptions)
public virtual AsyncUnaryCall<Empty> DeletePolicyAsync(DeletePolicyRequest request, CallOptions options)
Deletes a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint or Org Policy does not exist.
Parameters | |
---|---|
Name | Description |
request | DeletePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Empty> | The call object. |
DeletePolicyAsync(DeletePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<Empty> DeletePolicyAsync(DeletePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Deletes a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint or Org Policy does not exist.
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<Empty> | The call object. |
GetEffectivePolicy(GetEffectivePolicyRequest, CallOptions)
public virtual Policy GetEffectivePolicy(GetEffectivePolicyRequest request, CallOptions options)
Gets the effective Policy
on a resource. This is the result of merging
Policies
in the resource hierarchy and evaluating conditions. The
returned Policy
will not have an etag
or condition
set because it is
a computed Policy
across multiple resources.
Subtrees of Resource Manager resource hierarchy with 'under:' prefix will
not be expanded.
Parameters | |
---|---|
Name | Description |
request | GetEffectivePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
Policy | The response received from the server. |
GetEffectivePolicy(GetEffectivePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual Policy GetEffectivePolicy(GetEffectivePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Gets the effective Policy
on a resource. This is the result of merging
Policies
in the resource hierarchy and evaluating conditions. The
returned Policy
will not have an etag
or condition
set because it is
a computed Policy
across multiple resources.
Subtrees of Resource Manager resource hierarchy with 'under:' prefix will
not be expanded.
Parameters | |
---|---|
Name | Description |
request | GetEffectivePolicyRequest 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. |
GetEffectivePolicyAsync(GetEffectivePolicyRequest, CallOptions)
public virtual AsyncUnaryCall<Policy> GetEffectivePolicyAsync(GetEffectivePolicyRequest request, CallOptions options)
Gets the effective Policy
on a resource. This is the result of merging
Policies
in the resource hierarchy and evaluating conditions. The
returned Policy
will not have an etag
or condition
set because it is
a computed Policy
across multiple resources.
Subtrees of Resource Manager resource hierarchy with 'under:' prefix will
not be expanded.
Parameters | |
---|---|
Name | Description |
request | GetEffectivePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Policy> | The call object. |
GetEffectivePolicyAsync(GetEffectivePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<Policy> GetEffectivePolicyAsync(GetEffectivePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Gets the effective Policy
on a resource. This is the result of merging
Policies
in the resource hierarchy and evaluating conditions. The
returned Policy
will not have an etag
or condition
set because it is
a computed Policy
across multiple resources.
Subtrees of Resource Manager resource hierarchy with 'under:' prefix will
not be expanded.
Parameters | |
---|---|
Name | Description |
request | GetEffectivePolicyRequest 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. |
GetPolicy(GetPolicyRequest, CallOptions)
public virtual Policy GetPolicy(GetPolicyRequest request, CallOptions options)
Gets a Policy
on a resource.
If no Policy
is set on the resource, NOT_FOUND is returned. The
etag
value can be used with UpdatePolicy()
to update a
Policy
during read-modify-write.
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
on a resource.
If no Policy
is set on the resource, NOT_FOUND is returned. The
etag
value can be used with UpdatePolicy()
to update a
Policy
during read-modify-write.
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
on a resource.
If no Policy
is set on the resource, NOT_FOUND is returned. The
etag
value can be used with UpdatePolicy()
to update a
Policy
during read-modify-write.
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
on a resource.
If no Policy
is set on the resource, NOT_FOUND is returned. The
etag
value can be used with UpdatePolicy()
to update a
Policy
during read-modify-write.
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. |
ListConstraints(ListConstraintsRequest, CallOptions)
public virtual ListConstraintsResponse ListConstraints(ListConstraintsRequest request, CallOptions options)
Lists Constraints
that could be applied on the specified resource.
Parameters | |
---|---|
Name | Description |
request | ListConstraintsRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
ListConstraintsResponse | The response received from the server. |
ListConstraints(ListConstraintsRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual ListConstraintsResponse ListConstraints(ListConstraintsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Lists Constraints
that could be applied on the specified resource.
Parameters | |
---|---|
Name | Description |
request | ListConstraintsRequest 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 |
ListConstraintsResponse | The response received from the server. |
ListConstraintsAsync(ListConstraintsRequest, CallOptions)
public virtual AsyncUnaryCall<ListConstraintsResponse> ListConstraintsAsync(ListConstraintsRequest request, CallOptions options)
Lists Constraints
that could be applied on the specified resource.
Parameters | |
---|---|
Name | Description |
request | ListConstraintsRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<ListConstraintsResponse> | The call object. |
ListConstraintsAsync(ListConstraintsRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<ListConstraintsResponse> ListConstraintsAsync(ListConstraintsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Lists Constraints
that could be applied on the specified resource.
Parameters | |
---|---|
Name | Description |
request | ListConstraintsRequest 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<ListConstraintsResponse> | The call object. |
ListPolicies(ListPoliciesRequest, CallOptions)
public virtual ListPoliciesResponse ListPolicies(ListPoliciesRequest request, CallOptions options)
Retrieves all of the Policies
that exist on a particular resource.
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 all of the Policies
that exist on a particular resource.
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 all of the Policies
that exist on a particular resource.
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 all of the Policies
that exist on a particular resource.
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 OrgPolicy.OrgPolicyClient NewInstance(ClientBase.ClientBaseConfiguration configuration)
Creates a new instance of client from given ClientBaseConfiguration
.
Parameter | |
---|---|
Name | Description |
configuration | ClientBase.ClientBaseConfiguration |
Returns | |
---|---|
Type | Description |
OrgPolicy.OrgPolicyClient |
UpdatePolicy(UpdatePolicyRequest, CallOptions)
public virtual Policy UpdatePolicy(UpdatePolicyRequest request, CallOptions options)
Updates a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint or the policy do not exist.
Returns a google.rpc.Status
with google.rpc.Code.ABORTED
if the etag
supplied in the request does not match the persisted etag of the policy
Note: the supplied policy will perform a full overwrite of all fields.
Parameters | |
---|---|
Name | Description |
request | UpdatePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
Policy | The response received from the server. |
UpdatePolicy(UpdatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual Policy UpdatePolicy(UpdatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Updates a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint or the policy do not exist.
Returns a google.rpc.Status
with google.rpc.Code.ABORTED
if the etag
supplied in the request does not match the persisted etag of the policy
Note: the supplied policy will perform a full overwrite of all fields.
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 |
Policy | The response received from the server. |
UpdatePolicyAsync(UpdatePolicyRequest, CallOptions)
public virtual AsyncUnaryCall<Policy> UpdatePolicyAsync(UpdatePolicyRequest request, CallOptions options)
Updates a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint or the policy do not exist.
Returns a google.rpc.Status
with google.rpc.Code.ABORTED
if the etag
supplied in the request does not match the persisted etag of the policy
Note: the supplied policy will perform a full overwrite of all fields.
Parameters | |
---|---|
Name | Description |
request | UpdatePolicyRequest The request to send to the server. |
options | CallOptions The options for the call. |
Returns | |
---|---|
Type | Description |
AsyncUnaryCall<Policy> | The call object. |
UpdatePolicyAsync(UpdatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)
public virtual AsyncUnaryCall<Policy> UpdatePolicyAsync(UpdatePolicyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Updates a Policy.
Returns a google.rpc.Status
with google.rpc.Code.NOT_FOUND
if the
constraint or the policy do not exist.
Returns a google.rpc.Status
with google.rpc.Code.ABORTED
if the etag
supplied in the request does not match the persisted etag of the policy
Note: the supplied policy will perform a full overwrite of all fields.
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<Policy> | The call object. |