dagger/dsl/j_s_o_n_value
Types
pub type Opts {
Opts(
pretty: option.Option(Bool),
indent: option.Option(String),
)
}
Constructors
-
Opts(pretty: option.Option(Bool), indent: option.Option(String))
Values
pub fn as_array(
parent: types.JSONValue,
select select: fn(types.JSONValue) -> List(types.Field),
client client: types.Client,
then handler: fn(
Result(List(types.JSONValue), types.QueryError),
) -> a,
) -> a
Decode an array from json
pub fn as_boolean(
parent: types.JSONValue,
client client: types.Client,
then handler: fn(Result(Bool, types.QueryError)) -> a,
) -> a
Decode a boolean from json
pub fn as_integer(
parent: types.JSONValue,
client client: types.Client,
then handler: fn(Result(Int, types.QueryError)) -> a,
) -> a
Decode an integer from json
pub fn as_string(
parent: types.JSONValue,
client client: types.Client,
then handler: fn(Result(String, types.QueryError)) -> a,
) -> a
Decode a string from json
pub fn contents(
parent: types.JSONValue,
with with_fn: fn(Opts) -> Opts,
client client: types.Client,
then handler: fn(Result(String, types.QueryError)) -> a,
) -> a
Return the value encoded as json
pub fn field(
parent: types.JSONValue,
path path: List(String),
) -> types.JSONValue
Lookup the field at the given path, and return its value.
pub fn fields(
parent: types.JSONValue,
client client: types.Client,
then handler: fn(Result(List(String), types.QueryError)) -> a,
) -> a
List fields of the encoded object
pub fn id(parent: types.JSONValue) -> types.JSONValue
A unique identifier for this JSONValue.
pub fn j_s_o_n_value() -> types.JSONValue
pub fn new_boolean(
parent: types.JSONValue,
value value: Bool,
) -> types.JSONValue
Encode a boolean to json
pub fn new_integer(
parent: types.JSONValue,
value value: Int,
) -> types.JSONValue
Encode an integer to json
pub fn new_string(
parent: types.JSONValue,
value value: String,
) -> types.JSONValue
Encode a string to json
pub fn with_contents(
parent: types.JSONValue,
contents contents: String,
) -> types.JSONValue
Return a new json value, decoded from the given content
pub fn with_field(
parent: types.JSONValue,
path path: List(String),
value value: types.JSONValue,
) -> types.JSONValue
Set a new field at the given path