Class OrgPolicy.OrgPolicyClient (1.2.0)

public class OrgPolicyClient : ClientBase<OrgPolicy.OrgPolicyClient>

Client for OrgPolicy

Inheritance

Object > ClientBase > ClientBase<OrgPolicy.OrgPolicyClient> > OrgPolicy.OrgPolicyClient

Namespace

Google.Cloud.OrgPolicy.V2

Assembly

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

The callInvoker to use to make remote calls.

OrgPolicyClient(ChannelBase)

public OrgPolicyClient(ChannelBase channel)

Creates a new client for OrgPolicy

Parameter
NameDescription
channelChannelBase

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
NameDescription
configurationClientBase.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
NameDescription
requestCreatePolicyRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Policy

The response received from the server.

CreatePolicy(CreatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual Policy CreatePolicy(CreatePolicyRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), 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
NameDescription
requestCreatePolicyRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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.

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<Policy>

The call object.

CreatePolicyAsync(CreatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual AsyncUnaryCall<Policy> CreatePolicyAsync(CreatePolicyRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), 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
NameDescription
requestCreatePolicyRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Empty

The response received from the server.

DeletePolicy(DeletePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual Empty DeletePolicy(DeletePolicyRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), 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
NameDescription
requestDeletePolicyRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<Empty>

The call object.

DeletePolicyAsync(DeletePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual AsyncUnaryCall<Empty> DeletePolicyAsync(DeletePolicyRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), 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
NameDescription
requestDeletePolicyRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Policy

The response received from the server.

GetEffectivePolicy(GetEffectivePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual Policy GetEffectivePolicy(GetEffectivePolicyRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), 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
NameDescription
requestGetEffectivePolicyRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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.

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<Policy>

The call object.

GetEffectivePolicyAsync(GetEffectivePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual AsyncUnaryCall<Policy> GetEffectivePolicyAsync(GetEffectivePolicyRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), 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
NameDescription
requestGetEffectivePolicyRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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
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
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, Nullable<DateTime>, CancellationToken)

public virtual Policy GetPolicy(GetPolicyRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), 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
NameDescription
requestGetPolicyRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<Policy>

The call object.

GetPolicyAsync(GetPolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual AsyncUnaryCall<Policy> GetPolicyAsync(GetPolicyRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), 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
NameDescription
requestGetPolicyRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
ListConstraintsResponse

The response received from the server.

ListConstraints(ListConstraintsRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual ListConstraintsResponse ListConstraints(ListConstraintsRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))

Lists Constraints that could be applied on the specified resource.

Parameters
NameDescription
requestListConstraintsRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<ListConstraintsResponse>

The call object.

ListConstraintsAsync(ListConstraintsRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual AsyncUnaryCall<ListConstraintsResponse> ListConstraintsAsync(ListConstraintsRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))

Lists Constraints that could be applied on the specified resource.

Parameters
NameDescription
requestListConstraintsRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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
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
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, Nullable<DateTime>, CancellationToken)

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

Retrieves all of the Policies that exist on a particular resource.

Parameters
NameDescription
requestListPoliciesRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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 all of the Policies that exist on a particular resource.

Parameters
NameDescription
requestListPoliciesRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<ListPoliciesResponse>

The call object.

ListPoliciesAsync(ListPoliciesRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

Retrieves all of the Policies that exist on a particular resource.

Parameters
NameDescription
requestListPoliciesRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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
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
NameDescription
configurationClientBase.ClientBaseConfiguration
Returns
TypeDescription
OrgPolicy.OrgPolicyClient
Overrides
Grpc.Core.ClientBase<Google.Cloud.OrgPolicy.V2.OrgPolicy.OrgPolicyClient>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Policy

The response received from the server.

UpdatePolicy(UpdatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual Policy UpdatePolicy(UpdatePolicyRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), 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
NameDescription
requestUpdatePolicyRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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.

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

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<Policy>

The call object.

UpdatePolicyAsync(UpdatePolicyRequest, Metadata, Nullable<DateTime>, CancellationToken)

public virtual AsyncUnaryCall<Policy> UpdatePolicyAsync(UpdatePolicyRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), 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
NameDescription
requestUpdatePolicyRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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
AsyncUnaryCall<Policy>

The call object.