Organization Policy v2 API - Class OrgPolicy.OrgPolicyBase (2.4.0)

[BindServiceMethod(typeof(OrgPolicy), "BindService")]
public abstract class OrgPolicy.OrgPolicyBase

Reference documentation and code samples for the Organization Policy v2 API class OrgPolicy.OrgPolicyBase.

Base class for server-side implementations of OrgPolicy

Inheritance

object > OrgPolicy.OrgPolicyBase

Namespace

Google.Cloud.OrgPolicy.V2

Assembly

Google.Cloud.OrgPolicy.V2.dll

Methods

CreateCustomConstraint(CreateCustomConstraintRequest, ServerCallContext)

public virtual Task<CustomConstraint> CreateCustomConstraint(CreateCustomConstraintRequest request, ServerCallContext context)

Creates a custom constraint.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the organization does not exist. Returns a google.rpc.Status with google.rpc.Code.ALREADY_EXISTS if the constraint already exists on the given organization.

Parameters
NameDescription
requestCreateCustomConstraintRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskCustomConstraint

The response to send back to the client (wrapped by a task).

CreatePolicy(CreatePolicyRequest, ServerCallContext)

public virtual Task<Policy> CreatePolicy(CreatePolicyRequest request, ServerCallContext context)

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 Google Cloud resource.

Parameters
NameDescription
requestCreatePolicyRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskPolicy

The response to send back to the client (wrapped by a task).

DeleteCustomConstraint(DeleteCustomConstraintRequest, ServerCallContext)

public virtual Task<Empty> DeleteCustomConstraint(DeleteCustomConstraintRequest request, ServerCallContext context)

Deletes a custom constraint.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint does not exist.

Parameters
NameDescription
requestDeleteCustomConstraintRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskEmpty

The response to send back to the client (wrapped by a task).

DeletePolicy(DeletePolicyRequest, ServerCallContext)

public virtual Task<Empty> DeletePolicy(DeletePolicyRequest request, ServerCallContext context)

Deletes a policy.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint or organization policy does not exist.

Parameters
NameDescription
requestDeletePolicyRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskEmpty

The response to send back to the client (wrapped by a task).

GetCustomConstraint(GetCustomConstraintRequest, ServerCallContext)

public virtual Task<CustomConstraint> GetCustomConstraint(GetCustomConstraintRequest request, ServerCallContext context)

Gets a custom constraint.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the custom constraint does not exist.

Parameters
NameDescription
requestGetCustomConstraintRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskCustomConstraint

The response to send back to the client (wrapped by a task).

GetEffectivePolicy(GetEffectivePolicyRequest, ServerCallContext)

public virtual Task<Policy> GetEffectivePolicy(GetEffectivePolicyRequest request, ServerCallContext context)

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 an evaluated policy across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.

Parameters
NameDescription
requestGetEffectivePolicyRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskPolicy

The response to send back to the client (wrapped by a task).

GetPolicy(GetPolicyRequest, ServerCallContext)

public virtual Task<Policy> GetPolicy(GetPolicyRequest request, ServerCallContext context)

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 received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskPolicy

The response to send back to the client (wrapped by a task).

ListConstraints(ListConstraintsRequest, ServerCallContext)

public virtual Task<ListConstraintsResponse> ListConstraints(ListConstraintsRequest request, ServerCallContext context)

Lists constraints that could be applied on the specified resource.

Parameters
NameDescription
requestListConstraintsRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskListConstraintsResponse

The response to send back to the client (wrapped by a task).

ListCustomConstraints(ListCustomConstraintsRequest, ServerCallContext)

public virtual Task<ListCustomConstraintsResponse> ListCustomConstraints(ListCustomConstraintsRequest request, ServerCallContext context)

Retrieves all of the custom constraints that exist on a particular organization resource.

Parameters
NameDescription
requestListCustomConstraintsRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskListCustomConstraintsResponse

The response to send back to the client (wrapped by a task).

ListPolicies(ListPoliciesRequest, ServerCallContext)

public virtual Task<ListPoliciesResponse> ListPolicies(ListPoliciesRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestListPoliciesRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskListPoliciesResponse

The response to send back to the client (wrapped by a task).

UpdateCustomConstraint(UpdateCustomConstraintRequest, ServerCallContext)

public virtual Task<CustomConstraint> UpdateCustomConstraint(UpdateCustomConstraintRequest request, ServerCallContext context)

Updates a custom constraint.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint does not exist.

Note: the supplied policy will perform a full overwrite of all fields.

Parameters
NameDescription
requestUpdateCustomConstraintRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskCustomConstraint

The response to send back to the client (wrapped by a task).

UpdatePolicy(UpdatePolicyRequest, ServerCallContext)

public virtual Task<Policy> UpdatePolicy(UpdatePolicyRequest request, ServerCallContext context)

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 received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskPolicy

The response to send back to the client (wrapped by a task).