<?php

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

declare(strict_types=1);

namespace Dagger;

/**
 * An active function call.
 */
class FunctionCall extends Client\AbstractObject implements Client\IdAble
{
    /**
     * A unique identifier for this FunctionCall.
     */
    public function id(): FunctionCallId
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('id');
        return new \Dagger\FunctionCallId((string)$this->queryLeaf($leafQueryBuilder, 'id'));
    }

    public function inputArgs(): array
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('inputArgs');
        return (array)$this->queryLeaf($leafQueryBuilder, 'inputArgs');
    }

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

    public function parent(): Json
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('parent');
        return new \Dagger\Json((string)$this->queryLeaf($leafQueryBuilder, 'parent'));
    }

    public function parentName(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('parentName');
        return (string)$this->queryLeaf($leafQueryBuilder, 'parentName');
    }

    /**
     * Set the return value of the function call to the provided value.
     */
    public function returnValue(Json $value): void
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('returnValue');
        $leafQueryBuilder->setArgument('value', $value);
        $this->queryLeaf($leafQueryBuilder, 'returnValue');
    }
}
