defmodule Tanuki.Projects.Branches do @doc """ GET /projects/:id/repository/branches Lists all branches of a project. """ def list(id, client), do: Tanuki.get("projects/#{id}/repository/branches", client) @doc """ GET /projects/:id/repository/branches/:branch Lists a specific branch of a project. """ def branch(id, branch_name, client), do: Tanuki.get("projects/#{id}/repository/branches/#{branch_name}", client) @doc """ PUT /projects/:id/repository/branches/:branch/protect Protects a single branch of a project. """ def protect(id, branch_name, client), do: Tanuki.put("projects/#{id}/repository/branches/#{branch_name}/protect", client) @doc """ PUT /projects/:id/repository/branches/:branch/unprotect Unprotects a single branch of a project. """ def unprotect(id, branch_name, client), do: Tanuki.put("projects/#{id}/repository/branches/#{branch_name}/unprotect", client) end