Current section
Files
Jump to
Current section
Files
src/dagger@dsl@binding.erl
-module(dagger@dsl@binding).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/dagger/dsl/binding.gleam").
-export([binding/1, as_address/1, as_cache_volume/1, as_changeset/1, as_check/1, as_check_group/1, as_cloud/1, as_container/1, as_directory/1, as_env/1, as_env_file/1, as_file/1, as_generator/1, as_generator_group/1, as_git_ref/1, as_git_repository/1, as_j_s_o_n_value/1, as_module/1, as_module_config_client/1, as_module_source/1, as_search_result/1, as_search_submatch/1, as_secret/1, as_service/1, as_socket/1, as_stat/1, as_string/3, as_workspace/1, digest/3, id/1, is_null/3, name/3, type_name/3]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
-file("src/dagger/dsl/binding.gleam", 9).
-spec binding(dagger@dsl@types:binding()) -> dagger@dsl@types:binding().
binding(Id) ->
Field = {field,
<<"loadBindingFromID"/utf8>>,
[{<<"id"/utf8>>, {g_deferred, erlang:element(2, Id)}}],
[]},
{binding, {pure, [Field]}}.
-file("src/dagger/dsl/binding.gleam", 15).
?DOC(" Retrieve the binding value, as type Address\n").
-spec as_address(dagger@dsl@types:binding()) -> dagger@dsl@types:address().
as_address(Parent) ->
Field = {field, <<"asAddress"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{address, New_op}.
-file("src/dagger/dsl/binding.gleam", 25).
?DOC(" Retrieve the binding value, as type CacheVolume\n").
-spec as_cache_volume(dagger@dsl@types:binding()) -> dagger@dsl@types:cache_volume().
as_cache_volume(Parent) ->
Field = {field, <<"asCacheVolume"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{cache_volume, New_op}.
-file("src/dagger/dsl/binding.gleam", 35).
?DOC(" Retrieve the binding value, as type Changeset\n").
-spec as_changeset(dagger@dsl@types:binding()) -> dagger@dsl@types:changeset().
as_changeset(Parent) ->
Field = {field, <<"asChangeset"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{changeset, New_op}.
-file("src/dagger/dsl/binding.gleam", 45).
?DOC(" Retrieve the binding value, as type Check\n").
-spec as_check(dagger@dsl@types:binding()) -> dagger@dsl@types:check().
as_check(Parent) ->
Field = {field, <<"asCheck"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{check, New_op}.
-file("src/dagger/dsl/binding.gleam", 55).
?DOC(" Retrieve the binding value, as type CheckGroup\n").
-spec as_check_group(dagger@dsl@types:binding()) -> dagger@dsl@types:check_group().
as_check_group(Parent) ->
Field = {field, <<"asCheckGroup"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{check_group, New_op}.
-file("src/dagger/dsl/binding.gleam", 65).
?DOC(" Retrieve the binding value, as type Cloud\n").
-spec as_cloud(dagger@dsl@types:binding()) -> dagger@dsl@types:cloud().
as_cloud(Parent) ->
Field = {field, <<"asCloud"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{cloud, New_op}.
-file("src/dagger/dsl/binding.gleam", 75).
?DOC(" Retrieve the binding value, as type Container\n").
-spec as_container(dagger@dsl@types:binding()) -> dagger@dsl@types:container().
as_container(Parent) ->
Field = {field, <<"asContainer"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{container, New_op}.
-file("src/dagger/dsl/binding.gleam", 85).
?DOC(" Retrieve the binding value, as type Directory\n").
-spec as_directory(dagger@dsl@types:binding()) -> dagger@dsl@types:directory().
as_directory(Parent) ->
Field = {field, <<"asDirectory"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{directory, New_op}.
-file("src/dagger/dsl/binding.gleam", 95).
?DOC(" Retrieve the binding value, as type Env\n").
-spec as_env(dagger@dsl@types:binding()) -> dagger@dsl@types:env().
as_env(Parent) ->
Field = {field, <<"asEnv"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{env, New_op}.
-file("src/dagger/dsl/binding.gleam", 105).
?DOC(" Retrieve the binding value, as type EnvFile\n").
-spec as_env_file(dagger@dsl@types:binding()) -> dagger@dsl@types:env_file().
as_env_file(Parent) ->
Field = {field, <<"asEnvFile"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{env_file, New_op}.
-file("src/dagger/dsl/binding.gleam", 115).
?DOC(" Retrieve the binding value, as type File\n").
-spec as_file(dagger@dsl@types:binding()) -> dagger@dsl@types:file().
as_file(Parent) ->
Field = {field, <<"asFile"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{file, New_op}.
-file("src/dagger/dsl/binding.gleam", 125).
?DOC(" Retrieve the binding value, as type Generator\n").
-spec as_generator(dagger@dsl@types:binding()) -> dagger@dsl@types:generator().
as_generator(Parent) ->
Field = {field, <<"asGenerator"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{generator, New_op}.
-file("src/dagger/dsl/binding.gleam", 135).
?DOC(" Retrieve the binding value, as type GeneratorGroup\n").
-spec as_generator_group(dagger@dsl@types:binding()) -> dagger@dsl@types:generator_group().
as_generator_group(Parent) ->
Field = {field, <<"asGeneratorGroup"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{generator_group, New_op}.
-file("src/dagger/dsl/binding.gleam", 145).
?DOC(" Retrieve the binding value, as type GitRef\n").
-spec as_git_ref(dagger@dsl@types:binding()) -> dagger@dsl@types:git_ref().
as_git_ref(Parent) ->
Field = {field, <<"asGitRef"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{git_ref, New_op}.
-file("src/dagger/dsl/binding.gleam", 155).
?DOC(" Retrieve the binding value, as type GitRepository\n").
-spec as_git_repository(dagger@dsl@types:binding()) -> dagger@dsl@types:git_repository().
as_git_repository(Parent) ->
Field = {field, <<"asGitRepository"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{git_repository, New_op}.
-file("src/dagger/dsl/binding.gleam", 165).
?DOC(" Retrieve the binding value, as type JSONValue\n").
-spec as_j_s_o_n_value(dagger@dsl@types:binding()) -> dagger@dsl@types:j_s_o_n_value().
as_j_s_o_n_value(Parent) ->
Field = {field, <<"asJSONValue"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{j_s_o_n_value, New_op}.
-file("src/dagger/dsl/binding.gleam", 175).
?DOC(" Retrieve the binding value, as type Module\n").
-spec as_module(dagger@dsl@types:binding()) -> dagger@dsl@types:module_().
as_module(Parent) ->
Field = {field, <<"asModule"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{module, New_op}.
-file("src/dagger/dsl/binding.gleam", 185).
?DOC(" Retrieve the binding value, as type ModuleConfigClient\n").
-spec as_module_config_client(dagger@dsl@types:binding()) -> dagger@dsl@types:module_config_client().
as_module_config_client(Parent) ->
Field = {field, <<"asModuleConfigClient"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{module_config_client, New_op}.
-file("src/dagger/dsl/binding.gleam", 195).
?DOC(" Retrieve the binding value, as type ModuleSource\n").
-spec as_module_source(dagger@dsl@types:binding()) -> dagger@dsl@types:module_source().
as_module_source(Parent) ->
Field = {field, <<"asModuleSource"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{module_source, New_op}.
-file("src/dagger/dsl/binding.gleam", 205).
?DOC(" Retrieve the binding value, as type SearchResult\n").
-spec as_search_result(dagger@dsl@types:binding()) -> dagger@dsl@types:search_result().
as_search_result(Parent) ->
Field = {field, <<"asSearchResult"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{search_result, New_op}.
-file("src/dagger/dsl/binding.gleam", 215).
?DOC(" Retrieve the binding value, as type SearchSubmatch\n").
-spec as_search_submatch(dagger@dsl@types:binding()) -> dagger@dsl@types:search_submatch().
as_search_submatch(Parent) ->
Field = {field, <<"asSearchSubmatch"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{search_submatch, New_op}.
-file("src/dagger/dsl/binding.gleam", 225).
?DOC(" Retrieve the binding value, as type Secret\n").
-spec as_secret(dagger@dsl@types:binding()) -> dagger@dsl@types:secret().
as_secret(Parent) ->
Field = {field, <<"asSecret"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{secret, New_op}.
-file("src/dagger/dsl/binding.gleam", 235).
?DOC(" Retrieve the binding value, as type Service\n").
-spec as_service(dagger@dsl@types:binding()) -> dagger@dsl@types:service().
as_service(Parent) ->
Field = {field, <<"asService"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{service, New_op}.
-file("src/dagger/dsl/binding.gleam", 245).
?DOC(" Retrieve the binding value, as type Socket\n").
-spec as_socket(dagger@dsl@types:binding()) -> dagger@dsl@types:socket().
as_socket(Parent) ->
Field = {field, <<"asSocket"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{socket, New_op}.
-file("src/dagger/dsl/binding.gleam", 255).
?DOC(" Retrieve the binding value, as type Stat\n").
-spec as_stat(dagger@dsl@types:binding()) -> dagger@dsl@types:stat().
as_stat(Parent) ->
Field = {field, <<"asStat"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{stat, New_op}.
-file("src/dagger/dsl/binding.gleam", 265).
?DOC(" Returns the binding's string value\n").
-spec as_string(
dagger@dsl@types:binding(),
dagger@types:client(),
fun(({ok, binary()} | {error, dagger@types:query_error()}) -> GMD)
) -> GMD.
as_string(Parent, Client, Handler) ->
Field = {field, <<"asString"/utf8>>, [], []},
Op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) ->
Full_query = lists:append(Q, [Field]),
{fetch,
Full_query,
{decoder, fun gleam@dynamic@decode:decode_dynamic/1},
fun(Dyn) ->
Path = dagger@types:make_path(Full_query),
case gleam@dynamic@decode:run(
Dyn,
gleam@dynamic@decode:at(
Path,
{decoder,
fun gleam@dynamic@decode:decode_string/1}
)
) of
{ok, Val} ->
{pure, {ok, Val}};
{error, _} ->
{pure,
{error,
{decoding_error, <<"asString"/utf8>>}}}
end
end}
end
)
end,
Handler(dagger@interpreter:run(Op, Client)).
-file("src/dagger/dsl/binding.gleam", 286).
?DOC(" Retrieve the binding value, as type Workspace\n").
-spec as_workspace(dagger@dsl@types:binding()) -> dagger@dsl@types:workspace().
as_workspace(Parent) ->
Field = {field, <<"asWorkspace"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{workspace, New_op}.
-file("src/dagger/dsl/binding.gleam", 296).
?DOC(" Returns the digest of the binding value\n").
-spec digest(
dagger@dsl@types:binding(),
dagger@types:client(),
fun(({ok, binary()} | {error, dagger@types:query_error()}) -> GMF)
) -> GMF.
digest(Parent, Client, Handler) ->
Field = {field, <<"digest"/utf8>>, [], []},
Op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) ->
Full_query = lists:append(Q, [Field]),
{fetch,
Full_query,
{decoder, fun gleam@dynamic@decode:decode_dynamic/1},
fun(Dyn) ->
Path = dagger@types:make_path(Full_query),
case gleam@dynamic@decode:run(
Dyn,
gleam@dynamic@decode:at(
Path,
{decoder,
fun gleam@dynamic@decode:decode_string/1}
)
) of
{ok, Val} ->
{pure, {ok, Val}};
{error, _} ->
{pure,
{error, {decoding_error, <<"digest"/utf8>>}}}
end
end}
end
)
end,
Handler(dagger@interpreter:run(Op, Client)).
-file("src/dagger/dsl/binding.gleam", 317).
?DOC(" A unique identifier for this Binding.\n").
-spec id(dagger@dsl@types:binding()) -> dagger@dsl@types:binding().
id(Parent) ->
Field = {field, <<"id"/utf8>>, [], []},
New_op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) -> {pure, lists:append(Q, [Field])} end
)
end,
{binding, New_op}.
-file("src/dagger/dsl/binding.gleam", 327).
?DOC(" Returns true if the binding is null\n").
-spec is_null(
dagger@dsl@types:binding(),
dagger@types:client(),
fun(({ok, boolean()} | {error, dagger@types:query_error()}) -> GMH)
) -> GMH.
is_null(Parent, Client, Handler) ->
Field = {field, <<"isNull"/utf8>>, [], []},
Op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) ->
Full_query = lists:append(Q, [Field]),
{fetch,
Full_query,
{decoder, fun gleam@dynamic@decode:decode_dynamic/1},
fun(Dyn) ->
Path = dagger@types:make_path(Full_query),
case gleam@dynamic@decode:run(
Dyn,
gleam@dynamic@decode:at(
Path,
{decoder,
fun gleam@dynamic@decode:decode_bool/1}
)
) of
{ok, Val} ->
{pure, {ok, Val}};
{error, _} ->
{pure,
{error, {decoding_error, <<"isNull"/utf8>>}}}
end
end}
end
)
end,
Handler(dagger@interpreter:run(Op, Client)).
-file("src/dagger/dsl/binding.gleam", 348).
?DOC(" Returns the binding name\n").
-spec name(
dagger@dsl@types:binding(),
dagger@types:client(),
fun(({ok, binary()} | {error, dagger@types:query_error()}) -> GMJ)
) -> GMJ.
name(Parent, Client, Handler) ->
Field = {field, <<"name"/utf8>>, [], []},
Op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) ->
Full_query = lists:append(Q, [Field]),
{fetch,
Full_query,
{decoder, fun gleam@dynamic@decode:decode_dynamic/1},
fun(Dyn) ->
Path = dagger@types:make_path(Full_query),
case gleam@dynamic@decode:run(
Dyn,
gleam@dynamic@decode:at(
Path,
{decoder,
fun gleam@dynamic@decode:decode_string/1}
)
) of
{ok, Val} ->
{pure, {ok, Val}};
{error, _} ->
{pure,
{error, {decoding_error, <<"name"/utf8>>}}}
end
end}
end
)
end,
Handler(dagger@interpreter:run(Op, Client)).
-file("src/dagger/dsl/binding.gleam", 369).
?DOC(" Returns the binding type\n").
-spec type_name(
dagger@dsl@types:binding(),
dagger@types:client(),
fun(({ok, binary()} | {error, dagger@types:query_error()}) -> GML)
) -> GML.
type_name(Parent, Client, Handler) ->
Field = {field, <<"typeName"/utf8>>, [], []},
Op = begin
dagger@types:bind(
erlang:element(2, Parent),
fun(Q) ->
Full_query = lists:append(Q, [Field]),
{fetch,
Full_query,
{decoder, fun gleam@dynamic@decode:decode_dynamic/1},
fun(Dyn) ->
Path = dagger@types:make_path(Full_query),
case gleam@dynamic@decode:run(
Dyn,
gleam@dynamic@decode:at(
Path,
{decoder,
fun gleam@dynamic@decode:decode_string/1}
)
) of
{ok, Val} ->
{pure, {ok, Val}};
{error, _} ->
{pure,
{error,
{decoding_error, <<"typeName"/utf8>>}}}
end
end}
end
)
end,
Handler(dagger@interpreter:run(Op, Client)).