Table of Contents

Class BuiltinArg

Namespace
OpaDotNet.Wasm
Assembly
OpaDotNet.Wasm.dll

Represents built-in function argument.

public class BuiltinArg
Inheritance
BuiltinArg
Inherited Members

Properties

Raw

JSON with REGO sets specific patches.

public JsonNode? Raw { get; }

Property Value

JsonNode

RawJson

Raw JSON with REGO sets serialized as arrays.

public JsonNode? RawJson { get; }

Property Value

JsonNode

Methods

AsOrNull<T>(Func<T>?, RegoValueFormat)

Converts built-in function argument in JSON format to the specified type.

public T? AsOrNull<T>(Func<T>? defaultValue = null, RegoValueFormat format = RegoValueFormat.Json)

Parameters

defaultValue Func<T>

Value to return if built-in is null.

format RegoValueFormat

If RegoValueFormat.Json RawJson will be used as source for the conversion. If RegoValueFormat.Value Raw will be used as source for the conversion.

Returns

T

Type Parameters

T

Target type.

As<T>(RegoValueFormat)

Converts built-in function argument in JSON format to the specified type.

public T As<T>(RegoValueFormat format = RegoValueFormat.Json) where T : notnull

Parameters

format RegoValueFormat

Value type JSON.

Returns

T

Type Parameters

T

Target type.