def METHOD_NAME(
    self,
    kind,
    branch_match_kind="glob",
    branch_pattern="*",
    branch_type=None,
    users=None,
    groups=None,
    value=None,
):
    """
    Add a new branch restriction.
    :param value:
    :param kind: string: One of require_tasks_to_be_completed, force, restrict_merges,
                         enforce_merge_checks, require_approvals_to_merge, delete,
                         require_all_dependencies_merged, push, require_passing_builds_to_merge,
                         reset_pullrequest_approvals_on_change, require_default_reviewer_approvals_to_merge
    :param branch_match_kind: string: branching_model or glob, if branching_model use
                                      param branch_type otherwise branch_pattern.
    :param branch_pattern: string: A glob specifying the branch this restriction should
                                   apply to (supports * as wildcard).
    :param branch_type: string: The branch type specifies the branches this restriction
                                should apply to. One of: feature, bugfix, release, hotfix, development, production.
    :param users: List: List of user objects that are excluded from the restriction.
                        Minimal: {"username": "<username>"}
    :param groups: List: List of group objects that are excluded from the restriction.
                         Minimal: {"owner": {"username": "<teamname>"}, "slug": "<groupslug>"}
    :return: The created BranchRestriction object
    API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/branch-restrictions#post
    """
    if branch_match_kind == "branching_model":
        branch_pattern = ""
    data = {
        "kind": kind,
        "branch_match_kind": branch_match_kind,
        "pattern": branch_pattern,
    }
    if branch_match_kind == "branching_model":
        data["branch_type"] = branch_type
    if users is not None:
        data["users"] = users
    if groups is not None:
        data["groups"] = groups
    if value is not None:
        data["value"] = value
    return self.__get_object(self.post(None, data=data))