Table of Contents

Class OpaApiClient

Namespace
Styra.Opa.OpenApi
Assembly
Styra.Opa.dll

https://docs.styra.com/enterprise-opa} - Enterprise OPA documentation

public class OpaApiClient : IOpaApiClient
Inheritance
OpaApiClient
Implements
Inherited Members

Constructors

OpaApiClient(string?, Func<string>?, int?, string?, Dictionary<string, string>?, ISpeakeasyHttpClient?, RetryConfig?)

public OpaApiClient(string? bearerAuth = null, Func<string>? bearerAuthSource = null, int? serverIndex = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)

Parameters

bearerAuth string
bearerAuthSource Func<string>
serverIndex int?
serverUrl string
urlParams Dictionary<string, string>
client ISpeakeasyHttpClient
retryConfig RetryConfig

Properties

SDKConfiguration

public SDKConfig SDKConfiguration { get; }

Property Value

SDKConfig

Methods

ExecuteBatchPolicyWithInputAsync(ExecuteBatchPolicyWithInputRequest)

Execute a policy given a batch of inputs

public Task<ExecuteBatchPolicyWithInputResponse> ExecuteBatchPolicyWithInputAsync(ExecuteBatchPolicyWithInputRequest request)

Parameters

request ExecuteBatchPolicyWithInputRequest

Returns

Task<ExecuteBatchPolicyWithInputResponse>

ExecuteDefaultPolicyWithInputAsync(Input, bool?, GzipAcceptEncoding?)

Execute the default decision given an input

public Task<ExecuteDefaultPolicyWithInputResponse> ExecuteDefaultPolicyWithInputAsync(Input input, bool? pretty = null, GzipAcceptEncoding? acceptEncoding = null)

Parameters

input Input
pretty bool?
acceptEncoding GzipAcceptEncoding?

Returns

Task<ExecuteDefaultPolicyWithInputResponse>

ExecutePolicyAsync(ExecutePolicyRequest)

Execute a policy

public Task<ExecutePolicyResponse> ExecutePolicyAsync(ExecutePolicyRequest request)

Parameters

request ExecutePolicyRequest

Returns

Task<ExecutePolicyResponse>

ExecutePolicyWithInputAsync(ExecutePolicyWithInputRequest)

Execute a policy given an input

public Task<ExecutePolicyWithInputResponse> ExecutePolicyWithInputAsync(ExecutePolicyWithInputRequest request)

Parameters

request ExecutePolicyWithInputRequest

Returns

Task<ExecutePolicyWithInputResponse>

HealthAsync(bool?, bool?, List<string>?)

Verify the server is operational

The health API endpoint executes a simple built-in policy query to verify that the server is operational. Optionally it can account for bundle activation as well (useful for “ready” checks at startup).
public Task<HealthResponse> HealthAsync(bool? bundles = null, bool? plugins = null, List<string>? excludePlugin = null)

Parameters

bundles bool?
plugins bool?
excludePlugin List<string>

Returns

Task<HealthResponse>