Current section
Files
Jump to
Current section
Files
lib/dagger/gen/file.ex
# This file generated by `mix dagger.gen`. Please DO NOT EDIT.
defmodule Dagger.File do
@moduledoc "A file."
use Dagger.QueryBuilder
defstruct [:selection, :client]
(
@doc "Retrieves the contents of the file."
def contents(%__MODULE__{} = file) do
selection = select(file.selection, "contents")
execute(selection, file.client)
end
)
(
@doc "Writes the file to a file path on the host.\n\n## Required Arguments\n\n* `path` - Location of the written directory (e.g., \"output.txt\")."
def export(%__MODULE__{} = file, path) do
selection = select(file.selection, "export")
selection = arg(selection, "path", path)
execute(selection, file.client)
end
)
(
@doc "Retrieves the content-addressed identifier of the file."
def id(%__MODULE__{} = file) do
selection = select(file.selection, "id")
execute(selection, file.client)
end
)
(
@doc "Retrieves a secret referencing the contents of this file."
@deprecated "insecure, leaves secret in cache. Superseded by `setSecret`"
def secret(%__MODULE__{} = file) do
selection = select(file.selection, "secret")
%Dagger.Secret{selection: selection, client: file.client}
end
)
(
@doc "Gets the size of the file, in bytes."
def size(%__MODULE__{} = file) do
selection = select(file.selection, "size")
execute(selection, file.client)
end
)
(
@doc "Retrieves this file with its created/modified timestamps set to the given time.\n\n## Required Arguments\n\n* `timestamp` - Timestamp to set dir/files in.\n\nFormatted in seconds following Unix epoch (e.g., 1672531199)."
def with_timestamps(%__MODULE__{} = file, timestamp) do
selection = select(file.selection, "withTimestamps")
selection = arg(selection, "timestamp", timestamp)
%Dagger.File{selection: selection, client: file.client}
end
)
end