<?php

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

declare(strict_types=1);

namespace Dagger;

/**
 * A definition of a custom scalar defined in a Module.
 */
class ScalarTypeDef extends Client\AbstractObject implements Client\IdAble
{
    /**
     * A doc string for the scalar, if any.
     */
    public function description(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('description');
        return (string)$this->queryLeaf($leafQueryBuilder, 'description');
    }

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

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

    /**
     * If this ScalarTypeDef is associated with a Module, the name of the module. Unset otherwise.
     */
    public function sourceModuleName(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('sourceModuleName');
        return (string)$this->queryLeaf($leafQueryBuilder, 'sourceModuleName');
    }
}
