<?php

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

declare(strict_types=1);

namespace Dagger;

/**
 * A definition of a custom object defined in a Module.
 */
class ObjectTypeDef extends Client\AbstractObject implements Client\IdAble
{
    public function constructor(): Function_
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('constructor');
        return new \Dagger\Function_($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

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

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

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

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

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

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