Packages

Gleam SDK for Dagger — type-safe pipelines via GraphQL codegen

Current section

Files

Jump to
dagger_gleam src dagger dsl module_source.gleam
Raw

src/dagger/dsl/module_source.gleam

// AUTO-GENERATED BY DAGGER_GLEAM - DO NOT EDIT
import dagger/types.{type Client, type Try} as types
import dagger/interpreter
import dagger/dsl/types as t
import gleam/dynamic/decode
import gleam/list
pub fn module_source(id id: t.ModuleSource) -> t.ModuleSource {
let field = types.Field(name: "loadModuleSourceFromID", args: [#("id", types.GDeferred(id.op))], subfields: [])
t.ModuleSource(op: types.Pure([field]))
}
/// Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
pub fn as_module(parent: t.ModuleSource) -> t.Module {
let field = types.Field(name: "asModule", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.Module(op: new_op)
}
/// A human readable ref string representation of this module source.
pub fn as_string(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "asString", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("asString")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The blueprint referenced by the module source.
pub fn blueprint(parent: t.ModuleSource) -> t.ModuleSource {
let field = types.Field(name: "blueprint", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// The ref to clone the root of the git repo from. Only valid for git sources.
pub fn clone_ref(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "cloneRef", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("cloneRef")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The resolved commit of the git repo this source points to.
pub fn commit(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "commit", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("commit")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The clients generated for the module.
pub fn config_clients(parent: t.ModuleSource, select select: fn(t.ModuleConfigClient) -> List(types.Field), client client: Client, then handler: fn(Try(List(t.ModuleConfigClient))) -> a) -> a {
let subfields = select(t.ModuleConfigClient(op: types.Pure([])))
let field = types.Field(name: "configClients", args: [], subfields: subfields)
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.list(decode.dynamic))) {
Ok(items) -> types.Pure(Ok(list.map(items, fn(_) { t.ModuleConfigClient(op: types.Pure(full_query)) })))
Error(_) -> types.Pure(Error(types.DecodingError("configClients")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// Whether an existing dagger.json for the module was found.
pub fn config_exists(parent: t.ModuleSource, client client: Client, then handler: fn(Try(Bool)) -> a) -> a {
let field = types.Field(name: "configExists", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.bool)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("configExists")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The full directory loaded for the module source, including the source code as a subdirectory.
pub fn context_directory(parent: t.ModuleSource) -> t.Directory {
let field = types.Field(name: "contextDirectory", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.Directory(op: new_op)
}
/// The dependencies of the module source.
pub fn dependencies(parent: t.ModuleSource, select select: fn(t.ModuleSource) -> List(types.Field), client client: Client, then handler: fn(Try(List(t.ModuleSource))) -> a) -> a {
let subfields = select(t.ModuleSource(op: types.Pure([])))
let field = types.Field(name: "dependencies", args: [], subfields: subfields)
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.list(decode.dynamic))) {
Ok(items) -> types.Pure(Ok(list.map(items, fn(_) { t.ModuleSource(op: types.Pure(full_query)) })))
Error(_) -> types.Pure(Error(types.DecodingError("dependencies")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// A content-hash of the module source. Module sources with the same digest will output the same generated context and convert into the same module instance.
pub fn digest(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "digest", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("digest")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The directory containing the module configuration and source code (source code may be in a subdir).
pub fn directory(parent: t.ModuleSource, path path: String) -> t.Directory {
let field = types.Field(name: "directory", args: [#("path", types.GString(path))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.Directory(op: new_op)
}
/// The engine version of the module.
pub fn engine_version(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "engineVersion", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("engineVersion")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The generated files and directories made on top of the module source's context directory.
pub fn generated_context_directory(parent: t.ModuleSource) -> t.Directory {
let field = types.Field(name: "generatedContextDirectory", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.Directory(op: new_op)
}
/// The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
pub fn html_repo_u_r_l(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "htmlRepoURL", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("htmlRepoURL")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The URL to the source's git repo in a web browser. Only valid for git sources.
pub fn html_u_r_l(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "htmlURL", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("htmlURL")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// A unique identifier for this ModuleSource.
pub fn id(parent: t.ModuleSource) -> t.ModuleSource {
let field = types.Field(name: "id", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// The introspection schema JSON file for this module source.
/// This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
/// Note: this is in the context of a module, so some core types may be hidden.
pub fn introspection_schema_j_s_o_n(parent: t.ModuleSource) -> t.File {
let field = types.Field(name: "introspectionSchemaJSON", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.File(op: new_op)
}
/// The kind of module source (currently local, git or dir).
pub fn kind(parent: t.ModuleSource, client client: Client, then handler: fn(Try(t.ModuleSourceKind)) -> a) -> a {
let field = types.Field(name: "kind", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.map(decode.string, fn(s) { t.module_source_kind_from_string(s) }))) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("kind")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The full absolute path to the context directory on the caller's host filesystem that this module source is loaded from. Only valid for local module sources.
pub fn local_context_directory_path(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "localContextDirectoryPath", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("localContextDirectoryPath")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The name of the module, including any setting via the withName API.
pub fn module_name(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "moduleName", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("moduleName")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).
pub fn module_original_name(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "moduleOriginalName", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("moduleOriginalName")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The original subpath used when instantiating this module source, relative to the context directory.
pub fn original_subpath(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "originalSubpath", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("originalSubpath")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The pinned version of this module source.
pub fn pin(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "pin", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("pin")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
pub fn repo_root_path(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "repoRootPath", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("repoRootPath")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The SDK configuration of the module.
pub fn sdk(parent: t.ModuleSource) -> t.SDKConfig {
let field = types.Field(name: "sdk", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.SDKConfig(op: new_op)
}
/// The path, relative to the context directory, that contains the module's dagger.json.
pub fn source_root_subpath(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "sourceRootSubpath", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("sourceRootSubpath")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// The path to the directory containing the module's source code, relative to the context directory.
pub fn source_subpath(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "sourceSubpath", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("sourceSubpath")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// Forces evaluation of the module source, including any loading into the engine and associated validation.
pub fn sync(parent: t.ModuleSource) -> t.ModuleSource {
let field = types.Field(name: "sync", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// The toolchains referenced by the module source.
pub fn toolchains(parent: t.ModuleSource, select select: fn(t.ModuleSource) -> List(types.Field), client client: Client, then handler: fn(Try(List(t.ModuleSource))) -> a) -> a {
let subfields = select(t.ModuleSource(op: types.Pure([])))
let field = types.Field(name: "toolchains", args: [], subfields: subfields)
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.list(decode.dynamic))) {
Ok(items) -> types.Pure(Ok(list.map(items, fn(_) { t.ModuleSource(op: types.Pure(full_query)) })))
Error(_) -> types.Pure(Error(types.DecodingError("toolchains")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// User-defined defaults read from local .env files
pub fn user_defaults(parent: t.ModuleSource) -> t.EnvFile {
let field = types.Field(name: "userDefaults", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.EnvFile(op: new_op)
}
/// The specified version of the git repo this source points to.
pub fn version(parent: t.ModuleSource, client client: Client, then handler: fn(Try(String)) -> a) -> a {
let field = types.Field(name: "version", args: [], subfields: [])
let op = {
use q <- types.bind(parent.op)
let full_query = list.append(q, [field])
types.Fetch(
fields: full_query,
decoder: decode.dynamic,
next: fn(dyn) {
let path = types.make_path(full_query)
case decode.run(dyn, decode.at(path, decode.string)) {
Ok(val) -> types.Pure(Ok(val))
Error(_) -> types.Pure(Error(types.DecodingError("version")))
}
}
)
}
handler(interpreter.run(op, client))
}
/// Set a blueprint for the module source.
pub fn with_blueprint(parent: t.ModuleSource, blueprint blueprint: t.ModuleSource) -> t.ModuleSource {
let field = types.Field(name: "withBlueprint", args: [#("blueprint", types.GDeferred(blueprint.op))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Update the module source with a new client to generate.
pub fn with_client(parent: t.ModuleSource, generator generator: String, output_dir output_dir: String) -> t.ModuleSource {
let field = types.Field(name: "withClient", args: [#("generator", types.GString(generator)), #("outputDir", types.GString(output_dir))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Append the provided dependencies to the module source's dependency list.
pub fn with_dependencies(parent: t.ModuleSource, dependencies dependencies: List(t.ModuleSource)) -> t.ModuleSource {
let field = types.Field(name: "withDependencies", args: [#("dependencies", types.GList(list.map(dependencies, fn(x) { types.GDeferred(x.op) })))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Upgrade the engine version of the module to the given value.
pub fn with_engine_version(parent: t.ModuleSource, version version: String) -> t.ModuleSource {
let field = types.Field(name: "withEngineVersion", args: [#("version", types.GString(version))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Enable the experimental features for the module source.
pub fn with_experimental_features(parent: t.ModuleSource, features features: List(t.ModuleSourceExperimentalFeature)) -> t.ModuleSource {
let field = types.Field(name: "withExperimentalFeatures", args: [#("features", types.GList(list.map(features, fn(x) { types.GString(t.module_source_experimental_feature_to_json(x)) })))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Update the module source with additional include patterns for files+directories from its context that are required for building it
pub fn with_includes(parent: t.ModuleSource, patterns patterns: List(String)) -> t.ModuleSource {
let field = types.Field(name: "withIncludes", args: [#("patterns", types.GList(list.map(patterns, fn(x) { types.GString(x) })))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Update the module source with a new name.
pub fn with_name(parent: t.ModuleSource, name name: String) -> t.ModuleSource {
let field = types.Field(name: "withName", args: [#("name", types.GString(name))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Update the module source with a new SDK.
pub fn with_s_d_k(parent: t.ModuleSource, source source: String) -> t.ModuleSource {
let field = types.Field(name: "withSDK", args: [#("source", types.GString(source))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Update the module source with a new source subpath.
pub fn with_source_subpath(parent: t.ModuleSource, path path: String) -> t.ModuleSource {
let field = types.Field(name: "withSourceSubpath", args: [#("path", types.GString(path))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Add toolchains to the module source.
pub fn with_toolchains(parent: t.ModuleSource, toolchains toolchains: List(t.ModuleSource)) -> t.ModuleSource {
let field = types.Field(name: "withToolchains", args: [#("toolchains", types.GList(list.map(toolchains, fn(x) { types.GDeferred(x.op) })))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Update the blueprint module to the latest version.
pub fn with_update_blueprint(parent: t.ModuleSource) -> t.ModuleSource {
let field = types.Field(name: "withUpdateBlueprint", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Update one or more module dependencies.
pub fn with_update_dependencies(parent: t.ModuleSource, dependencies dependencies: List(String)) -> t.ModuleSource {
let field = types.Field(name: "withUpdateDependencies", args: [#("dependencies", types.GList(list.map(dependencies, fn(x) { types.GString(x) })))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Update one or more toolchains.
pub fn with_update_toolchains(parent: t.ModuleSource, toolchains toolchains: List(String)) -> t.ModuleSource {
let field = types.Field(name: "withUpdateToolchains", args: [#("toolchains", types.GList(list.map(toolchains, fn(x) { types.GString(x) })))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Update one or more clients.
pub fn with_updated_clients(parent: t.ModuleSource, clients clients: List(String)) -> t.ModuleSource {
let field = types.Field(name: "withUpdatedClients", args: [#("clients", types.GList(list.map(clients, fn(x) { types.GString(x) })))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Remove the current blueprint from the module source.
pub fn without_blueprint(parent: t.ModuleSource) -> t.ModuleSource {
let field = types.Field(name: "withoutBlueprint", args: [], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Remove a client from the module source.
pub fn without_client(parent: t.ModuleSource, path path: String) -> t.ModuleSource {
let field = types.Field(name: "withoutClient", args: [#("path", types.GString(path))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Remove the provided dependencies from the module source's dependency list.
pub fn without_dependencies(parent: t.ModuleSource, dependencies dependencies: List(String)) -> t.ModuleSource {
let field = types.Field(name: "withoutDependencies", args: [#("dependencies", types.GList(list.map(dependencies, fn(x) { types.GString(x) })))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Disable experimental features for the module source.
pub fn without_experimental_features(parent: t.ModuleSource, features features: List(t.ModuleSourceExperimentalFeature)) -> t.ModuleSource {
let field = types.Field(name: "withoutExperimentalFeatures", args: [#("features", types.GList(list.map(features, fn(x) { types.GString(t.module_source_experimental_feature_to_json(x)) })))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}
/// Remove the provided toolchains from the module source.
pub fn without_toolchains(parent: t.ModuleSource, toolchains toolchains: List(String)) -> t.ModuleSource {
let field = types.Field(name: "withoutToolchains", args: [#("toolchains", types.GList(list.map(toolchains, fn(x) { types.GString(x) })))], subfields: [])
let new_op = {
use q <- types.bind(parent.op)
types.Pure(list.append(q, [field]))
}
t.ModuleSource(op: new_op)
}