<?php

/**
 * This class has been generated by dagger-php-sdk. DO NOT EDIT.
 */

declare(strict_types=1);

namespace Dagger;

class Binding extends Client\AbstractObject implements Client\IdAble
{
    /**
     * Retrieve the binding value, as type Address
     */
    public function asAddress(): Address
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asAddress');
        return new \Dagger\Address($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type CacheVolume
     */
    public function asCacheVolume(): CacheVolume
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asCacheVolume');
        return new \Dagger\CacheVolume($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type Changeset
     */
    public function asChangeset(): Changeset
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asChangeset');
        return new \Dagger\Changeset($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type Cloud
     */
    public function asCloud(): Cloud
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asCloud');
        return new \Dagger\Cloud($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type Container
     */
    public function asContainer(): Container
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asContainer');
        return new \Dagger\Container($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type Directory
     */
    public function asDirectory(): Directory
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asDirectory');
        return new \Dagger\Directory($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type Env
     */
    public function asEnv(): Env
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asEnv');
        return new \Dagger\Env($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type EnvFile
     */
    public function asEnvFile(): EnvFile
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asEnvFile');
        return new \Dagger\EnvFile($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type File
     */
    public function asFile(): File
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asFile');
        return new \Dagger\File($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type GitRef
     */
    public function asGitRef(): GitRef
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asGitRef');
        return new \Dagger\GitRef($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type GitRepository
     */
    public function asGitRepository(): GitRepository
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asGitRepository');
        return new \Dagger\GitRepository($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type JSONValue
     */
    public function asJSONValue(): JsonValue
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asJSONValue');
        return new \Dagger\JsonValue($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type Module
     */
    public function asModule(): Module
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asModule');
        return new \Dagger\Module($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type ModuleConfigClient
     */
    public function asModuleConfigClient(): ModuleConfigClient
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asModuleConfigClient');
        return new \Dagger\ModuleConfigClient($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type ModuleSource
     */
    public function asModuleSource(): ModuleSource
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asModuleSource');
        return new \Dagger\ModuleSource($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type SearchResult
     */
    public function asSearchResult(): SearchResult
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asSearchResult');
        return new \Dagger\SearchResult($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type SearchSubmatch
     */
    public function asSearchSubmatch(): SearchSubmatch
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asSearchSubmatch');
        return new \Dagger\SearchSubmatch($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type Secret
     */
    public function asSecret(): Secret
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asSecret');
        return new \Dagger\Secret($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type Service
     */
    public function asService(): Service
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asService');
        return new \Dagger\Service($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Retrieve the binding value, as type Socket
     */
    public function asSocket(): Socket
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('asSocket');
        return new \Dagger\Socket($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Returns the binding's string value
     */
    public function asString(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('asString');
        return (string)$this->queryLeaf($leafQueryBuilder, 'asString');
    }

    /**
     * Returns the digest of the binding value
     */
    public function digest(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('digest');
        return (string)$this->queryLeaf($leafQueryBuilder, 'digest');
    }

    /**
     * A unique identifier for this Binding.
     */
    public function id(): BindingId
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('id');
        return new \Dagger\BindingId((string)$this->queryLeaf($leafQueryBuilder, 'id'));
    }

    /**
     * Returns true if the binding is null
     */
    public function isNull(): bool
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('isNull');
        return (bool)$this->queryLeaf($leafQueryBuilder, 'isNull');
    }

    /**
     * Returns the binding name
     */
    public function name(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('name');
        return (string)$this->queryLeaf($leafQueryBuilder, 'name');
    }

    /**
     * Returns the binding type
     */
    public function typeName(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('typeName');
        return (string)$this->queryLeaf($leafQueryBuilder, 'typeName');
    }
}
