Documentation
¶
Overview ¶
Package cloud does not implement AdminClient. Admin operations (secret rotation, logging config) are Bitbucket Server / Data Center features only. Calls to AsAdminClient against a Cloud backend return ErrUnsupportedOnHost.
Package cloud is the Bitbucket Cloud adapter for the backend.Client interface.
Package cloud does not implement GroupClient or GroupMemberClient. Bitbucket Cloud uses a different workspace-permissions model and does not expose admin/groups endpoints. Calls to AsGroupClient or AsGroupMemberClient against a Cloud backend return ErrUnsupportedOnHost.
Package cloud does not implement PATClient. Bitbucket Cloud API token management is not available via the REST API. Calls to AsPATClient against a Cloud backend return ErrUnsupportedOnHost.
Package cloud does not implement PermissionsClient. Bitbucket Cloud uses a different permissions model that is not yet supported by this CLI. Calls to AsPermissionsClient against a Cloud backend return ErrUnsupportedOnHost.
Package cloud does not implement ServerProjectClient. Bitbucket Cloud has no equivalent server project management API. Calls to AsServerProjectClient against a Cloud backend return ErrUnsupportedOnHost.
Package cloud does not implement RepoPRSettingsClient. Bitbucket Cloud does not expose per-repo PR gate settings (required approvers, merge strategies, etc.) via the same dedicated API endpoint that Server/DC provides. Calls to AsRepoPRSettingsClient against a Cloud backend return ErrUnsupportedOnHost.
Index ¶
- type Client
- func (c *Client) AddBranchRule(ns, slug string, input backend.BranchRuleInput) (backend.BranchRule, error)
- func (c *Client) AddCommitComment(ns, slug, hash string, in backend.AddCommitCommentInput) (backend.CommitComment, error)
- func (c *Client) AddDefaultReviewer(ns, slug, userSlug string) error
- func (c *Client) AddDeployKey(ns, slug string, input backend.DeployKeyInput) (backend.DeployKey, error)
- func (c *Client) AddIssueComment(ns, slug string, id int, body string) (backend.IssueComment, error)
- func (c *Client) AddPRComment(ns, slug string, id int, in backend.AddPRCommentInput) (backend.PRComment, error)
- func (c *Client) AddPipelineKnownHost(ns, slug string, in backend.PipelineKnownHostInput) (backend.PipelineKnownHost, error)
- func (c *Client) AddProjectDefaultReviewer(workspace, projectKey, accountID string) error
- func (c *Client) AddSSHKey(input backend.SSHKeyInput) (backend.SSHKey, error)
- func (c *Client) AddSnippetComment(workspace, snippetID, body string) (backend.SnippetComment, error)
- func (c *Client) ApprovePR(ns, slug string, id int) error
- func (c *Client) AssignIssue(ns, slug string, id int, assignee string) error
- func (c *Client) CompareRefs(ns, slug, base, head string, limit int) (backend.RefComparison, error)
- func (c *Client) CreateBranch(ns, slug string, in backend.CreateBranchInput) (backend.Branch, error)
- func (c *Client) CreateEnvironment(ns, slug string, in backend.CreateEnvironmentInput) (backend.Environment, error)
- func (c *Client) CreateIPAllowlist(workspace string, in backend.CreateIPAllowlistInput) (backend.IPAllowlist, error)
- func (c *Client) CreateIssue(ns, slug string, in backend.CreateIssueInput) (backend.Issue, error)
- func (c *Client) CreateIssueVersion(ns, slug, name string) (backend.IssueVersion, error)
- func (c *Client) CreatePR(ns, slug string, in backend.CreatePRInput) (backend.PullRequest, error)
- func (c *Client) CreatePipelineSchedule(ns, slug string, input backend.PipelineScheduleInput) (backend.PipelineSchedule, error)
- func (c *Client) CreateRepo(ns string, in backend.CreateRepoInput) (backend.Repository, error)
- func (c *Client) CreateRepoLabel(ns, slug string, in backend.CreateRepoLabelInput) (backend.RepoLabel, error)
- func (c *Client) CreateRunner(workspace string, in backend.CreateRunnerInput) (backend.Runner, error)
- func (c *Client) CreateSnippet(workspace string, in backend.CreateSnippetInput) (backend.Snippet, error)
- func (c *Client) CreateTag(ns, slug string, in backend.CreateTagInput) (backend.Tag, error)
- func (c *Client) CreateWebhook(ns, slug string, in backend.CreateWebhookInput) (backend.Webhook, error)
- func (c *Client) CreateWorkspaceProject(ws string, input backend.CreateWorkspaceProjectInput) (backend.WorkspaceProject, error)
- func (c *Client) CreateWorkspaceWebhook(workspace string, in backend.CreateWebhookInput) (backend.Webhook, error)
- func (c *Client) DeclinePR(ns, slug string, id int) error
- func (c *Client) DeleteBranch(ns, slug, branch string) error
- func (c *Client) DeleteBranchRule(ns, slug string, id int) error
- func (c *Client) DeleteCodeInsightsReport(workspace, slug, hash, key string) error
- func (c *Client) DeleteCommitComment(ns, slug, hash string, commentID int) error
- func (c *Client) DeleteDeployKey(ns, slug string, id int) error
- func (c *Client) DeleteEnvVariable(ns, slug, envUUID, varUUID string) error
- func (c *Client) DeleteEnvironment(ns, slug, uuid string) error
- func (c *Client) DeleteIPAllowlist(workspace, entryUUID string) error
- func (c *Client) DeleteIssueAttachment(ns, slug string, id int, filename string) error
- func (c *Client) DeleteIssueComment(ns, slug string, id, commentID int) error
- func (c *Client) DeleteIssueVersion(ns, slug string, id int) error
- func (c *Client) DeletePRComment(ns, slug string, id, commentID int) error
- func (c *Client) DeletePipelineCache(ns, slug, uuid string) error
- func (c *Client) DeletePipelineKnownHost(ns, slug, uuid string) error
- func (c *Client) DeletePipelineSchedule(ns, slug, uuid string) error
- func (c *Client) DeletePipelineVariable(ns, slug, key string) error
- func (c *Client) DeleteRepo(ns, slug string) error
- func (c *Client) DeleteRepoDownload(ns, slug, name string) error
- func (c *Client) DeleteRepoLabel(ns, slug string, id int) error
- func (c *Client) DeleteRunner(workspace, runnerUUID string) error
- func (c *Client) DeleteSSHKey(id int) error
- func (c *Client) DeleteSnippet(workspace, id string) error
- func (c *Client) DeleteSnippetComment(workspace, snippetID string, commentID int) error
- func (c *Client) DeleteTag(ns, slug, name string) error
- func (c *Client) DeleteWebhook(ns, slug, id string) error
- func (c *Client) DeleteWorkspacePipelineVariable(workspace, uuid string) error
- func (c *Client) DeleteWorkspaceProject(ws, key string) error
- func (c *Client) DeleteWorkspaceVariable(ns, key string) error
- func (c *Client) DeleteWorkspaceWebhook(workspace, uuid string) error
- func (c *Client) DisableAutoMerge(ns, slug string, id int) error
- func (c *Client) DownloadPipelineArtifact(ws, slug, pipelineUUID, stepUUID, name string, out io.Writer) error
- func (c *Client) DownloadRepoDownload(ns, slug, name string, out io.Writer) error
- func (c *Client) DryRunMergePR(ns, slug string, prID int, strategy string) (backend.MergeDryRunResult, error)
- func (c *Client) EditCommitComment(ns, slug, hash string, commentID int, body string) (backend.CommitComment, error)
- func (c *Client) EditIssueComment(ns, slug string, id, commentID int, body string) (backend.IssueComment, error)
- func (c *Client) EditPRComment(ns, slug string, id, commentID int, body string) (backend.PRComment, error)
- func (c *Client) EditRepo(ns, slug string, in backend.EditRepoInput) (backend.Repository, error)
- func (c *Client) EnableAutoMerge(ns, slug string, id int, strategy string) error
- func (c *Client) ForkRepo(ns, slug string, in backend.ForkRepoInput) (backend.Repository, error)
- func (c *Client) GetBranchModel(ws, slug string) (backend.BranchModel, error)
- func (c *Client) GetBranchModelSettings(ws, slug string) (backend.BranchModelSettings, error)
- func (c *Client) GetCodeInsightsReport(workspace, slug, hash, key string) (backend.CodeInsightsReport, error)
- func (c *Client) GetCommit(ns, slug, hash string) (backend.Commit, error)
- func (c *Client) GetCurrentUser() (backend.User, error)
- func (c *Client) GetDeployment(ns, slug, uuid string) (backend.Deployment, error)
- func (c *Client) GetDiff(ns, slug, from, to string) (string, error)
- func (c *Client) GetDiffStat(ns, slug, from, to string) (backend.DiffStat, error)
- func (c *Client) GetFileContent(ns, slug, ref, pathInRepo string) ([]byte, error)
- func (c *Client) GetHostInfo() (backend.HostInfo, error)
- func (c *Client) GetIssue(ns, slug string, id int) (backend.Issue, error)
- func (c *Client) GetIssueVersion(ns, slug string, id int) (backend.IssueVersion, error)
- func (c *Client) GetMilestone(ns, slug string, id int) (backend.Milestone, error)
- func (c *Client) GetPR(ns, slug string, id int) (backend.PullRequest, error)
- func (c *Client) GetPRActivity(ns, slug string, id int, limit int) ([]backend.PRActivityEvent, error)
- func (c *Client) GetPRDiff(ns, slug string, id int) (string, error)
- func (c *Client) GetPipeline(ns, slug, uuid string) (backend.Pipeline, error)
- func (c *Client) GetPipelineKnownHost(ns, slug, uuid string) (backend.PipelineKnownHost, error)
- func (c *Client) GetPipelineOIDCConfig(workspace string) (backend.PipelineOIDCConfig, error)
- func (c *Client) GetPipelineOIDCKeys(workspace string) (backend.PipelineOIDCKeys, error)
- func (c *Client) GetPipelineSSHKeyPair(ns, slug string) (backend.PipelineSSHKeyPair, error)
- func (c *Client) GetPipelineStepLog(ns, slug, pipelineUUID, stepUUID string) (io.ReadCloser, error)
- func (c *Client) GetPipelineTestReport(ws, slug, pipelineUUID, stepUUID string) (backend.PipelineTestReport, error)
- func (c *Client) GetPipelineVariable(ns, slug, key string) (backend.PipelineVariable, error)
- func (c *Client) GetPipelinesConfig(ws, slug string) (backend.PipelineConfig, error)
- func (c *Client) GetRepo(ns, slug string) (backend.Repository, error)
- func (c *Client) GetSnippet(workspace, id string) (backend.Snippet, error)
- func (c *Client) GetWebhook(ns, slug, id string) (backend.Webhook, error)
- func (c *Client) GetWorkspacePipelineVariable(workspace, uuid string) (backend.PipelineVariable, error)
- func (c *Client) GetWorkspaceProject(ws, key string) (backend.WorkspaceProject, error)
- func (c *Client) GrantWorkspacePerm(ws, user, permission string) error
- func (c *Client) GrantWorkspaceProjectPerm(workspace, projectKey string, in backend.WorkspaceProjectPermInput) error
- func (c *Client) ListAuditLog(workspace string, opts backend.AuditLogOpts) ([]backend.AuditEvent, error)
- func (c *Client) ListBranchRules(ns, slug string) ([]backend.BranchRule, error)
- func (c *Client) ListBranches(ns, slug string, limit int) ([]backend.Branch, error)
- func (c *Client) ListCodeInsightsAnnotations(workspace, slug, hash, key string) ([]backend.CodeInsightsAnnotation, error)
- func (c *Client) ListCodeInsightsReports(workspace, slug, hash string) ([]backend.CodeInsightsReport, error)
- func (c *Client) ListCommitComments(ns, slug, hash string, limit int) ([]backend.CommitComment, error)
- func (c *Client) ListCommitFiles(ns, slug, hash string) ([]backend.DiffStatEntry, error)
- func (c *Client) ListCommitStatuses(ns, slug, hash string) ([]backend.CommitStatus, error)
- func (c *Client) ListCommits(ns, slug, branch string, limit int) ([]backend.Commit, error)
- func (c *Client) ListDefaultReviewers(ns, slug string) ([]backend.DefaultReviewer, error)
- func (c *Client) ListDeployKeys(ns, slug string) ([]backend.DeployKey, error)
- func (c *Client) ListDeployments(ns, slug string, limit int) ([]backend.Deployment, error)
- func (c *Client) ListEnvVariables(ns, slug, envUUID string) ([]backend.EnvVariable, error)
- func (c *Client) ListEnvironments(ns, slug string) ([]backend.Environment, error)
- func (c *Client) ListIPAllowlists(workspace string) ([]backend.IPAllowlist, error)
- func (c *Client) ListIssueActivity(ns, slug string, issueID int, limit int) ([]backend.IssueChange, error)
- func (c *Client) ListIssueAttachments(ns, slug string, id int) ([]backend.IssueAttachment, error)
- func (c *Client) ListIssueComments(ns, slug string, id int) ([]backend.IssueComment, error)
- func (c *Client) ListIssueVersions(ns, slug string, limit int) ([]backend.IssueVersion, error)
- func (c *Client) ListIssues(ns, slug, state string, limit int) ([]backend.Issue, error)
- func (c *Client) ListMilestones(ns, slug string, limit int) ([]backend.Milestone, error)
- func (c *Client) ListMyPRs(ns, slug string) ([]backend.MyPREntry, error)
- func (c *Client) ListPRComments(ns, slug string, id int) ([]backend.PRComment, error)
- func (c *Client) ListPRCommits(ns, slug string, prID int) ([]backend.Commit, error)
- func (c *Client) ListPRFiles(ns, slug string, prID int) ([]backend.DiffStatEntry, error)
- func (c *Client) ListPRParticipants(ns, slug string, prID int) ([]backend.PRParticipant, error)
- func (c *Client) ListPRs(ns, slug, state string, limit int) ([]backend.PullRequest, error)
- func (c *Client) ListPipelineArtifacts(ws, slug, pipelineUUID, stepUUID string, limit int) ([]backend.PipelineArtifact, error)
- func (c *Client) ListPipelineCaches(ns, slug string) ([]backend.PipelineCache, error)
- func (c *Client) ListPipelineKnownHosts(ns, slug string) ([]backend.PipelineKnownHost, error)
- func (c *Client) ListPipelineSchedules(ns, slug string) ([]backend.PipelineSchedule, error)
- func (c *Client) ListPipelineSteps(ns, slug, uuid string) ([]backend.PipelineStep, error)
- func (c *Client) ListPipelineTestCases(ws, slug, pipelineUUID, stepUUID string, filter backend.TestCaseFilter) ([]backend.PipelineTestCase, error)
- func (c *Client) ListPipelineVariables(ns, slug string) ([]backend.PipelineVariable, error)
- func (c *Client) ListPipelines(ns, slug string, limit int) ([]backend.Pipeline, error)
- func (c *Client) ListProjectDefaultReviewers(workspace, projectKey string, limit int) ([]backend.ProjectDefaultReviewer, error)
- func (c *Client) ListProjects(workspace string, limit int) ([]backend.Project, error)
- func (c *Client) ListRepoDownloads(ns, slug string, limit int) ([]backend.RepoDownload, error)
- func (c *Client) ListRepoForks(ns, slug string, limit int) ([]backend.Repository, error)
- func (c *Client) ListRepoLabels(ns, slug string) ([]backend.RepoLabel, error)
- func (c *Client) ListRepoWatchers(ns, slug string) ([]backend.User, error)
- func (c *Client) ListRepos(ns string, limit int) ([]backend.Repository, error)
- func (c *Client) ListRunners(workspace string) ([]backend.Runner, error)
- func (c *Client) ListSSHKeys() ([]backend.SSHKey, error)
- func (c *Client) ListSnippetComments(workspace, snippetID string, limit int) ([]backend.SnippetComment, error)
- func (c *Client) ListSnippets(workspace string, limit int) ([]backend.Snippet, error)
- func (c *Client) ListTags(ns, slug string, limit int) ([]backend.Tag, error)
- func (c *Client) ListTree(ns, slug, ref, pathInRepo string) ([]backend.TreeEntry, error)
- func (c *Client) ListWebhooks(ns, slug string) ([]backend.Webhook, error)
- func (c *Client) ListWorkspaceMemberPerms(ws string, limit int) ([]backend.WorkspaceMemberPerm, error)
- func (c *Client) ListWorkspaceMembers(workspace string, limit int) ([]backend.WorkspaceMember, error)
- func (c *Client) ListWorkspacePipelineVariables(workspace string) ([]backend.PipelineVariable, error)
- func (c *Client) ListWorkspaceProjectPerms(workspace, projectKey string, limit int) ([]backend.WorkspaceProjectPerm, error)
- func (c *Client) ListWorkspaceRepoPerms(ws string, limit int) ([]backend.WorkspaceRepoPerm, error)
- func (c *Client) ListWorkspaceVariables(ns string) ([]backend.PipelineVariable, error)
- func (c *Client) ListWorkspaceWebhooks(workspace string) ([]backend.Webhook, error)
- func (c *Client) ListWorkspaces(limit int) ([]backend.Workspace, error)
- func (c *Client) MergePR(ns, slug string, id int, in backend.MergePRInput) (backend.PullRequest, error)
- func (c *Client) PutCodeInsightsAnnotations(workspace, slug, hash, key string, in []backend.CodeInsightsAnnotationInput) error
- func (c *Client) PutCodeInsightsReport(workspace, slug, hash, key string, in backend.CodeInsightsReportInput) (backend.CodeInsightsReport, error)
- func (c *Client) PutFile(ns, slug, path string, in backend.PutFileInput) error
- func (c *Client) ReadyPR(ns, slug string, id int) error
- func (c *Client) RegeneratePipelineSSHKeyPair(ns, slug string, bits int) (backend.PipelineSSHKeyPair, error)
- func (c *Client) RemoveDefaultReviewer(ns, slug, userSlug string) error
- func (c *Client) RemoveProjectDefaultReviewer(workspace, projectKey, accountID string) error
- func (c *Client) RemoveReviewers(ns, slug string, id int, users []string) error
- func (c *Client) RenameRepo(ns, slug, newName string) (backend.Repository, error)
- func (c *Client) ReopenIssue(ns, slug string, id int) error
- func (c *Client) ReportCommitStatus(ns, slug, hash string, input backend.CommitStatusInput) (backend.CommitStatus, error)
- func (c *Client) RequestChangesPR(ns, slug string, id int) error
- func (c *Client) RequestReview(ns, slug string, id int, users []string) error
- func (c *Client) RerunPipeline(ns, slug, sourceUUID string) (backend.Pipeline, error)
- func (c *Client) ResolvePRComment(ns, slug string, id, commentID int) error
- func (c *Client) RevokeWorkspacePerm(ws, user string) error
- func (c *Client) RevokeWorkspaceProjectPerm(workspace, projectKey, subjectSlug string, isGroup bool) error
- func (c *Client) RunPipeline(ns, slug string, in backend.RunPipelineInput) (backend.Pipeline, error)
- func (c *Client) SearchCode(workspace, query string, limit int) ([]backend.CodeSearchHit, error)
- func (c *Client) SearchCommits(ns, slug string, opts backend.CommitSearchOpts) ([]backend.Commit, error)
- func (c *Client) SearchWorkspaces(opts backend.WorkspaceSearchOpts) ([]backend.Workspace, error)
- func (c *Client) SetEnvVariable(ns, slug, envUUID string, in backend.EnvVariableInput) (backend.EnvVariable, error)
- func (c *Client) SetPipelineVariable(ns, slug string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
- func (c *Client) SetRepoDefaultBranch(ns, slug, branch string) error
- func (c *Client) SetRepoVisibility(ns, slug string, isPrivate bool) error
- func (c *Client) SetWorkspacePipelineVariable(workspace string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
- func (c *Client) SetWorkspaceVariable(ns string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
- func (c *Client) StopPipeline(ws, slug, uuid string) error
- func (c *Client) SubmitReview(ns, slug string, id int, in backend.SubmitReviewInput) error
- func (c *Client) SyncRepo(ns, slug, branch string) (backend.SyncResult, error)
- func (c *Client) TransferRepo(ns, slug, target string) (backend.Repository, error)
- func (c *Client) TriggerPipeline(ns, slug string, input backend.PipelineTriggerInput) (backend.PipelineTriggerResult, error)
- func (c *Client) UnapprovePR(ns, slug string, id int) error
- func (c *Client) UnreadyPR(ns, slug string, id int) error
- func (c *Client) UnvoteIssue(ns, slug string, id int) error
- func (c *Client) UnwatchIssue(ns, slug string, id int) error
- func (c *Client) UpdateBranchModelSettings(ws, slug string, in backend.BranchModelSettingsInput) (backend.BranchModelSettings, error)
- func (c *Client) UpdateBranchRule(ns, slug string, id int, in backend.UpdateBranchRuleInput) (backend.BranchRule, error)
- func (c *Client) UpdateIssue(ns, slug string, id int, in backend.UpdateIssueInput) (backend.Issue, error)
- func (c *Client) UpdatePR(ns, slug string, id int, in backend.UpdatePRInput) (backend.PullRequest, error)
- func (c *Client) UpdatePRBranch(ns, slug string, prID int) error
- func (c *Client) UpdatePRParticipant(ns, slug string, prID int, accountID, state string) (backend.PRParticipant, error)
- func (c *Client) UpdatePipelinesConfig(ws, slug string, input backend.PipelineConfig) (backend.PipelineConfig, error)
- func (c *Client) UpdateRepoLabel(ns, slug string, id int, in backend.UpdateRepoLabelInput) (backend.RepoLabel, error)
- func (c *Client) UpdateWorkspaceProject(ws, key string, input backend.UpdateWorkspaceProjectInput) (backend.WorkspaceProject, error)
- func (c *Client) UploadRepoDownload(ns, slug, name string, body io.Reader) (backend.RepoDownload, error)
- func (c *Client) VoteIssue(ns, slug string, id int) error
- func (c *Client) WatchIssue(ns, slug string, id int) error
- type HTTPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Bitbucket Cloud HTTP client.
func NewClient ¶
func NewClient(httpClient HTTPClient, baseURL, token, username string) *Client
NewClient constructs a Cloud Client. If token is non-empty Bearer auth is used; else if username is non-empty Basic auth is used with username:token as credentials.
func (*Client) AddBranchRule ¶ added in v1.53.0
func (c *Client) AddBranchRule(ns, slug string, input backend.BranchRuleInput) (backend.BranchRule, error)
AddBranchRule adds a branch restriction rule to a repository. POST /repositories/{workspace}/{slug}/branch-restrictions
func (*Client) AddCommitComment ¶ added in v1.27.0
func (c *Client) AddCommitComment(ns, slug, hash string, in backend.AddCommitCommentInput) (backend.CommitComment, error)
AddCommitComment posts a new comment on a commit.
func (*Client) AddDefaultReviewer ¶ added in v1.50.0
AddDefaultReviewer adds a default reviewer to a repository. PUT /repositories/{workspace}/{slug}/default-reviewers/{account_id_or_nickname} For Cloud, userSlug should be the account_id or nickname.
func (*Client) AddDeployKey ¶ added in v1.47.0
func (c *Client) AddDeployKey(ns, slug string, input backend.DeployKeyInput) (backend.DeployKey, error)
AddDeployKey adds a deploy key to a repository. POST /repositories/{workspace}/{slug}/deploy-keys
func (*Client) AddIssueComment ¶ added in v1.23.0
func (*Client) AddPRComment ¶ added in v1.6.0
func (*Client) AddPipelineKnownHost ¶ added in v1.114.0
func (c *Client) AddPipelineKnownHost(ns, slug string, in backend.PipelineKnownHostInput) (backend.PipelineKnownHost, error)
AddPipelineKnownHost adds a known host to a repository's pipelines config. POST /2.0/repositories/{ws}/{slug}/pipelines_config/ssh/known_hosts
func (*Client) AddProjectDefaultReviewer ¶ added in v1.122.0
AddProjectDefaultReviewer adds a default reviewer to a Cloud workspace project.
PUT /workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
func (*Client) AddSSHKey ¶ added in v1.51.0
AddSSHKey adds an SSH key for the current user. POST /users/{username}/ssh-keys
func (*Client) AddSnippetComment ¶ added in v1.123.0
func (c *Client) AddSnippetComment(workspace, snippetID, body string) (backend.SnippetComment, error)
AddSnippetComment posts a new comment on a snippet. POST /2.0/snippets/{workspace}/{snippet_id}/comments
func (*Client) ApprovePR ¶
ApprovePR approves a PR on behalf of the authenticated user. A nil body is intentional: Bitbucket Cloud returns HTTP 400 when Content-Type: application/json is sent with an empty body on this endpoint. The ContentTypeWhenBody policy on the Cloud transport ensures no Content-Type is set for nil-body POSTs.
func (*Client) AssignIssue ¶ added in v1.23.0
AssignIssue sets the assignee on an issue by username.
func (*Client) CompareRefs ¶ added in v1.110.0
CompareRefs returns commits ahead and behind for head relative to base. Cloud API: GET /2.0/repositories/{ws}/{slug}/commits/{ref}?exclude={other}
func (*Client) CreateBranch ¶
func (c *Client) CreateBranch(ns, slug string, in backend.CreateBranchInput) (backend.Branch, error)
CreateBranch creates a new branch in the given repository. Cloud requires a commit hash as the target; if StartAt is a branch name (not a 40-char hex string) it is resolved to its HEAD commit hash first.
func (*Client) CreateEnvironment ¶ added in v1.29.0
func (c *Client) CreateEnvironment(ns, slug string, in backend.CreateEnvironmentInput) (backend.Environment, error)
CreateEnvironment creates a new deployment environment.
func (*Client) CreateIPAllowlist ¶ added in v1.106.0
func (c *Client) CreateIPAllowlist(workspace string, in backend.CreateIPAllowlistInput) (backend.IPAllowlist, error)
CreateIPAllowlist adds a new IP allowlist entry to a workspace.
func (*Client) CreateIssue ¶ added in v1.17.0
func (*Client) CreateIssueVersion ¶ added in v1.112.0
func (c *Client) CreateIssueVersion(ns, slug, name string) (backend.IssueVersion, error)
CreateIssueVersion creates a new issue version on a repository.
func (*Client) CreatePR ¶
func (c *Client) CreatePR(ns, slug string, in backend.CreatePRInput) (backend.PullRequest, error)
func (*Client) CreatePipelineSchedule ¶ added in v1.54.0
func (c *Client) CreatePipelineSchedule(ns, slug string, input backend.PipelineScheduleInput) (backend.PipelineSchedule, error)
CreatePipelineSchedule creates a new pipeline schedule.
func (*Client) CreateRepo ¶
func (c *Client) CreateRepo(ns string, in backend.CreateRepoInput) (backend.Repository, error)
func (*Client) CreateRepoLabel ¶ added in v1.100.0
func (c *Client) CreateRepoLabel(ns, slug string, in backend.CreateRepoLabelInput) (backend.RepoLabel, error)
CreateRepoLabel creates a new label on a Cloud repository.
func (*Client) CreateRunner ¶ added in v1.104.0
func (c *Client) CreateRunner(workspace string, in backend.CreateRunnerInput) (backend.Runner, error)
CreateRunner registers a new self-hosted runner in a workspace.
func (*Client) CreateSnippet ¶ added in v1.91.0
func (c *Client) CreateSnippet(workspace string, in backend.CreateSnippetInput) (backend.Snippet, error)
CreateSnippet creates a new snippet in the given workspace. POST /2.0/snippets/{workspace}
func (*Client) CreateWebhook ¶ added in v1.15.0
func (c *Client) CreateWebhook(ns, slug string, in backend.CreateWebhookInput) (backend.Webhook, error)
CloudCreateWebhook is the request body for POST /hooks. Cloud requires a non-empty description, so we set "bitbottle" when the caller doesn't supply one. Secret is write-only and omitted when empty.
func (*Client) CreateWorkspaceProject ¶ added in v1.112.0
func (c *Client) CreateWorkspaceProject(ws string, input backend.CreateWorkspaceProjectInput) (backend.WorkspaceProject, error)
CreateWorkspaceProject creates a new project in a workspace.
func (*Client) CreateWorkspaceWebhook ¶ added in v1.66.0
func (*Client) DeclinePR ¶
DeclinePR declines an open pull request. A nil body is intentional: ContentTypeWhenBody ensures no Content-Type is set, which is required for this endpoint on Bitbucket Cloud.
func (*Client) DeleteBranch ¶
func (*Client) DeleteBranchRule ¶ added in v1.53.0
DeleteBranchRule removes a branch restriction rule from a repository. DELETE /repositories/{workspace}/{slug}/branch-restrictions/{id}
func (*Client) DeleteCodeInsightsReport ¶ added in v1.130.0
DeleteCodeInsightsReport removes a Code Insights report and all its annotations.
func (*Client) DeleteCommitComment ¶ added in v1.27.0
DeleteCommitComment removes a commit comment. Cloud returns 204 on success.
func (*Client) DeleteDeployKey ¶ added in v1.47.0
DeleteDeployKey removes a deploy key from a repository. DELETE /repositories/{workspace}/{slug}/deploy-keys/{id}
func (*Client) DeleteEnvVariable ¶ added in v1.29.0
DeleteEnvVariable deletes an environment variable by its UUID.
func (*Client) DeleteEnvironment ¶ added in v1.29.0
DeleteEnvironment deletes a deployment environment by UUID.
func (*Client) DeleteIPAllowlist ¶ added in v1.106.0
DeleteIPAllowlist removes an IP allowlist entry from a workspace.
func (*Client) DeleteIssueAttachment ¶ added in v1.100.0
DeleteIssueAttachment removes a named attachment from a Cloud issue.
func (*Client) DeleteIssueComment ¶ added in v1.23.0
func (*Client) DeleteIssueVersion ¶ added in v1.112.0
DeleteIssueVersion deletes an issue version by ID.
func (*Client) DeletePRComment ¶ added in v1.24.0
DeletePRComment removes a comment from a pull request. Cloud returns 204 No Content on success and 404 when the comment is unknown or already gone.
func (*Client) DeletePipelineCache ¶ added in v1.67.0
DeletePipelineCache deletes a pipeline cache by UUID.
func (*Client) DeletePipelineKnownHost ¶ added in v1.114.0
DeletePipelineKnownHost removes a known host by UUID. DELETE /2.0/repositories/{ws}/{slug}/pipelines_config/ssh/known_hosts/{uuid}
func (*Client) DeletePipelineSchedule ¶ added in v1.54.0
DeletePipelineSchedule deletes a pipeline schedule by UUID.
func (*Client) DeletePipelineVariable ¶ added in v1.15.0
DeletePipelineVariable looks up the variable by Key and DELETEs it. Returns a typed ErrNotFound DomainError when no variable matches the key.
func (*Client) DeleteRepo ¶
func (*Client) DeleteRepoDownload ¶ added in v1.111.0
DeleteRepoDownload removes a download artifact from a repository.
func (*Client) DeleteRepoLabel ¶ added in v1.100.0
DeleteRepoLabel removes a label from a Cloud repository.
func (*Client) DeleteRunner ¶ added in v1.104.0
DeleteRunner removes a pipeline self-hosted runner from a workspace.
func (*Client) DeleteSSHKey ¶ added in v1.51.0
DeleteSSHKey removes an SSH key for the current user. DELETE /users/{username}/ssh-keys/{id}
func (*Client) DeleteSnippet ¶ added in v1.91.0
DeleteSnippet removes a snippet. DELETE /2.0/snippets/{workspace}/{encoded_id} → 204
func (*Client) DeleteSnippetComment ¶ added in v1.123.0
DeleteSnippetComment removes a comment from a snippet. DELETE /2.0/snippets/{workspace}/{snippet_id}/comments/{comment_id}
func (*Client) DeleteWebhook ¶ added in v1.15.0
func (*Client) DeleteWorkspacePipelineVariable ¶ added in v1.115.0
DeleteWorkspacePipelineVariable deletes a workspace pipeline variable by UUID. Returns a typed ErrNotFound DomainError when the UUID is not found.
func (*Client) DeleteWorkspaceProject ¶ added in v1.112.0
DeleteWorkspaceProject deletes a workspace project by key.
func (*Client) DeleteWorkspaceVariable ¶ added in v1.31.0
DeleteWorkspaceVariable looks up a variable by Key and DELETEs it. Returns a typed ErrNotFound DomainError when no variable matches the key.
func (*Client) DeleteWorkspaceWebhook ¶ added in v1.66.0
func (*Client) DisableAutoMerge ¶ added in v1.30.0
DisableAutoMerge cancels a queued auto-merge on Bitbucket Cloud.
func (*Client) DownloadPipelineArtifact ¶ added in v1.93.0
func (c *Client) DownloadPipelineArtifact(ws, slug, pipelineUUID, stepUUID, name string, out io.Writer) error
DownloadPipelineArtifact streams a named artifact from a pipeline step to out.
func (*Client) DownloadRepoDownload ¶ added in v1.111.0
DownloadRepoDownload streams a download artifact to out.
func (*Client) DryRunMergePR ¶ added in v1.124.0
func (c *Client) DryRunMergePR(ns, slug string, prID int, strategy string) (backend.MergeDryRunResult, error)
DryRunMergePR performs a dry-run merge check on a Cloud pull request.
Cloud endpoint: POST /repositories/{workspace}/{slug}/pullrequests/{id}/merge?dry_run=true Body: {"merge_strategy": "<strategy>"} — strategy is omitted when empty. Response 200: {"can_merge_without_conflicts": true, "message": "..."} Response 409: same shape but can_merge_without_conflicts = false.
A 409 is NOT an error — it means the PR has conflicts. The response is decoded into MergeDryRunResult{CanMerge: false} and returned without error.
func (*Client) EditCommitComment ¶ added in v1.27.0
func (c *Client) EditCommitComment(ns, slug, hash string, commentID int, body string) (backend.CommitComment, error)
EditCommitComment updates the body of an existing commit comment via PUT.
func (*Client) EditIssueComment ¶ added in v1.23.0
func (*Client) EditPRComment ¶ added in v1.24.0
func (c *Client) EditPRComment(ns, slug string, id, commentID int, body string) (backend.PRComment, error)
EditPRComment updates the body of an existing comment on a pull request. Cloud accepts the same `{ "content": { "raw": ... } }` shape on PUT as on the original POST, returning the refreshed comment.
func (*Client) EditRepo ¶ added in v1.89.0
func (c *Client) EditRepo(ns, slug string, in backend.EditRepoInput) (backend.Repository, error)
EditRepo updates mutable metadata fields on a Bitbucket Cloud repository. Nil pointer fields in in are left unchanged.
func (*Client) EnableAutoMerge ¶ added in v1.30.0
EnableAutoMerge queues a PR for automatic merge on Bitbucket Cloud. The auto-merge endpoint is currently in beta; workspaces must have opted in. A 404 response whose message mentions "auto-merge" or "auto_merge" surfaces as a dedicated error rather than a generic pr.not_found.
func (*Client) ForkRepo ¶ added in v1.16.0
func (c *Client) ForkRepo(ns, slug string, in backend.ForkRepoInput) (backend.Repository, error)
func (*Client) GetBranchModel ¶ added in v1.92.0
func (c *Client) GetBranchModel(ws, slug string) (backend.BranchModel, error)
GetBranchModel returns the effective branching model for a repository. GET /repositories/{workspace}/{slug}/branching-model
func (*Client) GetBranchModelSettings ¶ added in v1.92.0
func (c *Client) GetBranchModelSettings(ws, slug string) (backend.BranchModelSettings, error)
GetBranchModelSettings returns the editable branching model settings. GET /repositories/{workspace}/{slug}/branching-model/settings
func (*Client) GetCodeInsightsReport ¶ added in v1.130.0
func (c *Client) GetCodeInsightsReport(workspace, slug, hash, key string) (backend.CodeInsightsReport, error)
GetCodeInsightsReport fetches a single Code Insights report by key.
func (*Client) GetDeployment ¶ added in v1.29.0
func (c *Client) GetDeployment(ns, slug, uuid string) (backend.Deployment, error)
GetDeployment fetches a single deployment by UUID.
func (*Client) GetDiff ¶ added in v1.49.0
GetDiff returns the unified diff between two refs for a repository. Cloud endpoint: GET /repositories/{ws}/{slug}/diff/{from}..{to}
func (*Client) GetDiffStat ¶ added in v1.49.0
GetDiffStat returns the diff summary between two refs for a repository. Cloud endpoint: GET /repositories/{ws}/{slug}/diffstat/{from}..{to} (paginated)
func (*Client) GetFileContent ¶ added in v1.22.0
GetFileContent returns the raw bytes of a file at ref. Cloud's /src endpoint serves the file content directly with the file's native Content-Type for files, or a JSON directory listing when the path is a directory. The directory case is rejected with ErrNotFound so callers see a consistent "use ListTree" hint regardless of backend.
func (*Client) GetHostInfo ¶ added in v1.126.0
GetHostInfo returns static metadata about the Bitbucket Cloud backend. No HTTP request is made: the backend type is fixed, the feature list is derived from AllFeatureSpecs at compile time, and the version is omitted (Cloud is always "rolling").
func (*Client) GetIssueVersion ¶ added in v1.112.0
GetIssueVersion returns a single issue version by ID.
func (*Client) GetMilestone ¶ added in v1.111.0
GetMilestone returns a single milestone by ID.
func (*Client) GetPRActivity ¶ added in v1.26.0
func (*Client) GetPipeline ¶
GetPipeline fetches a single pipeline run by UUID. Bitbucket Cloud requires pipeline UUIDs to be enclosed in curly braces in the URL path (e.g. "{abc-123}"), so we normalise the caller-supplied uuid.
func (*Client) GetPipelineKnownHost ¶ added in v1.114.0
func (c *Client) GetPipelineKnownHost(ns, slug, uuid string) (backend.PipelineKnownHost, error)
GetPipelineKnownHost returns a single known host by UUID. GET /2.0/repositories/{ws}/{slug}/pipelines_config/ssh/known_hosts/{uuid}
func (*Client) GetPipelineOIDCConfig ¶ added in v1.125.0
func (c *Client) GetPipelineOIDCConfig(workspace string) (backend.PipelineOIDCConfig, error)
GetPipelineOIDCConfig returns the OIDC discovery document for a workspace. GET /2.0/workspaces/{workspace}/pipelines-config/identity/oidc/.well-known/openid-configuration
func (*Client) GetPipelineOIDCKeys ¶ added in v1.125.0
func (c *Client) GetPipelineOIDCKeys(workspace string) (backend.PipelineOIDCKeys, error)
GetPipelineOIDCKeys returns the JWKS key-set for a workspace. GET /2.0/workspaces/{workspace}/pipelines-config/identity/oidc/keys.json
func (*Client) GetPipelineSSHKeyPair ¶ added in v1.114.0
func (c *Client) GetPipelineSSHKeyPair(ns, slug string) (backend.PipelineSSHKeyPair, error)
GetPipelineSSHKeyPair returns the SSH key pair for a repository's pipelines. GET /2.0/repositories/{ws}/{slug}/pipelines_config/ssh/key_pair
func (*Client) GetPipelineStepLog ¶ added in v1.15.0
func (c *Client) GetPipelineStepLog(ns, slug, pipelineUUID, stepUUID string) (io.ReadCloser, error)
GetPipelineStepLog returns a streaming reader for the plaintext log of a single pipeline step. The caller is responsible for calling Close on the returned reader.
func (*Client) GetPipelineTestReport ¶ added in v1.110.0
func (c *Client) GetPipelineTestReport(ws, slug, pipelineUUID, stepUUID string) (backend.PipelineTestReport, error)
GetPipelineTestReport returns the test report summary for a pipeline step. GET /2.0/repositories/{ws}/{slug}/pipelines/{uuid}/steps/{step_uuid}/test_reports
func (*Client) GetPipelineVariable ¶ added in v1.132.0
func (c *Client) GetPipelineVariable(ns, slug, key string) (backend.PipelineVariable, error)
GetPipelineVariable returns the variable matching key, or a typed ErrNotFound DomainError when no variable with that key exists in the repository.
func (*Client) GetPipelinesConfig ¶ added in v1.109.0
func (c *Client) GetPipelinesConfig(ws, slug string) (backend.PipelineConfig, error)
GetPipelinesConfig returns the pipeline configuration for a repository. GET /2.0/repositories/{workspace}/{repo_slug}/pipelines_config
func (*Client) GetSnippet ¶ added in v1.91.0
GetSnippet fetches a single snippet by ID. GET /2.0/snippets/{workspace}/{encoded_id}
func (*Client) GetWebhook ¶ added in v1.15.0
func (*Client) GetWorkspacePipelineVariable ¶ added in v1.115.0
func (c *Client) GetWorkspacePipelineVariable(workspace, uuid string) (backend.PipelineVariable, error)
GetWorkspacePipelineVariable retrieves a single workspace pipeline variable by UUID.
func (*Client) GetWorkspaceProject ¶ added in v1.112.0
func (c *Client) GetWorkspaceProject(ws, key string) (backend.WorkspaceProject, error)
GetWorkspaceProject returns a single workspace project by key.
func (*Client) GrantWorkspacePerm ¶ added in v1.113.0
GrantWorkspacePerm grants a permission to a user in a workspace. PUT /2.0/workspaces/{ws}/permissions/members/{user}
func (*Client) GrantWorkspaceProjectPerm ¶ added in v1.120.0
func (c *Client) GrantWorkspaceProjectPerm(workspace, projectKey string, in backend.WorkspaceProjectPermInput) error
GrantWorkspaceProjectPerm grants a permission to a user or group on a Cloud workspace project.
For user: PUT /workspaces/{ws}/projects/{key}/permissions-config/users/{user_slug} For group: PUT /workspaces/{ws}/projects/{key}/permissions-config/groups/{group_slug}
func (*Client) ListAuditLog ¶ added in v1.105.0
func (c *Client) ListAuditLog(workspace string, opts backend.AuditLogOpts) ([]backend.AuditEvent, error)
ListAuditLog returns workspace audit log events for the given workspace.
func (*Client) ListBranchRules ¶ added in v1.53.0
func (c *Client) ListBranchRules(ns, slug string) ([]backend.BranchRule, error)
ListBranchRules returns all branch restriction rules for a repository. GET /repositories/{workspace}/{slug}/branch-restrictions
func (*Client) ListBranches ¶
ListBranches lists branches for a repository, capping the total returned at limit (limit <= 0 means unbounded).
func (*Client) ListCodeInsightsAnnotations ¶ added in v1.130.0
func (c *Client) ListCodeInsightsAnnotations(workspace, slug, hash, key string) ([]backend.CodeInsightsAnnotation, error)
ListCodeInsightsAnnotations returns all annotations under a given report.
func (*Client) ListCodeInsightsReports ¶ added in v1.130.0
func (c *Client) ListCodeInsightsReports(workspace, slug, hash string) ([]backend.CodeInsightsReport, error)
ListCodeInsightsReports returns all Code Insights reports attached to a commit. The workspace argument maps to the Cloud "workspace" slug (same as the project field used by the CLI).
func (*Client) ListCommitComments ¶ added in v1.27.0
func (c *Client) ListCommitComments(ns, slug, hash string, limit int) ([]backend.CommitComment, error)
ListCommitComments lists all comments on a commit. Cloud supports pagination via the standard paged response envelope.
func (*Client) ListCommitFiles ¶ added in v1.55.0
func (c *Client) ListCommitFiles(ns, slug, hash string) ([]backend.DiffStatEntry, error)
ListCommitFiles returns the files changed in a specific commit. Cloud endpoint: GET /repositories/{ws}/{slug}/diffstat/{hash}~1..{hash}
func (*Client) ListCommitStatuses ¶ added in v1.6.0
func (c *Client) ListCommitStatuses(ns, slug, hash string) ([]backend.CommitStatus, error)
func (*Client) ListCommits ¶
func (*Client) ListDefaultReviewers ¶ added in v1.50.0
func (c *Client) ListDefaultReviewers(ns, slug string) ([]backend.DefaultReviewer, error)
ListDefaultReviewers returns all effective default reviewers for a repository. GET /repositories/{workspace}/{slug}/effective-default-reviewers
func (*Client) ListDeployKeys ¶ added in v1.47.0
ListDeployKeys returns all deploy keys for a repository. GET /repositories/{workspace}/{slug}/deploy-keys
func (*Client) ListDeployments ¶ added in v1.29.0
ListDeployments returns up to limit deployments for the repository, most recent first.
func (*Client) ListEnvVariables ¶ added in v1.29.0
func (c *Client) ListEnvVariables(ns, slug, envUUID string) ([]backend.EnvVariable, error)
ListEnvVariables returns all variables for a deployment environment.
func (*Client) ListEnvironments ¶ added in v1.29.0
func (c *Client) ListEnvironments(ns, slug string) ([]backend.Environment, error)
ListEnvironments returns all deployment environments for the repository.
func (*Client) ListIPAllowlists ¶ added in v1.106.0
func (c *Client) ListIPAllowlists(workspace string) ([]backend.IPAllowlist, error)
ListIPAllowlists returns all IP allowlist entries for the given workspace.
func (*Client) ListIssueActivity ¶ added in v1.118.0
func (c *Client) ListIssueActivity(ns, slug string, issueID int, limit int) ([]backend.IssueChange, error)
ListIssueActivity returns the change history of a Cloud issue. Cloud endpoint: GET /repositories/{ws}/{slug}/issues/{id}/changes
func (*Client) ListIssueAttachments ¶ added in v1.100.0
ListIssueAttachments returns the attachments on a Cloud issue.
func (*Client) ListIssueComments ¶ added in v1.23.0
func (*Client) ListIssueVersions ¶ added in v1.112.0
ListIssueVersions returns all issue versions for a repository.
func (*Client) ListIssues ¶ added in v1.17.0
ListIssues fetches issues from a repository's tracker. The state argument is appended as a `q=state="..."` filter when non-empty. Bitbucket Cloud's query language is case-sensitive on field names but accepts lowercase state values exactly.
func (*Client) ListMilestones ¶ added in v1.111.0
ListMilestones returns all milestones for a repository.
func (*Client) ListMyPRs ¶ added in v1.28.0
ListMyPRs returns the authenticated user's open PRs from the Cloud dashboard endpoint, combining AUTHOR and REVIEWER roles. Duplicates (PR appearing in both roles) keep the AUTHOR entry.
func (*Client) ListPRComments ¶ added in v1.6.0
func (*Client) ListPRCommits ¶ added in v1.56.0
ListPRCommits returns the commits in a pull request, paginated.
func (*Client) ListPRFiles ¶ added in v1.57.0
ListPRFiles returns the files changed in a pull request, paginated. Cloud endpoint: GET /repositories/{ws}/{slug}/pullrequests/{id}/diffstat
func (*Client) ListPRParticipants ¶ added in v1.60.0
ListPRParticipants returns the participants of a pull request. Cloud endpoint: GET /repositories/{ws}/{slug}/pullrequests/{id}/participants
func (*Client) ListPipelineArtifacts ¶ added in v1.93.0
func (c *Client) ListPipelineArtifacts(ws, slug, pipelineUUID, stepUUID string, limit int) ([]backend.PipelineArtifact, error)
ListPipelineArtifacts returns artifacts produced by a pipeline step.
func (*Client) ListPipelineCaches ¶ added in v1.67.0
func (c *Client) ListPipelineCaches(ns, slug string) ([]backend.PipelineCache, error)
ListPipelineCaches returns all pipeline caches for a repository.
func (*Client) ListPipelineKnownHosts ¶ added in v1.114.0
func (c *Client) ListPipelineKnownHosts(ns, slug string) ([]backend.PipelineKnownHost, error)
ListPipelineKnownHosts returns all known hosts for a repository's pipelines. GET /2.0/repositories/{ws}/{slug}/pipelines_config/ssh/known_hosts
func (*Client) ListPipelineSchedules ¶ added in v1.54.0
func (c *Client) ListPipelineSchedules(ns, slug string) ([]backend.PipelineSchedule, error)
ListPipelineSchedules returns all pipeline schedules for a repository.
func (*Client) ListPipelineSteps ¶ added in v1.15.0
func (c *Client) ListPipelineSteps(ns, slug, uuid string) ([]backend.PipelineStep, error)
ListPipelineSteps lists the steps in a pipeline run.
func (*Client) ListPipelineTestCases ¶ added in v1.110.0
func (c *Client) ListPipelineTestCases(ws, slug, pipelineUUID, stepUUID string, filter backend.TestCaseFilter) ([]backend.PipelineTestCase, error)
ListPipelineTestCases returns the test cases for a pipeline step. GET /2.0/repositories/{ws}/{slug}/pipelines/{uuid}/steps/{step_uuid}/test_reports/test_cases
func (*Client) ListPipelineVariables ¶ added in v1.15.0
func (c *Client) ListPipelineVariables(ns, slug string) ([]backend.PipelineVariable, error)
ListPipelineVariables returns repository-level pipeline variables. The Bitbucket Cloud API never includes the value of secured variables in the response, so PipelineVariable.Value is empty when Secured is true.
func (*Client) ListPipelines ¶
func (*Client) ListProjectDefaultReviewers ¶ added in v1.122.0
func (c *Client) ListProjectDefaultReviewers(workspace, projectKey string, limit int) ([]backend.ProjectDefaultReviewer, error)
ListProjectDefaultReviewers returns the default reviewers for a Cloud workspace project.
GET /workspaces/{workspace}/projects/{project_key}/default-reviewers
func (*Client) ListProjects ¶ added in v1.17.0
ListProjects lists projects in the given workspace. Workspace is required; an empty value yields an explicit error so callers don't accidentally hit /workspaces//projects (the API would 404, but the error message would be less helpful).
func (*Client) ListRepoDownloads ¶ added in v1.111.0
ListRepoDownloads returns the list of download artifacts for a repository.
func (*Client) ListRepoForks ¶ added in v1.64.0
ListRepoForks lists forks of a repository on Bitbucket Cloud. limit controls the maximum number of results (0 = no cap).
func (*Client) ListRepoLabels ¶ added in v1.100.0
ListRepoLabels fetches all labels for a Cloud repository.
func (*Client) ListRepoWatchers ¶ added in v1.58.0
ListRepoWatchers returns all users watching a repository. Cloud endpoint: GET /repositories/{ws}/{slug}/watchers
func (*Client) ListRunners ¶ added in v1.104.0
ListRunners returns all pipeline self-hosted runners for a workspace.
func (*Client) ListSSHKeys ¶ added in v1.51.0
ListSSHKeys returns all SSH keys for the current user. GET /users/{username}/ssh-keys
func (*Client) ListSnippetComments ¶ added in v1.123.0
func (c *Client) ListSnippetComments(workspace, snippetID string, limit int) ([]backend.SnippetComment, error)
ListSnippetComments fetches comments for a snippet. GET /2.0/snippets/{workspace}/{snippet_id}/comments
func (*Client) ListSnippets ¶ added in v1.91.0
ListSnippets fetches snippets for the given workspace. GET /2.0/snippets/{workspace}
func (*Client) ListTree ¶ added in v1.22.0
ListTree returns the immediate children of pathInRepo at ref. Cloud's /src endpoint paginates with the standard cloud envelope, so GetAllJSON + the configured paginator handle multi-page directories transparently.
When the path resolves to a file rather than a directory the response won't carry a "values" array and unmarshal yields an empty slice; we detect that explicitly and return ErrNotFound so the cmd-layer hint distinguishes "missing path" from "wrong kind of path".
func (*Client) ListWebhooks ¶ added in v1.15.0
func (*Client) ListWorkspaceMemberPerms ¶ added in v1.113.0
func (c *Client) ListWorkspaceMemberPerms(ws string, limit int) ([]backend.WorkspaceMemberPerm, error)
ListWorkspaceMemberPerms returns member-level permissions for a workspace. GET /2.0/workspaces/{ws}/permissions
func (*Client) ListWorkspaceMembers ¶ added in v1.62.0
func (c *Client) ListWorkspaceMembers(workspace string, limit int) ([]backend.WorkspaceMember, error)
ListWorkspaceMembers returns members of the given Cloud workspace. Cloud endpoint: GET /workspaces/{workspace}/members
func (*Client) ListWorkspacePipelineVariables ¶ added in v1.115.0
func (c *Client) ListWorkspacePipelineVariables(workspace string) ([]backend.PipelineVariable, error)
ListWorkspacePipelineVariables returns workspace-level pipeline variables. Secured variable values are not returned by the API.
func (*Client) ListWorkspaceProjectPerms ¶ added in v1.120.0
func (c *Client) ListWorkspaceProjectPerms(workspace, projectKey string, limit int) ([]backend.WorkspaceProjectPerm, error)
ListWorkspaceProjectPerms returns both user and group permissions for a Cloud workspace project. It calls GET /permissions-config/users and GET /permissions-config/groups, collects each via paging.Collect, and merges the results into one slice.
func (*Client) ListWorkspaceRepoPerms ¶ added in v1.113.0
ListWorkspaceRepoPerms returns repository-level permissions for a workspace. GET /2.0/workspaces/{ws}/permissions/repositories
func (*Client) ListWorkspaceVariables ¶ added in v1.31.0
func (c *Client) ListWorkspaceVariables(ns string) ([]backend.PipelineVariable, error)
ListWorkspaceVariables returns workspace-level pipeline variables. Secured variable values are not returned by the API.
func (*Client) ListWorkspaceWebhooks ¶ added in v1.66.0
func (*Client) ListWorkspaces ¶ added in v1.17.0
ListWorkspaces lists workspaces the authenticated user is a member of. Pagination is driven by paging.Collect; limit caps total items (0 = no cap, follow Cloud's default page size to exhaustion).
func (*Client) MergePR ¶
func (c *Client) MergePR(ns, slug string, id int, in backend.MergePRInput) (backend.PullRequest, error)
func (*Client) PutCodeInsightsAnnotations ¶ added in v1.130.0
func (c *Client) PutCodeInsightsAnnotations(workspace, slug, hash, key string, in []backend.CodeInsightsAnnotationInput) error
PutCodeInsightsAnnotations bulk-POSTs annotations to a report in a single request. Cloud uses POST with a wrapper object; Server uses {"annotations":[...]}.
func (*Client) PutCodeInsightsReport ¶ added in v1.130.0
func (c *Client) PutCodeInsightsReport(workspace, slug, hash, key string, in backend.CodeInsightsReportInput) (backend.CodeInsightsReport, error)
PutCodeInsightsReport creates or replaces a Code Insights report (PUT / upsert). Only non-zero fields in in are sent.
func (*Client) PutFile ¶ added in v1.102.0
func (c *Client) PutFile(ns, slug, path string, in backend.PutFileInput) error
PutFile creates or updates a file via the Bitbucket Cloud src endpoint. POST /repositories/{workspace}/{slug}/src with a multipart/form-data body where the file field name is the repo-relative path, plus required fields: branch and message. An optional sourceCommit field enables conflict detection.
func (*Client) RegeneratePipelineSSHKeyPair ¶ added in v1.114.0
func (c *Client) RegeneratePipelineSSHKeyPair(ns, slug string, bits int) (backend.PipelineSSHKeyPair, error)
RegeneratePipelineSSHKeyPair triggers generation of a new SSH key pair. PUT /2.0/repositories/{ws}/{slug}/pipelines_config/ssh/key_pair Passing bits=0 uses the Cloud default (2048).
func (*Client) RemoveDefaultReviewer ¶ added in v1.50.0
RemoveDefaultReviewer removes a default reviewer from a repository. DELETE /repositories/{workspace}/{slug}/default-reviewers/{account_id_or_nickname}
func (*Client) RemoveProjectDefaultReviewer ¶ added in v1.122.0
RemoveProjectDefaultReviewer removes a default reviewer from a Cloud workspace project.
DELETE /workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
func (*Client) RemoveReviewers ¶ added in v1.76.0
RemoveReviewers removes the given users from a pull request's reviewer list. Cloud has no dedicated DELETE reviewer endpoint; we GET the current PR, filter out the named account IDs, and PUT the reduced list back.
func (*Client) RenameRepo ¶ added in v1.16.0
func (c *Client) RenameRepo(ns, slug, newName string) (backend.Repository, error)
func (*Client) ReopenIssue ¶ added in v1.23.0
ReopenIssue transitions an issue back to the "open" state.
func (*Client) ReportCommitStatus ¶ added in v1.59.0
func (c *Client) ReportCommitStatus(ns, slug, hash string, input backend.CommitStatusInput) (backend.CommitStatus, error)
func (*Client) RequestChangesPR ¶
RequestChangesPR requests changes on a pull request (Cloud only). A nil body is intentional: ContentTypeWhenBody ensures no Content-Type is set, which is required for this endpoint on Bitbucket Cloud.
func (*Client) RequestReview ¶
RequestReview adds reviewers to a pull request using PUT /pullrequests/{id}. It first GETs the current PR to preserve existing reviewers, then PUTs the merged list. This is the only Cloud-supported approach (the /participants endpoint does not support adding reviewers).
func (*Client) RerunPipeline ¶ added in v1.108.0
RerunPipeline fetches the source pipeline's target (including commit hash) and triggers a new run at exactly the same commit. When the source pipeline has no commit hash (e.g. custom pipelines), the trigger falls back to a ref-only request.
func (*Client) ResolvePRComment ¶ added in v1.24.0
ResolvePRComment marks a Cloud PR comment as resolved by writing `resolution.type=resolved` to the comment endpoint via PUT. Cloud has no dedicated resolve verb in the public REST surface; the resolution field of an existing comment is the documented mechanism. Server has no equivalent concept on regular comments and returns ErrUnsupportedOnHost via AsPRCommentResolver.
func (*Client) RevokeWorkspacePerm ¶ added in v1.113.0
RevokeWorkspacePerm removes a user's permission from a workspace. DELETE /2.0/workspaces/{ws}/permissions/members/{user}
func (*Client) RevokeWorkspaceProjectPerm ¶ added in v1.120.0
func (c *Client) RevokeWorkspaceProjectPerm(workspace, projectKey, subjectSlug string, isGroup bool) error
RevokeWorkspaceProjectPerm removes a user or group permission from a Cloud workspace project.
For user: DELETE /workspaces/{ws}/projects/{key}/permissions-config/users/{subject_slug} For group: DELETE /workspaces/{ws}/projects/{key}/permissions-config/groups/{subject_slug}
func (*Client) RunPipeline ¶
func (c *Client) RunPipeline(ns, slug string, in backend.RunPipelineInput) (backend.Pipeline, error)
RunPipeline triggers a new pipeline run on a branch.
func (*Client) SearchCode ¶ added in v1.21.0
SearchCode runs Bitbucket Cloud's workspace-scoped code search. Bitbucket Cloud's query language is passed through verbatim — the caller is responsible for any operator escaping. limit caps total items (0 = no cap, follow Cloud's default page size to exhaustion).
func (*Client) SearchCommits ¶ added in v1.135.0
func (c *Client) SearchCommits(ns, slug string, opts backend.CommitSearchOpts) ([]backend.Commit, error)
SearchCommits lists commits filtered by message keyword, author, or date range. Cloud's filter syntax is used for message and date; author filtering is applied client-side (Cloud requires account_id, not a slug).
func (*Client) SearchWorkspaces ¶ added in v1.119.0
SearchWorkspaces searches workspaces matching the given opts. Cloud: GET /2.0/user/permissions/workspaces with optional q and role query params.
func (*Client) SetEnvVariable ¶ added in v1.29.0
func (c *Client) SetEnvVariable(ns, slug, envUUID string, in backend.EnvVariableInput) (backend.EnvVariable, error)
SetEnvVariable upserts an environment variable by Key. If a variable with the same Key already exists it is updated via PUT; otherwise it is created via POST.
func (*Client) SetPipelineVariable ¶ added in v1.15.0
func (c *Client) SetPipelineVariable(ns, slug string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
SetPipelineVariable upserts a pipeline variable by Key. If a variable with the same Key already exists, it is updated via PUT; otherwise a new one is created via POST. Hides the UUID-vs-key wrinkle from the caller.
func (*Client) SetRepoDefaultBranch ¶ added in v1.85.0
SetRepoDefaultBranch sets the default (main) branch of a repository. Cloud: PUT /2.0/repositories/{workspace}/{slug} body: {"mainbranch": {"name": branch}}
func (*Client) SetRepoVisibility ¶ added in v1.65.0
func (*Client) SetWorkspacePipelineVariable ¶ added in v1.115.0
func (c *Client) SetWorkspacePipelineVariable(workspace string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
SetWorkspacePipelineVariable upserts a workspace-level pipeline variable by key: PUTs if a variable with that key already exists, POSTs otherwise.
func (*Client) SetWorkspaceVariable ¶ added in v1.31.0
func (c *Client) SetWorkspaceVariable(ns string, in backend.PipelineVariableInput) (backend.PipelineVariable, error)
SetWorkspaceVariable upserts a workspace-level pipeline variable by Key. If a variable with the same Key already exists it is updated via PUT; otherwise a new one is created via POST.
func (*Client) StopPipeline ¶ added in v1.90.0
StopPipeline stops a running pipeline. The Bitbucket Cloud API returns HTTP 204 with an empty body on success.
func (*Client) SubmitReview ¶ added in v1.25.0
SubmitReview implements backend.PRReviewer for Bitbucket Cloud by sequencing the writes that make up a compound `pr review` call:
- Optional top-level body comment (when in.Body != "").
- Each inline comment in order — failures short-circuit so partial review state is observable in the activity log rather than papered over.
- The review action: ApprovePR / RequestChangesPR / no-op for "comment".
An unknown Action returns an error before any writes happen — sequencing is responsible for preserving the comments-then-action ordering, not for validating the action vocabulary.
func (*Client) SyncRepo ¶ added in v1.133.0
func (c *Client) SyncRepo(ns, slug, branch string) (backend.SyncResult, error)
SyncRepo synchronises a fork branch with its upstream. POST /repositories/{workspace}/{slug}/merge-upstream On 409 the transport returns ErrConflict (diverged history). On 404 the transport returns ErrNotFound.
func (*Client) TransferRepo ¶ added in v1.52.0
func (c *Client) TransferRepo(ns, slug, target string) (backend.Repository, error)
TransferRepo transfers a Cloud repository to another workspace. POST /repositories/{workspace}/{slug}/transfer
func (*Client) TriggerPipeline ¶ added in v1.48.0
func (c *Client) TriggerPipeline(ns, slug string, input backend.PipelineTriggerInput) (backend.PipelineTriggerResult, error)
TriggerPipeline implements backend.PipelineTriggerClient for Bitbucket Cloud.
func (*Client) UnapprovePR ¶
UnapprovePR removes the authenticated user's approval from a pull request.
func (*Client) UnvoteIssue ¶ added in v1.100.0
UnvoteIssue removes a vote from a Cloud issue (DELETE /vote).
func (*Client) UnwatchIssue ¶ added in v1.100.0
UnwatchIssue unsubscribes the authenticated user from a Cloud issue (DELETE /watch).
func (*Client) UpdateBranchModelSettings ¶ added in v1.92.0
func (c *Client) UpdateBranchModelSettings(ws, slug string, in backend.BranchModelSettingsInput) (backend.BranchModelSettings, error)
UpdateBranchModelSettings updates the branching model settings. PUT /repositories/{workspace}/{slug}/branching-model/settings
func (*Client) UpdateBranchRule ¶ added in v1.121.0
func (c *Client) UpdateBranchRule(ns, slug string, id int, in backend.UpdateBranchRuleInput) (backend.BranchRule, error)
UpdateBranchRule updates a branch restriction rule using a fetch-first + PUT strategy. PUT /repositories/{workspace}/{slug}/branch-restrictions/{id}
func (*Client) UpdateIssue ¶ added in v1.17.0
func (*Client) UpdatePR ¶
func (c *Client) UpdatePR(ns, slug string, id int, in backend.UpdatePRInput) (backend.PullRequest, error)
UpdatePR updates the title and/or description of a pull request.
func (*Client) UpdatePRBranch ¶ added in v1.28.0
UpdatePRBranch syncs a PR's source branch with its base branch. POST /2.0/repositories/{workspace}/{slug}/pullrequests/{prID}/update-branch 202 Accepted on success.
func (*Client) UpdatePRParticipant ¶ added in v1.117.0
func (c *Client) UpdatePRParticipant(ns, slug string, prID int, accountID, state string) (backend.PRParticipant, error)
UpdatePRParticipant updates a participant's approval state on a pull request. Cloud endpoint: PUT /repositories/{ws}/{slug}/pullrequests/{id}/participants/{accountID} state: "approved", "changes_requested", or "" (neutral/unapprove).
func (*Client) UpdatePipelinesConfig ¶ added in v1.109.0
func (c *Client) UpdatePipelinesConfig(ws, slug string, input backend.PipelineConfig) (backend.PipelineConfig, error)
UpdatePipelinesConfig updates the pipeline configuration for a repository. PUT /2.0/repositories/{workspace}/{repo_slug}/pipelines_config
func (*Client) UpdateRepoLabel ¶ added in v1.100.0
func (c *Client) UpdateRepoLabel(ns, slug string, id int, in backend.UpdateRepoLabelInput) (backend.RepoLabel, error)
UpdateRepoLabel updates an existing label on a Cloud repository.
func (*Client) UpdateWorkspaceProject ¶ added in v1.112.0
func (c *Client) UpdateWorkspaceProject(ws, key string, input backend.UpdateWorkspaceProjectInput) (backend.WorkspaceProject, error)
UpdateWorkspaceProject applies non-nil fields from input to the existing project and PUTs the merged result.
func (*Client) UploadRepoDownload ¶ added in v1.111.0
func (c *Client) UploadRepoDownload(ns, slug, name string, body io.Reader) (backend.RepoDownload, error)
UploadRepoDownload uploads a file as a repository download artifact. After the POST the server does not return useful JSON, so we return a minimal RepoDownload populated with the name only.
type HTTPClient ¶
HTTPClient is the transport interface for making HTTP requests.
Source Files
¶
- admin.go
- audit.go
- branch_model.go
- branch_rules.go
- branches.go
- client.go
- code_insights.go
- commit.go
- commit_comment.go
- commit_files.go
- commit_search.go
- commit_status.go
- default_reviewers_mgmt.go
- deploy_keys.go
- deployments.go
- diff.go
- group.go
- host_info.go
- ipallowlist.go
- issue_activity.go
- issue_version.go
- issues.go
- issues_extras.go
- milestone.go
- pat_stub.go
- permissions.go
- pipeline_artifacts.go
- pipeline_caches.go
- pipeline_config.go
- pipeline_logs.go
- pipeline_oidc.go
- pipeline_rerun.go
- pipeline_schedules.go
- pipeline_ssh.go
- pipeline_steps.go
- pipeline_test_report.go
- pipeline_trigger.go
- pipeline_variables.go
- pipelines.go
- pr_activity.go
- pr_comments.go
- pr_commits.go
- pr_files.go
- pr_lifecycle.go
- pr_merge_preview.go
- pr_participants.go
- pr_review.go
- pr_status.go
- pr_update_branch.go
- project_server_stub.go
- prs.go
- ref_compare.go
- repo_default_branch.go
- repo_download.go
- repo_edit.go
- repo_forks.go
- repo_labels.go
- repo_pr_settings.go
- repo_sync.go
- repo_transfer.go
- repo_watchers.go
- repos.go
- runner.go
- search.go
- snippet_comments.go
- snippets.go
- source.go
- source_write.go
- ssh_keys.go
- tag.go
- webhooks.go
- workspace_members.go
- workspace_perms.go
- workspace_pipeline_vars.go
- workspace_project.go
- workspace_project_default_reviewer.go
- workspace_project_perms.go
- workspace_variables.go
- workspace_webhooks.go
- workspaces.go