#![allow(clippy::needless_lifetimes)]
use crate::core::cli_session::DaggerSessionProc;
use crate::core::graphql_client::DynGraphQLClient;
use crate::errors::DaggerError;
use crate::id::IntoID;
use crate::querybuilder::Selection;
use derive_builder::Builder;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct AddressId(pub String);
impl From<&str> for AddressId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for AddressId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<AddressId> for Address {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<AddressId> for AddressId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<AddressId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<AddressId, DaggerError>(self) })
}
}
impl AddressId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct BindingId(pub String);
impl From<&str> for BindingId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for BindingId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<BindingId> for Binding {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<BindingId> for BindingId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<BindingId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<BindingId, DaggerError>(self) })
}
}
impl BindingId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct CacheVolumeId(pub String);
impl From<&str> for CacheVolumeId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for CacheVolumeId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<CacheVolumeId> for CacheVolume {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<CacheVolumeId> for CacheVolumeId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<CacheVolumeId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<CacheVolumeId, DaggerError>(self) })
}
}
impl CacheVolumeId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ChangesetId(pub String);
impl From<&str> for ChangesetId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ChangesetId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ChangesetId> for Changeset {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<ChangesetId> for ChangesetId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ChangesetId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<ChangesetId, DaggerError>(self) })
}
}
impl ChangesetId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct CheckGroupId(pub String);
impl From<&str> for CheckGroupId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for CheckGroupId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<CheckGroupId> for CheckGroup {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<CheckGroupId> for CheckGroupId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<CheckGroupId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<CheckGroupId, DaggerError>(self) })
}
}
impl CheckGroupId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct CheckId(pub String);
impl From<&str> for CheckId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for CheckId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<CheckId> for Check {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<CheckId> for CheckId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CheckId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<CheckId, DaggerError>(self) })
}
}
impl CheckId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct CloudId(pub String);
impl From<&str> for CloudId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for CloudId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<CloudId> for Cloud {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<CloudId> for CloudId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<CloudId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<CloudId, DaggerError>(self) })
}
}
impl CloudId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ContainerId(pub String);
impl From<&str> for ContainerId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ContainerId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ContainerId> for Container {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<ContainerId> for ContainerId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ContainerId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<ContainerId, DaggerError>(self) })
}
}
impl ContainerId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct CurrentModuleId(pub String);
impl From<&str> for CurrentModuleId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for CurrentModuleId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<CurrentModuleId> for CurrentModule {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<CurrentModuleId> for CurrentModuleId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<CurrentModuleId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<CurrentModuleId, DaggerError>(self) })
}
}
impl CurrentModuleId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct DiffStatId(pub String);
impl From<&str> for DiffStatId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for DiffStatId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<DiffStatId> for DiffStat {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<DiffStatId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<DiffStatId> for DiffStatId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<DiffStatId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<DiffStatId, DaggerError>(self) })
}
}
impl DiffStatId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct DirectoryId(pub String);
impl From<&str> for DirectoryId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for DirectoryId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<DirectoryId> for Directory {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<DirectoryId> for DirectoryId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<DirectoryId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<DirectoryId, DaggerError>(self) })
}
}
impl DirectoryId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct EngineCacheEntryId(pub String);
impl From<&str> for EngineCacheEntryId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for EngineCacheEntryId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<EngineCacheEntryId> for EngineCacheEntry {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<EngineCacheEntryId> for EngineCacheEntryId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EngineCacheEntryId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<EngineCacheEntryId, DaggerError>(self) })
}
}
impl EngineCacheEntryId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct EngineCacheEntrySetId(pub String);
impl From<&str> for EngineCacheEntrySetId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for EngineCacheEntrySetId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySet {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<EngineCacheEntrySetId> for EngineCacheEntrySetId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EngineCacheEntrySetId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<EngineCacheEntrySetId, DaggerError>(self) })
}
}
impl EngineCacheEntrySetId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct EngineCacheId(pub String);
impl From<&str> for EngineCacheId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for EngineCacheId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<EngineCacheId> for EngineCache {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<EngineCacheId> for EngineCacheId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EngineCacheId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<EngineCacheId, DaggerError>(self) })
}
}
impl EngineCacheId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct EngineId(pub String);
impl From<&str> for EngineId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for EngineId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<EngineId> for Engine {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<EngineId> for EngineId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EngineId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<EngineId, DaggerError>(self) })
}
}
impl EngineId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct EnumTypeDefId(pub String);
impl From<&str> for EnumTypeDefId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for EnumTypeDefId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<EnumTypeDefId> for EnumTypeDef {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<EnumTypeDefId> for EnumTypeDefId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EnumTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<EnumTypeDefId, DaggerError>(self) })
}
}
impl EnumTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct EnumValueTypeDefId(pub String);
impl From<&str> for EnumValueTypeDefId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for EnumValueTypeDefId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<EnumValueTypeDefId> for EnumValueTypeDef {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<EnumValueTypeDefId> for EnumValueTypeDefId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EnumValueTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<EnumValueTypeDefId, DaggerError>(self) })
}
}
impl EnumValueTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct EnvFileId(pub String);
impl From<&str> for EnvFileId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for EnvFileId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<EnvFileId> for EnvFile {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<EnvFileId> for EnvFileId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvFileId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<EnvFileId, DaggerError>(self) })
}
}
impl EnvFileId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct EnvId(pub String);
impl From<&str> for EnvId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for EnvId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<EnvId> for Env {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<EnvId> for EnvId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<EnvId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<EnvId, DaggerError>(self) })
}
}
impl EnvId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct EnvVariableId(pub String);
impl From<&str> for EnvVariableId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for EnvVariableId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<EnvVariableId> for EnvVariable {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<EnvVariableId> for EnvVariableId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<EnvVariableId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<EnvVariableId, DaggerError>(self) })
}
}
impl EnvVariableId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ErrorId(pub String);
impl From<&str> for ErrorId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ErrorId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ErrorId> for Error {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<ErrorId> for ErrorId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ErrorId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<ErrorId, DaggerError>(self) })
}
}
impl ErrorId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ErrorValueId(pub String);
impl From<&str> for ErrorValueId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ErrorValueId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ErrorValueId> for ErrorValue {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<ErrorValueId> for ErrorValueId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ErrorValueId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<ErrorValueId, DaggerError>(self) })
}
}
impl ErrorValueId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FieldTypeDefId(pub String);
impl From<&str> for FieldTypeDefId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for FieldTypeDefId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<FieldTypeDefId> for FieldTypeDef {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<FieldTypeDefId> for FieldTypeDefId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<FieldTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<FieldTypeDefId, DaggerError>(self) })
}
}
impl FieldTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FileId(pub String);
impl From<&str> for FileId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for FileId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<FileId> for File {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<FileId> for FileId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FileId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<FileId, DaggerError>(self) })
}
}
impl FileId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FunctionArgId(pub String);
impl From<&str> for FunctionArgId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for FunctionArgId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<FunctionArgId> for FunctionArg {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<FunctionArgId> for FunctionArgId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<FunctionArgId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<FunctionArgId, DaggerError>(self) })
}
}
impl FunctionArgId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FunctionCallArgValueId(pub String);
impl From<&str> for FunctionCallArgValueId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for FunctionCallArgValueId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<FunctionCallArgValueId> for FunctionCallArgValue {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<FunctionCallArgValueId> for FunctionCallArgValueId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<FunctionCallArgValueId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<FunctionCallArgValueId, DaggerError>(self) })
}
}
impl FunctionCallArgValueId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FunctionCallId(pub String);
impl From<&str> for FunctionCallId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for FunctionCallId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<FunctionCallId> for FunctionCall {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<FunctionCallId> for FunctionCallId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<FunctionCallId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<FunctionCallId, DaggerError>(self) })
}
}
impl FunctionCallId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FunctionId(pub String);
impl From<&str> for FunctionId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for FunctionId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<FunctionId> for Function {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<FunctionId> for FunctionId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<FunctionId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<FunctionId, DaggerError>(self) })
}
}
impl FunctionId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct GeneratedCodeId(pub String);
impl From<&str> for GeneratedCodeId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for GeneratedCodeId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<GeneratedCodeId> for GeneratedCode {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<GeneratedCodeId> for GeneratedCodeId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<GeneratedCodeId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<GeneratedCodeId, DaggerError>(self) })
}
}
impl GeneratedCodeId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct GeneratorGroupId(pub String);
impl From<&str> for GeneratorGroupId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for GeneratorGroupId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<GeneratorGroupId> for GeneratorGroup {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<GeneratorGroupId> for GeneratorGroupId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<GeneratorGroupId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<GeneratorGroupId, DaggerError>(self) })
}
}
impl GeneratorGroupId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct GeneratorId(pub String);
impl From<&str> for GeneratorId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for GeneratorId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<GeneratorId> for Generator {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<GeneratorId> for GeneratorId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<GeneratorId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<GeneratorId, DaggerError>(self) })
}
}
impl GeneratorId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct GitRefId(pub String);
impl From<&str> for GitRefId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for GitRefId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<GitRefId> for GitRef {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<GitRefId> for GitRefId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<GitRefId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<GitRefId, DaggerError>(self) })
}
}
impl GitRefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct GitRepositoryId(pub String);
impl From<&str> for GitRepositoryId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for GitRepositoryId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<GitRepositoryId> for GitRepository {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<GitRepositoryId> for GitRepositoryId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<GitRepositoryId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<GitRepositoryId, DaggerError>(self) })
}
}
impl GitRepositoryId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct HealthcheckConfigId(pub String);
impl From<&str> for HealthcheckConfigId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for HealthcheckConfigId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<HealthcheckConfigId> for HealthcheckConfig {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<HealthcheckConfigId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<HealthcheckConfigId> for HealthcheckConfigId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<HealthcheckConfigId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<HealthcheckConfigId, DaggerError>(self) })
}
}
impl HealthcheckConfigId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct HostId(pub String);
impl From<&str> for HostId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for HostId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<HostId> for Host {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<HostId> for HostId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<HostId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<HostId, DaggerError>(self) })
}
}
impl HostId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct InputTypeDefId(pub String);
impl From<&str> for InputTypeDefId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for InputTypeDefId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<InputTypeDefId> for InputTypeDef {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<InputTypeDefId> for InputTypeDefId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<InputTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<InputTypeDefId, DaggerError>(self) })
}
}
impl InputTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct InterfaceTypeDefId(pub String);
impl From<&str> for InterfaceTypeDefId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for InterfaceTypeDefId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<InterfaceTypeDefId> for InterfaceTypeDef {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<InterfaceTypeDefId> for InterfaceTypeDefId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<InterfaceTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<InterfaceTypeDefId, DaggerError>(self) })
}
}
impl InterfaceTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Json(pub String);
impl From<&str> for Json {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for Json {
fn from(value: String) -> Self {
Self(value)
}
}
impl Json {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct JsonValueId(pub String);
impl From<&str> for JsonValueId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for JsonValueId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<JsonValueId> for JsonValue {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<JsonValueId> for JsonValueId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<JsonValueId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<JsonValueId, DaggerError>(self) })
}
}
impl JsonValueId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Llmid(pub String);
impl From<&str> for Llmid {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for Llmid {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<Llmid> for Llm {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<Llmid> for Llmid {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Llmid, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<Llmid, DaggerError>(self) })
}
}
impl Llmid {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct LlmTokenUsageId(pub String);
impl From<&str> for LlmTokenUsageId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for LlmTokenUsageId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<LlmTokenUsageId> for LlmTokenUsage {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<LlmTokenUsageId> for LlmTokenUsageId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<LlmTokenUsageId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<LlmTokenUsageId, DaggerError>(self) })
}
}
impl LlmTokenUsageId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct LabelId(pub String);
impl From<&str> for LabelId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for LabelId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<LabelId> for Label {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<LabelId> for LabelId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<LabelId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<LabelId, DaggerError>(self) })
}
}
impl LabelId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ListTypeDefId(pub String);
impl From<&str> for ListTypeDefId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ListTypeDefId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ListTypeDefId> for ListTypeDef {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<ListTypeDefId> for ListTypeDefId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ListTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<ListTypeDefId, DaggerError>(self) })
}
}
impl ListTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ModuleConfigClientId(pub String);
impl From<&str> for ModuleConfigClientId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ModuleConfigClientId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ModuleConfigClientId> for ModuleConfigClient {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<ModuleConfigClientId> for ModuleConfigClientId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ModuleConfigClientId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<ModuleConfigClientId, DaggerError>(self) })
}
}
impl ModuleConfigClientId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ModuleId(pub String);
impl From<&str> for ModuleId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ModuleId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ModuleId> for Module {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<ModuleId> for ModuleId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ModuleId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<ModuleId, DaggerError>(self) })
}
}
impl ModuleId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ModuleSourceId(pub String);
impl From<&str> for ModuleSourceId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ModuleSourceId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ModuleSourceId> for ModuleSource {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<ModuleSourceId> for ModuleSourceId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ModuleSourceId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<ModuleSourceId, DaggerError>(self) })
}
}
impl ModuleSourceId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ObjectTypeDefId(pub String);
impl From<&str> for ObjectTypeDefId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ObjectTypeDefId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ObjectTypeDefId> for ObjectTypeDef {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<ObjectTypeDefId> for ObjectTypeDefId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ObjectTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<ObjectTypeDefId, DaggerError>(self) })
}
}
impl ObjectTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Platform(pub String);
impl From<&str> for Platform {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for Platform {
fn from(value: String) -> Self {
Self(value)
}
}
impl Platform {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct PortId(pub String);
impl From<&str> for PortId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for PortId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<PortId> for Port {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<PortId> for PortId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<PortId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<PortId, DaggerError>(self) })
}
}
impl PortId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct QueryId(pub String);
impl From<&str> for QueryId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for QueryId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<QueryId> for Query {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<QueryId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<QueryId> for QueryId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<QueryId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<QueryId, DaggerError>(self) })
}
}
impl QueryId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct SdkConfigId(pub String);
impl From<&str> for SdkConfigId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for SdkConfigId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<SdkConfigId> for SdkConfig {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<SdkConfigId> for SdkConfigId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<SdkConfigId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<SdkConfigId, DaggerError>(self) })
}
}
impl SdkConfigId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ScalarTypeDefId(pub String);
impl From<&str> for ScalarTypeDefId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ScalarTypeDefId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ScalarTypeDefId> for ScalarTypeDef {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<ScalarTypeDefId> for ScalarTypeDefId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<ScalarTypeDefId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<ScalarTypeDefId, DaggerError>(self) })
}
}
impl ScalarTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct SearchResultId(pub String);
impl From<&str> for SearchResultId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for SearchResultId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<SearchResultId> for SearchResult {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<SearchResultId> for SearchResultId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<SearchResultId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<SearchResultId, DaggerError>(self) })
}
}
impl SearchResultId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct SearchSubmatchId(pub String);
impl From<&str> for SearchSubmatchId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for SearchSubmatchId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<SearchSubmatchId> for SearchSubmatch {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<SearchSubmatchId> for SearchSubmatchId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<SearchSubmatchId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<SearchSubmatchId, DaggerError>(self) })
}
}
impl SearchSubmatchId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct SecretId(pub String);
impl From<&str> for SecretId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for SecretId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<SecretId> for Secret {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<SecretId> for SecretId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SecretId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<SecretId, DaggerError>(self) })
}
}
impl SecretId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ServiceId(pub String);
impl From<&str> for ServiceId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for ServiceId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<ServiceId> for Service {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<ServiceId> for ServiceId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<ServiceId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<ServiceId, DaggerError>(self) })
}
}
impl ServiceId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct SocketId(pub String);
impl From<&str> for SocketId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for SocketId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<SocketId> for Socket {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<SocketId> for SocketId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<SocketId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<SocketId, DaggerError>(self) })
}
}
impl SocketId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct SourceMapId(pub String);
impl From<&str> for SourceMapId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for SourceMapId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<SourceMapId> for SourceMap {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<SourceMapId> for SourceMapId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<SourceMapId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<SourceMapId, DaggerError>(self) })
}
}
impl SourceMapId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct StatId(pub String);
impl From<&str> for StatId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for StatId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<StatId> for Stat {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<StatId> for StatId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<StatId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<StatId, DaggerError>(self) })
}
}
impl StatId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct TerminalId(pub String);
impl From<&str> for TerminalId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for TerminalId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<TerminalId> for Terminal {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<TerminalId> for TerminalId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TerminalId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<TerminalId, DaggerError>(self) })
}
}
impl TerminalId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct TypeDefId(pub String);
impl From<&str> for TypeDefId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for TypeDefId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<TypeDefId> for TypeDef {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<TypeDefId> for TypeDefId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<TypeDefId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<TypeDefId, DaggerError>(self) })
}
}
impl TypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct UpGroupId(pub String);
impl From<&str> for UpGroupId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for UpGroupId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<UpGroupId> for UpGroup {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpGroupId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<UpGroupId> for UpGroupId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpGroupId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<UpGroupId, DaggerError>(self) })
}
}
impl UpGroupId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct UpId(pub String);
impl From<&str> for UpId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for UpId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<UpId> for Up {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpId, DaggerError>> + Send>>
{
Box::pin(async move { self.id().await })
}
}
impl IntoID<UpId> for UpId {
fn into_id(
self,
) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<UpId, DaggerError>> + Send>>
{
Box::pin(async move { Ok::<UpId, DaggerError>(self) })
}
}
impl UpId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Void(pub String);
impl From<&str> for Void {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for Void {
fn from(value: String) -> Self {
Self(value)
}
}
impl Void {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct WorkspaceId(pub String);
impl From<&str> for WorkspaceId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<String> for WorkspaceId {
fn from(value: String) -> Self {
Self(value)
}
}
impl IntoID<WorkspaceId> for Workspace {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
> {
Box::pin(async move { self.id().await })
}
}
impl IntoID<WorkspaceId> for WorkspaceId {
fn into_id(
self,
) -> std::pin::Pin<
Box<dyn core::future::Future<Output = Result<WorkspaceId, DaggerError>> + Send>,
> {
Box::pin(async move { Ok::<WorkspaceId, DaggerError>(self) })
}
}
impl WorkspaceId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct BuildArg {
pub name: String,
pub value: String,
}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct PipelineLabel {
pub name: String,
pub value: String,
}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct PortForward {
pub backend: isize,
pub frontend: isize,
pub protocol: NetworkProtocol,
}
#[derive(Clone)]
pub struct Address {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct AddressDirectoryOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub gitignore: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub no_cache: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct AddressFileOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub gitignore: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub no_cache: Option<bool>,
}
impl Address {
pub fn container(&self) -> Container {
let query = self.selection.select("container");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn directory(&self) -> Directory {
let query = self.selection.select("directory");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
let mut query = self.selection.select("directory");
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
if let Some(gitignore) = opts.gitignore {
query = query.arg("gitignore", gitignore);
}
if let Some(no_cache) = opts.no_cache {
query = query.arg("noCache", no_cache);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn file(&self) -> File {
let query = self.selection.select("file");
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
let mut query = self.selection.select("file");
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
if let Some(gitignore) = opts.gitignore {
query = query.arg("gitignore", gitignore);
}
if let Some(no_cache) = opts.no_cache {
query = query.arg("noCache", no_cache);
}
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn git_ref(&self) -> GitRef {
let query = self.selection.select("gitRef");
GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn git_repository(&self) -> GitRepository {
let query = self.selection.select("gitRepository");
GitRepository {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<AddressId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn secret(&self) -> Secret {
let query = self.selection.select("secret");
Secret {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn service(&self) -> Service {
let query = self.selection.select("service");
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn socket(&self) -> Socket {
let query = self.selection.select("socket");
Socket {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn value(&self) -> Result<String, DaggerError> {
let query = self.selection.select("value");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Binding {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Binding {
pub fn as_address(&self) -> Address {
let query = self.selection.select("asAddress");
Address {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_cache_volume(&self) -> CacheVolume {
let query = self.selection.select("asCacheVolume");
CacheVolume {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_changeset(&self) -> Changeset {
let query = self.selection.select("asChangeset");
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_check(&self) -> Check {
let query = self.selection.select("asCheck");
Check {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_check_group(&self) -> CheckGroup {
let query = self.selection.select("asCheckGroup");
CheckGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_cloud(&self) -> Cloud {
let query = self.selection.select("asCloud");
Cloud {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_container(&self) -> Container {
let query = self.selection.select("asContainer");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_diff_stat(&self) -> DiffStat {
let query = self.selection.select("asDiffStat");
DiffStat {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_directory(&self) -> Directory {
let query = self.selection.select("asDirectory");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_env(&self) -> Env {
let query = self.selection.select("asEnv");
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_env_file(&self) -> EnvFile {
let query = self.selection.select("asEnvFile");
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_file(&self) -> File {
let query = self.selection.select("asFile");
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_generator(&self) -> Generator {
let query = self.selection.select("asGenerator");
Generator {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_generator_group(&self) -> GeneratorGroup {
let query = self.selection.select("asGeneratorGroup");
GeneratorGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_git_ref(&self) -> GitRef {
let query = self.selection.select("asGitRef");
GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_git_repository(&self) -> GitRepository {
let query = self.selection.select("asGitRepository");
GitRepository {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_json_value(&self) -> JsonValue {
let query = self.selection.select("asJSONValue");
JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_module(&self) -> Module {
let query = self.selection.select("asModule");
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_module_config_client(&self) -> ModuleConfigClient {
let query = self.selection.select("asModuleConfigClient");
ModuleConfigClient {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_module_source(&self) -> ModuleSource {
let query = self.selection.select("asModuleSource");
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_search_result(&self) -> SearchResult {
let query = self.selection.select("asSearchResult");
SearchResult {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_search_submatch(&self) -> SearchSubmatch {
let query = self.selection.select("asSearchSubmatch");
SearchSubmatch {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_secret(&self) -> Secret {
let query = self.selection.select("asSecret");
Secret {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_service(&self) -> Service {
let query = self.selection.select("asService");
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_socket(&self) -> Socket {
let query = self.selection.select("asSocket");
Socket {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_stat(&self) -> Stat {
let query = self.selection.select("asStat");
Stat {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn as_string(&self) -> Result<String, DaggerError> {
let query = self.selection.select("asString");
query.execute(self.graphql_client.clone()).await
}
pub fn as_up(&self) -> Up {
let query = self.selection.select("asUp");
Up {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_up_group(&self) -> UpGroup {
let query = self.selection.select("asUpGroup");
UpGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_workspace(&self) -> Workspace {
let query = self.selection.select("asWorkspace");
Workspace {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn digest(&self) -> Result<String, DaggerError> {
let query = self.selection.select("digest");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<BindingId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn is_null(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("isNull");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn type_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("typeName");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct CacheVolume {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl CacheVolume {
pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Changeset {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ChangesetWithChangesetOpts {
#[builder(setter(into, strip_option), default)]
pub on_conflict: Option<ChangesetMergeConflict>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ChangesetWithChangesetsOpts {
#[builder(setter(into, strip_option), default)]
pub on_conflict: Option<ChangesetsMergeConflict>,
}
impl Changeset {
pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("addedPaths");
query.execute(self.graphql_client.clone()).await
}
pub fn after(&self) -> Directory {
let query = self.selection.select("after");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_patch(&self) -> File {
let query = self.selection.select("asPatch");
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn before(&self) -> Directory {
let query = self.selection.select("before");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn diff_stats(&self) -> Vec<DiffStat> {
let query = self.selection.select("diffStats");
vec![DiffStat {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<ChangesetId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn is_empty(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("isEmpty");
query.execute(self.graphql_client.clone()).await
}
pub fn layer(&self) -> Directory {
let query = self.selection.select("layer");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("modifiedPaths");
query.execute(self.graphql_client.clone()).await
}
pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("removedPaths");
query.execute(self.graphql_client.clone()).await
}
pub async fn sync(&self) -> Result<ChangesetId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
pub fn with_changeset(&self, changes: impl IntoID<ChangesetId>) -> Changeset {
let mut query = self.selection.select("withChangeset");
query = query.arg_lazy(
"changes",
Box::new(move || {
let changes = changes.clone();
Box::pin(async move { changes.into_id().await.unwrap().quote() })
}),
);
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_changeset_opts(
&self,
changes: impl IntoID<ChangesetId>,
opts: ChangesetWithChangesetOpts,
) -> Changeset {
let mut query = self.selection.select("withChangeset");
query = query.arg_lazy(
"changes",
Box::new(move || {
let changes = changes.clone();
Box::pin(async move { changes.into_id().await.unwrap().quote() })
}),
);
if let Some(on_conflict) = opts.on_conflict {
query = query.arg("onConflict", on_conflict);
}
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_changesets(&self, changes: Vec<ChangesetId>) -> Changeset {
let mut query = self.selection.select("withChangesets");
query = query.arg("changes", changes);
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_changesets_opts(
&self,
changes: Vec<ChangesetId>,
opts: ChangesetWithChangesetsOpts,
) -> Changeset {
let mut query = self.selection.select("withChangesets");
query = query.arg("changes", changes);
if let Some(on_conflict) = opts.on_conflict {
query = query.arg("onConflict", on_conflict);
}
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct Check {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Check {
pub async fn completed(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("completed");
query.execute(self.graphql_client.clone()).await
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub fn error(&self) -> Error {
let query = self.selection.select("error");
Error {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<CheckId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn original_module(&self) -> Module {
let query = self.selection.select("originalModule");
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn passed(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("passed");
query.execute(self.graphql_client.clone()).await
}
pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("path");
query.execute(self.graphql_client.clone()).await
}
pub async fn result_emoji(&self) -> Result<String, DaggerError> {
let query = self.selection.select("resultEmoji");
query.execute(self.graphql_client.clone()).await
}
pub fn run(&self) -> Check {
let query = self.selection.select("run");
Check {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct CheckGroup {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct CheckGroupRunOpts {
#[builder(setter(into, strip_option), default)]
pub fail_fast: Option<bool>,
}
impl CheckGroup {
pub async fn id(&self) -> Result<CheckGroupId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn list(&self) -> Vec<Check> {
let query = self.selection.select("list");
vec![Check {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn report(&self) -> File {
let query = self.selection.select("report");
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn run(&self) -> CheckGroup {
let query = self.selection.select("run");
CheckGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
let mut query = self.selection.select("run");
if let Some(fail_fast) = opts.fail_fast {
query = query.arg("failFast", fail_fast);
}
CheckGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct Cloud {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Cloud {
pub async fn id(&self) -> Result<CloudId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn trace_url(&self) -> Result<String, DaggerError> {
let query = self.selection.select("traceURL");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Container {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerAsServiceOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub args: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub experimental_privileged_nesting: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub insecure_root_capabilities: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub no_init: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub use_entrypoint: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerAsTarballOpts {
#[builder(setter(into, strip_option), default)]
pub forced_compression: Option<ImageLayerCompression>,
#[builder(setter(into, strip_option), default)]
pub media_types: Option<ImageMediaTypes>,
#[builder(setter(into, strip_option), default)]
pub platform_variants: Option<Vec<ContainerId>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerDirectoryOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerExistsOpts {
#[builder(setter(into, strip_option), default)]
pub do_not_follow_symlinks: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub expected_type: Option<ExistsType>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerExportOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub forced_compression: Option<ImageLayerCompression>,
#[builder(setter(into, strip_option), default)]
pub media_types: Option<ImageMediaTypes>,
#[builder(setter(into, strip_option), default)]
pub platform_variants: Option<Vec<ContainerId>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerExportImageOpts {
#[builder(setter(into, strip_option), default)]
pub forced_compression: Option<ImageLayerCompression>,
#[builder(setter(into, strip_option), default)]
pub media_types: Option<ImageMediaTypes>,
#[builder(setter(into, strip_option), default)]
pub platform_variants: Option<Vec<ContainerId>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerFileOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerImportOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub tag: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerPublishOpts {
#[builder(setter(into, strip_option), default)]
pub forced_compression: Option<ImageLayerCompression>,
#[builder(setter(into, strip_option), default)]
pub media_types: Option<ImageMediaTypes>,
#[builder(setter(into, strip_option), default)]
pub platform_variants: Option<Vec<ContainerId>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerStatOpts {
#[builder(setter(into, strip_option), default)]
pub do_not_follow_symlinks: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerTerminalOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub cmd: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub experimental_privileged_nesting: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub insecure_root_capabilities: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerUpOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub args: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub experimental_privileged_nesting: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub insecure_root_capabilities: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub no_init: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub ports: Option<Vec<PortForward>>,
#[builder(setter(into, strip_option), default)]
pub random: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub use_entrypoint: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithDefaultTerminalCmdOpts {
#[builder(setter(into, strip_option), default)]
pub experimental_privileged_nesting: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub insecure_root_capabilities: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithDirectoryOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub gitignore: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithDockerHealthcheckOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub interval: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub retries: Option<isize>,
#[builder(setter(into, strip_option), default)]
pub shell: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub start_interval: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub start_period: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub timeout: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithEntrypointOpts {
#[builder(setter(into, strip_option), default)]
pub keep_default_args: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithEnvVariableOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithExecOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub expect: Option<ReturnType>,
#[builder(setter(into, strip_option), default)]
pub experimental_privileged_nesting: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub insecure_root_capabilities: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub no_init: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub redirect_stderr: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub redirect_stdin: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub redirect_stdout: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub stdin: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub use_entrypoint: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithExposedPortOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub experimental_skip_healthcheck: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub protocol: Option<NetworkProtocol>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithFileOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithFilesOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithMountedCacheOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub sharing: Option<CacheSharingMode>,
#[builder(setter(into, strip_option), default)]
pub source: Option<DirectoryId>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithMountedDirectoryOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithMountedFileOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithMountedSecretOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub mode: Option<isize>,
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithMountedTempOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub size: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithNewFileOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithSymlinkOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithUnixSocketOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithWorkdirOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithoutDirectoryOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithoutEntrypointOpts {
#[builder(setter(into, strip_option), default)]
pub keep_default_args: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithoutExposedPortOpts {
#[builder(setter(into, strip_option), default)]
pub protocol: Option<NetworkProtocol>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithoutFileOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithoutFilesOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithoutMountOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithoutUnixSocketOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
impl Container {
pub fn as_service(&self) -> Service {
let query = self.selection.select("asService");
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
let mut query = self.selection.select("asService");
if let Some(args) = opts.args {
query = query.arg("args", args);
}
if let Some(use_entrypoint) = opts.use_entrypoint {
query = query.arg("useEntrypoint", use_entrypoint);
}
if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
query = query.arg(
"experimentalPrivilegedNesting",
experimental_privileged_nesting,
);
}
if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
if let Some(no_init) = opts.no_init {
query = query.arg("noInit", no_init);
}
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_tarball(&self) -> File {
let query = self.selection.select("asTarball");
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
let mut query = self.selection.select("asTarball");
if let Some(platform_variants) = opts.platform_variants {
query = query.arg("platformVariants", platform_variants);
}
if let Some(forced_compression) = opts.forced_compression {
query = query.arg("forcedCompression", forced_compression);
}
if let Some(media_types) = opts.media_types {
query = query.arg("mediaTypes", media_types);
}
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn combined_output(&self) -> Result<String, DaggerError> {
let query = self.selection.select("combinedOutput");
query.execute(self.graphql_client.clone()).await
}
pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("defaultArgs");
query.execute(self.graphql_client.clone()).await
}
pub fn directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn directory_opts(
&self,
path: impl Into<String>,
opts: ContainerDirectoryOpts,
) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn docker_healthcheck(&self) -> HealthcheckConfig {
let query = self.selection.select("dockerHealthcheck");
HealthcheckConfig {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("entrypoint");
query.execute(self.graphql_client.clone()).await
}
pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("envVariable");
query = query.arg("name", name.into());
query.execute(self.graphql_client.clone()).await
}
pub fn env_variables(&self) -> Vec<EnvVariable> {
let query = self.selection.select("envVariables");
vec![EnvVariable {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
let mut query = self.selection.select("exists");
query = query.arg("path", path.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn exists_opts(
&self,
path: impl Into<String>,
opts: ContainerExistsOpts,
) -> Result<bool, DaggerError> {
let mut query = self.selection.select("exists");
query = query.arg("path", path.into());
if let Some(expected_type) = opts.expected_type {
query = query.arg("expectedType", expected_type);
}
if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn exit_code(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("exitCode");
query.execute(self.graphql_client.clone()).await
}
pub fn experimental_with_all_gp_us(&self) -> Container {
let query = self.selection.select("experimentalWithAllGPUs");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("experimentalWithGPU");
query = query.arg(
"devices",
devices
.into_iter()
.map(|i| i.into())
.collect::<Vec<String>>(),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn export_opts(
&self,
path: impl Into<String>,
opts: ContainerExportOpts,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
if let Some(platform_variants) = opts.platform_variants {
query = query.arg("platformVariants", platform_variants);
}
if let Some(forced_compression) = opts.forced_compression {
query = query.arg("forcedCompression", forced_compression);
}
if let Some(media_types) = opts.media_types {
query = query.arg("mediaTypes", media_types);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
let mut query = self.selection.select("exportImage");
query = query.arg("name", name.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn export_image_opts(
&self,
name: impl Into<String>,
opts: ContainerExportImageOpts,
) -> Result<Void, DaggerError> {
let mut query = self.selection.select("exportImage");
query = query.arg("name", name.into());
if let Some(platform_variants) = opts.platform_variants {
query = query.arg("platformVariants", platform_variants);
}
if let Some(forced_compression) = opts.forced_compression {
query = query.arg("forcedCompression", forced_compression);
}
if let Some(media_types) = opts.media_types {
query = query.arg("mediaTypes", media_types);
}
query.execute(self.graphql_client.clone()).await
}
pub fn exposed_ports(&self) -> Vec<Port> {
let query = self.selection.select("exposedPorts");
vec![Port {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn file(&self, path: impl Into<String>) -> File {
let mut query = self.selection.select("file");
query = query.arg("path", path.into());
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
let mut query = self.selection.select("file");
query = query.arg("path", path.into());
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn from(&self, address: impl Into<String>) -> Container {
let mut query = self.selection.select("from");
query = query.arg("address", address.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<ContainerId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn image_ref(&self) -> Result<String, DaggerError> {
let query = self.selection.select("imageRef");
query.execute(self.graphql_client.clone()).await
}
pub fn import(&self, source: impl IntoID<FileId>) -> Container {
let mut query = self.selection.select("import");
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn import_opts<'a>(
&self,
source: impl IntoID<FileId>,
opts: ContainerImportOpts<'a>,
) -> Container {
let mut query = self.selection.select("import");
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
if let Some(tag) = opts.tag {
query = query.arg("tag", tag);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("label");
query = query.arg("name", name.into());
query.execute(self.graphql_client.clone()).await
}
pub fn labels(&self) -> Vec<Label> {
let query = self.selection.select("labels");
vec![Label {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("mounts");
query.execute(self.graphql_client.clone()).await
}
pub async fn platform(&self) -> Result<Platform, DaggerError> {
let query = self.selection.select("platform");
query.execute(self.graphql_client.clone()).await
}
pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("publish");
query = query.arg("address", address.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn publish_opts(
&self,
address: impl Into<String>,
opts: ContainerPublishOpts,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("publish");
query = query.arg("address", address.into());
if let Some(platform_variants) = opts.platform_variants {
query = query.arg("platformVariants", platform_variants);
}
if let Some(forced_compression) = opts.forced_compression {
query = query.arg("forcedCompression", forced_compression);
}
if let Some(media_types) = opts.media_types {
query = query.arg("mediaTypes", media_types);
}
query.execute(self.graphql_client.clone()).await
}
pub fn rootfs(&self) -> Directory {
let query = self.selection.select("rootfs");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn stat(&self, path: impl Into<String>) -> Stat {
let mut query = self.selection.select("stat");
query = query.arg("path", path.into());
Stat {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
let mut query = self.selection.select("stat");
query = query.arg("path", path.into());
if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
}
Stat {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn stderr(&self) -> Result<String, DaggerError> {
let query = self.selection.select("stderr");
query.execute(self.graphql_client.clone()).await
}
pub async fn stdout(&self) -> Result<String, DaggerError> {
let query = self.selection.select("stdout");
query.execute(self.graphql_client.clone()).await
}
pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
pub fn terminal(&self) -> Container {
let query = self.selection.select("terminal");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
let mut query = self.selection.select("terminal");
if let Some(cmd) = opts.cmd {
query = query.arg("cmd", cmd);
}
if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
query = query.arg(
"experimentalPrivilegedNesting",
experimental_privileged_nesting,
);
}
if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn up(&self) -> Result<Void, DaggerError> {
let query = self.selection.select("up");
query.execute(self.graphql_client.clone()).await
}
pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
let mut query = self.selection.select("up");
if let Some(random) = opts.random {
query = query.arg("random", random);
}
if let Some(ports) = opts.ports {
query = query.arg("ports", ports);
}
if let Some(args) = opts.args {
query = query.arg("args", args);
}
if let Some(use_entrypoint) = opts.use_entrypoint {
query = query.arg("useEntrypoint", use_entrypoint);
}
if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
query = query.arg(
"experimentalPrivilegedNesting",
experimental_privileged_nesting,
);
}
if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
if let Some(no_init) = opts.no_init {
query = query.arg("noInit", no_init);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn user(&self) -> Result<String, DaggerError> {
let query = self.selection.select("user");
query.execute(self.graphql_client.clone()).await
}
pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
let mut query = self.selection.select("withAnnotation");
query = query.arg("name", name.into());
query = query.arg("value", value.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("withDefaultArgs");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("withDefaultTerminalCmd");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_default_terminal_cmd_opts(
&self,
args: Vec<impl Into<String>>,
opts: ContainerWithDefaultTerminalCmdOpts,
) -> Container {
let mut query = self.selection.select("withDefaultTerminalCmd");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
query = query.arg(
"experimentalPrivilegedNesting",
experimental_privileged_nesting,
);
}
if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_directory(
&self,
path: impl Into<String>,
source: impl IntoID<DirectoryId>,
) -> Container {
let mut query = self.selection.select("withDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_directory_opts<'a>(
&self,
path: impl Into<String>,
source: impl IntoID<DirectoryId>,
opts: ContainerWithDirectoryOpts<'a>,
) -> Container {
let mut query = self.selection.select("withDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
if let Some(gitignore) = opts.gitignore {
query = query.arg("gitignore", gitignore);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("withDockerHealthcheck");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_docker_healthcheck_opts<'a>(
&self,
args: Vec<impl Into<String>>,
opts: ContainerWithDockerHealthcheckOpts<'a>,
) -> Container {
let mut query = self.selection.select("withDockerHealthcheck");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
if let Some(shell) = opts.shell {
query = query.arg("shell", shell);
}
if let Some(interval) = opts.interval {
query = query.arg("interval", interval);
}
if let Some(timeout) = opts.timeout {
query = query.arg("timeout", timeout);
}
if let Some(start_period) = opts.start_period {
query = query.arg("startPeriod", start_period);
}
if let Some(start_interval) = opts.start_interval {
query = query.arg("startInterval", start_interval);
}
if let Some(retries) = opts.retries {
query = query.arg("retries", retries);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("withEntrypoint");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_entrypoint_opts(
&self,
args: Vec<impl Into<String>>,
opts: ContainerWithEntrypointOpts,
) -> Container {
let mut query = self.selection.select("withEntrypoint");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
if let Some(keep_default_args) = opts.keep_default_args {
query = query.arg("keepDefaultArgs", keep_default_args);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_env_file_variables(&self, source: impl IntoID<EnvFileId>) -> Container {
let mut query = self.selection.select("withEnvFileVariables");
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_env_variable(
&self,
name: impl Into<String>,
value: impl Into<String>,
) -> Container {
let mut query = self.selection.select("withEnvVariable");
query = query.arg("name", name.into());
query = query.arg("value", value.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_env_variable_opts(
&self,
name: impl Into<String>,
value: impl Into<String>,
opts: ContainerWithEnvVariableOpts,
) -> Container {
let mut query = self.selection.select("withEnvVariable");
query = query.arg("name", name.into());
query = query.arg("value", value.into());
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_error(&self, err: impl Into<String>) -> Container {
let mut query = self.selection.select("withError");
query = query.arg("err", err.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("withExec");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_exec_opts<'a>(
&self,
args: Vec<impl Into<String>>,
opts: ContainerWithExecOpts<'a>,
) -> Container {
let mut query = self.selection.select("withExec");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
if let Some(use_entrypoint) = opts.use_entrypoint {
query = query.arg("useEntrypoint", use_entrypoint);
}
if let Some(stdin) = opts.stdin {
query = query.arg("stdin", stdin);
}
if let Some(redirect_stdin) = opts.redirect_stdin {
query = query.arg("redirectStdin", redirect_stdin);
}
if let Some(redirect_stdout) = opts.redirect_stdout {
query = query.arg("redirectStdout", redirect_stdout);
}
if let Some(redirect_stderr) = opts.redirect_stderr {
query = query.arg("redirectStderr", redirect_stderr);
}
if let Some(expect) = opts.expect {
query = query.arg("expect", expect);
}
if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
query = query.arg(
"experimentalPrivilegedNesting",
experimental_privileged_nesting,
);
}
if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
if let Some(no_init) = opts.no_init {
query = query.arg("noInit", no_init);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_exposed_port(&self, port: isize) -> Container {
let mut query = self.selection.select("withExposedPort");
query = query.arg("port", port);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_exposed_port_opts<'a>(
&self,
port: isize,
opts: ContainerWithExposedPortOpts<'a>,
) -> Container {
let mut query = self.selection.select("withExposedPort");
query = query.arg("port", port);
if let Some(protocol) = opts.protocol {
query = query.arg("protocol", protocol);
}
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Container {
let mut query = self.selection.select("withFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_file_opts<'a>(
&self,
path: impl Into<String>,
source: impl IntoID<FileId>,
opts: ContainerWithFileOpts<'a>,
) -> Container {
let mut query = self.selection.select("withFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Container {
let mut query = self.selection.select("withFiles");
query = query.arg("path", path.into());
query = query.arg("sources", sources);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_files_opts<'a>(
&self,
path: impl Into<String>,
sources: Vec<FileId>,
opts: ContainerWithFilesOpts<'a>,
) -> Container {
let mut query = self.selection.select("withFiles");
query = query.arg("path", path.into());
query = query.arg("sources", sources);
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
let mut query = self.selection.select("withLabel");
query = query.arg("name", name.into());
query = query.arg("value", value.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mounted_cache(
&self,
path: impl Into<String>,
cache: impl IntoID<CacheVolumeId>,
) -> Container {
let mut query = self.selection.select("withMountedCache");
query = query.arg("path", path.into());
query = query.arg_lazy(
"cache",
Box::new(move || {
let cache = cache.clone();
Box::pin(async move { cache.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mounted_cache_opts<'a>(
&self,
path: impl Into<String>,
cache: impl IntoID<CacheVolumeId>,
opts: ContainerWithMountedCacheOpts<'a>,
) -> Container {
let mut query = self.selection.select("withMountedCache");
query = query.arg("path", path.into());
query = query.arg_lazy(
"cache",
Box::new(move || {
let cache = cache.clone();
Box::pin(async move { cache.into_id().await.unwrap().quote() })
}),
);
if let Some(source) = opts.source {
query = query.arg("source", source);
}
if let Some(sharing) = opts.sharing {
query = query.arg("sharing", sharing);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mounted_directory(
&self,
path: impl Into<String>,
source: impl IntoID<DirectoryId>,
) -> Container {
let mut query = self.selection.select("withMountedDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mounted_directory_opts<'a>(
&self,
path: impl Into<String>,
source: impl IntoID<DirectoryId>,
opts: ContainerWithMountedDirectoryOpts<'a>,
) -> Container {
let mut query = self.selection.select("withMountedDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mounted_file(
&self,
path: impl Into<String>,
source: impl IntoID<FileId>,
) -> Container {
let mut query = self.selection.select("withMountedFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mounted_file_opts<'a>(
&self,
path: impl Into<String>,
source: impl IntoID<FileId>,
opts: ContainerWithMountedFileOpts<'a>,
) -> Container {
let mut query = self.selection.select("withMountedFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mounted_secret(
&self,
path: impl Into<String>,
source: impl IntoID<SecretId>,
) -> Container {
let mut query = self.selection.select("withMountedSecret");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mounted_secret_opts<'a>(
&self,
path: impl Into<String>,
source: impl IntoID<SecretId>,
opts: ContainerWithMountedSecretOpts<'a>,
) -> Container {
let mut query = self.selection.select("withMountedSecret");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
if let Some(mode) = opts.mode {
query = query.arg("mode", mode);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withMountedTemp");
query = query.arg("path", path.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mounted_temp_opts(
&self,
path: impl Into<String>,
opts: ContainerWithMountedTempOpts,
) -> Container {
let mut query = self.selection.select("withMountedTemp");
query = query.arg("path", path.into());
if let Some(size) = opts.size {
query = query.arg("size", size);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
let mut query = self.selection.select("withNewFile");
query = query.arg("path", path.into());
query = query.arg("contents", contents.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_new_file_opts<'a>(
&self,
path: impl Into<String>,
contents: impl Into<String>,
opts: ContainerWithNewFileOpts<'a>,
) -> Container {
let mut query = self.selection.select("withNewFile");
query = query.arg("path", path.into());
query = query.arg("contents", contents.into());
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_registry_auth(
&self,
address: impl Into<String>,
username: impl Into<String>,
secret: impl IntoID<SecretId>,
) -> Container {
let mut query = self.selection.select("withRegistryAuth");
query = query.arg("address", address.into());
query = query.arg("username", username.into());
query = query.arg_lazy(
"secret",
Box::new(move || {
let secret = secret.clone();
Box::pin(async move { secret.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_rootfs(&self, directory: impl IntoID<DirectoryId>) -> Container {
let mut query = self.selection.select("withRootfs");
query = query.arg_lazy(
"directory",
Box::new(move || {
let directory = directory.clone();
Box::pin(async move { directory.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_secret_variable(
&self,
name: impl Into<String>,
secret: impl IntoID<SecretId>,
) -> Container {
let mut query = self.selection.select("withSecretVariable");
query = query.arg("name", name.into());
query = query.arg_lazy(
"secret",
Box::new(move || {
let secret = secret.clone();
Box::pin(async move { secret.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_service_binding(
&self,
alias: impl Into<String>,
service: impl IntoID<ServiceId>,
) -> Container {
let mut query = self.selection.select("withServiceBinding");
query = query.arg("alias", alias.into());
query = query.arg_lazy(
"service",
Box::new(move || {
let service = service.clone();
Box::pin(async move { service.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_symlink(
&self,
target: impl Into<String>,
link_name: impl Into<String>,
) -> Container {
let mut query = self.selection.select("withSymlink");
query = query.arg("target", target.into());
query = query.arg("linkName", link_name.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_symlink_opts(
&self,
target: impl Into<String>,
link_name: impl Into<String>,
opts: ContainerWithSymlinkOpts,
) -> Container {
let mut query = self.selection.select("withSymlink");
query = query.arg("target", target.into());
query = query.arg("linkName", link_name.into());
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_unix_socket(
&self,
path: impl Into<String>,
source: impl IntoID<SocketId>,
) -> Container {
let mut query = self.selection.select("withUnixSocket");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_unix_socket_opts<'a>(
&self,
path: impl Into<String>,
source: impl IntoID<SocketId>,
opts: ContainerWithUnixSocketOpts<'a>,
) -> Container {
let mut query = self.selection.select("withUnixSocket");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_user(&self, name: impl Into<String>) -> Container {
let mut query = self.selection.select("withUser");
query = query.arg("name", name.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_workdir(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withWorkdir");
query = query.arg("path", path.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_workdir_opts(
&self,
path: impl Into<String>,
opts: ContainerWithWorkdirOpts,
) -> Container {
let mut query = self.selection.select("withWorkdir");
query = query.arg("path", path.into());
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_annotation(&self, name: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutAnnotation");
query = query.arg("name", name.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_default_args(&self) -> Container {
let query = self.selection.select("withoutDefaultArgs");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_directory(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutDirectory");
query = query.arg("path", path.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_directory_opts(
&self,
path: impl Into<String>,
opts: ContainerWithoutDirectoryOpts,
) -> Container {
let mut query = self.selection.select("withoutDirectory");
query = query.arg("path", path.into());
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_docker_healthcheck(&self) -> Container {
let query = self.selection.select("withoutDockerHealthcheck");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_entrypoint(&self) -> Container {
let query = self.selection.select("withoutEntrypoint");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
let mut query = self.selection.select("withoutEntrypoint");
if let Some(keep_default_args) = opts.keep_default_args {
query = query.arg("keepDefaultArgs", keep_default_args);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutEnvVariable");
query = query.arg("name", name.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_exposed_port(&self, port: isize) -> Container {
let mut query = self.selection.select("withoutExposedPort");
query = query.arg("port", port);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_exposed_port_opts(
&self,
port: isize,
opts: ContainerWithoutExposedPortOpts,
) -> Container {
let mut query = self.selection.select("withoutExposedPort");
query = query.arg("port", port);
if let Some(protocol) = opts.protocol {
query = query.arg("protocol", protocol);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_file(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutFile");
query = query.arg("path", path.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_file_opts(
&self,
path: impl Into<String>,
opts: ContainerWithoutFileOpts,
) -> Container {
let mut query = self.selection.select("withoutFile");
query = query.arg("path", path.into());
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("withoutFiles");
query = query.arg(
"paths",
paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_files_opts(
&self,
paths: Vec<impl Into<String>>,
opts: ContainerWithoutFilesOpts,
) -> Container {
let mut query = self.selection.select("withoutFiles");
query = query.arg(
"paths",
paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_label(&self, name: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutLabel");
query = query.arg("name", name.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_mount(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutMount");
query = query.arg("path", path.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_mount_opts(
&self,
path: impl Into<String>,
opts: ContainerWithoutMountOpts,
) -> Container {
let mut query = self.selection.select("withoutMount");
query = query.arg("path", path.into());
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutRegistryAuth");
query = query.arg("address", address.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutSecretVariable");
query = query.arg("name", name.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutUnixSocket");
query = query.arg("path", path.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_unix_socket_opts(
&self,
path: impl Into<String>,
opts: ContainerWithoutUnixSocketOpts,
) -> Container {
let mut query = self.selection.select("withoutUnixSocket");
query = query.arg("path", path.into());
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_user(&self) -> Container {
let query = self.selection.select("withoutUser");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_workdir(&self) -> Container {
let query = self.selection.select("withoutWorkdir");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn workdir(&self) -> Result<String, DaggerError> {
let query = self.selection.select("workdir");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct CurrentModule {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct CurrentModuleGeneratorsOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct CurrentModuleWorkdirOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub gitignore: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
impl CurrentModule {
pub fn dependencies(&self) -> Vec<Module> {
let query = self.selection.select("dependencies");
vec![Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn generated_context_directory(&self) -> Directory {
let query = self.selection.select("generatedContextDirectory");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn generators(&self) -> GeneratorGroup {
let query = self.selection.select("generators");
GeneratorGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
let mut query = self.selection.select("generators");
if let Some(include) = opts.include {
query = query.arg("include", include);
}
GeneratorGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<CurrentModuleId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn source(&self) -> Directory {
let query = self.selection.select("source");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn workdir(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("workdir");
query = query.arg("path", path.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn workdir_opts<'a>(
&self,
path: impl Into<String>,
opts: CurrentModuleWorkdirOpts<'a>,
) -> Directory {
let mut query = self.selection.select("workdir");
query = query.arg("path", path.into());
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
if let Some(gitignore) = opts.gitignore {
query = query.arg("gitignore", gitignore);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn workdir_file(&self, path: impl Into<String>) -> File {
let mut query = self.selection.select("workdirFile");
query = query.arg("path", path.into());
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct DiffStat {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl DiffStat {
pub async fn added_lines(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("addedLines");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<DiffStatId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
let query = self.selection.select("kind");
query.execute(self.graphql_client.clone()).await
}
pub async fn old_path(&self) -> Result<String, DaggerError> {
let query = self.selection.select("oldPath");
query.execute(self.graphql_client.clone()).await
}
pub async fn path(&self) -> Result<String, DaggerError> {
let query = self.selection.select("path");
query.execute(self.graphql_client.clone()).await
}
pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("removedLines");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Directory {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryAsModuleOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub source_root_path: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryAsModuleSourceOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub source_root_path: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryDockerBuildOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub build_args: Option<Vec<BuildArg>>,
#[builder(setter(into, strip_option), default)]
pub dockerfile: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub no_init: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub platform: Option<Platform>,
#[builder(setter(into, strip_option), default)]
pub secrets: Option<Vec<SecretId>>,
#[builder(setter(into, strip_option), default)]
pub ssh: Option<SocketId>,
#[builder(setter(into, strip_option), default)]
pub target: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryEntriesOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub path: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryExistsOpts {
#[builder(setter(into, strip_option), default)]
pub do_not_follow_symlinks: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub expected_type: Option<ExistsType>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryExportOpts {
#[builder(setter(into, strip_option), default)]
pub wipe: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryFilterOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub gitignore: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectorySearchOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub dotall: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub files_only: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub globs: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub insensitive: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub limit: Option<isize>,
#[builder(setter(into, strip_option), default)]
pub literal: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub multiline: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub paths: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub skip_hidden: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub skip_ignored: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryStatOpts {
#[builder(setter(into, strip_option), default)]
pub do_not_follow_symlinks: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryTerminalOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub cmd: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub container: Option<ContainerId>,
#[builder(setter(into, strip_option), default)]
pub experimental_privileged_nesting: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub insecure_root_capabilities: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryWithDirectoryOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub gitignore: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryWithFileOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryWithFilesOpts {
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryWithNewDirectoryOpts {
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryWithNewFileOpts {
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
impl Directory {
pub fn as_git(&self) -> GitRepository {
let query = self.selection.select("asGit");
GitRepository {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_module(&self) -> Module {
let query = self.selection.select("asModule");
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
let mut query = self.selection.select("asModule");
if let Some(source_root_path) = opts.source_root_path {
query = query.arg("sourceRootPath", source_root_path);
}
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_module_source(&self) -> ModuleSource {
let query = self.selection.select("asModuleSource");
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
let mut query = self.selection.select("asModuleSource");
if let Some(source_root_path) = opts.source_root_path {
query = query.arg("sourceRootPath", source_root_path);
}
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn changes(&self, from: impl IntoID<DirectoryId>) -> Changeset {
let mut query = self.selection.select("changes");
query = query.arg_lazy(
"from",
Box::new(move || {
let from = from.clone();
Box::pin(async move { from.into_id().await.unwrap().quote() })
}),
);
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
let mut query = self.selection.select("chown");
query = query.arg("path", path.into());
query = query.arg("owner", owner.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory {
let mut query = self.selection.select("diff");
query = query.arg_lazy(
"other",
Box::new(move || {
let other = other.clone();
Box::pin(async move { other.into_id().await.unwrap().quote() })
}),
);
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn digest(&self) -> Result<String, DaggerError> {
let query = self.selection.select("digest");
query.execute(self.graphql_client.clone()).await
}
pub fn directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn docker_build(&self) -> Container {
let query = self.selection.select("dockerBuild");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
let mut query = self.selection.select("dockerBuild");
if let Some(dockerfile) = opts.dockerfile {
query = query.arg("dockerfile", dockerfile);
}
if let Some(platform) = opts.platform {
query = query.arg("platform", platform);
}
if let Some(build_args) = opts.build_args {
query = query.arg("buildArgs", build_args);
}
if let Some(target) = opts.target {
query = query.arg("target", target);
}
if let Some(secrets) = opts.secrets {
query = query.arg("secrets", secrets);
}
if let Some(no_init) = opts.no_init {
query = query.arg("noInit", no_init);
}
if let Some(ssh) = opts.ssh {
query = query.arg("ssh", ssh);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("entries");
query.execute(self.graphql_client.clone()).await
}
pub async fn entries_opts<'a>(
&self,
opts: DirectoryEntriesOpts<'a>,
) -> Result<Vec<String>, DaggerError> {
let mut query = self.selection.select("entries");
if let Some(path) = opts.path {
query = query.arg("path", path);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
let mut query = self.selection.select("exists");
query = query.arg("path", path.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn exists_opts(
&self,
path: impl Into<String>,
opts: DirectoryExistsOpts,
) -> Result<bool, DaggerError> {
let mut query = self.selection.select("exists");
query = query.arg("path", path.into());
if let Some(expected_type) = opts.expected_type {
query = query.arg("expectedType", expected_type);
}
if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn export_opts(
&self,
path: impl Into<String>,
opts: DirectoryExportOpts,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
if let Some(wipe) = opts.wipe {
query = query.arg("wipe", wipe);
}
query.execute(self.graphql_client.clone()).await
}
pub fn file(&self, path: impl Into<String>) -> File {
let mut query = self.selection.select("file");
query = query.arg("path", path.into());
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn filter(&self) -> Directory {
let query = self.selection.select("filter");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
let mut query = self.selection.select("filter");
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
if let Some(gitignore) = opts.gitignore {
query = query.arg("gitignore", gitignore);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn find_up(
&self,
name: impl Into<String>,
start: impl Into<String>,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("findUp");
query = query.arg("name", name.into());
query = query.arg("start", start.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
let mut query = self.selection.select("glob");
query = query.arg("pattern", pattern.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
let mut query = self.selection.select("search");
query = query.arg("pattern", pattern.into());
vec![SearchResult {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn search_opts<'a>(
&self,
pattern: impl Into<String>,
opts: DirectorySearchOpts<'a>,
) -> Vec<SearchResult> {
let mut query = self.selection.select("search");
query = query.arg("pattern", pattern.into());
if let Some(paths) = opts.paths {
query = query.arg("paths", paths);
}
if let Some(globs) = opts.globs {
query = query.arg("globs", globs);
}
if let Some(literal) = opts.literal {
query = query.arg("literal", literal);
}
if let Some(multiline) = opts.multiline {
query = query.arg("multiline", multiline);
}
if let Some(dotall) = opts.dotall {
query = query.arg("dotall", dotall);
}
if let Some(insensitive) = opts.insensitive {
query = query.arg("insensitive", insensitive);
}
if let Some(skip_ignored) = opts.skip_ignored {
query = query.arg("skipIgnored", skip_ignored);
}
if let Some(skip_hidden) = opts.skip_hidden {
query = query.arg("skipHidden", skip_hidden);
}
if let Some(files_only) = opts.files_only {
query = query.arg("filesOnly", files_only);
}
if let Some(limit) = opts.limit {
query = query.arg("limit", limit);
}
vec![SearchResult {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn stat(&self, path: impl Into<String>) -> Stat {
let mut query = self.selection.select("stat");
query = query.arg("path", path.into());
Stat {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
let mut query = self.selection.select("stat");
query = query.arg("path", path.into());
if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
}
Stat {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
pub fn terminal(&self) -> Directory {
let query = self.selection.select("terminal");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
let mut query = self.selection.select("terminal");
if let Some(container) = opts.container {
query = query.arg("container", container);
}
if let Some(cmd) = opts.cmd {
query = query.arg("cmd", cmd);
}
if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
query = query.arg(
"experimentalPrivilegedNesting",
experimental_privileged_nesting,
);
}
if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_changes(&self, changes: impl IntoID<ChangesetId>) -> Directory {
let mut query = self.selection.select("withChanges");
query = query.arg_lazy(
"changes",
Box::new(move || {
let changes = changes.clone();
Box::pin(async move { changes.into_id().await.unwrap().quote() })
}),
);
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_directory(
&self,
path: impl Into<String>,
source: impl IntoID<DirectoryId>,
) -> Directory {
let mut query = self.selection.select("withDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_directory_opts<'a>(
&self,
path: impl Into<String>,
source: impl IntoID<DirectoryId>,
opts: DirectoryWithDirectoryOpts<'a>,
) -> Directory {
let mut query = self.selection.select("withDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
if let Some(gitignore) = opts.gitignore {
query = query.arg("gitignore", gitignore);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_error(&self, err: impl Into<String>) -> Directory {
let mut query = self.selection.select("withError");
query = query.arg("err", err.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<FileId>) -> Directory {
let mut query = self.selection.select("withFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_file_opts<'a>(
&self,
path: impl Into<String>,
source: impl IntoID<FileId>,
opts: DirectoryWithFileOpts<'a>,
) -> Directory {
let mut query = self.selection.select("withFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.into_id().await.unwrap().quote() })
}),
);
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_files(&self, path: impl Into<String>, sources: Vec<FileId>) -> Directory {
let mut query = self.selection.select("withFiles");
query = query.arg("path", path.into());
query = query.arg("sources", sources);
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_files_opts(
&self,
path: impl Into<String>,
sources: Vec<FileId>,
opts: DirectoryWithFilesOpts,
) -> Directory {
let mut query = self.selection.select("withFiles");
query = query.arg("path", path.into());
query = query.arg("sources", sources);
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("withNewDirectory");
query = query.arg("path", path.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_new_directory_opts(
&self,
path: impl Into<String>,
opts: DirectoryWithNewDirectoryOpts,
) -> Directory {
let mut query = self.selection.select("withNewDirectory");
query = query.arg("path", path.into());
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
let mut query = self.selection.select("withNewFile");
query = query.arg("path", path.into());
query = query.arg("contents", contents.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_new_file_opts(
&self,
path: impl Into<String>,
contents: impl Into<String>,
opts: DirectoryWithNewFileOpts,
) -> Directory {
let mut query = self.selection.select("withNewFile");
query = query.arg("path", path.into());
query = query.arg("contents", contents.into());
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
let mut query = self.selection.select("withPatch");
query = query.arg("patch", patch.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_patch_file(&self, patch: impl IntoID<FileId>) -> Directory {
let mut query = self.selection.select("withPatchFile");
query = query.arg_lazy(
"patch",
Box::new(move || {
let patch = patch.clone();
Box::pin(async move { patch.into_id().await.unwrap().quote() })
}),
);
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_symlink(
&self,
target: impl Into<String>,
link_name: impl Into<String>,
) -> Directory {
let mut query = self.selection.select("withSymlink");
query = query.arg("target", target.into());
query = query.arg("linkName", link_name.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_timestamps(&self, timestamp: isize) -> Directory {
let mut query = self.selection.select("withTimestamps");
query = query.arg("timestamp", timestamp);
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("withoutDirectory");
query = query.arg("path", path.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_file(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("withoutFile");
query = query.arg("path", path.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
let mut query = self.selection.select("withoutFiles");
query = query.arg(
"paths",
paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct Engine {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Engine {
pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("clients");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<EngineId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn local_cache(&self) -> EngineCache {
let query = self.selection.select("localCache");
EngineCache {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct EngineCache {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct EngineCacheEntrySetOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub key: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct EngineCachePruneOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub max_used_space: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub min_free_space: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub reserved_space: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub target_space: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub use_default_policy: Option<bool>,
}
impl EngineCache {
pub fn entry_set(&self) -> EngineCacheEntrySet {
let query = self.selection.select("entrySet");
EngineCacheEntrySet {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
let mut query = self.selection.select("entrySet");
if let Some(key) = opts.key {
query = query.arg("key", key);
}
EngineCacheEntrySet {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<EngineCacheId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("maxUsedSpace");
query.execute(self.graphql_client.clone()).await
}
pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("minFreeSpace");
query.execute(self.graphql_client.clone()).await
}
pub async fn prune(&self) -> Result<Void, DaggerError> {
let query = self.selection.select("prune");
query.execute(self.graphql_client.clone()).await
}
pub async fn prune_opts<'a>(
&self,
opts: EngineCachePruneOpts<'a>,
) -> Result<Void, DaggerError> {
let mut query = self.selection.select("prune");
if let Some(use_default_policy) = opts.use_default_policy {
query = query.arg("useDefaultPolicy", use_default_policy);
}
if let Some(max_used_space) = opts.max_used_space {
query = query.arg("maxUsedSpace", max_used_space);
}
if let Some(reserved_space) = opts.reserved_space {
query = query.arg("reservedSpace", reserved_space);
}
if let Some(min_free_space) = opts.min_free_space {
query = query.arg("minFreeSpace", min_free_space);
}
if let Some(target_space) = opts.target_space {
query = query.arg("targetSpace", target_space);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("reservedSpace");
query.execute(self.graphql_client.clone()).await
}
pub async fn target_space(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("targetSpace");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct EngineCacheEntry {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl EngineCacheEntry {
pub async fn actively_used(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("activelyUsed");
query.execute(self.graphql_client.clone()).await
}
pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("createdTimeUnixNano");
query.execute(self.graphql_client.clone()).await
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("diskSpaceBytes");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<EngineCacheEntryId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("mostRecentUseTimeUnixNano");
query.execute(self.graphql_client.clone()).await
}
pub async fn record_type(&self) -> Result<String, DaggerError> {
let query = self.selection.select("recordType");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct EngineCacheEntrySet {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl EngineCacheEntrySet {
pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("diskSpaceBytes");
query.execute(self.graphql_client.clone()).await
}
pub fn entries(&self) -> Vec<EngineCacheEntry> {
let query = self.selection.select("entries");
vec![EngineCacheEntry {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn entry_count(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("entryCount");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<EngineCacheEntrySetId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct EnumTypeDef {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl EnumTypeDef {
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<EnumTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn members(&self) -> Vec<EnumValueTypeDef> {
let query = self.selection.select("members");
vec![EnumValueTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn source_map(&self) -> SourceMap {
let query = self.selection.select("sourceMap");
SourceMap {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn source_module_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sourceModuleName");
query.execute(self.graphql_client.clone()).await
}
pub fn values(&self) -> Vec<EnumValueTypeDef> {
let query = self.selection.select("values");
vec![EnumValueTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
}
#[derive(Clone)]
pub struct EnumValueTypeDef {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl EnumValueTypeDef {
pub async fn deprecated(&self) -> Result<String, DaggerError> {
let query = self.selection.select("deprecated");
query.execute(self.graphql_client.clone()).await
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<EnumValueTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn source_map(&self) -> SourceMap {
let query = self.selection.select("sourceMap");
SourceMap {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn value(&self) -> Result<String, DaggerError> {
let query = self.selection.select("value");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Env {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct EnvChecksOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct EnvServicesOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
impl Env {
pub fn check(&self, name: impl Into<String>) -> Check {
let mut query = self.selection.select("check");
query = query.arg("name", name.into());
Check {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn checks(&self) -> CheckGroup {
let query = self.selection.select("checks");
CheckGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
let mut query = self.selection.select("checks");
if let Some(include) = opts.include {
query = query.arg("include", include);
}
CheckGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<EnvId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn input(&self, name: impl Into<String>) -> Binding {
let mut query = self.selection.select("input");
query = query.arg("name", name.into());
Binding {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn inputs(&self) -> Vec<Binding> {
let query = self.selection.select("inputs");
vec![Binding {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn output(&self, name: impl Into<String>) -> Binding {
let mut query = self.selection.select("output");
query = query.arg("name", name.into());
Binding {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn outputs(&self) -> Vec<Binding> {
let query = self.selection.select("outputs");
vec![Binding {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn services(&self) -> UpGroup {
let query = self.selection.select("services");
UpGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
let mut query = self.selection.select("services");
if let Some(include) = opts.include {
query = query.arg("include", include);
}
UpGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_address_input(
&self,
name: impl Into<String>,
value: impl IntoID<AddressId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withAddressInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_address_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withAddressOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_cache_volume_input(
&self,
name: impl Into<String>,
value: impl IntoID<CacheVolumeId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withCacheVolumeInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_cache_volume_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withCacheVolumeOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_changeset_input(
&self,
name: impl Into<String>,
value: impl IntoID<ChangesetId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withChangesetInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_changeset_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withChangesetOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_check_group_input(
&self,
name: impl Into<String>,
value: impl IntoID<CheckGroupId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withCheckGroupInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_check_group_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withCheckGroupOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_check_input(
&self,
name: impl Into<String>,
value: impl IntoID<CheckId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withCheckInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_check_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withCheckOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_cloud_input(
&self,
name: impl Into<String>,
value: impl IntoID<CloudId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withCloudInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_cloud_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withCloudOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_container_input(
&self,
name: impl Into<String>,
value: impl IntoID<ContainerId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withContainerInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_container_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withContainerOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_current_module(&self) -> Env {
let query = self.selection.select("withCurrentModule");
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_diff_stat_input(
&self,
name: impl Into<String>,
value: impl IntoID<DiffStatId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withDiffStatInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_diff_stat_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withDiffStatOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_directory_input(
&self,
name: impl Into<String>,
value: impl IntoID<DirectoryId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withDirectoryInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_directory_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withDirectoryOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_env_file_input(
&self,
name: impl Into<String>,
value: impl IntoID<EnvFileId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withEnvFileInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_env_file_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withEnvFileOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_env_input(
&self,
name: impl Into<String>,
value: impl IntoID<EnvId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withEnvInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
let mut query = self.selection.select("withEnvOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_file_input(
&self,
name: impl Into<String>,
value: impl IntoID<FileId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withFileInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
let mut query = self.selection.select("withFileOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_generator_group_input(
&self,
name: impl Into<String>,
value: impl IntoID<GeneratorGroupId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withGeneratorGroupInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_generator_group_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withGeneratorGroupOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_generator_input(
&self,
name: impl Into<String>,
value: impl IntoID<GeneratorId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withGeneratorInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_generator_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withGeneratorOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_git_ref_input(
&self,
name: impl Into<String>,
value: impl IntoID<GitRefId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withGitRefInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_git_ref_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withGitRefOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_git_repository_input(
&self,
name: impl Into<String>,
value: impl IntoID<GitRepositoryId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withGitRepositoryInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_git_repository_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withGitRepositoryOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_json_value_input(
&self,
name: impl Into<String>,
value: impl IntoID<JsonValueId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withJSONValueInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_json_value_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withJSONValueOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_main_module(&self, module: impl IntoID<ModuleId>) -> Env {
let mut query = self.selection.select("withMainModule");
query = query.arg_lazy(
"module",
Box::new(move || {
let module = module.clone();
Box::pin(async move { module.into_id().await.unwrap().quote() })
}),
);
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_module(&self, module: impl IntoID<ModuleId>) -> Env {
let mut query = self.selection.select("withModule");
query = query.arg_lazy(
"module",
Box::new(move || {
let module = module.clone();
Box::pin(async move { module.into_id().await.unwrap().quote() })
}),
);
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_module_config_client_input(
&self,
name: impl Into<String>,
value: impl IntoID<ModuleConfigClientId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withModuleConfigClientInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_module_config_client_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withModuleConfigClientOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_module_input(
&self,
name: impl Into<String>,
value: impl IntoID<ModuleId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withModuleInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_module_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withModuleOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_module_source_input(
&self,
name: impl Into<String>,
value: impl IntoID<ModuleSourceId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withModuleSourceInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_module_source_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withModuleSourceOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_search_result_input(
&self,
name: impl Into<String>,
value: impl IntoID<SearchResultId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withSearchResultInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_search_result_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withSearchResultOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_search_submatch_input(
&self,
name: impl Into<String>,
value: impl IntoID<SearchSubmatchId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withSearchSubmatchInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_search_submatch_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withSearchSubmatchOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_secret_input(
&self,
name: impl Into<String>,
value: impl IntoID<SecretId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withSecretInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_secret_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withSecretOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_service_input(
&self,
name: impl Into<String>,
value: impl IntoID<ServiceId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withServiceInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_service_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withServiceOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_socket_input(
&self,
name: impl Into<String>,
value: impl IntoID<SocketId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withSocketInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_socket_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withSocketOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_stat_input(
&self,
name: impl Into<String>,
value: impl IntoID<StatId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withStatInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
let mut query = self.selection.select("withStatOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_string_input(
&self,
name: impl Into<String>,
value: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withStringInput");
query = query.arg("name", name.into());
query = query.arg("value", value.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_string_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withStringOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_up_group_input(
&self,
name: impl Into<String>,
value: impl IntoID<UpGroupId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withUpGroupInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_up_group_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withUpGroupOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_up_input(
&self,
name: impl Into<String>,
value: impl IntoID<UpId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withUpInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
let mut query = self.selection.select("withUpOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_workspace(&self, workspace: impl IntoID<DirectoryId>) -> Env {
let mut query = self.selection.select("withWorkspace");
query = query.arg_lazy(
"workspace",
Box::new(move || {
let workspace = workspace.clone();
Box::pin(async move { workspace.into_id().await.unwrap().quote() })
}),
);
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_workspace_input(
&self,
name: impl Into<String>,
value: impl IntoID<WorkspaceId>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withWorkspaceInput");
query = query.arg("name", name.into());
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_workspace_output(
&self,
name: impl Into<String>,
description: impl Into<String>,
) -> Env {
let mut query = self.selection.select("withWorkspaceOutput");
query = query.arg("name", name.into());
query = query.arg("description", description.into());
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_outputs(&self) -> Env {
let query = self.selection.select("withoutOutputs");
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn workspace(&self) -> Directory {
let query = self.selection.select("workspace");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct EnvFile {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct EnvFileGetOpts {
#[builder(setter(into, strip_option), default)]
pub raw: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct EnvFileVariablesOpts {
#[builder(setter(into, strip_option), default)]
pub raw: Option<bool>,
}
impl EnvFile {
pub fn as_file(&self) -> File {
let query = self.selection.select("asFile");
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
let mut query = self.selection.select("exists");
query = query.arg("name", name.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("get");
query = query.arg("name", name.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn get_opts(
&self,
name: impl Into<String>,
opts: EnvFileGetOpts,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("get");
query = query.arg("name", name.into());
if let Some(raw) = opts.raw {
query = query.arg("raw", raw);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<EnvFileId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
let mut query = self.selection.select("namespace");
query = query.arg("prefix", prefix.into());
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn variables(&self) -> Vec<EnvVariable> {
let query = self.selection.select("variables");
vec![EnvVariable {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn variables_opts(&self, opts: EnvFileVariablesOpts) -> Vec<EnvVariable> {
let mut query = self.selection.select("variables");
if let Some(raw) = opts.raw {
query = query.arg("raw", raw);
}
vec![EnvVariable {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
let mut query = self.selection.select("withVariable");
query = query.arg("name", name.into());
query = query.arg("value", value.into());
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
let mut query = self.selection.select("withoutVariable");
query = query.arg("name", name.into());
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct EnvVariable {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl EnvVariable {
pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn value(&self) -> Result<String, DaggerError> {
let query = self.selection.select("value");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Error {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Error {
pub async fn id(&self) -> Result<ErrorId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn message(&self) -> Result<String, DaggerError> {
let query = self.selection.select("message");
query.execute(self.graphql_client.clone()).await
}
pub fn values(&self) -> Vec<ErrorValue> {
let query = self.selection.select("values");
vec![ErrorValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
let mut query = self.selection.select("withValue");
query = query.arg("name", name.into());
query = query.arg("value", value);
Error {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct ErrorValue {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl ErrorValue {
pub async fn id(&self) -> Result<ErrorValueId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn value(&self) -> Result<Json, DaggerError> {
let query = self.selection.select("value");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct FieldTypeDef {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl FieldTypeDef {
pub async fn deprecated(&self) -> Result<String, DaggerError> {
let query = self.selection.select("deprecated");
query.execute(self.graphql_client.clone()).await
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn source_map(&self) -> SourceMap {
let query = self.selection.select("sourceMap");
SourceMap {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn type_def(&self) -> TypeDef {
let query = self.selection.select("typeDef");
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct File {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FileAsEnvFileOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FileContentsOpts {
#[builder(setter(into, strip_option), default)]
pub limit_lines: Option<isize>,
#[builder(setter(into, strip_option), default)]
pub offset_lines: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FileDigestOpts {
#[builder(setter(into, strip_option), default)]
pub exclude_metadata: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FileExportOpts {
#[builder(setter(into, strip_option), default)]
pub allow_parent_dir_path: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FileSearchOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub dotall: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub files_only: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub globs: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub insensitive: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub limit: Option<isize>,
#[builder(setter(into, strip_option), default)]
pub literal: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub multiline: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub paths: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub skip_hidden: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub skip_ignored: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FileWithReplacedOpts {
#[builder(setter(into, strip_option), default)]
pub all: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub first_from: Option<isize>,
}
impl File {
pub fn as_env_file(&self) -> EnvFile {
let query = self.selection.select("asEnvFile");
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
let mut query = self.selection.select("asEnvFile");
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_json(&self) -> JsonValue {
let query = self.selection.select("asJSON");
JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn chown(&self, owner: impl Into<String>) -> File {
let mut query = self.selection.select("chown");
query = query.arg("owner", owner.into());
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn contents(&self) -> Result<String, DaggerError> {
let query = self.selection.select("contents");
query.execute(self.graphql_client.clone()).await
}
pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
let mut query = self.selection.select("contents");
if let Some(offset_lines) = opts.offset_lines {
query = query.arg("offsetLines", offset_lines);
}
if let Some(limit_lines) = opts.limit_lines {
query = query.arg("limitLines", limit_lines);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn digest(&self) -> Result<String, DaggerError> {
let query = self.selection.select("digest");
query.execute(self.graphql_client.clone()).await
}
pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
let mut query = self.selection.select("digest");
if let Some(exclude_metadata) = opts.exclude_metadata {
query = query.arg("excludeMetadata", exclude_metadata);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn export_opts(
&self,
path: impl Into<String>,
opts: FileExportOpts,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
query = query.arg("allowParentDirPath", allow_parent_dir_path);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<FileId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn search(&self, pattern: impl Into<String>) -> Vec<SearchResult> {
let mut query = self.selection.select("search");
query = query.arg("pattern", pattern.into());
vec![SearchResult {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn search_opts<'a>(
&self,
pattern: impl Into<String>,
opts: FileSearchOpts<'a>,
) -> Vec<SearchResult> {
let mut query = self.selection.select("search");
query = query.arg("pattern", pattern.into());
if let Some(literal) = opts.literal {
query = query.arg("literal", literal);
}
if let Some(multiline) = opts.multiline {
query = query.arg("multiline", multiline);
}
if let Some(dotall) = opts.dotall {
query = query.arg("dotall", dotall);
}
if let Some(insensitive) = opts.insensitive {
query = query.arg("insensitive", insensitive);
}
if let Some(skip_ignored) = opts.skip_ignored {
query = query.arg("skipIgnored", skip_ignored);
}
if let Some(skip_hidden) = opts.skip_hidden {
query = query.arg("skipHidden", skip_hidden);
}
if let Some(files_only) = opts.files_only {
query = query.arg("filesOnly", files_only);
}
if let Some(limit) = opts.limit {
query = query.arg("limit", limit);
}
if let Some(paths) = opts.paths {
query = query.arg("paths", paths);
}
if let Some(globs) = opts.globs {
query = query.arg("globs", globs);
}
vec![SearchResult {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn size(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("size");
query.execute(self.graphql_client.clone()).await
}
pub fn stat(&self) -> Stat {
let query = self.selection.select("stat");
Stat {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn sync(&self) -> Result<FileId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
pub fn with_name(&self, name: impl Into<String>) -> File {
let mut query = self.selection.select("withName");
query = query.arg("name", name.into());
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
let mut query = self.selection.select("withReplaced");
query = query.arg("search", search.into());
query = query.arg("replacement", replacement.into());
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_replaced_opts(
&self,
search: impl Into<String>,
replacement: impl Into<String>,
opts: FileWithReplacedOpts,
) -> File {
let mut query = self.selection.select("withReplaced");
query = query.arg("search", search.into());
query = query.arg("replacement", replacement.into());
if let Some(all) = opts.all {
query = query.arg("all", all);
}
if let Some(first_from) = opts.first_from {
query = query.arg("firstFrom", first_from);
}
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_timestamps(&self, timestamp: isize) -> File {
let mut query = self.selection.select("withTimestamps");
query = query.arg("timestamp", timestamp);
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct Function {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FunctionWithArgOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub default_address: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub default_path: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub default_value: Option<Json>,
#[builder(setter(into, strip_option), default)]
pub deprecated: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub ignore: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub source_map: Option<SourceMapId>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FunctionWithCachePolicyOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub time_to_live: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FunctionWithDeprecatedOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub reason: Option<&'a str>,
}
impl Function {
pub fn args(&self) -> Vec<FunctionArg> {
let query = self.selection.select("args");
vec![FunctionArg {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn deprecated(&self) -> Result<String, DaggerError> {
let query = self.selection.select("deprecated");
query.execute(self.graphql_client.clone()).await
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<FunctionId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn return_type(&self) -> TypeDef {
let query = self.selection.select("returnType");
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn source_map(&self) -> SourceMap {
let query = self.selection.select("sourceMap");
SourceMap {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn source_module_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sourceModuleName");
query.execute(self.graphql_client.clone()).await
}
pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> Function {
let mut query = self.selection.select("withArg");
query = query.arg("name", name.into());
query = query.arg_lazy(
"typeDef",
Box::new(move || {
let type_def = type_def.clone();
Box::pin(async move { type_def.into_id().await.unwrap().quote() })
}),
);
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_arg_opts<'a>(
&self,
name: impl Into<String>,
type_def: impl IntoID<TypeDefId>,
opts: FunctionWithArgOpts<'a>,
) -> Function {
let mut query = self.selection.select("withArg");
query = query.arg("name", name.into());
query = query.arg_lazy(
"typeDef",
Box::new(move || {
let type_def = type_def.clone();
Box::pin(async move { type_def.into_id().await.unwrap().quote() })
}),
);
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(default_value) = opts.default_value {
query = query.arg("defaultValue", default_value);
}
if let Some(default_path) = opts.default_path {
query = query.arg("defaultPath", default_path);
}
if let Some(ignore) = opts.ignore {
query = query.arg("ignore", ignore);
}
if let Some(source_map) = opts.source_map {
query = query.arg("sourceMap", source_map);
}
if let Some(deprecated) = opts.deprecated {
query = query.arg("deprecated", deprecated);
}
if let Some(default_address) = opts.default_address {
query = query.arg("defaultAddress", default_address);
}
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
let mut query = self.selection.select("withCachePolicy");
query = query.arg("policy", policy);
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_cache_policy_opts<'a>(
&self,
policy: FunctionCachePolicy,
opts: FunctionWithCachePolicyOpts<'a>,
) -> Function {
let mut query = self.selection.select("withCachePolicy");
query = query.arg("policy", policy);
if let Some(time_to_live) = opts.time_to_live {
query = query.arg("timeToLive", time_to_live);
}
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_check(&self) -> Function {
let query = self.selection.select("withCheck");
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_deprecated(&self) -> Function {
let query = self.selection.select("withDeprecated");
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
let mut query = self.selection.select("withDeprecated");
if let Some(reason) = opts.reason {
query = query.arg("reason", reason);
}
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_description(&self, description: impl Into<String>) -> Function {
let mut query = self.selection.select("withDescription");
query = query.arg("description", description.into());
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_generator(&self) -> Function {
let query = self.selection.select("withGenerator");
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function {
let mut query = self.selection.select("withSourceMap");
query = query.arg_lazy(
"sourceMap",
Box::new(move || {
let source_map = source_map.clone();
Box::pin(async move { source_map.into_id().await.unwrap().quote() })
}),
);
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_up(&self) -> Function {
let query = self.selection.select("withUp");
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct FunctionArg {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl FunctionArg {
pub async fn default_address(&self) -> Result<String, DaggerError> {
let query = self.selection.select("defaultAddress");
query.execute(self.graphql_client.clone()).await
}
pub async fn default_path(&self) -> Result<String, DaggerError> {
let query = self.selection.select("defaultPath");
query.execute(self.graphql_client.clone()).await
}
pub async fn default_value(&self) -> Result<Json, DaggerError> {
let query = self.selection.select("defaultValue");
query.execute(self.graphql_client.clone()).await
}
pub async fn deprecated(&self) -> Result<String, DaggerError> {
let query = self.selection.select("deprecated");
query.execute(self.graphql_client.clone()).await
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("ignore");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn source_map(&self) -> SourceMap {
let query = self.selection.select("sourceMap");
SourceMap {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn type_def(&self) -> TypeDef {
let query = self.selection.select("typeDef");
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct FunctionCall {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl FunctionCall {
pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
let query = self.selection.select("inputArgs");
vec![FunctionCallArgValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn parent(&self) -> Result<Json, DaggerError> {
let query = self.selection.select("parent");
query.execute(self.graphql_client.clone()).await
}
pub async fn parent_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("parentName");
query.execute(self.graphql_client.clone()).await
}
pub async fn return_error(&self, error: impl IntoID<ErrorId>) -> Result<Void, DaggerError> {
let mut query = self.selection.select("returnError");
query = query.arg_lazy(
"error",
Box::new(move || {
let error = error.clone();
Box::pin(async move { error.into_id().await.unwrap().quote() })
}),
);
query.execute(self.graphql_client.clone()).await
}
pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
let mut query = self.selection.select("returnValue");
query = query.arg("value", value);
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct FunctionCallArgValue {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl FunctionCallArgValue {
pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn value(&self) -> Result<Json, DaggerError> {
let query = self.selection.select("value");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct GeneratedCode {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl GeneratedCode {
pub fn code(&self) -> Directory {
let query = self.selection.select("code");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("vcsGeneratedPaths");
query.execute(self.graphql_client.clone()).await
}
pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("vcsIgnoredPaths");
query.execute(self.graphql_client.clone()).await
}
pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
let mut query = self.selection.select("withVCSGeneratedPaths");
query = query.arg(
"paths",
paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
GeneratedCode {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
let mut query = self.selection.select("withVCSIgnoredPaths");
query = query.arg(
"paths",
paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
GeneratedCode {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct Generator {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Generator {
pub fn changes(&self) -> Changeset {
let query = self.selection.select("changes");
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn completed(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("completed");
query.execute(self.graphql_client.clone()).await
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<GeneratorId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn is_empty(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("isEmpty");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn original_module(&self) -> Module {
let query = self.selection.select("originalModule");
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("path");
query.execute(self.graphql_client.clone()).await
}
pub fn run(&self) -> Generator {
let query = self.selection.select("run");
Generator {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct GeneratorGroup {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct GeneratorGroupChangesOpts {
#[builder(setter(into, strip_option), default)]
pub on_conflict: Option<ChangesetsMergeConflict>,
}
impl GeneratorGroup {
pub fn changes(&self) -> Changeset {
let query = self.selection.select("changes");
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
let mut query = self.selection.select("changes");
if let Some(on_conflict) = opts.on_conflict {
query = query.arg("onConflict", on_conflict);
}
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<GeneratorGroupId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn is_empty(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("isEmpty");
query.execute(self.graphql_client.clone()).await
}
pub fn list(&self) -> Vec<Generator> {
let query = self.selection.select("list");
vec![Generator {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn run(&self) -> GeneratorGroup {
let query = self.selection.select("run");
GeneratorGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct GitRef {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct GitRefTreeOpts {
#[builder(setter(into, strip_option), default)]
pub depth: Option<isize>,
#[builder(setter(into, strip_option), default)]
pub discard_git_dir: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub include_tags: Option<bool>,
}
impl GitRef {
pub async fn commit(&self) -> Result<String, DaggerError> {
let query = self.selection.select("commit");
query.execute(self.graphql_client.clone()).await
}
pub fn common_ancestor(&self, other: impl IntoID<GitRefId>) -> GitRef {
let mut query = self.selection.select("commonAncestor");
query = query.arg_lazy(
"other",
Box::new(move || {
let other = other.clone();
Box::pin(async move { other.into_id().await.unwrap().quote() })
}),
);
GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<GitRefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn r#ref(&self) -> Result<String, DaggerError> {
let query = self.selection.select("ref");
query.execute(self.graphql_client.clone()).await
}
pub fn tree(&self) -> Directory {
let query = self.selection.select("tree");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
let mut query = self.selection.select("tree");
if let Some(discard_git_dir) = opts.discard_git_dir {
query = query.arg("discardGitDir", discard_git_dir);
}
if let Some(depth) = opts.depth {
query = query.arg("depth", depth);
}
if let Some(include_tags) = opts.include_tags {
query = query.arg("includeTags", include_tags);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct GitRepository {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct GitRepositoryBranchesOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub patterns: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct GitRepositoryTagsOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub patterns: Option<Vec<&'a str>>,
}
impl GitRepository {
pub fn branch(&self, name: impl Into<String>) -> GitRef {
let mut query = self.selection.select("branch");
query = query.arg("name", name.into());
GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("branches");
query.execute(self.graphql_client.clone()).await
}
pub async fn branches_opts<'a>(
&self,
opts: GitRepositoryBranchesOpts<'a>,
) -> Result<Vec<String>, DaggerError> {
let mut query = self.selection.select("branches");
if let Some(patterns) = opts.patterns {
query = query.arg("patterns", patterns);
}
query.execute(self.graphql_client.clone()).await
}
pub fn commit(&self, id: impl Into<String>) -> GitRef {
let mut query = self.selection.select("commit");
query = query.arg("id", id.into());
GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn head(&self) -> GitRef {
let query = self.selection.select("head");
GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn latest_version(&self) -> GitRef {
let query = self.selection.select("latestVersion");
GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
let mut query = self.selection.select("ref");
query = query.arg("name", name.into());
GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn tag(&self, name: impl Into<String>) -> GitRef {
let mut query = self.selection.select("tag");
query = query.arg("name", name.into());
GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("tags");
query.execute(self.graphql_client.clone()).await
}
pub async fn tags_opts<'a>(
&self,
opts: GitRepositoryTagsOpts<'a>,
) -> Result<Vec<String>, DaggerError> {
let mut query = self.selection.select("tags");
if let Some(patterns) = opts.patterns {
query = query.arg("patterns", patterns);
}
query.execute(self.graphql_client.clone()).await
}
pub fn uncommitted(&self) -> Changeset {
let query = self.selection.select("uncommitted");
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn url(&self) -> Result<String, DaggerError> {
let query = self.selection.select("url");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct HealthcheckConfig {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl HealthcheckConfig {
pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("args");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<HealthcheckConfigId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn interval(&self) -> Result<String, DaggerError> {
let query = self.selection.select("interval");
query.execute(self.graphql_client.clone()).await
}
pub async fn retries(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("retries");
query.execute(self.graphql_client.clone()).await
}
pub async fn shell(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("shell");
query.execute(self.graphql_client.clone()).await
}
pub async fn start_interval(&self) -> Result<String, DaggerError> {
let query = self.selection.select("startInterval");
query.execute(self.graphql_client.clone()).await
}
pub async fn start_period(&self) -> Result<String, DaggerError> {
let query = self.selection.select("startPeriod");
query.execute(self.graphql_client.clone()).await
}
pub async fn timeout(&self) -> Result<String, DaggerError> {
let query = self.selection.select("timeout");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Host {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct HostDirectoryOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub gitignore: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub no_cache: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct HostFileOpts {
#[builder(setter(into, strip_option), default)]
pub no_cache: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct HostFindUpOpts {
#[builder(setter(into, strip_option), default)]
pub no_cache: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct HostServiceOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub host: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct HostTunnelOpts {
#[builder(setter(into, strip_option), default)]
pub native: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub ports: Option<Vec<PortForward>>,
}
impl Host {
pub fn container_image(&self, name: impl Into<String>) -> Container {
let mut query = self.selection.select("containerImage");
query = query.arg("name", name.into());
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn directory_opts<'a>(
&self,
path: impl Into<String>,
opts: HostDirectoryOpts<'a>,
) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
if let Some(no_cache) = opts.no_cache {
query = query.arg("noCache", no_cache);
}
if let Some(gitignore) = opts.gitignore {
query = query.arg("gitignore", gitignore);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn file(&self, path: impl Into<String>) -> File {
let mut query = self.selection.select("file");
query = query.arg("path", path.into());
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
let mut query = self.selection.select("file");
query = query.arg("path", path.into());
if let Some(no_cache) = opts.no_cache {
query = query.arg("noCache", no_cache);
}
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("findUp");
query = query.arg("name", name.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn find_up_opts(
&self,
name: impl Into<String>,
opts: HostFindUpOpts,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("findUp");
query = query.arg("name", name.into());
if let Some(no_cache) = opts.no_cache {
query = query.arg("noCache", no_cache);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<HostId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn service(&self, ports: Vec<PortForward>) -> Service {
let mut query = self.selection.select("service");
query = query.arg("ports", ports);
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
let mut query = self.selection.select("service");
query = query.arg("ports", ports);
if let Some(host) = opts.host {
query = query.arg("host", host);
}
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn tunnel(&self, service: impl IntoID<ServiceId>) -> Service {
let mut query = self.selection.select("tunnel");
query = query.arg_lazy(
"service",
Box::new(move || {
let service = service.clone();
Box::pin(async move { service.into_id().await.unwrap().quote() })
}),
);
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn tunnel_opts(&self, service: impl IntoID<ServiceId>, opts: HostTunnelOpts) -> Service {
let mut query = self.selection.select("tunnel");
query = query.arg_lazy(
"service",
Box::new(move || {
let service = service.clone();
Box::pin(async move { service.into_id().await.unwrap().quote() })
}),
);
if let Some(native) = opts.native {
query = query.arg("native", native);
}
if let Some(ports) = opts.ports {
query = query.arg("ports", ports);
}
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
let mut query = self.selection.select("unixSocket");
query = query.arg("path", path.into());
Socket {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct InputTypeDef {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl InputTypeDef {
pub fn fields(&self) -> Vec<FieldTypeDef> {
let query = self.selection.select("fields");
vec![FieldTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn id(&self) -> Result<InputTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct InterfaceTypeDef {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl InterfaceTypeDef {
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub fn functions(&self) -> Vec<Function> {
let query = self.selection.select("functions");
vec![Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn source_map(&self) -> SourceMap {
let query = self.selection.select("sourceMap");
SourceMap {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn source_module_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sourceModuleName");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct JsonValue {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct JsonValueContentsOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub indent: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub pretty: Option<bool>,
}
impl JsonValue {
pub fn as_array(&self) -> Vec<JsonValue> {
let query = self.selection.select("asArray");
vec![JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("asBoolean");
query.execute(self.graphql_client.clone()).await
}
pub async fn as_integer(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("asInteger");
query.execute(self.graphql_client.clone()).await
}
pub async fn as_string(&self) -> Result<String, DaggerError> {
let query = self.selection.select("asString");
query.execute(self.graphql_client.clone()).await
}
pub async fn contents(&self) -> Result<Json, DaggerError> {
let query = self.selection.select("contents");
query.execute(self.graphql_client.clone()).await
}
pub async fn contents_opts<'a>(
&self,
opts: JsonValueContentsOpts<'a>,
) -> Result<Json, DaggerError> {
let mut query = self.selection.select("contents");
if let Some(pretty) = opts.pretty {
query = query.arg("pretty", pretty);
}
if let Some(indent) = opts.indent {
query = query.arg("indent", indent);
}
query.execute(self.graphql_client.clone()).await
}
pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
let mut query = self.selection.select("field");
query = query.arg(
"path",
path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("fields");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<JsonValueId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn new_boolean(&self, value: bool) -> JsonValue {
let mut query = self.selection.select("newBoolean");
query = query.arg("value", value);
JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn new_integer(&self, value: isize) -> JsonValue {
let mut query = self.selection.select("newInteger");
query = query.arg("value", value);
JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
let mut query = self.selection.select("newString");
query = query.arg("value", value.into());
JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_contents(&self, contents: Json) -> JsonValue {
let mut query = self.selection.select("withContents");
query = query.arg("contents", contents);
JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_field(
&self,
path: Vec<impl Into<String>>,
value: impl IntoID<JsonValueId>,
) -> JsonValue {
let mut query = self.selection.select("withField");
query = query.arg(
"path",
path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
query = query.arg_lazy(
"value",
Box::new(move || {
let value = value.clone();
Box::pin(async move { value.into_id().await.unwrap().quote() })
}),
);
JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct Llm {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Llm {
pub fn attempt(&self, number: isize) -> Llm {
let mut query = self.selection.select("attempt");
query = query.arg("number", number);
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn bind_result(&self, name: impl Into<String>) -> Binding {
let mut query = self.selection.select("bindResult");
query = query.arg("name", name.into());
Binding {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn env(&self) -> Env {
let query = self.selection.select("env");
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("hasPrompt");
query.execute(self.graphql_client.clone()).await
}
pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("history");
query.execute(self.graphql_client.clone()).await
}
pub async fn history_json(&self) -> Result<Json, DaggerError> {
let query = self.selection.select("historyJSON");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<Llmid, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn last_reply(&self) -> Result<String, DaggerError> {
let query = self.selection.select("lastReply");
query.execute(self.graphql_client.clone()).await
}
pub fn r#loop(&self) -> Llm {
let query = self.selection.select("loop");
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn model(&self) -> Result<String, DaggerError> {
let query = self.selection.select("model");
query.execute(self.graphql_client.clone()).await
}
pub async fn provider(&self) -> Result<String, DaggerError> {
let query = self.selection.select("provider");
query.execute(self.graphql_client.clone()).await
}
pub async fn step(&self) -> Result<Llmid, DaggerError> {
let query = self.selection.select("step");
query.execute(self.graphql_client.clone()).await
}
pub async fn sync(&self) -> Result<Llmid, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
pub fn token_usage(&self) -> LlmTokenUsage {
let query = self.selection.select("tokenUsage");
LlmTokenUsage {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn tools(&self) -> Result<String, DaggerError> {
let query = self.selection.select("tools");
query.execute(self.graphql_client.clone()).await
}
pub fn with_blocked_function(
&self,
type_name: impl Into<String>,
function: impl Into<String>,
) -> Llm {
let mut query = self.selection.select("withBlockedFunction");
query = query.arg("typeName", type_name.into());
query = query.arg("function", function.into());
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_env(&self, env: impl IntoID<EnvId>) -> Llm {
let mut query = self.selection.select("withEnv");
query = query.arg_lazy(
"env",
Box::new(move || {
let env = env.clone();
Box::pin(async move { env.into_id().await.unwrap().quote() })
}),
);
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<ServiceId>) -> Llm {
let mut query = self.selection.select("withMCPServer");
query = query.arg("name", name.into());
query = query.arg_lazy(
"service",
Box::new(move || {
let service = service.clone();
Box::pin(async move { service.into_id().await.unwrap().quote() })
}),
);
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_model(&self, model: impl Into<String>) -> Llm {
let mut query = self.selection.select("withModel");
query = query.arg("model", model.into());
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
let mut query = self.selection.select("withPrompt");
query = query.arg("prompt", prompt.into());
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_prompt_file(&self, file: impl IntoID<FileId>) -> Llm {
let mut query = self.selection.select("withPromptFile");
query = query.arg_lazy(
"file",
Box::new(move || {
let file = file.clone();
Box::pin(async move { file.into_id().await.unwrap().quote() })
}),
);
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_static_tools(&self) -> Llm {
let query = self.selection.select("withStaticTools");
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
let mut query = self.selection.select("withSystemPrompt");
query = query.arg("prompt", prompt.into());
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_default_system_prompt(&self) -> Llm {
let query = self.selection.select("withoutDefaultSystemPrompt");
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_message_history(&self) -> Llm {
let query = self.selection.select("withoutMessageHistory");
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_system_prompts(&self) -> Llm {
let query = self.selection.select("withoutSystemPrompts");
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct LlmTokenUsage {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl LlmTokenUsage {
pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("cachedTokenReads");
query.execute(self.graphql_client.clone()).await
}
pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("cachedTokenWrites");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<LlmTokenUsageId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("inputTokens");
query.execute(self.graphql_client.clone()).await
}
pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("outputTokens");
query.execute(self.graphql_client.clone()).await
}
pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("totalTokens");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Label {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Label {
pub async fn id(&self) -> Result<LabelId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn value(&self) -> Result<String, DaggerError> {
let query = self.selection.select("value");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct ListTypeDef {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl ListTypeDef {
pub fn element_type_def(&self) -> TypeDef {
let query = self.selection.select("elementTypeDef");
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Module {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ModuleChecksOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ModuleGeneratorsOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ModuleServeOpts {
#[builder(setter(into, strip_option), default)]
pub entrypoint: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub include_dependencies: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ModuleServicesOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
impl Module {
pub fn check(&self, name: impl Into<String>) -> Check {
let mut query = self.selection.select("check");
query = query.arg("name", name.into());
Check {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn checks(&self) -> CheckGroup {
let query = self.selection.select("checks");
CheckGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
let mut query = self.selection.select("checks");
if let Some(include) = opts.include {
query = query.arg("include", include);
}
CheckGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn dependencies(&self) -> Vec<Module> {
let query = self.selection.select("dependencies");
vec![Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub fn enums(&self) -> Vec<TypeDef> {
let query = self.selection.select("enums");
vec![TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn generated_context_directory(&self) -> Directory {
let query = self.selection.select("generatedContextDirectory");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn generator(&self, name: impl Into<String>) -> Generator {
let mut query = self.selection.select("generator");
query = query.arg("name", name.into());
Generator {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn generators(&self) -> GeneratorGroup {
let query = self.selection.select("generators");
GeneratorGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
let mut query = self.selection.select("generators");
if let Some(include) = opts.include {
query = query.arg("include", include);
}
GeneratorGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<ModuleId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn interfaces(&self) -> Vec<TypeDef> {
let query = self.selection.select("interfaces");
vec![TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn introspection_schema_json(&self) -> File {
let query = self.selection.select("introspectionSchemaJSON");
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn objects(&self) -> Vec<TypeDef> {
let query = self.selection.select("objects");
vec![TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn runtime(&self) -> Container {
let query = self.selection.select("runtime");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn sdk(&self) -> SdkConfig {
let query = self.selection.select("sdk");
SdkConfig {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn serve(&self) -> Result<Void, DaggerError> {
let query = self.selection.select("serve");
query.execute(self.graphql_client.clone()).await
}
pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
let mut query = self.selection.select("serve");
if let Some(include_dependencies) = opts.include_dependencies {
query = query.arg("includeDependencies", include_dependencies);
}
if let Some(entrypoint) = opts.entrypoint {
query = query.arg("entrypoint", entrypoint);
}
query.execute(self.graphql_client.clone()).await
}
pub fn services(&self) -> UpGroup {
let query = self.selection.select("services");
UpGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
let mut query = self.selection.select("services");
if let Some(include) = opts.include {
query = query.arg("include", include);
}
UpGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn source(&self) -> ModuleSource {
let query = self.selection.select("source");
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn sync(&self) -> Result<ModuleId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
pub fn user_defaults(&self) -> EnvFile {
let query = self.selection.select("userDefaults");
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_description(&self, description: impl Into<String>) -> Module {
let mut query = self.selection.select("withDescription");
query = query.arg("description", description.into());
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_enum(&self, r#enum: impl IntoID<TypeDefId>) -> Module {
let mut query = self.selection.select("withEnum");
query = query.arg_lazy(
"enum",
Box::new(move || {
let r#enum = r#enum.clone();
Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
}),
);
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_interface(&self, iface: impl IntoID<TypeDefId>) -> Module {
let mut query = self.selection.select("withInterface");
query = query.arg_lazy(
"iface",
Box::new(move || {
let iface = iface.clone();
Box::pin(async move { iface.into_id().await.unwrap().quote() })
}),
);
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_object(&self, object: impl IntoID<TypeDefId>) -> Module {
let mut query = self.selection.select("withObject");
query = query.arg_lazy(
"object",
Box::new(move || {
let object = object.clone();
Box::pin(async move { object.into_id().await.unwrap().quote() })
}),
);
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct ModuleConfigClient {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl ModuleConfigClient {
pub async fn directory(&self) -> Result<String, DaggerError> {
let query = self.selection.select("directory");
query.execute(self.graphql_client.clone()).await
}
pub async fn generator(&self) -> Result<String, DaggerError> {
let query = self.selection.select("generator");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<ModuleConfigClientId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct ModuleSource {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl ModuleSource {
pub fn as_module(&self) -> Module {
let query = self.selection.select("asModule");
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn as_string(&self) -> Result<String, DaggerError> {
let query = self.selection.select("asString");
query.execute(self.graphql_client.clone()).await
}
pub fn blueprint(&self) -> ModuleSource {
let query = self.selection.select("blueprint");
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn clone_ref(&self) -> Result<String, DaggerError> {
let query = self.selection.select("cloneRef");
query.execute(self.graphql_client.clone()).await
}
pub async fn commit(&self) -> Result<String, DaggerError> {
let query = self.selection.select("commit");
query.execute(self.graphql_client.clone()).await
}
pub fn config_clients(&self) -> Vec<ModuleConfigClient> {
let query = self.selection.select("configClients");
vec![ModuleConfigClient {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn config_exists(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("configExists");
query.execute(self.graphql_client.clone()).await
}
pub fn context_directory(&self) -> Directory {
let query = self.selection.select("contextDirectory");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn dependencies(&self) -> Vec<ModuleSource> {
let query = self.selection.select("dependencies");
vec![ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn digest(&self) -> Result<String, DaggerError> {
let query = self.selection.select("digest");
query.execute(self.graphql_client.clone()).await
}
pub fn directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn engine_version(&self) -> Result<String, DaggerError> {
let query = self.selection.select("engineVersion");
query.execute(self.graphql_client.clone()).await
}
pub fn generated_context_changeset(&self) -> Changeset {
let query = self.selection.select("generatedContextChangeset");
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn generated_context_directory(&self) -> Directory {
let query = self.selection.select("generatedContextDirectory");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
let query = self.selection.select("htmlRepoURL");
query.execute(self.graphql_client.clone()).await
}
pub async fn html_url(&self) -> Result<String, DaggerError> {
let query = self.selection.select("htmlURL");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<ModuleSourceId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn introspection_schema_json(&self) -> File {
let query = self.selection.select("introspectionSchemaJSON");
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
let query = self.selection.select("kind");
query.execute(self.graphql_client.clone()).await
}
pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
let query = self.selection.select("localContextDirectoryPath");
query.execute(self.graphql_client.clone()).await
}
pub async fn module_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("moduleName");
query.execute(self.graphql_client.clone()).await
}
pub async fn module_original_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("moduleOriginalName");
query.execute(self.graphql_client.clone()).await
}
pub async fn original_subpath(&self) -> Result<String, DaggerError> {
let query = self.selection.select("originalSubpath");
query.execute(self.graphql_client.clone()).await
}
pub async fn pin(&self) -> Result<String, DaggerError> {
let query = self.selection.select("pin");
query.execute(self.graphql_client.clone()).await
}
pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
let query = self.selection.select("repoRootPath");
query.execute(self.graphql_client.clone()).await
}
pub fn sdk(&self) -> SdkConfig {
let query = self.selection.select("sdk");
SdkConfig {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sourceRootSubpath");
query.execute(self.graphql_client.clone()).await
}
pub async fn source_subpath(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sourceSubpath");
query.execute(self.graphql_client.clone()).await
}
pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
pub fn toolchains(&self) -> Vec<ModuleSource> {
let query = self.selection.select("toolchains");
vec![ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn user_defaults(&self) -> EnvFile {
let query = self.selection.select("userDefaults");
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn version(&self) -> Result<String, DaggerError> {
let query = self.selection.select("version");
query.execute(self.graphql_client.clone()).await
}
pub fn with_blueprint(&self, blueprint: impl IntoID<ModuleSourceId>) -> ModuleSource {
let mut query = self.selection.select("withBlueprint");
query = query.arg_lazy(
"blueprint",
Box::new(move || {
let blueprint = blueprint.clone();
Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
}),
);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_client(
&self,
generator: impl Into<String>,
output_dir: impl Into<String>,
) -> ModuleSource {
let mut query = self.selection.select("withClient");
query = query.arg("generator", generator.into());
query = query.arg("outputDir", output_dir.into());
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_dependencies(&self, dependencies: Vec<ModuleSourceId>) -> ModuleSource {
let mut query = self.selection.select("withDependencies");
query = query.arg("dependencies", dependencies);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
let mut query = self.selection.select("withEngineVersion");
query = query.arg("version", version.into());
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_experimental_features(
&self,
features: Vec<ModuleSourceExperimentalFeature>,
) -> ModuleSource {
let mut query = self.selection.select("withExperimentalFeatures");
query = query.arg("features", features);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
let mut query = self.selection.select("withIncludes");
query = query.arg(
"patterns",
patterns
.into_iter()
.map(|i| i.into())
.collect::<Vec<String>>(),
);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
let mut query = self.selection.select("withName");
query = query.arg("name", name.into());
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
let mut query = self.selection.select("withSDK");
query = query.arg("source", source.into());
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
let mut query = self.selection.select("withSourceSubpath");
query = query.arg("path", path.into());
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource {
let mut query = self.selection.select("withToolchains");
query = query.arg("toolchains", toolchains);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_update_blueprint(&self) -> ModuleSource {
let query = self.selection.select("withUpdateBlueprint");
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
let mut query = self.selection.select("withUpdateDependencies");
query = query.arg(
"dependencies",
dependencies
.into_iter()
.map(|i| i.into())
.collect::<Vec<String>>(),
);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
let mut query = self.selection.select("withUpdateToolchains");
query = query.arg(
"toolchains",
toolchains
.into_iter()
.map(|i| i.into())
.collect::<Vec<String>>(),
);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
let mut query = self.selection.select("withUpdatedClients");
query = query.arg(
"clients",
clients
.into_iter()
.map(|i| i.into())
.collect::<Vec<String>>(),
);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_blueprint(&self) -> ModuleSource {
let query = self.selection.select("withoutBlueprint");
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
let mut query = self.selection.select("withoutClient");
query = query.arg("path", path.into());
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
let mut query = self.selection.select("withoutDependencies");
query = query.arg(
"dependencies",
dependencies
.into_iter()
.map(|i| i.into())
.collect::<Vec<String>>(),
);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_experimental_features(
&self,
features: Vec<ModuleSourceExperimentalFeature>,
) -> ModuleSource {
let mut query = self.selection.select("withoutExperimentalFeatures");
query = query.arg("features", features);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
let mut query = self.selection.select("withoutToolchains");
query = query.arg(
"toolchains",
toolchains
.into_iter()
.map(|i| i.into())
.collect::<Vec<String>>(),
);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct ObjectTypeDef {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl ObjectTypeDef {
pub fn constructor(&self) -> Function {
let query = self.selection.select("constructor");
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn deprecated(&self) -> Result<String, DaggerError> {
let query = self.selection.select("deprecated");
query.execute(self.graphql_client.clone()).await
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub fn fields(&self) -> Vec<FieldTypeDef> {
let query = self.selection.select("fields");
vec![FieldTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn functions(&self) -> Vec<Function> {
let query = self.selection.select("functions");
vec![Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn source_map(&self) -> SourceMap {
let query = self.selection.select("sourceMap");
SourceMap {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn source_module_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sourceModuleName");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Port {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Port {
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("experimentalSkipHealthcheck");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<PortId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn port(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("port");
query.execute(self.graphql_client.clone()).await
}
pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
let query = self.selection.select("protocol");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Query {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryContainerOpts {
#[builder(setter(into, strip_option), default)]
pub platform: Option<Platform>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryCurrentTypeDefsOpts {
#[builder(setter(into, strip_option), default)]
pub hide_core: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryEnvOpts {
#[builder(setter(into, strip_option), default)]
pub privileged: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub writable: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryEnvFileOpts {
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryFileOpts {
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryGitOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub experimental_service_host: Option<ServiceId>,
#[builder(setter(into, strip_option), default)]
pub http_auth_header: Option<SecretId>,
#[builder(setter(into, strip_option), default)]
pub http_auth_token: Option<SecretId>,
#[builder(setter(into, strip_option), default)]
pub http_auth_username: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub keep_git_dir: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub ssh_auth_socket: Option<SocketId>,
#[builder(setter(into, strip_option), default)]
pub ssh_known_hosts: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryHttpOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub auth_header: Option<SecretId>,
#[builder(setter(into, strip_option), default)]
pub experimental_service_host: Option<ServiceId>,
#[builder(setter(into, strip_option), default)]
pub name: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryLlmOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub max_api_calls: Option<isize>,
#[builder(setter(into, strip_option), default)]
pub model: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryModuleSourceOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub allow_not_exists: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub disable_find_up: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub ref_pin: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub require_kind: Option<ModuleSourceKind>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QuerySecretOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub cache_key: Option<&'a str>,
}
impl Query {
pub fn address(&self, value: impl Into<String>) -> Address {
let mut query = self.selection.select("address");
query = query.arg("value", value.into());
Address {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
let mut query = self.selection.select("cacheVolume");
query = query.arg("key", key.into());
CacheVolume {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn changeset(&self) -> Changeset {
let query = self.selection.select("changeset");
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn cloud(&self) -> Cloud {
let query = self.selection.select("cloud");
Cloud {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn container(&self) -> Container {
let query = self.selection.select("container");
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
let mut query = self.selection.select("container");
if let Some(platform) = opts.platform {
query = query.arg("platform", platform);
}
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn current_env(&self) -> Env {
let query = self.selection.select("currentEnv");
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn current_function_call(&self) -> FunctionCall {
let query = self.selection.select("currentFunctionCall");
FunctionCall {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn current_module(&self) -> CurrentModule {
let query = self.selection.select("currentModule");
CurrentModule {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn current_type_defs(&self) -> Vec<TypeDef> {
let query = self.selection.select("currentTypeDefs");
vec![TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn current_type_defs_opts(&self, opts: QueryCurrentTypeDefsOpts) -> Vec<TypeDef> {
let mut query = self.selection.select("currentTypeDefs");
if let Some(hide_core) = opts.hide_core {
query = query.arg("hideCore", hide_core);
}
vec![TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn current_workspace(&self) -> Workspace {
let query = self.selection.select("currentWorkspace");
Workspace {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
let query = self.selection.select("defaultPlatform");
query.execute(self.graphql_client.clone()).await
}
pub fn directory(&self) -> Directory {
let query = self.selection.select("directory");
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn engine(&self) -> Engine {
let query = self.selection.select("engine");
Engine {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn env(&self) -> Env {
let query = self.selection.select("env");
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
let mut query = self.selection.select("env");
if let Some(privileged) = opts.privileged {
query = query.arg("privileged", privileged);
}
if let Some(writable) = opts.writable {
query = query.arg("writable", writable);
}
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn env_file(&self) -> EnvFile {
let query = self.selection.select("envFile");
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
let mut query = self.selection.select("envFile");
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn error(&self, message: impl Into<String>) -> Error {
let mut query = self.selection.select("error");
query = query.arg("message", message.into());
Error {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
let mut query = self.selection.select("file");
query = query.arg("name", name.into());
query = query.arg("contents", contents.into());
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn file_opts(
&self,
name: impl Into<String>,
contents: impl Into<String>,
opts: QueryFileOpts,
) -> File {
let mut query = self.selection.select("file");
query = query.arg("name", name.into());
query = query.arg("contents", contents.into());
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn function(
&self,
name: impl Into<String>,
return_type: impl IntoID<TypeDefId>,
) -> Function {
let mut query = self.selection.select("function");
query = query.arg("name", name.into());
query = query.arg_lazy(
"returnType",
Box::new(move || {
let return_type = return_type.clone();
Box::pin(async move { return_type.into_id().await.unwrap().quote() })
}),
);
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode {
let mut query = self.selection.select("generatedCode");
query = query.arg_lazy(
"code",
Box::new(move || {
let code = code.clone();
Box::pin(async move { code.into_id().await.unwrap().quote() })
}),
);
GeneratedCode {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn git(&self, url: impl Into<String>) -> GitRepository {
let mut query = self.selection.select("git");
query = query.arg("url", url.into());
GitRepository {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
let mut query = self.selection.select("git");
query = query.arg("url", url.into());
if let Some(keep_git_dir) = opts.keep_git_dir {
query = query.arg("keepGitDir", keep_git_dir);
}
if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
query = query.arg("sshKnownHosts", ssh_known_hosts);
}
if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
query = query.arg("sshAuthSocket", ssh_auth_socket);
}
if let Some(http_auth_username) = opts.http_auth_username {
query = query.arg("httpAuthUsername", http_auth_username);
}
if let Some(http_auth_token) = opts.http_auth_token {
query = query.arg("httpAuthToken", http_auth_token);
}
if let Some(http_auth_header) = opts.http_auth_header {
query = query.arg("httpAuthHeader", http_auth_header);
}
if let Some(experimental_service_host) = opts.experimental_service_host {
query = query.arg("experimentalServiceHost", experimental_service_host);
}
GitRepository {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn host(&self) -> Host {
let query = self.selection.select("host");
Host {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn http(&self, url: impl Into<String>) -> File {
let mut query = self.selection.select("http");
query = query.arg("url", url.into());
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
let mut query = self.selection.select("http");
query = query.arg("url", url.into());
if let Some(name) = opts.name {
query = query.arg("name", name);
}
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
if let Some(auth_header) = opts.auth_header {
query = query.arg("authHeader", auth_header);
}
if let Some(experimental_service_host) = opts.experimental_service_host {
query = query.arg("experimentalServiceHost", experimental_service_host);
}
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<QueryId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn json(&self) -> JsonValue {
let query = self.selection.select("json");
JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn llm(&self) -> Llm {
let query = self.selection.select("llm");
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
let mut query = self.selection.select("llm");
if let Some(model) = opts.model {
query = query.arg("model", model);
}
if let Some(max_api_calls) = opts.max_api_calls {
query = query.arg("maxAPICalls", max_api_calls);
}
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
let mut query = self.selection.select("loadAddressFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Address {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
let mut query = self.selection.select("loadBindingFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Binding {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
let mut query = self.selection.select("loadCacheVolumeFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
CacheVolume {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
let mut query = self.selection.select("loadChangesetFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Changeset {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
let mut query = self.selection.select("loadCheckFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Check {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
let mut query = self.selection.select("loadCheckGroupFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
CheckGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
let mut query = self.selection.select("loadCloudFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Cloud {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
let mut query = self.selection.select("loadContainerFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
let mut query = self.selection.select("loadCurrentModuleFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
CurrentModule {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
let mut query = self.selection.select("loadDiffStatFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
DiffStat {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
let mut query = self.selection.select("loadDirectoryFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_engine_cache_entry_from_id(
&self,
id: impl IntoID<EngineCacheEntryId>,
) -> EngineCacheEntry {
let mut query = self.selection.select("loadEngineCacheEntryFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
EngineCacheEntry {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_engine_cache_entry_set_from_id(
&self,
id: impl IntoID<EngineCacheEntrySetId>,
) -> EngineCacheEntrySet {
let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
EngineCacheEntrySet {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
let mut query = self.selection.select("loadEngineCacheFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
EngineCache {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
let mut query = self.selection.select("loadEngineFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Engine {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
let mut query = self.selection.select("loadEnumTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
EnumTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_enum_value_type_def_from_id(
&self,
id: impl IntoID<EnumValueTypeDefId>,
) -> EnumValueTypeDef {
let mut query = self.selection.select("loadEnumValueTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
EnumValueTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
let mut query = self.selection.select("loadEnvFileFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
EnvFile {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
let mut query = self.selection.select("loadEnvFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Env {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
let mut query = self.selection.select("loadEnvVariableFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
EnvVariable {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
let mut query = self.selection.select("loadErrorFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Error {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
let mut query = self.selection.select("loadErrorValueFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
ErrorValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
let mut query = self.selection.select("loadFieldTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
FieldTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
let mut query = self.selection.select("loadFileFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
let mut query = self.selection.select("loadFunctionArgFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
FunctionArg {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_function_call_arg_value_from_id(
&self,
id: impl IntoID<FunctionCallArgValueId>,
) -> FunctionCallArgValue {
let mut query = self.selection.select("loadFunctionCallArgValueFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
FunctionCallArgValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
let mut query = self.selection.select("loadFunctionCallFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
FunctionCall {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
let mut query = self.selection.select("loadFunctionFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
let mut query = self.selection.select("loadGeneratedCodeFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
GeneratedCode {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
let mut query = self.selection.select("loadGeneratorFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Generator {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_generator_group_from_id(
&self,
id: impl IntoID<GeneratorGroupId>,
) -> GeneratorGroup {
let mut query = self.selection.select("loadGeneratorGroupFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
GeneratorGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
let mut query = self.selection.select("loadGitRefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
let mut query = self.selection.select("loadGitRepositoryFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
GitRepository {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_healthcheck_config_from_id(
&self,
id: impl IntoID<HealthcheckConfigId>,
) -> HealthcheckConfig {
let mut query = self.selection.select("loadHealthcheckConfigFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
HealthcheckConfig {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
let mut query = self.selection.select("loadHostFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Host {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
let mut query = self.selection.select("loadInputTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
InputTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_interface_type_def_from_id(
&self,
id: impl IntoID<InterfaceTypeDefId>,
) -> InterfaceTypeDef {
let mut query = self.selection.select("loadInterfaceTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
InterfaceTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
let mut query = self.selection.select("loadJSONValueFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
JsonValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
let mut query = self.selection.select("loadLLMFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Llm {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
let mut query = self.selection.select("loadLLMTokenUsageFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
LlmTokenUsage {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
let mut query = self.selection.select("loadLabelFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Label {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
let mut query = self.selection.select("loadListTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
ListTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_module_config_client_from_id(
&self,
id: impl IntoID<ModuleConfigClientId>,
) -> ModuleConfigClient {
let mut query = self.selection.select("loadModuleConfigClientFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
ModuleConfigClient {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
let mut query = self.selection.select("loadModuleFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
let mut query = self.selection.select("loadModuleSourceFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
let mut query = self.selection.select("loadObjectTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
ObjectTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
let mut query = self.selection.select("loadPortFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Port {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_query_from_id(&self, id: impl IntoID<QueryId>) -> Query {
let mut query = self.selection.select("loadQueryFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Query {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
let mut query = self.selection.select("loadSDKConfigFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
SdkConfig {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
let mut query = self.selection.select("loadScalarTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
ScalarTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
let mut query = self.selection.select("loadSearchResultFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
SearchResult {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_search_submatch_from_id(
&self,
id: impl IntoID<SearchSubmatchId>,
) -> SearchSubmatch {
let mut query = self.selection.select("loadSearchSubmatchFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
SearchSubmatch {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
let mut query = self.selection.select("loadSecretFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Secret {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
let mut query = self.selection.select("loadServiceFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
let mut query = self.selection.select("loadSocketFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Socket {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
let mut query = self.selection.select("loadSourceMapFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
SourceMap {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
let mut query = self.selection.select("loadStatFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Stat {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
let mut query = self.selection.select("loadTerminalFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Terminal {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
let mut query = self.selection.select("loadTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
let mut query = self.selection.select("loadUpFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Up {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
let mut query = self.selection.select("loadUpGroupFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
UpGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
let mut query = self.selection.select("loadWorkspaceFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.into_id().await.unwrap().quote() })
}),
);
Workspace {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn module(&self) -> Module {
let query = self.selection.select("module");
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
let mut query = self.selection.select("moduleSource");
query = query.arg("refString", ref_string.into());
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn module_source_opts<'a>(
&self,
ref_string: impl Into<String>,
opts: QueryModuleSourceOpts<'a>,
) -> ModuleSource {
let mut query = self.selection.select("moduleSource");
query = query.arg("refString", ref_string.into());
if let Some(ref_pin) = opts.ref_pin {
query = query.arg("refPin", ref_pin);
}
if let Some(disable_find_up) = opts.disable_find_up {
query = query.arg("disableFindUp", disable_find_up);
}
if let Some(allow_not_exists) = opts.allow_not_exists {
query = query.arg("allowNotExists", allow_not_exists);
}
if let Some(require_kind) = opts.require_kind {
query = query.arg("requireKind", require_kind);
}
ModuleSource {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn secret(&self, uri: impl Into<String>) -> Secret {
let mut query = self.selection.select("secret");
query = query.arg("uri", uri.into());
Secret {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
let mut query = self.selection.select("secret");
query = query.arg("uri", uri.into());
if let Some(cache_key) = opts.cache_key {
query = query.arg("cacheKey", cache_key);
}
Secret {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
let mut query = self.selection.select("setSecret");
query = query.arg("name", name.into());
query = query.arg("plaintext", plaintext.into());
Secret {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
let mut query = self.selection.select("sourceMap");
query = query.arg("filename", filename.into());
query = query.arg("line", line);
query = query.arg("column", column);
SourceMap {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn type_def(&self) -> TypeDef {
let query = self.selection.select("typeDef");
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn version(&self) -> Result<String, DaggerError> {
let query = self.selection.select("version");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct SdkConfig {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl SdkConfig {
pub async fn debug(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("debug");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<SdkConfigId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn source(&self) -> Result<String, DaggerError> {
let query = self.selection.select("source");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct ScalarTypeDef {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl ScalarTypeDef {
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<ScalarTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn source_module_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sourceModuleName");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct SearchResult {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl SearchResult {
pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("absoluteOffset");
query.execute(self.graphql_client.clone()).await
}
pub async fn file_path(&self) -> Result<String, DaggerError> {
let query = self.selection.select("filePath");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<SearchResultId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn line_number(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("lineNumber");
query.execute(self.graphql_client.clone()).await
}
pub async fn matched_lines(&self) -> Result<String, DaggerError> {
let query = self.selection.select("matchedLines");
query.execute(self.graphql_client.clone()).await
}
pub fn submatches(&self) -> Vec<SearchSubmatch> {
let query = self.selection.select("submatches");
vec![SearchSubmatch {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
}
#[derive(Clone)]
pub struct SearchSubmatch {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl SearchSubmatch {
pub async fn end(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("end");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<SearchSubmatchId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn start(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("start");
query.execute(self.graphql_client.clone()).await
}
pub async fn text(&self) -> Result<String, DaggerError> {
let query = self.selection.select("text");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Secret {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Secret {
pub async fn id(&self) -> Result<SecretId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn plaintext(&self) -> Result<String, DaggerError> {
let query = self.selection.select("plaintext");
query.execute(self.graphql_client.clone()).await
}
pub async fn uri(&self) -> Result<String, DaggerError> {
let query = self.selection.select("uri");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Service {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ServiceEndpointOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub port: Option<isize>,
#[builder(setter(into, strip_option), default)]
pub scheme: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ServiceStopOpts {
#[builder(setter(into, strip_option), default)]
pub kill: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ServiceTerminalOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub cmd: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ServiceUpOpts {
#[builder(setter(into, strip_option), default)]
pub ports: Option<Vec<PortForward>>,
#[builder(setter(into, strip_option), default)]
pub random: Option<bool>,
}
impl Service {
pub async fn endpoint(&self) -> Result<String, DaggerError> {
let query = self.selection.select("endpoint");
query.execute(self.graphql_client.clone()).await
}
pub async fn endpoint_opts<'a>(
&self,
opts: ServiceEndpointOpts<'a>,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("endpoint");
if let Some(port) = opts.port {
query = query.arg("port", port);
}
if let Some(scheme) = opts.scheme {
query = query.arg("scheme", scheme);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn hostname(&self) -> Result<String, DaggerError> {
let query = self.selection.select("hostname");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<ServiceId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn ports(&self) -> Vec<Port> {
let query = self.selection.select("ports");
vec![Port {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub async fn start(&self) -> Result<ServiceId, DaggerError> {
let query = self.selection.select("start");
query.execute(self.graphql_client.clone()).await
}
pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
let query = self.selection.select("stop");
query.execute(self.graphql_client.clone()).await
}
pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<ServiceId, DaggerError> {
let mut query = self.selection.select("stop");
if let Some(kill) = opts.kill {
query = query.arg("kill", kill);
}
query.execute(self.graphql_client.clone()).await
}
pub async fn sync(&self) -> Result<ServiceId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
pub fn terminal(&self) -> Service {
let query = self.selection.select("terminal");
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
let mut query = self.selection.select("terminal");
if let Some(cmd) = opts.cmd {
query = query.arg("cmd", cmd);
}
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn up(&self) -> Result<Void, DaggerError> {
let query = self.selection.select("up");
query.execute(self.graphql_client.clone()).await
}
pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
let mut query = self.selection.select("up");
if let Some(ports) = opts.ports {
query = query.arg("ports", ports);
}
if let Some(random) = opts.random {
query = query.arg("random", random);
}
query.execute(self.graphql_client.clone()).await
}
pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
let mut query = self.selection.select("withHostname");
query = query.arg("hostname", hostname.into());
Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct Socket {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Socket {
pub async fn id(&self) -> Result<SocketId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct SourceMap {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl SourceMap {
pub async fn column(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("column");
query.execute(self.graphql_client.clone()).await
}
pub async fn filename(&self) -> Result<String, DaggerError> {
let query = self.selection.select("filename");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<SourceMapId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn line(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("line");
query.execute(self.graphql_client.clone()).await
}
pub async fn module(&self) -> Result<String, DaggerError> {
let query = self.selection.select("module");
query.execute(self.graphql_client.clone()).await
}
pub async fn url(&self) -> Result<String, DaggerError> {
let query = self.selection.select("url");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Stat {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Stat {
pub async fn file_type(&self) -> Result<FileType, DaggerError> {
let query = self.selection.select("fileType");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<StatId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn permissions(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("permissions");
query.execute(self.graphql_client.clone()).await
}
pub async fn size(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("size");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Terminal {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Terminal {
pub async fn id(&self) -> Result<TerminalId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn sync(&self) -> Result<TerminalId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct TypeDef {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct TypeDefWithEnumOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub source_map: Option<SourceMapId>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct TypeDefWithEnumMemberOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub deprecated: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub source_map: Option<SourceMapId>,
#[builder(setter(into, strip_option), default)]
pub value: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct TypeDefWithEnumValueOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub deprecated: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub source_map: Option<SourceMapId>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct TypeDefWithFieldOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub deprecated: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub source_map: Option<SourceMapId>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct TypeDefWithInterfaceOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub source_map: Option<SourceMapId>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct TypeDefWithObjectOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub deprecated: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
#[builder(setter(into, strip_option), default)]
pub source_map: Option<SourceMapId>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct TypeDefWithScalarOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
}
impl TypeDef {
pub fn as_enum(&self) -> EnumTypeDef {
let query = self.selection.select("asEnum");
EnumTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_input(&self) -> InputTypeDef {
let query = self.selection.select("asInput");
InputTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_interface(&self) -> InterfaceTypeDef {
let query = self.selection.select("asInterface");
InterfaceTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_list(&self) -> ListTypeDef {
let query = self.selection.select("asList");
ListTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_object(&self) -> ObjectTypeDef {
let query = self.selection.select("asObject");
ObjectTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn as_scalar(&self) -> ScalarTypeDef {
let query = self.selection.select("asScalar");
ScalarTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
let query = self.selection.select("kind");
query.execute(self.graphql_client.clone()).await
}
pub async fn optional(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("optional");
query.execute(self.graphql_client.clone()).await
}
pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef {
let mut query = self.selection.select("withConstructor");
query = query.arg_lazy(
"function",
Box::new(move || {
let function = function.clone();
Box::pin(async move { function.into_id().await.unwrap().quote() })
}),
);
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
let mut query = self.selection.select("withEnum");
query = query.arg("name", name.into());
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_enum_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithEnumOpts<'a>,
) -> TypeDef {
let mut query = self.selection.select("withEnum");
query = query.arg("name", name.into());
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(source_map) = opts.source_map {
query = query.arg("sourceMap", source_map);
}
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
let mut query = self.selection.select("withEnumMember");
query = query.arg("name", name.into());
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_enum_member_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithEnumMemberOpts<'a>,
) -> TypeDef {
let mut query = self.selection.select("withEnumMember");
query = query.arg("name", name.into());
if let Some(value) = opts.value {
query = query.arg("value", value);
}
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(source_map) = opts.source_map {
query = query.arg("sourceMap", source_map);
}
if let Some(deprecated) = opts.deprecated {
query = query.arg("deprecated", deprecated);
}
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
let mut query = self.selection.select("withEnumValue");
query = query.arg("value", value.into());
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_enum_value_opts<'a>(
&self,
value: impl Into<String>,
opts: TypeDefWithEnumValueOpts<'a>,
) -> TypeDef {
let mut query = self.selection.select("withEnumValue");
query = query.arg("value", value.into());
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(source_map) = opts.source_map {
query = query.arg("sourceMap", source_map);
}
if let Some(deprecated) = opts.deprecated {
query = query.arg("deprecated", deprecated);
}
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>) -> TypeDef {
let mut query = self.selection.select("withField");
query = query.arg("name", name.into());
query = query.arg_lazy(
"typeDef",
Box::new(move || {
let type_def = type_def.clone();
Box::pin(async move { type_def.into_id().await.unwrap().quote() })
}),
);
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_field_opts<'a>(
&self,
name: impl Into<String>,
type_def: impl IntoID<TypeDefId>,
opts: TypeDefWithFieldOpts<'a>,
) -> TypeDef {
let mut query = self.selection.select("withField");
query = query.arg("name", name.into());
query = query.arg_lazy(
"typeDef",
Box::new(move || {
let type_def = type_def.clone();
Box::pin(async move { type_def.into_id().await.unwrap().quote() })
}),
);
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(source_map) = opts.source_map {
query = query.arg("sourceMap", source_map);
}
if let Some(deprecated) = opts.deprecated {
query = query.arg("deprecated", deprecated);
}
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef {
let mut query = self.selection.select("withFunction");
query = query.arg_lazy(
"function",
Box::new(move || {
let function = function.clone();
Box::pin(async move { function.into_id().await.unwrap().quote() })
}),
);
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
let mut query = self.selection.select("withInterface");
query = query.arg("name", name.into());
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_interface_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithInterfaceOpts<'a>,
) -> TypeDef {
let mut query = self.selection.select("withInterface");
query = query.arg("name", name.into());
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(source_map) = opts.source_map {
query = query.arg("sourceMap", source_map);
}
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
let mut query = self.selection.select("withKind");
query = query.arg("kind", kind);
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef {
let mut query = self.selection.select("withListOf");
query = query.arg_lazy(
"elementType",
Box::new(move || {
let element_type = element_type.clone();
Box::pin(async move { element_type.into_id().await.unwrap().quote() })
}),
);
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
let mut query = self.selection.select("withObject");
query = query.arg("name", name.into());
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_object_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithObjectOpts<'a>,
) -> TypeDef {
let mut query = self.selection.select("withObject");
query = query.arg("name", name.into());
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(source_map) = opts.source_map {
query = query.arg("sourceMap", source_map);
}
if let Some(deprecated) = opts.deprecated {
query = query.arg("deprecated", deprecated);
}
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_optional(&self, optional: bool) -> TypeDef {
let mut query = self.selection.select("withOptional");
query = query.arg("optional", optional);
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
let mut query = self.selection.select("withScalar");
query = query.arg("name", name.into());
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn with_scalar_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithScalarOpts<'a>,
) -> TypeDef {
let mut query = self.selection.select("withScalar");
query = query.arg("name", name.into());
if let Some(description) = opts.description {
query = query.arg("description", description);
}
TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct Up {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Up {
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<UpId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn original_module(&self) -> Module {
let query = self.selection.select("originalModule");
Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("path");
query.execute(self.graphql_client.clone()).await
}
pub fn run(&self) -> Up {
let query = self.selection.select("run");
Up {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct UpGroup {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl UpGroup {
pub async fn id(&self) -> Result<UpGroupId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn list(&self) -> Vec<Up> {
let query = self.selection.select("list");
vec![Up {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}]
}
pub fn run(&self) -> UpGroup {
let query = self.selection.select("run");
UpGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Clone)]
pub struct Workspace {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct WorkspaceChecksOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct WorkspaceDirectoryOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
#[builder(setter(into, strip_option), default)]
pub gitignore: Option<bool>,
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct WorkspaceFindUpOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub from: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct WorkspaceGeneratorsOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct WorkspaceServicesOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
impl Workspace {
pub async fn address(&self) -> Result<String, DaggerError> {
let query = self.selection.select("address");
query.execute(self.graphql_client.clone()).await
}
pub fn checks(&self) -> CheckGroup {
let query = self.selection.select("checks");
CheckGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
let mut query = self.selection.select("checks");
if let Some(include) = opts.include {
query = query.arg("include", include);
}
CheckGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn client_id(&self) -> Result<String, DaggerError> {
let query = self.selection.select("clientId");
query.execute(self.graphql_client.clone()).await
}
pub async fn config_path(&self) -> Result<String, DaggerError> {
let query = self.selection.select("configPath");
query.execute(self.graphql_client.clone()).await
}
pub fn directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn directory_opts<'a>(
&self,
path: impl Into<String>,
opts: WorkspaceDirectoryOpts<'a>,
) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
if let Some(gitignore) = opts.gitignore {
query = query.arg("gitignore", gitignore);
}
Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn file(&self, path: impl Into<String>) -> File {
let mut query = self.selection.select("file");
query = query.arg("path", path.into());
File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("findUp");
query = query.arg("name", name.into());
query.execute(self.graphql_client.clone()).await
}
pub async fn find_up_opts<'a>(
&self,
name: impl Into<String>,
opts: WorkspaceFindUpOpts<'a>,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("findUp");
query = query.arg("name", name.into());
if let Some(from) = opts.from {
query = query.arg("from", from);
}
query.execute(self.graphql_client.clone()).await
}
pub fn generators(&self) -> GeneratorGroup {
let query = self.selection.select("generators");
GeneratorGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
let mut query = self.selection.select("generators");
if let Some(include) = opts.include {
query = query.arg("include", include);
}
GeneratorGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub async fn has_config(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("hasConfig");
query.execute(self.graphql_client.clone()).await
}
pub async fn id(&self) -> Result<WorkspaceId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn initialized(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("initialized");
query.execute(self.graphql_client.clone()).await
}
pub async fn path(&self) -> Result<String, DaggerError> {
let query = self.selection.select("path");
query.execute(self.graphql_client.clone()).await
}
pub fn services(&self) -> UpGroup {
let query = self.selection.select("services");
UpGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
let mut query = self.selection.select("services");
if let Some(include) = opts.include {
query = query.arg("include", include);
}
UpGroup {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}
}
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum CacheSharingMode {
#[serde(rename = "LOCKED")]
Locked,
#[serde(rename = "PRIVATE")]
Private,
#[serde(rename = "SHARED")]
Shared,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum ChangesetMergeConflict {
#[serde(rename = "FAIL")]
Fail,
#[serde(rename = "FAIL_EARLY")]
FailEarly,
#[serde(rename = "LEAVE_CONFLICT_MARKERS")]
LeaveConflictMarkers,
#[serde(rename = "PREFER_OURS")]
PreferOurs,
#[serde(rename = "PREFER_THEIRS")]
PreferTheirs,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum ChangesetsMergeConflict {
#[serde(rename = "FAIL")]
Fail,
#[serde(rename = "FAIL_EARLY")]
FailEarly,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum DiffStatKind {
#[serde(rename = "ADDED")]
Added,
#[serde(rename = "MODIFIED")]
Modified,
#[serde(rename = "REMOVED")]
Removed,
#[serde(rename = "RENAMED")]
Renamed,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum ExistsType {
#[serde(rename = "DIRECTORY_TYPE")]
DirectoryType,
#[serde(rename = "REGULAR_TYPE")]
RegularType,
#[serde(rename = "SYMLINK_TYPE")]
SymlinkType,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum FileType {
#[serde(rename = "DIRECTORY")]
Directory,
#[serde(rename = "DIRECTORY_TYPE")]
DirectoryType,
#[serde(rename = "REGULAR")]
Regular,
#[serde(rename = "REGULAR_TYPE")]
RegularType,
#[serde(rename = "SYMLINK")]
Symlink,
#[serde(rename = "SYMLINK_TYPE")]
SymlinkType,
#[serde(rename = "UNKNOWN")]
Unknown,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum FunctionCachePolicy {
#[serde(rename = "Default")]
Default,
#[serde(rename = "Never")]
Never,
#[serde(rename = "PerSession")]
PerSession,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum ImageLayerCompression {
#[serde(rename = "EStarGZ")]
EStarGz,
#[serde(rename = "ESTARGZ")]
Estargz,
#[serde(rename = "Gzip")]
Gzip,
#[serde(rename = "Uncompressed")]
Uncompressed,
#[serde(rename = "Zstd")]
Zstd,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum ImageMediaTypes {
#[serde(rename = "DOCKER")]
Docker,
#[serde(rename = "DockerMediaTypes")]
DockerMediaTypes,
#[serde(rename = "OCI")]
Oci,
#[serde(rename = "OCIMediaTypes")]
OciMediaTypes,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum ModuleSourceExperimentalFeature {
#[serde(rename = "SELF_CALLS")]
SelfCalls,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum ModuleSourceKind {
#[serde(rename = "DIR")]
Dir,
#[serde(rename = "DIR_SOURCE")]
DirSource,
#[serde(rename = "GIT")]
Git,
#[serde(rename = "GIT_SOURCE")]
GitSource,
#[serde(rename = "LOCAL")]
Local,
#[serde(rename = "LOCAL_SOURCE")]
LocalSource,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum NetworkProtocol {
#[serde(rename = "TCP")]
Tcp,
#[serde(rename = "UDP")]
Udp,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum ReturnType {
#[serde(rename = "ANY")]
Any,
#[serde(rename = "FAILURE")]
Failure,
#[serde(rename = "SUCCESS")]
Success,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum TypeDefKind {
#[serde(rename = "BOOLEAN")]
Boolean,
#[serde(rename = "BOOLEAN_KIND")]
BooleanKind,
#[serde(rename = "ENUM")]
Enum,
#[serde(rename = "ENUM_KIND")]
EnumKind,
#[serde(rename = "FLOAT")]
Float,
#[serde(rename = "FLOAT_KIND")]
FloatKind,
#[serde(rename = "INPUT")]
Input,
#[serde(rename = "INPUT_KIND")]
InputKind,
#[serde(rename = "INTEGER")]
Integer,
#[serde(rename = "INTEGER_KIND")]
IntegerKind,
#[serde(rename = "INTERFACE")]
Interface,
#[serde(rename = "INTERFACE_KIND")]
InterfaceKind,
#[serde(rename = "LIST")]
List,
#[serde(rename = "LIST_KIND")]
ListKind,
#[serde(rename = "OBJECT")]
Object,
#[serde(rename = "OBJECT_KIND")]
ObjectKind,
#[serde(rename = "SCALAR")]
Scalar,
#[serde(rename = "SCALAR_KIND")]
ScalarKind,
#[serde(rename = "STRING")]
String,
#[serde(rename = "STRING_KIND")]
StringKind,
#[serde(rename = "VOID")]
Void,
#[serde(rename = "VOID_KIND")]
VoidKind,
}