def calculate_client(*, api_version: str) -> str:
    """
    Calculate the name of the client based on the api version.

    Args:
        api_version: The Kubernetes API version from a yaml template.

    Returns:
        The name of the kubernetes client module to use for the template.

    """
    group, _, version = api_version.partition("/")
    # Checking for core group
    if version == "":
        version = group
        group = "core"
    # Remove .k8s.io
    group = "".join(group.rsplit(".k8s.io", 1))
    # Capitalize based on dots in group
    group = "".join(word.capitalize() for word in group.split("."))
    return f"{group}{version.capitalize()}Api"