use std::process::Child; use std::sync::Arc; use dagger_core::connect_params::ConnectParams; use dagger_core::{Boolean, Input, Int, Scalar}; use crate::client::graphql_client; use crate::querybuilder::Selection; // code generated by dagger. DO NOT EDIT. /// A global cache volume identifier. pub struct CacheID(Scalar); /// A unique container identifier. Null designates an empty container (scratch). pub struct ContainerID(Scalar); /// A content-addressed directory identifier. pub struct DirectoryID(Scalar); /// A file identifier. pub struct FileID(Scalar); /// The platform config OS and architecture in a Container. /// The format is [os]/[platform]/[version] (e.g. darwin/arm64/v7, windows/amd64, linux/arm64). pub struct Platform(Scalar); /// A unique identifier for a secret. pub struct SecretID(Scalar); /// A content-addressed socket identifier. pub struct SocketID(Scalar); /// pub struct BuildArg { pub name: String, pub value: String, } impl Input for BuildArg {} /// A directory whose contents persist across runs. pub struct CacheVolume {} impl CacheVolume { /// pub fn id(&self) -> CacheID { todo!() } } impl Input for CacheVolume {} /// An OCI-compatible container, also known as a docker container. pub struct Container { pub conn: ConnectParams, pub proc: Arc, pub selection: Selection, } impl Container { /// Initializes this container from a Dockerfile build, using the context, a dockerfile file path and some additional buildArgs. /// # Arguments /// /// * `context` - Directory context used by the Dockerfile. /// * `dockerfile` - Path to the Dockerfile to use. /// Defaults to './Dockerfile'. /// * `buildArgs` - Additional build arguments. /// * `target` - Target build stage to build. pub fn build( &self, _context: DirectoryID, _dockerfile: Option, _build_args: Option>, _target: Option, ) -> Container { todo!() } /// Retrieves default arguments for future commands. pub fn default_args(&self) -> Option> { todo!() } /// Retrieves a directory at the given path. Mounts are included. pub fn directory(&self, _path: String) -> Directory { todo!() } /// Retrieves entrypoint to be prepended to the arguments of all commands. pub fn entrypoint(&self) -> Option> { todo!() } /// Retrieves the value of the specified environment variable. pub fn env_variable(&self, _name: String) -> Option { todo!() } /// Retrieves the list of environment variables passed to commands. pub fn env_variables(&self) -> Vec { todo!() } /// Retrieves this container after executing the specified command inside it. /// # Arguments /// /// * `args` - Command to run instead of the container's default command. /// * `stdin` - Content to write to the command's standard input before closing. /// * `redirectStdout` - Redirect the command's standard output to a file in the container. /// * `redirectStderr` - Redirect the command's standard error to a file in the container. /// * `experimentalPrivilegedNesting` - Provide dagger access to the executed command. /// Do not use this option unless you trust the command being executed. /// The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM. pub fn exec( &self, args: Option>, _stdin: Option, _redirect_stdout: Option, _redirect_stderr: Option, _experimental_privileged_nesting: Option, ) -> Container { let query = self.selection.select("exec"); let query = query.arg("args", args).unwrap(); Container { conn: self.conn.clone(), proc: self.proc.clone(), selection: query, } } /// Exit code of the last executed command. Zero means success. /// Null if no command has been executed. pub fn exit_code(&self) -> Option { todo!() } /// Writes the container as an OCI tarball to the destination file path on the host for the specified platformVariants. /// Return true on success. /// # Arguments /// /// * `path` - Host's destination path. /// Path can be relative to the engine's workdir or absolute. /// * `platformVariants` - Identifiers for other platform specific containers. /// Used for multi-platform image. pub fn export(&self, _path: String, _platform_variants: Option>) -> Boolean { todo!() } /// Retrieves a file at the given path. Mounts are included. pub fn file(&self, _path: String) -> File { todo!() } /// Initializes this container from the base image published at the given address. /// # Arguments /// /// * `address` - Image's address from its registry. /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main). pub fn from(&self, address: String) -> Container { let query = self.selection.select("from"); let query = query.arg("address", address).unwrap(); Container { conn: self.conn.clone(), proc: self.proc.clone(), selection: query, } } /// Retrieves this container's root filesystem. Mounts are not included. pub fn fs(&self) -> Directory { todo!() } /// A unique identifier for this container. pub fn id(&self) -> ContainerID { todo!() } /// Retrieves the value of the specified label. pub fn label(&self, _name: String) -> Option { todo!() } /// Retrieves the list of labels passed to container. pub fn labels(&self) -> Vec