cloud

package
v1.72.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: MIT Imports: 13 Imported by: 0

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 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.

Index

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

func (c *Client) AddDefaultReviewer(ns, slug, userSlug string) error

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 (c *Client) AddIssueComment(ns, slug string, id int, body string) (backend.IssueComment, error)

func (*Client) AddPRComment added in v1.6.0

func (c *Client) AddPRComment(ns, slug string, id int, in backend.AddPRCommentInput) (backend.PRComment, error)

func (*Client) AddSSHKey added in v1.51.0

func (c *Client) AddSSHKey(input backend.SSHKeyInput) (backend.SSHKey, error)

AddSSHKey adds an SSH key for the current user. POST /users/{username}/ssh-keys

func (*Client) ApprovePR

func (c *Client) ApprovePR(ns, slug string, id int) error

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

func (c *Client) AssignIssue(ns, slug string, id int, assignee string) error

AssignIssue sets the assignee on an issue by username.

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) CreateIssue added in v1.17.0

func (c *Client) CreateIssue(ns, slug string, in backend.CreateIssueInput) (backend.Issue, error)

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) CreateTag

func (c *Client) CreateTag(ns, slug string, in backend.CreateTagInput) (backend.Tag, error)

func (*Client) CreateWebhook added in v1.15.0

func (c *Client) CreateWebhook(ns, slug string, in backend.CreateWebhookInput) (backend.Webhook, error)

func (*Client) CreateWorkspaceWebhook added in v1.66.0

func (c *Client) CreateWorkspaceWebhook(workspace string, in backend.CreateWebhookInput) (backend.Webhook, error)

func (*Client) DeclinePR

func (c *Client) DeclinePR(ns, slug string, id int) error

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 (c *Client) DeleteBranch(ns, slug, branch string) error

func (*Client) DeleteBranchRule added in v1.53.0

func (c *Client) DeleteBranchRule(ns, slug string, id int) error

DeleteBranchRule removes a branch restriction rule from a repository. DELETE /repositories/{workspace}/{slug}/branch-restrictions/{id}

func (*Client) DeleteCommitComment added in v1.27.0

func (c *Client) DeleteCommitComment(ns, slug, hash string, commentID int) error

DeleteCommitComment removes a commit comment. Cloud returns 204 on success.

func (*Client) DeleteDeployKey added in v1.47.0

func (c *Client) DeleteDeployKey(ns, slug string, id int) error

DeleteDeployKey removes a deploy key from a repository. DELETE /repositories/{workspace}/{slug}/deploy-keys/{id}

func (*Client) DeleteEnvVariable added in v1.29.0

func (c *Client) DeleteEnvVariable(ns, slug, envUUID, varUUID string) error

DeleteEnvVariable deletes an environment variable by its UUID.

func (*Client) DeleteEnvironment added in v1.29.0

func (c *Client) DeleteEnvironment(ns, slug, uuid string) error

DeleteEnvironment deletes a deployment environment by UUID.

func (*Client) DeleteIssueComment added in v1.23.0

func (c *Client) DeleteIssueComment(ns, slug string, id, commentID int) error

func (*Client) DeletePRComment added in v1.24.0

func (c *Client) DeletePRComment(ns, slug string, id, commentID int) error

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

func (c *Client) DeletePipelineCache(ns, slug, uuid string) error

DeletePipelineCache deletes a pipeline cache by UUID.

func (*Client) DeletePipelineSchedule added in v1.54.0

func (c *Client) DeletePipelineSchedule(ns, slug, uuid string) error

DeletePipelineSchedule deletes a pipeline schedule by UUID.

func (*Client) DeletePipelineVariable added in v1.15.0

func (c *Client) DeletePipelineVariable(ns, slug, key string) error

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 (c *Client) DeleteRepo(ns, slug string) error

func (*Client) DeleteSSHKey added in v1.51.0

func (c *Client) DeleteSSHKey(id int) error

DeleteSSHKey removes an SSH key for the current user. DELETE /users/{username}/ssh-keys/{id}

func (*Client) DeleteTag

func (c *Client) DeleteTag(ns, slug, name string) error

func (*Client) DeleteWebhook added in v1.15.0

func (c *Client) DeleteWebhook(ns, slug, id string) error

func (*Client) DeleteWorkspaceVariable added in v1.31.0

func (c *Client) DeleteWorkspaceVariable(ns, key string) error

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 (c *Client) DeleteWorkspaceWebhook(workspace, uuid string) error

func (*Client) DisableAutoMerge added in v1.30.0

func (c *Client) DisableAutoMerge(ns, slug string, id int) error

DisableAutoMerge cancels a queued auto-merge on Bitbucket Cloud.

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 (c *Client) EditIssueComment(ns, slug string, id, commentID int, body string) (backend.IssueComment, error)

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) EnableAutoMerge added in v1.30.0

func (c *Client) EnableAutoMerge(ns, slug string, id int, strategy string) error

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) GetCommit

func (c *Client) GetCommit(ns, slug, hash string) (backend.Commit, error)

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser() (backend.User, error)

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

func (c *Client) GetDiff(ns, slug, from, to string) (string, error)

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

func (c *Client) GetDiffStat(ns, slug, from, to string) (backend.DiffStat, error)

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

func (c *Client) GetFileContent(ns, slug, ref, pathInRepo string) ([]byte, error)

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) GetIssue added in v1.17.0

func (c *Client) GetIssue(ns, slug string, id int) (backend.Issue, error)

func (*Client) GetPR

func (c *Client) GetPR(ns, slug string, id int) (backend.PullRequest, error)

func (*Client) GetPRActivity added in v1.26.0

func (c *Client) GetPRActivity(ns, slug string, id int, limit int) ([]backend.PRActivityEvent, error)

func (*Client) GetPRDiff

func (c *Client) GetPRDiff(ns, slug string, id int) (string, error)

func (*Client) GetPipeline

func (c *Client) GetPipeline(ns, slug, uuid string) (backend.Pipeline, error)

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) 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) GetRepo

func (c *Client) GetRepo(ns, slug string) (backend.Repository, error)

func (*Client) GetWebhook added in v1.15.0

func (c *Client) GetWebhook(ns, slug, id string) (backend.Webhook, error)

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

func (c *Client) ListBranches(ns, slug string, limit int) ([]backend.Branch, error)

ListBranches lists branches for a repository, capping the total returned at limit (limit <= 0 means unbounded).

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 (c *Client) ListCommits(ns, slug, branch string, limit int) ([]backend.Commit, error)

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

func (c *Client) ListDeployKeys(ns, slug string) ([]backend.DeployKey, error)

ListDeployKeys returns all deploy keys for a repository. GET /repositories/{workspace}/{slug}/deploy-keys

func (*Client) ListDeployments added in v1.29.0

func (c *Client) ListDeployments(ns, slug string, limit int) ([]backend.Deployment, error)

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) ListIssueComments added in v1.23.0

func (c *Client) ListIssueComments(ns, slug string, id int) ([]backend.IssueComment, error)

func (*Client) ListIssues added in v1.17.0

func (c *Client) ListIssues(ns, slug, state string, limit int) ([]backend.Issue, error)

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) ListMyPRs added in v1.28.0

func (c *Client) ListMyPRs(ns, slug string) ([]backend.MyPREntry, error)

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 (c *Client) ListPRComments(ns, slug string, id int) ([]backend.PRComment, error)

func (*Client) ListPRCommits added in v1.56.0

func (c *Client) ListPRCommits(ns, slug string, prID int) ([]backend.Commit, error)

ListPRCommits returns the commits in a pull request, paginated.

func (*Client) ListPRFiles added in v1.57.0

func (c *Client) ListPRFiles(ns, slug string, prID int) ([]backend.DiffStatEntry, error)

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

func (c *Client) ListPRParticipants(ns, slug string, prID int) ([]backend.PRParticipant, error)

ListPRParticipants returns the participants of a pull request. Cloud endpoint: GET /repositories/{ws}/{slug}/pullrequests/{id}/participants

func (*Client) ListPRs

func (c *Client) ListPRs(ns, slug, state string, limit int) ([]backend.PullRequest, error)

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) 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) 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 (c *Client) ListPipelines(ns, slug string, limit int) ([]backend.Pipeline, error)

func (*Client) ListProjects added in v1.17.0

func (c *Client) ListProjects(workspace string, limit int) ([]backend.Project, error)

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) ListRepoForks added in v1.64.0

func (c *Client) ListRepoForks(ns, slug string, limit int) ([]backend.Repository, error)

ListRepoForks lists forks of a repository on Bitbucket Cloud. limit controls the maximum number of results (0 = no cap).

func (*Client) ListRepoWatchers added in v1.58.0

func (c *Client) ListRepoWatchers(ns, slug string) ([]backend.User, error)

ListRepoWatchers returns all users watching a repository. Cloud endpoint: GET /repositories/{ws}/{slug}/watchers

func (*Client) ListRepos

func (c *Client) ListRepos(ns string, limit int) ([]backend.Repository, error)

func (*Client) ListSSHKeys added in v1.51.0

func (c *Client) ListSSHKeys() ([]backend.SSHKey, error)

ListSSHKeys returns all SSH keys for the current user. GET /users/{username}/ssh-keys

func (*Client) ListTags

func (c *Client) ListTags(ns, slug string, limit int) ([]backend.Tag, error)

func (*Client) ListTree added in v1.22.0

func (c *Client) ListTree(ns, slug, ref, pathInRepo string) ([]backend.TreeEntry, error)

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 (c *Client) ListWebhooks(ns, slug string) ([]backend.Webhook, error)

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) 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 (c *Client) ListWorkspaceWebhooks(workspace string) ([]backend.Webhook, error)

func (*Client) ListWorkspaces added in v1.17.0

func (c *Client) ListWorkspaces(limit int) ([]backend.Workspace, error)

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) ReadyPR

func (c *Client) ReadyPR(ns, slug string, id int) error

ReadyPR marks a draft pull request as ready for review.

func (*Client) RemoveDefaultReviewer added in v1.50.0

func (c *Client) RemoveDefaultReviewer(ns, slug, userSlug string) error

RemoveDefaultReviewer removes a default reviewer from a repository. DELETE /repositories/{workspace}/{slug}/default-reviewers/{account_id_or_nickname}

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

func (c *Client) ReopenIssue(ns, slug string, id int) error

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

func (c *Client) RequestChangesPR(ns, slug string, id int) error

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

func (c *Client) RequestReview(ns, slug string, id int, users []string) error

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) ResolvePRComment added in v1.24.0

func (c *Client) ResolvePRComment(ns, slug string, id, commentID int) error

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) 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

func (c *Client) SearchCode(workspace, query string, limit int) ([]backend.CodeSearchHit, error)

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) 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) SetRepoVisibility added in v1.65.0

func (c *Client) SetRepoVisibility(ns, slug string, isPrivate bool) error

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) SubmitReview added in v1.25.0

func (c *Client) SubmitReview(ns, slug string, id int, in backend.SubmitReviewInput) error

SubmitReview implements backend.PRReviewer for Bitbucket Cloud by sequencing the writes that make up a compound `pr review` call:

  1. Optional top-level body comment (when in.Body != "").
  2. Each inline comment in order — failures short-circuit so partial review state is observable in the activity log rather than papered over.
  3. 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) 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

func (c *Client) UnapprovePR(ns, slug string, id int) error

UnapprovePR removes the authenticated user's approval from a pull request.

func (*Client) UpdateIssue added in v1.17.0

func (c *Client) UpdateIssue(ns, slug string, id int, in backend.UpdateIssueInput) (backend.Issue, error)

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

func (c *Client) UpdatePRBranch(ns, slug string, prID int) error

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.

type HTTPClient

type HTTPClient = httpx.Doer

HTTPClient is the transport interface for making HTTP requests.

Directories

Path Synopsis
Code generated by oapi-codegen; DO NOT EDIT.
Code generated by oapi-codegen; DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL