Documentation
¶
Overview ¶
Package bitbucket provides request/response/payload types, and Timpani activity names and wrapper functions, for interacting with Bitbucket Cloud.
Index ¶
- Constants
- func CommitsDiff(ctx workflow.Context, req CommitsDiffRequest) (string, error)
- func PullRequestsApprove(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string) error
- func PullRequestsDecline(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string) error
- func PullRequestsDeleteComment(ctx workflow.Context, thrippyLinkID, workspace, repo, prID, commentID string) error
- func PullRequestsGet(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string) (map[string]any, error)
- func PullRequestsListActivityLog(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string) ([]map[string]any, error)
- func PullRequestsListForCommit(ctx workflow.Context, thrippyLinkID, workspace, repo, commit string) ([]map[string]any, error)
- func PullRequestsMerge(ctx workflow.Context, req PullRequestsMergeRequest) error
- func PullRequestsUnapprove(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string) error
- func PullRequestsUpdate(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string, ...) (map[string]any, error)
- func PullRequestsUpdateComment(ctx workflow.Context, ...) error
- func SourceGetFile(ctx workflow.Context, thrippyLinkID, workspace, repo, commit, path string) (string, error)
- type Comment
- type Commit
- type CommitFile
- type CommitsDiffRequest
- type CommitsDiffstatRequest
- type CommitsDiffstatResponse
- type CommitsRequest
- type Diffstat
- type Inline
- type Link
- type Membership
- type Parent
- type PullRequestsApproveRequest
- type PullRequestsCreateCommentRequest
- type PullRequestsCreateCommentResponse
- type PullRequestsDeclineRequest
- type PullRequestsDeleteCommentRequest
- type PullRequestsDiffstatRequest
- type PullRequestsDiffstatResponse
- type PullRequestsGetCommentRequest
- type PullRequestsGetCommentResponse
- type PullRequestsGetRequest
- type PullRequestsListActivityLogRequest
- type PullRequestsListActivityLogResponse
- type PullRequestsListCommitsRequest
- type PullRequestsListCommitsResponse
- type PullRequestsListForCommitRequest
- type PullRequestsListForCommitResponse
- type PullRequestsListTasksRequest
- type PullRequestsListTasksResponse
- type PullRequestsMergeRequest
- type PullRequestsRequest
- type PullRequestsUnapproveRequest
- type PullRequestsUpdateCommentRequest
- type PullRequestsUpdateRequest
- type Rendered
- type SourceGetRequest
- type Task
- type User
- func UsersGetByAccountID(ctx workflow.Context, accountID string) (*User, error)
- func UsersGetByUUID(ctx workflow.Context, uuid string) (*User, error)
- func UsersGetCurrent(ctx workflow.Context) (*User, error)
- func WorkspacesListMembers(ctx workflow.Context, workspace string, emailsFilter []string) ([]User, error)
- type UsersGetRequest
- type UsersGetResponse
- type WorkspacesListMembersRequest
- type WorkspacesListMembersResponse
Constants ¶
const ( CommitsDiffActivityName = "bitbucket.commits.diff" CommitsDiffstatActivityName = "bitbucket.commits.diffstat" )
const ( PullRequestsApproveActivityName = "bitbucket.pullrequests.approve" PullRequestsCreateCommentActivityName = "bitbucket.pullrequests.createComment" PullRequestsDeclineActivityName = "bitbucket.pullrequests.decline" PullRequestsDeleteCommentActivityName = "bitbucket.pullrequests.deleteComment" PullRequestsDiffstatActivityName = "bitbucket.pullrequests.diffstat" PullRequestsGetActivityName = "bitbucket.pullrequests.get" PullRequestsGetCommentActivityName = "bitbucket.pullrequests.getComment" PullRequestsListActivityLogActivityName = "bitbucket.pullrequests.listActivityLog" PullRequestsListCommitsActivityName = "bitbucket.pullrequests.listCommits" PullRequestsListForCommitActivityName = "bitbucket.pullrequests.listForCommit" PullRequestsListTasksActivityName = "bitbucket.pullrequests.listTasks" PullRequestsMergeActivityName = "bitbucket.pullrequests.merge" PullRequestsUnapproveActivityName = "bitbucket.pullrequests.unapprove" PullRequestsUpdateActivityName = "bitbucket.pullrequests.update" PullRequestsUpdateCommentActivityName = "bitbucket.pullrequests.updateComment" )
const (
SourceGetFileActivityName = "bitbucket.source.getFile"
)
const (
UsersGetActivityName = "bitbucket.users.get"
)
const (
WorkspacesListMembersActivityName = "bitbucket.workspaces.listMembers"
)
Variables ¶
This section is empty.
Functions ¶
func CommitsDiff ¶ added in v1.5.0
func CommitsDiff(ctx workflow.Context, req CommitsDiffRequest) (string, error)
CommitsDiff is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diff-spec-get
func PullRequestsApprove ¶ added in v1.5.0
PullRequestsApprove is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-approve-post
func PullRequestsDecline ¶ added in v1.5.0
PullRequestsDecline is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-decline-post
func PullRequestsDeleteComment ¶ added in v1.5.0
func PullRequestsDeleteComment(ctx workflow.Context, thrippyLinkID, workspace, repo, prID, commentID string) error
PullRequestsDeleteComment is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-delete
func PullRequestsGet ¶ added in v1.7.0
func PullRequestsGet(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string) (map[string]any, error)
PullRequestsGet is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-get
func PullRequestsListActivityLog ¶ added in v1.5.0
func PullRequestsListActivityLog(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string) ([]map[string]any, error)
PullRequestsListActivityLog is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-activity-get
It retrieves the full list of activity log entries by handling pagination internally.
func PullRequestsListForCommit ¶ added in v1.5.0
func PullRequestsListForCommit(ctx workflow.Context, thrippyLinkID, workspace, repo, commit string) ([]map[string]any, error)
PullRequestsListForCommit is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-commit-commit-pullrequests-get
It retrieves the full list of PRs by handling pagination internally.
func PullRequestsMerge ¶ added in v1.5.0
func PullRequestsMerge(ctx workflow.Context, req PullRequestsMergeRequest) error
PullRequestsMerge is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-merge-post
func PullRequestsUnapprove ¶ added in v1.5.0
PullRequestsUnapprove is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-approve-delete
func PullRequestsUpdate ¶ added in v1.7.0
func PullRequestsUpdate(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string, update map[string]any) (map[string]any, error)
PullRequestsUpdate is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-put
func PullRequestsUpdateComment ¶ added in v1.5.0
func PullRequestsUpdateComment(ctx workflow.Context, thrippyLinkID, workspace, repo, prID, commentID, markdown string) error
PullRequestsUpdateComment is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-put
func SourceGetFile ¶ added in v1.5.0
func SourceGetFile(ctx workflow.Context, thrippyLinkID, workspace, repo, commit, path string) (string, error)
SourceGetFile is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-src-commit-path-get
Types ¶
type Comment ¶ added in v1.8.0
type Comment struct {
ID int `json:"id"`
Content Rendered `json:"content"`
Inline *Inline `json:"inline,omitempty"`
User User `json:"user"`
CreatedOn time.Time `json:"created_on"`
UpdatedOn time.Time `json:"updated_on,omitzero"`
Deleted bool `json:"deleted,omitempty"`
Pending bool `json:"pending,omitempty"`
Parent *Parent `json:"parent,omitempty"`
Links map[string]Link `json:"links"`
}
Comment is based on: https://support.atlassian.com/bitbucket-cloud/docs/event-payloads/#Comment
func PullRequestsGetComment ¶ added in v1.8.0
func PullRequestsGetComment(ctx workflow.Context, thrippyLinkID, workspace, repo, prID, commentID string) (*Comment, error)
PullRequestsGetComment is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-get
type Commit ¶ added in v0.5.0
type Commit struct {
Hash string `json:"hash"`
Date string `json:"date,omitempty"`
Author *User `json:"author,omitempty"`
Message string `json:"message,omitempty"`
Parents []Commit `json:"parents,omitempty"`
Links map[string]Link `json:"links"`
}
Commit is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-get
func PullRequestsListCommits ¶ added in v1.5.0
func PullRequestsListCommits(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string) ([]Commit, error)
PullRequestsListCommits is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-commits-get
It retrieves the full list of commits by handling pagination internally.
type CommitFile ¶ added in v1.4.0
type CommitFile struct {
Path string `json:"path"`
EscapedPath string `json:"escaped_path"`
Links map[string]Link `json:"links"`
}
CommitFile is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get
type CommitsDiffRequest ¶ added in v1.1.0
type CommitsDiffRequest = CommitsRequest
CommitsDiffRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diff-spec-get
type CommitsDiffstatRequest ¶ added in v1.5.0
type CommitsDiffstatRequest struct {
CommitsRequest
IgnoreWhitespace bool `json:"ignore_whitespace,omitempty"`
Merge bool `json:"merge,omitempty"`
Renames bool `json:"renames,omitempty"`
Topic bool `json:"topic,omitempty"`
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen string `json:"pagelen,omitempty"`
Page string `json:"page,omitempty"`
Next string `json:"next,omitempty"` // Populated and used only in Timpani, for pagination.
}
CommitsDiffstatRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get
type CommitsDiffstatResponse ¶ added in v1.5.0
type CommitsDiffstatResponse struct {
Values []Diffstat `json:"values"`
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
Size int `json:"size,omitempty"`
PageLen int `json:"pagelen,omitempty"`
Page int `json:"page,omitempty"`
Next string `json:"next,omitempty"`
}
CommitsDiffstatResponse is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get
type CommitsRequest ¶ added in v1.7.2
type CommitsRequest struct {
ThrippyLinkID string `json:"thrippy_link_id,omitempty"`
Workspace string `json:"workspace"`
RepoSlug string `json:"repo_slug"`
Spec string `json:"spec"`
Path string `json:"path,omitempty"`
}
CommitsRequest contains common fields for commit-related requests.
type Diffstat ¶ added in v1.5.0
type Diffstat struct {
Status string `json:"status"`
LinesAdded int `json:"lines_added"`
LinesRemoved int `json:"lines_removed"`
Old *CommitFile `json:"old,omitempty"`
New *CommitFile `json:"new,omitempty"`
}
Diffstat is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get
func CommitsDiffstat ¶ added in v1.5.0
func CommitsDiffstat(ctx workflow.Context, req CommitsDiffstatRequest) ([]Diffstat, error)
CommitsDiffstat is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get
It retrieves the full list of diffstat entries by handling pagination internally.
func PullRequestsDiffstat ¶ added in v1.5.0
func PullRequestsDiffstat(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string) ([]Diffstat, error)
PullRequestsDiffstat is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-diffstat-get
It retrieves the full list of diffstat entries by handling pagination internally.
type Inline ¶ added in v1.8.0
type Inline struct {
Path string `json:"path"`
StartFrom *int `json:"start_from,omitempty"`
StartTo *int `json:"start_to,omitempty"`
From *int `json:"from,omitempty"`
To *int `json:"to,omitempty"`
ContextLines string `json:"context_lines"`
Outdated bool `json:"outdated,omitempty"`
SrcRev string `json:"src_rev"`
DestRev string `json:"dest_rev"`
}
Inline is based on: https://support.atlassian.com/bitbucket-cloud/docs/event-payloads/#Comment
type Membership ¶ added in v0.1.2
type Membership struct {
User User `json:"user"`
}
Membership is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-members-get
type Parent ¶ added in v0.2.0
Parent is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-post
type PullRequestsApproveRequest ¶ added in v1.0.0
type PullRequestsApproveRequest = PullRequestsRequest
PullRequestsApproveRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-approve-post
type PullRequestsCreateCommentRequest ¶ added in v0.1.3
type PullRequestsCreateCommentRequest struct {
PullRequestsRequest
Markdown string `json:"text"`
ParentID string `json:"parent_id,omitempty"`
}
PullRequestsCreateCommentRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-post
type PullRequestsCreateCommentResponse ¶ added in v0.1.3
type PullRequestsCreateCommentResponse = Comment
PullRequestsCreateCommentResponse is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-post
func PullRequestsCreateComment ¶ added in v1.5.0
func PullRequestsCreateComment(ctx workflow.Context, req PullRequestsCreateCommentRequest) (*PullRequestsCreateCommentResponse, error)
PullRequestsCreateComment is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-post
type PullRequestsDeclineRequest ¶ added in v1.0.0
type PullRequestsDeclineRequest = PullRequestsRequest
PullRequestsDeclineRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-decline-post
type PullRequestsDeleteCommentRequest ¶ added in v0.2.0
type PullRequestsDeleteCommentRequest struct {
PullRequestsRequest
CommentID string `json:"comment_id"`
}
PullRequestsDeleteCommentRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-delete
type PullRequestsDiffstatRequest ¶ added in v1.5.0
type PullRequestsDiffstatRequest struct {
PullRequestsRequest
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen string `json:"pagelen,omitempty"`
Page string `json:"page,omitempty"`
Next string `json:"next,omitempty"` // Populated and used only in Timpani, for pagination.
}
PullRequestsDiffstatRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-diffstat-get
type PullRequestsDiffstatResponse ¶ added in v1.5.0
type PullRequestsDiffstatResponse = CommitsDiffstatResponse
PullRequestsDiffstatResponse is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-diffstat-get
type PullRequestsGetCommentRequest ¶ added in v1.8.0
type PullRequestsGetCommentRequest struct {
PullRequestsRequest
CommentID string `json:"comment_id"`
}
PullRequestsGetCommentRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-get
type PullRequestsGetCommentResponse ¶ added in v1.8.0
type PullRequestsGetCommentResponse = Comment
PullRequestsGetCommentResponse is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-get
type PullRequestsGetRequest ¶ added in v1.7.0
type PullRequestsGetRequest = PullRequestsRequest
PullRequestsGetRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-get
type PullRequestsListActivityLogRequest ¶ added in v1.0.0
type PullRequestsListActivityLogRequest struct {
PullRequestsRequest
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen string `json:"pagelen,omitempty"`
Page string `json:"page,omitempty"`
Next string `json:"next,omitempty"` // Populated and used only in Timpani, for pagination.
}
PullRequestsListActivityLogRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-activity-get
type PullRequestsListActivityLogResponse ¶ added in v1.0.0
type PullRequestsListActivityLogResponse struct {
Values []map[string]any `json:"values"`
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen int `json:"pagelen,omitempty"`
Next string `json:"next,omitempty"`
}
PullRequestsListActivityLogResponse is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-activity-get
type PullRequestsListCommitsRequest ¶ added in v0.5.0
type PullRequestsListCommitsRequest struct {
PullRequestsRequest
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen string `json:"pagelen,omitempty"`
Page string `json:"page,omitempty"`
Next string `json:"next,omitempty"` // Populated and used only in Timpani, for pagination.
}
PullRequestsListCommitsRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-commits-get
type PullRequestsListCommitsResponse ¶ added in v0.5.0
type PullRequestsListCommitsResponse struct {
Values []Commit `json:"values"`
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen int `json:"pagelen,omitempty"`
Page int `json:"page,omitempty"`
Next string `json:"next,omitempty"`
}
PullRequestsListCommitsResponse is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-commits-get
type PullRequestsListForCommitRequest ¶ added in v1.0.0
type PullRequestsListForCommitRequest struct {
ThrippyLinkID string `json:"thrippy_link_id,omitempty"`
Workspace string `json:"workspace"`
RepoSlug string `json:"repo_slug"`
Commit string `json:"commit"`
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen string `json:"pagelen,omitempty"`
Page string `json:"page,omitempty"`
Next string `json:"next,omitempty"` // Populated and used only in Timpani, for pagination.
}
PullRequestsListForCommitRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-commit-commit-pullrequests-get
type PullRequestsListForCommitResponse ¶ added in v1.0.0
type PullRequestsListForCommitResponse struct {
Values []map[string]any `json:"values"`
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen int `json:"pagelen,omitempty"`
Page int `json:"page,omitempty"`
Next string `json:"next,omitempty"`
}
PullRequestsListForCommitResponse is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-commit-commit-pullrequests-get
type PullRequestsListTasksRequest ¶ added in v1.13.0
type PullRequestsListTasksRequest struct {
PullRequestsRequest
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen string `json:"pagelen,omitempty"`
Page string `json:"page,omitempty"`
Next string `json:"next,omitempty"` // Populated and used only in Timpani, for pagination.
}
PullRequestsListTasksRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-tasks-get
type PullRequestsListTasksResponse ¶ added in v1.13.0
type PullRequestsListTasksResponse struct {
Values []Task `json:"values"`
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
Size int `json:"size,omitempty"`
PageLen int `json:"pagelen,omitempty"`
Page int `json:"page,omitempty"`
Next string `json:"next,omitempty"`
}
PullRequestsListTasksResponse is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-tasks-get
type PullRequestsMergeRequest ¶ added in v1.0.0
type PullRequestsMergeRequest struct {
PullRequestsRequest
Type string `json:"type,omitempty"`
Message string `json:"message,omitempty"`
MergeStrategy string `json:"merge_strategy,omitempty"`
CloseSourceBranch bool `json:"close_source_branch,omitempty"`
}
PullRequestsMergeRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-merge-post
type PullRequestsRequest ¶ added in v1.7.2
type PullRequestsRequest struct {
ThrippyLinkID string `json:"thrippy_link_id,omitempty"`
Workspace string `json:"workspace"`
RepoSlug string `json:"repo_slug"`
PullRequestID string `json:"pull_request_id"`
}
PullRequestsRequest contains common fields for PR-related requests.
type PullRequestsUnapproveRequest ¶ added in v1.0.0
type PullRequestsUnapproveRequest = PullRequestsRequest
PullRequestsUnapproveRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-approve-delete
type PullRequestsUpdateCommentRequest ¶ added in v0.2.0
type PullRequestsUpdateCommentRequest struct {
PullRequestsRequest
CommentID string `json:"comment_id"`
Markdown string `json:"text"`
}
PullRequestsUpdateCommentRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-put
type PullRequestsUpdateRequest ¶ added in v1.7.0
type PullRequestsUpdateRequest struct {
PullRequestsRequest
PullRequest map[string]any `json:"pullrequest"`
}
PullRequestsUpdateRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-put
type SourceGetRequest ¶ added in v1.1.0
type SourceGetRequest struct {
ThrippyLinkID string `json:"thrippy_link_id,omitempty"`
Workspace string `json:"workspace"`
RepoSlug string `json:"repo_slug"`
Commit string `json:"commit"`
Path string `json:"path"`
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering
Filter string `json:"q,omitempty"`
Sort string `json:"sort,omitempty"`
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen string `json:"pagelen,omitempty"`
Page string `json:"page,omitempty"`
Next string `json:"next,omitempty"`
}
SourceGetRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-src-commit-path-get
type Task ¶ added in v1.13.0
type Task struct {
ID int `json:"id"`
State string `json:"state"`
Content Rendered `json:"content"`
Creator User `json:"creator"`
CreatedOn time.Time `json:"created_on"`
UpdatedOn time.Time `json:"updated_on,omitzero"`
Pending bool `json:"pending,omitempty"`
ResolvedBy *User `json:"resolved_by,omitempty"`
ResolvedOn time.Time `json:"resolved_on,omitzero"`
}
Task is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-tasks-get
func PullRequestsListTasks ¶ added in v1.13.0
func PullRequestsListTasks(ctx workflow.Context, thrippyLinkID, workspace, repo, prID string) ([]Task, error)
PullRequestsListTasks is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-tasks-get
It retrieves the full list of tasks by handling pagination internally.
type User ¶ added in v0.1.2
type User struct {
Type string `json:"type"` // "user" or "app_user".
DisplayName string `json:"display_name"`
Nickname string `json:"nickname"`
AccountID string `json:"account_id"`
UUID string `json:"uuid"`
Links map[string]Link `json:"links"`
}
User is based on:
- https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-user-get
- https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-users-selected-user-get
- https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-members-get
- https://developer.atlassian.com/cloud/bitbucket/announcement-introducing-app-user/
func UsersGetByAccountID ¶ added in v1.10.0
UsersGetByAccountID is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-users-selected-user-get
func UsersGetByUUID ¶ added in v1.10.0
UsersGetByUUID is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-users-selected-user-get
func UsersGetCurrent ¶ added in v1.10.0
UsersGetCurrent is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-user-get
func WorkspacesListMembers ¶ added in v1.5.0
func WorkspacesListMembers(ctx workflow.Context, workspace string, emailsFilter []string) ([]User, error)
WorkspacesListMembers is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-members-get
type UsersGetRequest ¶
type UsersGetRequest struct {
AccountID string `json:"account_id,omitempty"`
UUID string `json:"uuid,omitempty"`
}
UsersGetRequest is based on:
type WorkspacesListMembersRequest ¶
type WorkspacesListMembersRequest struct {
Workspace string `json:"workspace"`
EmailsFilter []string `json:"emails_filter"`
}
WorkspacesListMembersRequest is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-members-get
type WorkspacesListMembersResponse ¶ added in v0.1.2
type WorkspacesListMembersResponse struct {
Values []Membership `json:"values,omitempty"`
// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
PageLen int `json:"pagelen,omitempty"`
Page int `json:"page,omitempty"`
Next string `json:"next,omitempty"`
}
WorkspacesListMembersResponse is based on: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-members-get