Current section

Files

Jump to
dagger lib dagger gen local_module_source.ex
Raw

lib/dagger/gen/local_module_source.ex

# This file generated by `mix dagger.gen`. Please DO NOT EDIT.
defmodule Dagger.LocalModuleSource do
@moduledoc "Module source that that originates from a path locally relative to an arbitrary directory."
use Dagger.Core.QueryBuilder
@type t() :: %__MODULE__{}
defstruct [:selection, :client]
(
@doc "The directory containing everything needed to load load and use the module."
@spec context_directory(t()) :: {:ok, Dagger.Directory.t() | nil} | {:error, term()}
def context_directory(%__MODULE__{} = local_module_source) do
selection = select(local_module_source.selection, "contextDirectory")
case execute(selection, local_module_source.client) do
{:ok, nil} -> {:ok, nil}
{:ok, data} -> Nestru.decode_from_map(data, Dagger.Directory)
error -> error
end
end
)
(
@doc "A unique identifier for this LocalModuleSource."
@spec id(t()) :: {:ok, Dagger.LocalModuleSourceID.t()} | {:error, term()}
def id(%__MODULE__{} = local_module_source) do
selection = select(local_module_source.selection, "id")
execute(selection, local_module_source.client)
end
)
(
@doc "The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory)."
@spec root_subpath(t()) :: {:ok, Dagger.String.t()} | {:error, term()}
def root_subpath(%__MODULE__{} = local_module_source) do
selection = select(local_module_source.selection, "rootSubpath")
execute(selection, local_module_source.client)
end
)
end