Table of Contents

Class OpaResult

Namespace
Styra.Opa
Assembly
Styra.Opa.dll
public class OpaResult
Inheritance
OpaResult
Inherited Members

Constructors

OpaResult()

public OpaResult()

OpaResult(SuccessfulPolicyResponse)

public OpaResult(SuccessfulPolicyResponse resp)

Parameters

resp SuccessfulPolicyResponse

OpaResult(SuccessfulPolicyResponseWithStatusCode)

public OpaResult(SuccessfulPolicyResponseWithStatusCode resp)

Parameters

resp SuccessfulPolicyResponseWithStatusCode

Properties

DecisionId

If decision logging is enabled, this field contains a string that uniquely identifies the decision. The identifier will be included in the decision log event for this decision. Callers can use the identifier for correlation purposes.

[JsonProperty("decision_id")]
public string? DecisionId { get; set; }

Property Value

string

HttpStatusCode

The HTTP status code for the request. Limited to "200" or "500".

[JsonProperty("http_status_code")]
public string? HttpStatusCode { get; set; }

Property Value

string

Metrics

If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps.

[JsonProperty("metrics")]
public Dictionary<string, object>? Metrics { get; set; }

Property Value

Dictionary<string, object>

Provenance

Provenance information can be requested on individual API calls and are returned inline with the API response. To obtain provenance information on an API call, specify the provenance=true query parameter when executing the API call.

[JsonProperty("provenance")]
public Provenance? Provenance { get; set; }

Property Value

Provenance

Result

The Result from the OPA query. This field will be null if the query path was undefined.

[JsonProperty("result")]
public Result? Result { get; set; }

Property Value

Result

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

explicit operator OpaResult(SuccessfulPolicyResponse)

public static explicit operator OpaResult(SuccessfulPolicyResponse e)

Parameters

e SuccessfulPolicyResponse

Returns

OpaResult

explicit operator OpaResult(SuccessfulPolicyResponseWithStatusCode)

public static explicit operator OpaResult(SuccessfulPolicyResponseWithStatusCode e)

Parameters

e SuccessfulPolicyResponseWithStatusCode

Returns

OpaResult