Dagger.JSONValue (dagger v0.19.4)

View Source

Dagger.JSONValue

Summary

Functions

Decode an array from json

Decode a boolean from json

Decode an integer from json

Decode a string from json

Return the value encoded as json

Lookup the field at the given path, and return its value.

List fields of the encoded object

A unique identifier for this JSONValue.

Encode a boolean to json

Encode an integer to json

Encode a string to json

Return a new json value, decoded from the given content

Set a new field at the given path

Types

t()

@type t() :: %Dagger.JSONValue{client: term(), query_builder: term()}

Functions

as_array(json_value)

@spec as_array(t()) :: {:ok, [t()]} | {:error, term()}

Decode an array from json

as_boolean(json_value)

@spec as_boolean(t()) :: {:ok, boolean()} | {:error, term()}

Decode a boolean from json

as_integer(json_value)

@spec as_integer(t()) :: {:ok, integer()} | {:error, term()}

Decode an integer from json

as_string(json_value)

@spec as_string(t()) :: {:ok, String.t()} | {:error, term()}

Decode a string from json

contents(json_value, optional_args \\ [])

@spec contents(t(), pretty: boolean() | nil, indent: String.t() | nil) ::
  {:ok, Dagger.JSON.t()} | {:error, term()}

Return the value encoded as json

field(json_value, path)

@spec field(t(), [String.t()]) :: t()

Lookup the field at the given path, and return its value.

fields(json_value)

@spec fields(t()) :: {:ok, [String.t()]} | {:error, term()}

List fields of the encoded object

id(json_value)

@spec id(t()) :: {:ok, Dagger.JSONValueID.t()} | {:error, term()}

A unique identifier for this JSONValue.

new_boolean(json_value, value)

@spec new_boolean(t(), boolean()) :: t()

Encode a boolean to json

new_integer(json_value, value)

@spec new_integer(t(), integer()) :: t()

Encode an integer to json

new_string(json_value, value)

@spec new_string(t(), String.t()) :: t()

Encode a string to json

with_contents(json_value, contents)

@spec with_contents(t(), Dagger.JSON.t()) :: t()

Return a new json value, decoded from the given content

with_field(json_value, path, value)

@spec with_field(t(), [String.t()], t()) :: t()

Set a new field at the given path