from typing import Dict


def create_branch(
    access_key: str,
    url: str,
    owner: str,
    dataset: str,
    *,
    name: str,
    revision: str,
) -> Dict[str, str]:
    """Execute the OpenAPI `POST /v2/datasets/{owner}/{dataset}/branches`.

    Arguments:
        access_key: User's access key.
        url: The URL of the graviti website.
        owner: The owner of the dataset.
        dataset: Name of the dataset, unique for a user.
        name: The name of the branch.
        revision: The information to locate the specific commit, which can be the commit id,
            the branch name, or the tag name.

    Returns:
        The response of OpenAPI.

    Examples:
        >>> create_branch(
        ...     "ACCESSKEY-********",
        ...     "https://api.graviti.com",
        ...     "czhual",
        ...     "MNIST",
        ...     name="branch-1",
        ...     revision="main"
        ... )
        {
            "name": "main",
            "commit_id": "fde63f357daf46088639e9f57fd81cad",
            "parent_commit_id": "f68b1375454f459b8a486b8d1f4d9ddb",
            "title": "first commit",
            "description": "desc",
            "committer": "graviti",
            "committed_at": "2021-03-03T18:58:10Z"
        }

    """
    url = f"{url}/v2/datasets/{owner}/{dataset}/branches"
    post_data = {"name": name, "revision": revision}
    return open_api_do(  # type: ignore[no-any-return]
        "POST", access_key, url, json=post_data
    ).json()