# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables

class GetBranchResult:
    """
    A collection of values returned by getBranch.
    """
    def __init__(__self__, branch=None, etag=None, id=None, ref=None, repository=None, sha=None):
        if branch and not isinstance(branch, str):
            raise TypeError("Expected argument 'branch' to be a str")
        __self__.branch = branch
        if etag and not isinstance(etag, str):
            raise TypeError("Expected argument 'etag' to be a str")
        __self__.etag = etag
        """
        An etag representing the Branch object.
        """
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        The provider-assigned unique ID for this managed resource.
        """
        if ref and not isinstance(ref, str):
            raise TypeError("Expected argument 'ref' to be a str")
        __self__.ref = ref
        """
        A string representing a branch reference, in the form of `refs/heads/<branch>`.
        """
        if repository and not isinstance(repository, str):
            raise TypeError("Expected argument 'repository' to be a str")
        __self__.repository = repository
        if sha and not isinstance(sha, str):
            raise TypeError("Expected argument 'sha' to be a str")
        __self__.sha = sha
        """
        A string storing the reference's `HEAD` commit's SHA1.
        """
class AwaitableGetBranchResult(GetBranchResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetBranchResult(
            branch=self.branch,
            etag=self.etag,
            id=self.id,
            ref=self.ref,
            repository=self.repository,
            sha=self.sha)

def get_branch(branch=None,repository=None,opts=None):
    """
    Use this data source to retrieve information about a repository branch.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_github as github

    development = github.get_branch(branch="development",
        repository="example")
    ```


    :param str branch: The repository branch to create.
    :param str repository: The GitHub repository name.
    """
    __args__ = dict()


    __args__['branch'] = branch
    __args__['repository'] = repository
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('github:index/getBranch:getBranch', __args__, opts=opts).value

    return AwaitableGetBranchResult(
        branch=__ret__.get('branch'),
        etag=__ret__.get('etag'),
        id=__ret__.get('id'),
        ref=__ret__.get('ref'),
        repository=__ret__.get('repository'),
        sha=__ret__.get('sha'))
