Class OrgPolicy.OrgPolicyBase (1.0.0)

[BindServiceMethod(typeof(OrgPolicy), "BindService")]
public abstract class 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

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

Parameters
NameDescription
requestCreatePolicyRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
Task<Policy>

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 Org 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
Task<Empty>

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 a computed 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
Task<Policy>

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

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
Task<ListConstraintsResponse>

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
Task<ListPoliciesResponse>

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

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