<?php

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

declare(strict_types=1);

namespace Dagger;

/**
 * A git repository.
 */
class GitRepository extends Client\AbstractObject implements Client\IdAble
{
    /**
     * Returns details of a branch.
     */
    public function branch(string $name): GitRef
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('branch');
        $innerQueryBuilder->setArgument('name', $name);
        return new \Dagger\GitRef($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

    /**
     * Returns details of a commit.
     */
    public function commit(string $id): GitRef
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('commit');
        $innerQueryBuilder->setArgument('id', $id);
        return new \Dagger\GitRef($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }

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

    /**
     * Returns details of a tag.
     */
    public function tag(string $name): GitRef
    {
        $innerQueryBuilder = new \Dagger\Client\QueryBuilder('tag');
        $innerQueryBuilder->setArgument('name', $name);
        return new \Dagger\GitRef($this->client, $this->queryBuilderChain->chain($innerQueryBuilder));
    }
}
