<?php

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

declare(strict_types=1);

namespace Dagger;

/**
 * An argument accepted by a function.
 *
 * This is a specification for an argument at function definition time, not an argument passed at function call time.
 */
class FunctionArg extends Client\AbstractObject implements Client\IdAble
{
    /**
     * Only applies to arguments of type File or Directory. If the argument is not set, load it from the given path in the context directory
     */
    public function defaultPath(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('defaultPath');
        return (string)$this->queryLeaf($leafQueryBuilder, 'defaultPath');
    }

    /**
     * A default value to use for this argument when not explicitly set by the caller, if any.
     */
    public function defaultValue(): Json
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('defaultValue');
        return new \Dagger\Json((string)$this->queryLeaf($leafQueryBuilder, 'defaultValue'));
    }

    /**
     * A doc string for the argument, if any.
     */
    public function description(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('description');
        return (string)$this->queryLeaf($leafQueryBuilder, 'description');
    }

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

    /**
     * Only applies to arguments of type Directory. The ignore patterns are applied to the input directory, and matching entries are filtered out, in a cache-efficient manner.
     */
    public function ignore(): array
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('ignore');
        return (array)$this->queryLeaf($leafQueryBuilder, 'ignore');
    }

    /**
     * The name of the argument in lowerCamelCase format.
     */
    public function name(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('name');
        return (string)$this->queryLeaf($leafQueryBuilder, 'name');
    }

    /**
     * The location of this arg declaration.
     */
    public function sourceMap(): SourceMap
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('sourceMap');
        return new \Dagger\SourceMap($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * The type of the argument.
     */
    public function typeDef(): TypeDef
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('typeDef');
        return new \Dagger\TypeDef($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }
}
