bitbucket

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: BSD-3-Clause Imports: 16 Imported by: 1

Documentation

Overview

Copyright 2017 The go-github AUTHORS. All rights reserved.

Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Code generated by gen-accessors; DO NOT EDIT.

Index

Constants

View Source
const (
	// DefaultAPIBaseURL for the base API URL.
	DefaultAPIBaseURL = "https://api.bitbucket.org/2.0"

	// DefaultUserAgent for the API calls.
	DefaultUserAgent = "bitbucket-go"

	// DefaultPageLength represents the default page length returned from API calls.
	DefaultPageLength = 10
)
View Source
const (
	// UpdateActivity represents an update activity to a pull request.
	UpdateActivity = "update"

	// ApprovalActivity represents an update activity to a pull request.
	ApprovalActivity = "approval"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptedError

type AcceptedError struct {
	// Raw contains the response body.
	Raw []byte
}

AcceptedError occurs when Bitbucket returns 202 Accepted response with an empty body, which means a job was scheduled on the Bitbucket side to process the information needed and cache it. Technically, 202 Accepted is not a real error, it's just used to indicate that results are not ready yet, but should be available soon. The request can be repeated after some time.

func (*AcceptedError) Error

func (*AcceptedError) Error() string

type Artifact

type Artifact struct {
	Name          *string            `json:"name,omitempty"`
	Links         *ArtifactFileLinks `json:"links,omitempty"`
	DownloadCount *int64             `json:"downloads,omitempty"`
	User          *User              `json:"user,omitempty"`
	Type          *string            `json:"type,omitempty"`
	Size          *int64             `json:"size,omitempty"`
}

Artifact represents a file on Bitbucket.

func (*Artifact) GetDownloadCount

func (a *Artifact) GetDownloadCount() int64

GetDownloadCount returns the DownloadCount field if it's non-nil, zero value otherwise.

func (a *Artifact) GetLinks() *ArtifactFileLinks

GetLinks returns the Links field.

func (*Artifact) GetName

func (a *Artifact) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Artifact) GetSize

func (a *Artifact) GetSize() int64

GetSize returns the Size field if it's non-nil, zero value otherwise.

func (*Artifact) GetType

func (a *Artifact) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Artifact) GetUser

func (a *Artifact) GetUser() *User

GetUser returns the User field.

type ArtifactFileLinks struct {
	Self *Link `json:"self,omitempty"`
}

ArtifactFileLinks represents the "links" object in a Bitbucket artifact.

func (*ArtifactFileLinks) GetSelf

func (a *ArtifactFileLinks) GetSelf() *Link

GetSelf returns the Self field.

type Artifacts

type Artifacts struct {
	PaginationInfo

	Values []*Artifact `json:"values,omitempty"`
}

Artifacts represents a collection of artifacts (or files).

func (*Artifacts) HasValues

func (a *Artifacts) HasValues() bool

HasValues checks if Artifacts has any Values.

type BMBranch

type BMBranch struct {
	Name          *string `json:"name,omitempty"`
	IsValid       *bool   `json:"is_valid,omitempty"`
	Branch        *Ref    `json:"branch,omitempty"`
	UseMainbranch *bool   `json:"use_mainbranch,omitempty"`
}

BMBranch represents the git branches you want the model to be applied to.

func (*BMBranch) GetBranch

func (b *BMBranch) GetBranch() *Ref

GetBranch returns the Branch field.

func (*BMBranch) GetIsValid

func (b *BMBranch) GetIsValid() bool

GetIsValid returns the IsValid field if it's non-nil, zero value otherwise.

func (*BMBranch) GetName

func (b *BMBranch) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*BMBranch) GetUseMainbranch

func (b *BMBranch) GetUseMainbranch() bool

GetUseMainbranch returns the UseMainbranch field if it's non-nil, zero value otherwise.

type BMBranchType

type BMBranchType struct {
	Kind    *string `json:"kind,omitempty"`
	Enabled *bool   `json:"enabled,omitempty"`
	Prefix  *string `json:"prefix,omitempty"`
}

BMBranchType represents the branch prefix configurations for new branches.

func (*BMBranchType) GetEnabled

func (b *BMBranchType) GetEnabled() bool

GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.

func (*BMBranchType) GetKind

func (b *BMBranchType) GetKind() string

GetKind returns the Kind field if it's non-nil, zero value otherwise.

func (*BMBranchType) GetPrefix

func (b *BMBranchType) GetPrefix() string

GetPrefix returns the Prefix field if it's non-nil, zero value otherwise.

type BMBranchUpdateOpts

type BMBranchUpdateOpts struct {
	UseMainbranch *bool   `json:"use_mainbranch,omitempty"`
	Enabled       *bool   `json:"enabled,omitempty"`
	Name          *string `json:"name,omitempty"`
}

BMBranchUpdateOpts represents the fields available when updating the development/production branches.

Tips: If development/production branch are not using `master` and you wish to switch to it, you will need to set `Name` field to an empty string along with `UseMainbranch: true`.

func (*BMBranchUpdateOpts) GetEnabled

func (b *BMBranchUpdateOpts) GetEnabled() bool

GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.

func (*BMBranchUpdateOpts) GetName

func (b *BMBranchUpdateOpts) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*BMBranchUpdateOpts) GetUseMainbranch

func (b *BMBranchUpdateOpts) GetUseMainbranch() bool

GetUseMainbranch returns the UseMainbranch field if it's non-nil, zero value otherwise.

type BMLinks struct {
	Self *Link `json:"self,omitempty"`
}

BMLinks represents the "links" object in a Bitbucket branching model.

func (*BMLinks) GetSelf

func (b *BMLinks) GetSelf() *Link

GetSelf returns the Self field.

type BMRequest

type BMRequest struct {
	Development *BMBranchUpdateOpts `json:"development,omitempty"`
	Production  *BMBranchUpdateOpts `json:"production,omitempty"`
	BranchTypes []*BMBranchType     `json:"branch_types,omitempty"`
}

BMRequest represents a request to update an existing branching model.

func (*BMRequest) GetDevelopment

func (b *BMRequest) GetDevelopment() *BMBranchUpdateOpts

GetDevelopment returns the Development field.

func (*BMRequest) GetProduction

func (b *BMRequest) GetProduction() *BMBranchUpdateOpts

GetProduction returns the Production field.

func (*BMRequest) HasBranchTypes

func (b *BMRequest) HasBranchTypes() bool

HasBranchTypes checks if BMRequest has any BranchTypes.

type BRLinks struct {
	Self *Link `json:"self,omitempty"`
}

BRLinks represents the "links" object in a Bitbucket branch restriction.

func (*BRLinks) GetSelf

func (b *BRLinks) GetSelf() *Link

GetSelf returns the Self field.

type BRRequest

type BRRequest struct {
	Kind            *string `json:"kind,omitempty"`
	BranchMatchKind *string `json:"branch_match_kind,omitempty"`
	BranchType      *string `json:"branch_type,omitempty"`
	Pattern         *string `json:"pattern,omitempty"`
}

BRRequest represents a request to create/update a branch restriction.

func (*BRRequest) GetBranchMatchKind

func (b *BRRequest) GetBranchMatchKind() string

GetBranchMatchKind returns the BranchMatchKind field if it's non-nil, zero value otherwise.

func (*BRRequest) GetBranchType

func (b *BRRequest) GetBranchType() string

GetBranchType returns the BranchType field if it's non-nil, zero value otherwise.

func (*BRRequest) GetKind

func (b *BRRequest) GetKind() string

GetKind returns the Kind field if it's non-nil, zero value otherwise.

func (*BRRequest) GetPattern

func (b *BRRequest) GetPattern() string

GetPattern returns the Pattern field if it's non-nil, zero value otherwise.

type Branch

type Branch struct {
	Name *string `json:"name,omitempty"`
}

Branch represents a branch.

func (*Branch) GetName

func (b *Branch) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

type BranchRestriction

type BranchRestriction struct {
	ID              *int64   `json:"id,omitempty"`
	Kind            *string  `json:"kind,omitempty"`
	Users           []*User  `json:"users,omitempty"`
	Pattern         *string  `json:"pattern,omitempty"`
	Value           *int64   `json:"value,omitempty"`
	BranchMatchKind *string  `json:"branch_match_kind,omitempty"`
	Type            *string  `json:"type,omitempty"`
	Links           *BRLinks `json:"links,omitempty"`
}

BranchRestriction represents a Bitbucket repository branch restriction.

func (*BranchRestriction) GetBranchMatchKind

func (b *BranchRestriction) GetBranchMatchKind() string

GetBranchMatchKind returns the BranchMatchKind field if it's non-nil, zero value otherwise.

func (*BranchRestriction) GetID

func (b *BranchRestriction) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*BranchRestriction) GetKind

func (b *BranchRestriction) GetKind() string

GetKind returns the Kind field if it's non-nil, zero value otherwise.

func (b *BranchRestriction) GetLinks() *BRLinks

GetLinks returns the Links field.

func (*BranchRestriction) GetPattern

func (b *BranchRestriction) GetPattern() string

GetPattern returns the Pattern field if it's non-nil, zero value otherwise.

func (*BranchRestriction) GetType

func (b *BranchRestriction) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*BranchRestriction) GetValue

func (b *BranchRestriction) GetValue() int64

GetValue returns the Value field if it's non-nil, zero value otherwise.

func (*BranchRestriction) HasUsers

func (b *BranchRestriction) HasUsers() bool

HasUsers checks if BranchRestriction has any Users.

type BranchRestrictionListOpts

type BranchRestrictionListOpts struct {
	// Branch restrictions of this type
	Kind string `url:"kind,omitempty"`

	// Branch restrictions applied to branches of this pattern
	Pattern string `url:"pattern,omitempty"`
}

BranchRestrictionListOpts represents the query parameters available to listing all branch restrictions.

type BranchRestrictions

type BranchRestrictions struct {
	PaginationInfo

	Values []*BranchRestriction `json:"values,omitempty"`
}

BranchRestrictions represent a collection of branch restrictions.

func (*BranchRestrictions) HasValues

func (b *BranchRestrictions) HasValues() bool

HasValues checks if BranchRestrictions has any Values.

type BranchRestrictionsService

type BranchRestrictionsService service

BranchRestrictionsService handles communication with the branch restrictions related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions

func (*BranchRestrictionsService) Create

func (br *BranchRestrictionsService) Create(owner, repoSlug string, bo *BRRequest) (*BranchRestriction, *simpleresty.Response, error)

Create creates a new branch restriction rule for a repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions#post

func (*BranchRestrictionsService) Delete

func (br *BranchRestrictionsService) Delete(owner, repoSlug string, brID int64) (*simpleresty.Response, error)

Delete an existing branch restriction rule.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions/%7Bid%7D#delete

func (*BranchRestrictionsService) Get

func (br *BranchRestrictionsService) Get(owner, repoSlug, id string, opts ...interface{}) (*BranchRestriction, *simpleresty.Response, error)

Get Returns a specific branch restriction.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions/%7Bid%7D#get

func (*BranchRestrictionsService) List

func (br *BranchRestrictionsService) List(owner, repoSlug string, opts ...interface{}) (*BranchRestrictions, *simpleresty.Response, error)

List returns a paginated list of all branch restrictions on the repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions#get

func (*BranchRestrictionsService) Update

func (br *BranchRestrictionsService) Update(owner, repoSlug string, brID int64, bo *BRRequest) (*BranchRestriction, *simpleresty.Response, error)

Update updates an existing branch restriction rule.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions/%7Bid%7D#put

type BranchingModel

type BranchingModel struct {
	Development *BMBranch       `json:"development,omitempty"`
	BranchTypes []*BMBranchType `json:"values,omitempty"`
	Production  *BMBranch       `json:"production,omitempty"`
	Type        *string         `json:"type,omitempty"`
	Links       *BMLinks        `json:"links,omitempty"`
}

BranchingModel represents the brancing model for a repository.

func (*BranchingModel) GetDevelopment

func (b *BranchingModel) GetDevelopment() *BMBranch

GetDevelopment returns the Development field.

func (b *BranchingModel) GetLinks() *BMLinks

GetLinks returns the Links field.

func (*BranchingModel) GetProduction

func (b *BranchingModel) GetProduction() *BMBranch

GetProduction returns the Production field.

func (*BranchingModel) GetType

func (b *BranchingModel) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*BranchingModel) HasBranchTypes

func (b *BranchingModel) HasBranchTypes() bool

HasBranchTypes checks if BranchingModel has any BranchTypes.

type BranchingModelService

type BranchingModelService service

BranchingModelService handles communication with the branching model related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branching-model

func (*BranchingModelService) Get

func (bm *BranchingModelService) Get(owner, repoSlug string, opts ...interface{}) (*BranchingModel, *simpleresty.Response, error)

Get returns the branching model as applied to the repository. This view is read-only.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branching-model

func (*BranchingModelService) GetRaw

func (bm *BranchingModelService) GetRaw(owner, repoSlug string, opts ...interface{}) (*BranchingModel, *simpleresty.Response, error)

GetRaw returns the branching model's raw configuration for a repository.

A client wishing to see the branching model with its actual current branches should use the 'Get' function above.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branching-model/settings#get

func (*BranchingModelService) Update

func (bm *BranchingModelService) Update(owner, repoSlug string, bo *BMRequest) (*BranchingModel, *simpleresty.Response, error)

Update update the branching model configuration for a repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branching-model/settings#put

type CCLinks struct {
	Self *Link `json:"self,omitempty"`
	HTML *Link `json:"html,omitempty"`
}

CCLinks represents the "links" object in a Bitbucket commit comment.

func (*CCLinks) GetHTML

func (c *CCLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*CCLinks) GetSelf

func (c *CCLinks) GetSelf() *Link

GetSelf returns the Self field.

type CSLinks struct {
	Self *Link `json:"self,omitempty"`
	HTML *Link `json:"html,omitempty"`
}

CSLinks represents the "links" object in a Bitbucket commit status.

func (*CSLinks) GetHTML

func (c *CSLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*CSLinks) GetSelf

func (c *CSLinks) GetSelf() *Link

GetSelf returns the Self field.

type Client

type Client struct {

	// Services used for talking to different parts of the Bitbucket API.
	BranchRestrictions *BranchRestrictionsService
	Commit             *CommitService
	Commits            *CommitsService
	Components         *ComponentsService
	DefaultReviewers   *DefaultReviewersService
	DeployKeys         *DeployKeysService
	Diff               *DiffService
	Downloads          *DownloadsService
	FileHistory        *FileHistoryService
	Forks              *ForksService
	HookEvents         *HookEventsService
	Issues             *IssuesService
	Milestones         *MilestonesService
	Patch              *PatchService
	PullRequests       *PullRequestsService
	Refs               *RefsService
	Repositories       *RepositoriesService
	SRC                *SRCService
	Teams              *TeamsService
	User               *UserService
	Users              *UsersService
	Versions           *VersionsService
	Watchers           *WatchersService

	Pagelen uint64
	// contains filtered or unexported fields
}

A Client manages communication with the Bitbucket API.

func New added in v0.2.0

func New(username, appPassword string, opts ...Option) (*Client, error)

New creates a new client using username and an app password, essentially basic authentication.

type CodeFile

type CodeFile struct {
	Path  *string              `json:"path,omitempty"`
	Type  *string              `json:"type,omitempty"`
	Links *SearchCodeFileLinks `json:"links,omitempty"`
}

CodeFile represents the information regarding the file that matched a search query.

func (c *CodeFile) GetLinks() *SearchCodeFileLinks

GetLinks returns the Links field.

func (*CodeFile) GetPath

func (c *CodeFile) GetPath() string

GetPath returns the Path field if it's non-nil, zero value otherwise.

func (*CodeFile) GetType

func (c *CodeFile) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type CodeSearchQueryParams

type CodeSearchQueryParams struct {
	// The search query
	SearchQuery string `url:"search_query,omitempty"`
}

CodeSearchQueryParams represents the query parameters available when searching for code.

type Comment

type Comment struct {
	Links     *CommentLinks `json:"links,omitempty"`
	Content   *Content      `json:"content,omitempty"`
	CreatedOn *time.Time    `json:"created_on,omitempty"`
	User      *User         `json:"user,omitempty"`
	UpdatedOn *time.Time    `json:"updated_on,omitempty"`
	Type      *string       `json:"type,omitempty"`
	ID        *int64        `json:"id,omitempty"`
}

Comment represents a generic comment on a Bitbucket pull request or issue.

func (*Comment) GetContent

func (c *Comment) GetContent() *Content

GetContent returns the Content field.

func (*Comment) GetCreatedOn

func (c *Comment) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*Comment) GetID

func (c *Comment) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (c *Comment) GetLinks() *CommentLinks

GetLinks returns the Links field.

func (*Comment) GetType

func (c *Comment) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Comment) GetUpdatedOn

func (c *Comment) GetUpdatedOn() time.Time

GetUpdatedOn returns the UpdatedOn field if it's non-nil, zero value otherwise.

func (*Comment) GetUser

func (c *Comment) GetUser() *User

GetUser returns the User field.

type CommentLinks struct {
	Self *Link `json:"self,omitempty"`
	HTML *Link `json:"html,omitempty"`
}

CommentLinks represents the "links" object in a Bitbucket comment.

func (*CommentLinks) GetHTML

func (c *CommentLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*CommentLinks) GetSelf

func (c *CommentLinks) GetSelf() *Link

GetSelf returns the Self field.

type Commit

type Commit struct {
	Rendered     *CommitMessageContent `json:"rendered,omitempty"`
	Hash         *string               `json:"hash,omitempty"`
	Repository   *Repository           `json:"repository,omitempty"`
	Links        *CommitLinks          `json:"links,omitempty"`
	Author       *User                 `json:"author,omitempty"`
	Summary      *Content              `json:"summary,omitempty"`
	Participants []*Participant        `json:"participants,omitempty"`
	Parents      []*Commit             `json:"parents,omitempty"`
	Date         *time.Time            `json:"date,omitempty"`
	Message      *string               `json:"message,omitempty"`
	Type         *string               `json:"type,omitempty"`
}

Commit represents a git commit in a Bitbucket repository.

func (*Commit) GetAuthor

func (c *Commit) GetAuthor() *User

GetAuthor returns the Author field.

func (*Commit) GetDate

func (c *Commit) GetDate() time.Time

GetDate returns the Date field if it's non-nil, zero value otherwise.

func (*Commit) GetHash

func (c *Commit) GetHash() string

GetHash returns the Hash field if it's non-nil, zero value otherwise.

func (c *Commit) GetLinks() *CommitLinks

GetLinks returns the Links field.

func (*Commit) GetMessage

func (c *Commit) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*Commit) GetRendered

func (c *Commit) GetRendered() *CommitMessageContent

GetRendered returns the Rendered field.

func (*Commit) GetRepository

func (c *Commit) GetRepository() *Repository

GetRepository returns the Repository field.

func (*Commit) GetSummary

func (c *Commit) GetSummary() *Content

GetSummary returns the Summary field.

func (*Commit) GetType

func (c *Commit) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Commit) HasParents

func (c *Commit) HasParents() bool

HasParents checks if Commit has any Parents.

func (*Commit) HasParticipants

func (c *Commit) HasParticipants() bool

HasParticipants checks if Commit has any Participants.

type CommitComment

type CommitComment struct {
	ID        *int64         `json:"id,omitempty"`
	Links     *CCLinks       `json:"links,omitempty"`
	Deleted   *bool          `json:"deleted,omitempty"`
	Content   *Content       `json:"content,omitempty"`
	CreatedOn *time.Time     `json:"created_on,omitempty"`
	User      *User          `json:"user,omitempty"`
	Commit    *Commit        `json:"commit,omitempty"`
	UpdatedOn *time.Time     `json:"updated_on,omitempty"`
	Type      *string        `json:"type,omitempty"`
	Parent    *CommitComment `json:"parent,omitempty"`
}

CommitComment represents a commit comment.

func (*CommitComment) GetCommit

func (c *CommitComment) GetCommit() *Commit

GetCommit returns the Commit field.

func (*CommitComment) GetContent

func (c *CommitComment) GetContent() *Content

GetContent returns the Content field.

func (*CommitComment) GetCreatedOn

func (c *CommitComment) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*CommitComment) GetDeleted

func (c *CommitComment) GetDeleted() bool

GetDeleted returns the Deleted field if it's non-nil, zero value otherwise.

func (*CommitComment) GetID

func (c *CommitComment) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (c *CommitComment) GetLinks() *CCLinks

GetLinks returns the Links field.

func (*CommitComment) GetParent

func (c *CommitComment) GetParent() *CommitComment

GetParent returns the Parent field.

func (*CommitComment) GetType

func (c *CommitComment) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*CommitComment) GetUpdatedOn

func (c *CommitComment) GetUpdatedOn() time.Time

GetUpdatedOn returns the UpdatedOn field if it's non-nil, zero value otherwise.

func (*CommitComment) GetUser

func (c *CommitComment) GetUser() *User

GetUser returns the User field.

type CommitCommentRequest

type CommitCommentRequest struct {
	Content       *Content       `json:"content,omitempty"`
	ParentComment *CommitComment `json:"parent,omitempty"`
}

CommitCommentRequest represents a new commit comment.

func (*CommitCommentRequest) GetContent

func (c *CommitCommentRequest) GetContent() *Content

GetContent returns the Content field.

func (*CommitCommentRequest) GetParentComment

func (c *CommitCommentRequest) GetParentComment() *CommitComment

GetParentComment returns the ParentComment field.

type CommitComments

type CommitComments struct {
	PaginationInfo

	Values []*CommitComment `json:"values,omitempty"`
}

CommitComments represent a collection of a commit's comments.

func (*CommitComments) HasValues

func (c *CommitComments) HasValues() bool

HasValues checks if CommitComments has any Values.

type CommitLinks struct {
	Self     *Link `json:"self,omitempty"`
	Comment  *Link `json:"comment,omitempty"`
	HTML     *Link `json:"html,omitempty"`
	Diff     *Link `json:"diff,omitempty"`
	Approve  *Link `json:"approve,omitempty"`
	Statuses *Link `json:"statuses,omitempty"`
}

CommitLinks represents the "links" object in a Bitbucket commit.

func (*CommitLinks) GetApprove

func (c *CommitLinks) GetApprove() *Link

GetApprove returns the Approve field.

func (*CommitLinks) GetComment

func (c *CommitLinks) GetComment() *Link

GetComment returns the Comment field.

func (*CommitLinks) GetDiff

func (c *CommitLinks) GetDiff() *Link

GetDiff returns the Diff field.

func (*CommitLinks) GetHTML

func (c *CommitLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*CommitLinks) GetSelf

func (c *CommitLinks) GetSelf() *Link

GetSelf returns the Self field.

func (*CommitLinks) GetStatuses

func (c *CommitLinks) GetStatuses() *Link

GetStatuses returns the Statuses field.

type CommitMessageContent

type CommitMessageContent struct {
	Message *Content `json:"message,omitempty"`
}

CommitMessageContent represents the commit's message.

func (*CommitMessageContent) GetMessage

func (c *CommitMessageContent) GetMessage() *Content

GetMessage returns the Message field.

type CommitService

type CommitService service

CommitService handles communication with the commit related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit

func (*CommitService) Approve

func (c *CommitService) Approve(owner, repoSlug, sha string) (*Participant, *simpleresty.Response, error)

Approve approves the specified commit as the authenticated user.

This operation is only available to users that have explicit access to the repository. In contrast, just the fact that a repository is publicly accessible to users does not give them the ability to approve commits.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/approve#post

func (*CommitService) CreateComment

func (c *CommitService) CreateComment(owner, repoSlug, sha string, co *CommitCommentRequest) (*CommitComment, *simpleresty.Response, error)

CreateComment creates new comment on the specified commit.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/comments#post

func (*CommitService) CreateStatus

func (c *CommitService) CreateStatus(owner, repoSlug, sha string, co *CommitStatusRequest) (*CommitStatus, *simpleresty.Response, error)

CreateStatus creates a new build status against the specified commit.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/statuses/build#post

func (*CommitService) Get

func (c *CommitService) Get(owner, repoSlug, sha string, opts ...interface{}) (*Commit, *simpleresty.Response, error)

Get return the specified commit.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D#get

func (*CommitService) GetComment

func (c *CommitService) GetComment(owner, repoSlug, sha string, cID int64, opts ...interface{}) (*CommitComment, *simpleresty.Response, error)

GetComment returns the specified commit comment.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/comments/%7Bcomment_id%7D#get

func (*CommitService) GetStatusByBuild

func (c *CommitService) GetStatusByBuild(owner, repoSlug, sha, key string, opts ...interface{}) (*CommitStatus, *simpleresty.Response, error)

GetStatusByBuild returns the specified build status for a commit.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/statuses/build/%7Bkey%7D#get

func (*CommitService) ListComments

func (c *CommitService) ListComments(owner, repoSlug, sha string, opts ...interface{}) (*CommitComments, *simpleresty.Response, error)

ListComments returns the commit's comments.

This includes both global and inline comments. The default sorting is oldest to newest and can be overridden with the sort query parameter.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/comments#get

func (*CommitService) ListStatuses

func (c *CommitService) ListStatuses(owner, repoSlug, sha string, opts ...interface{}) (*CommitStatuses, *simpleresty.Response, error)

ListStatuses returns all statuses (e.g. build results) for a specific commit.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/statuses#get

func (*CommitService) UnApprove

func (c *CommitService) UnApprove(owner, repoSlug, sha string) (*simpleresty.Response, error)

UnApprove redacts/removes the authenticated user's approval of the specified commit.

This operation is only available to users that have explicit access to the repository. In contrast, just the fact that a repository is publicly accessible to users does not give them the ability to approve commits.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/approve#delete

func (*CommitService) UpdateStatus

func (c *CommitService) UpdateStatus(owner, repoSlug, sha, key string, co *CommitStatusRequest) (*CommitStatus, *simpleresty.Response, error)

UpdateStatus update the current status of a build status object on the specific commit.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/statuses/build/%7Bkey%7D#put

type CommitStatus

type CommitStatus struct {
	Links       *CSLinks   `json:"links,omitempty"`
	UUID        *string    `json:"uuid,omitempty"`
	Key         *string    `json:"key,omitempty"`
	Refname     *string    `json:"refname,omitempty"`
	URL         *string    `json:"url,omitempty"`
	State       *string    `json:"state,omitempty"`
	Name        *string    `json:"name,omitempty"`
	Description *string    `json:"description,omitempty"`
	CreatedOn   *time.Time `json:"created_on,omitempty"`
	UpdatedOn   *time.Time `json:"updated_on,omitempty"`
}

CommitStatus represents a commit status.

func (*CommitStatus) GetCreatedOn

func (c *CommitStatus) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*CommitStatus) GetDescription

func (c *CommitStatus) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*CommitStatus) GetKey

func (c *CommitStatus) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (c *CommitStatus) GetLinks() *CSLinks

GetLinks returns the Links field.

func (*CommitStatus) GetName

func (c *CommitStatus) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CommitStatus) GetRefname

func (c *CommitStatus) GetRefname() string

GetRefname returns the Refname field if it's non-nil, zero value otherwise.

func (*CommitStatus) GetState

func (c *CommitStatus) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*CommitStatus) GetURL

func (c *CommitStatus) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*CommitStatus) GetUUID

func (c *CommitStatus) GetUUID() string

GetUUID returns the UUID field if it's non-nil, zero value otherwise.

func (*CommitStatus) GetUpdatedOn

func (c *CommitStatus) GetUpdatedOn() time.Time

GetUpdatedOn returns the UpdatedOn field if it's non-nil, zero value otherwise.

type CommitStatusRequest

type CommitStatusRequest struct {
	URL         *string `json:"url,omitempty"`
	State       *string `json:"state,omitempty"`
	Key         *string `json:"key,omitempty"`
	Refname     *string `json:"refname,omitempty"`
	Description *string `json:"description,omitempty"`
	Name        *string `json:"name,omitempty"`
}

CommitStatusRequest represents a new commit status.

func (*CommitStatusRequest) GetDescription

func (c *CommitStatusRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*CommitStatusRequest) GetKey

func (c *CommitStatusRequest) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*CommitStatusRequest) GetName

func (c *CommitStatusRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CommitStatusRequest) GetRefname

func (c *CommitStatusRequest) GetRefname() string

GetRefname returns the Refname field if it's non-nil, zero value otherwise.

func (*CommitStatusRequest) GetState

func (c *CommitStatusRequest) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*CommitStatusRequest) GetURL

func (c *CommitStatusRequest) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type CommitStatuses

type CommitStatuses struct {
	PaginationInfo

	Values []*CommitStatus `json:"values,omitempty"`
}

CommitStatuses represent a collection of a commit's statuses.

func (*CommitStatuses) HasValues

func (c *CommitStatuses) HasValues() bool

HasValues checks if CommitStatuses has any Values.

type Commits

type Commits struct {
	PaginationInfo

	Values []*Commit `json:"values,omitempty"`
}

Commits represent a collection of commits.

func (*Commits) HasValues

func (c *Commits) HasValues() bool

HasValues checks if Commits has any Values.

type CommitsService

type CommitsService service

CommitsService handles communication with the commits related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commits

func (*CommitsService) GetRevision

func (c *CommitsService) GetRevision(owner, repoSlug, revision string, opts ...interface{}) (*Commits, *simpleresty.Response, error)

GetRevision returns a commit revision. The results can return a collection of commits. Does not support any query parameters.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commits/%7Brevision%7D#get

func (*CommitsService) List

func (c *CommitsService) List(owner, repoSlug string, opts ...interface{}) (*Commits, *simpleresty.Response, error)

List all commits for a given repository.

Supports filtering by passing in a non-URI encoded query string. Refer to the API docs below.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commits#get

func (*CommitsService) ListSafe

func (c *CommitsService) ListSafe(owner, repoSlug string, opts ...interface{}) (*Commits, *simpleresty.Response, error)

ListSafe returns a commit revision.

NOTE: Identical to GET /repositories/{username}/{repo_slug}/commits, except that POST allows clients to place the include and exclude parameters in the request body to avoid URL length issues.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commits/%7Brevision%7D#post

type Component

type Component struct {
	ID         *int64          `json:"-"` // This field is not present in the API response.
	Repository *Repository     `json:"repository,omitempty"`
	Type       *string         `json:"type,omitempty"`
	Name       *string         `json:"name,omitempty"`
	Links      *ComponentLinks `json:"links,omitempty"`
}

Component represents a Bitbucket repository component.

func (*Component) GetID

func (c *Component) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (c *Component) GetLinks() *ComponentLinks

GetLinks returns the Links field.

func (*Component) GetName

func (c *Component) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Component) GetRepository

func (c *Component) GetRepository() *Repository

GetRepository returns the Repository field.

func (*Component) GetType

func (c *Component) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type ComponentLinks struct {
	Self *Link `json:"self,omitempty"`
}

ComponentLinks represents the "links" object in a Bitbucket component.

func (*ComponentLinks) GetSelf

func (c *ComponentLinks) GetSelf() *Link

GetSelf returns the Self field.

type ComponentRequest

type ComponentRequest struct {
	Name *string `json:"name,omitempty"`
}

ComponentRequest represents an existing component to be added to an issue or pull request. There is no CREATE or UPDATE endpoint for the component resource.

func (*ComponentRequest) GetName

func (c *ComponentRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

type Components

type Components struct {
	PaginationInfo

	Values []*Component `json:"values,omitempty"`
}

Components represent a collection of components.

func (*Components) HasValues

func (c *Components) HasValues() bool

HasValues checks if Components has any Values.

type ComponentsService

type ComponentsService service

ComponentsService handles communication with the user related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/components

func (*ComponentsService) Get

func (c *ComponentsService) Get(owner, repoSlug string, componentID int64, opts ...interface{}) (*Component, *simpleresty.Response, error)

Get a single component. NOTE: The component ID is a numerical value, not the component name, that is visible in the links.self.href object.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/components/%7Bcomponent_id%7D#get

func (*ComponentsService) List

func (c *ComponentsService) List(owner, repoSlug string, opts ...interface{}) (*Components, *simpleresty.Response, error)

List all components that have been defined in the issue tracker.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/components#get

type Content

type Content struct {
	Raw    *string `json:"raw,omitempty"`
	Markup *string `json:"markup,omitempty"`
	HTML   *string `json:"html,omitempty"`
	Type   *string `json:"type,omitempty"`
}

Content represents content found in a Bitbucket resource.

func (*Content) GetHTML

func (c *Content) GetHTML() string

GetHTML returns the HTML field if it's non-nil, zero value otherwise.

func (*Content) GetMarkup

func (c *Content) GetMarkup() string

GetMarkup returns the Markup field if it's non-nil, zero value otherwise.

func (*Content) GetRaw

func (c *Content) GetRaw() string

GetRaw returns the Raw field if it's non-nil, zero value otherwise.

func (*Content) GetType

func (c *Content) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type DefaultReviewersService

type DefaultReviewersService service

DefaultReviewersService handles communication with the default reviewers related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/default-reviewers

func (*DefaultReviewersService) Add

func (dr *DefaultReviewersService) Add(owner, repoSlug, userID string) (*User, *simpleresty.Response, error)

Add adds the specified user to the repository's list of default reviewers. This method is idempotent. Adding a user a second time has no effect.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/default-reviewers/%7Btarget_username%7D#put

func (*DefaultReviewersService) Get

func (dr *DefaultReviewersService) Get(owner, repoSlug, userID string, opts ...interface{}) (*User, *simpleresty.Response, error)

Get returns the specified reviewer.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

This can be used to test whether a user is among the repository's default reviewers list. A 404 indicates that that specified user is not a default reviewer.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/default-reviewers/%7Btarget_username%7D#get

func (*DefaultReviewersService) List

func (dr *DefaultReviewersService) List(owner, repoSlug string, opts ...interface{}) (*Users, *simpleresty.Response, error)

List returns the repository's default reviewers.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/default-reviewers#get

func (*DefaultReviewersService) Remove

func (dr *DefaultReviewersService) Remove(owner, repoSlug, userID string) (*simpleresty.Response, error)

Remove removes a default reviewer from the repository. This method is idempotent. Removing a user a second time has no effect.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/default-reviewers/%7Btarget_username%7D#delete

type DeployKey

type DeployKey struct {
	ID         *int64          `json:"id,omitempty"`
	Key        *string         `json:"key,omitempty"`
	Label      *string         `json:"label,omitempty"`
	Type       *string         `json:"type,omitempty"`
	CreatedOn  *time.Time      `json:"created_on,omitempty"`
	Repository *Repository     `json:"repository,omitempty"`
	Links      *DeployKeyLinks `json:"links,omitempty"`
	LastUsed   *time.Time      `json:"last_used,omitempty"`
	Comment    *string         `json:"comment,omitempty"`
	AddedOn    *time.Time      `json:"added_on,omitempty"`
}

DeployKey represents a deploy key aka access key on a repository.

func (*DeployKey) GetAddedOn

func (d *DeployKey) GetAddedOn() time.Time

GetAddedOn returns the AddedOn field if it's non-nil, zero value otherwise.

func (*DeployKey) GetComment

func (d *DeployKey) GetComment() string

GetComment returns the Comment field if it's non-nil, zero value otherwise.

func (*DeployKey) GetCreatedOn

func (d *DeployKey) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*DeployKey) GetID

func (d *DeployKey) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*DeployKey) GetKey

func (d *DeployKey) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*DeployKey) GetLabel

func (d *DeployKey) GetLabel() string

GetLabel returns the Label field if it's non-nil, zero value otherwise.

func (*DeployKey) GetLastUsed

func (d *DeployKey) GetLastUsed() time.Time

GetLastUsed returns the LastUsed field if it's non-nil, zero value otherwise.

func (d *DeployKey) GetLinks() *DeployKeyLinks

GetLinks returns the Links field.

func (*DeployKey) GetRepository

func (d *DeployKey) GetRepository() *Repository

GetRepository returns the Repository field.

func (*DeployKey) GetType

func (d *DeployKey) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type DeployKeyLinks struct {
	Self *Link `json:"self,omitempty"`
}

DeployKeyLinks represents the "links" object in a Bitbucket deploy key.

func (*DeployKeyLinks) GetSelf

func (d *DeployKeyLinks) GetSelf() *Link

GetSelf returns the Self field.

type DeployKeyRequest

type DeployKeyRequest struct {
	Key   *string `json:"key,omitempty"`
	Label *string `json:"label,omitempty"`
}

DeployKeyRequest represents a request to create/update a deploy/access key.

func (*DeployKeyRequest) GetKey

func (d *DeployKeyRequest) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*DeployKeyRequest) GetLabel

func (d *DeployKeyRequest) GetLabel() string

GetLabel returns the Label field if it's non-nil, zero value otherwise.

type DeployKeys

type DeployKeys struct {
	PaginationInfo

	Values []*DeployKey `json:"values,omitempty"`
}

DeployKeys represents a collection of deploy keys.

func (*DeployKeys) HasValues

func (d *DeployKeys) HasValues() bool

HasValues checks if DeployKeys has any Values.

type DeployKeysService

type DeployKeysService service

DeployKeysService handles communication with the deploy keys related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/deploy-keys

func (*DeployKeysService) Add

func (dk *DeployKeysService) Add(owner, repoSlug string, do *DeployKeyRequest) (*DeployKey, *simpleresty.Response, error)

Add creates a new deploy key in a repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/deploy-keys#post

func (*DeployKeysService) Get

func (dk *DeployKeysService) Get(owner, repoSlug string, keyID int64, opts ...interface{}) (*DeployKey, *simpleresty.Response, error)

Get returns the deploy key belonging to a specific key.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/deploy-keys/%7Bkey_id%7D#get

func (*DeployKeysService) List

func (dk *DeployKeysService) List(owner, repoSlug string, opts ...interface{}) (*DeployKeys, *simpleresty.Response, error)

List returns all deploy-keys belonging to a repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/deploy-keys#get

func (*DeployKeysService) Remove

func (dk *DeployKeysService) Remove(owner, repoSlug string, keyID int64) (*simpleresty.Response, error)

Remove deletes a deploy key from a repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/deploy-keys/%7Bkey_id%7D#delete

func (*DeployKeysService) Update

func (dk *DeployKeysService) Update(owner, repoSlug string, keyID int64, do *DeployKeyRequest) (*DeployKey, *simpleresty.Response, error)

Update modifies an existing key's label and/or comment. The same key needs to be passed in but the comment and label can change.

For security reasons, you can't modify the contents of an access key. To update, delete and re-add the key.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/deploy-keys/%7Bkey_id%7D#put

type Diff

type Diff struct {
	Status       *string   `json:"state,omitempty"`
	Old          *CodeFile `json:"old,omitempty"`
	New          *CodeFile `json:"new,omitempty"`
	LinesRemoved *int64    `json:"lines_removed,omitempty"`
	LinesAdded   *int64    `json:"lines_added,omitempty"`
	Type         *string   `json:"type,omitempty"`
}

Diff represents a code diff on Bitbucket.

func (*Diff) GetLinesAdded

func (d *Diff) GetLinesAdded() int64

GetLinesAdded returns the LinesAdded field if it's non-nil, zero value otherwise.

func (*Diff) GetLinesRemoved

func (d *Diff) GetLinesRemoved() int64

GetLinesRemoved returns the LinesRemoved field if it's non-nil, zero value otherwise.

func (*Diff) GetNew

func (d *Diff) GetNew() *CodeFile

GetNew returns the New field.

func (*Diff) GetOld

func (d *Diff) GetOld() *CodeFile

GetOld returns the Old field.

func (*Diff) GetStatus

func (d *Diff) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*Diff) GetType

func (d *Diff) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type DiffGetOpts

type DiffGetOpts struct {
	Context          *int    `url:"context,omitempty"`
	Path             *string `url:"path,omitempty"`
	IgnoreWhitespace *string `url:"ignore_whitespace,omitempty"`
	Binary           *string `url:"binary,omitempty"`
}

DiffGetOpts represents the query parameters available when getting the raw of a diff.

func (*DiffGetOpts) GetBinary

func (d *DiffGetOpts) GetBinary() string

GetBinary returns the Binary field if it's non-nil, zero value otherwise.

func (*DiffGetOpts) GetContext

func (d *DiffGetOpts) GetContext() int

GetContext returns the Context field if it's non-nil, zero value otherwise.

func (*DiffGetOpts) GetIgnoreWhitespace

func (d *DiffGetOpts) GetIgnoreWhitespace() string

GetIgnoreWhitespace returns the IgnoreWhitespace field if it's non-nil, zero value otherwise.

func (*DiffGetOpts) GetPath

func (d *DiffGetOpts) GetPath() string

GetPath returns the Path field if it's non-nil, zero value otherwise.

type DiffService

type DiffService service

DiffService handles communication with the diff related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/diff

func (*DiffService) Get

func (d *DiffService) Get(owner, repoSlug, spec string, opts ...interface{}) (*Diffs, *simpleresty.Response, error)

Get returns the diff stat for the specified commit.

Diff stat responses contain a record for every path modified by the commit and lists the number of lines added and removed for each file.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/diffstat/%7Bspec%7D#get

func (*DiffService) GetRaw

func (d *DiffService) GetRaw(owner, repoSlug, spec string) (*bytes.Buffer, *simpleresty.Response, error)

GetRaw produces a raw, git-style diff for either a single commit (diffed against its first parent), or a revspec of 2 commits (e.g. 3a8b42..9ff173 where the first commit represents the source and the second commit the destination).

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/diff/%7Bspec%7D#get

type Diffs

type Diffs struct {
	PaginationInfo

	Values []*Diff `json:"values,omitempty"`
}

Diffs represents a collection of diffs.

func (*Diffs) HasValues

func (d *Diffs) HasValues() bool

HasValues checks if Diffs has any Values.

type DownloadsService

type DownloadsService service

DownloadsService handles communication with the downloads related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/downloads

func (*DownloadsService) Delete

func (d *DownloadsService) Delete(owner, repoSlug, fileName string) (*simpleresty.Response, error)

Delete the specified download artifact from the repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/downloads/%7Bfilename%7D#delete

func (*DownloadsService) List

func (d *DownloadsService) List(owner, repoSlug string, opts ...interface{}) (*Artifacts, *simpleresty.Response, error)

List returns a list of download links associated with the repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/downloads#get

type FileHistory

type FileHistory struct {
	PaginationInfo

	Values []*SRCMetadata `json:"values,omitempty"`
}

FileHistory represents the history of a file.

func (*FileHistory) HasValues

func (f *FileHistory) HasValues() bool

HasValues checks if FileHistory has any Values.

type FileHistoryLinks struct {
	Self    *Link `json:"self,omitempty"`
	Meta    *Link `json:"meta,omitempty"`
	History *Link `json:"history,omitempty"`
}

FileHistoryLinks represents the "links" object in a Bitbucket file history.

func (*FileHistoryLinks) GetHistory

func (f *FileHistoryLinks) GetHistory() *Link

GetHistory returns the History field.

func (*FileHistoryLinks) GetMeta

func (f *FileHistoryLinks) GetMeta() *Link

GetMeta returns the Meta field.

func (*FileHistoryLinks) GetSelf

func (f *FileHistoryLinks) GetSelf() *Link

GetSelf returns the Self field.

type FileHistoryListOpts

type FileHistoryListOpts struct {
	// When true, Bitbucket will follow the history of the file across renames (this is the default behavior).
	// This can be turned off by specifying false.
	Renames bool `url:"renames,omitempty"`
}

FileHistoryListOpts represents the unique query parameters for file history.

type FileHistoryService

type FileHistoryService service

FileHistoryService handles communication with the file history related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/filehistory

func (*FileHistoryService) Get

func (fh *FileHistoryService) Get(owner, repoSlug, nodeRev, path string, opts ...interface{}) (*FileHistory, *simpleresty.Response, error)

Get returns a paginated list of commits that modified the specified file. Commits are returned in reverse chronological order.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/filehistory/%7Bnode%7D/%7Bpath%7D#get

type FilterSortOpts

type FilterSortOpts struct {
	// Query is the raw non-URL encoded query string.
	// Note that the entire query string is put in the Query field.
	// This library will take care of URL encoding the string for you.
	Query string `url:"q,omitempty"`

	// In principle, every field that can be queried can also be used as a key for sorting.
	// By default the sort order is ascending. To reverse the order, prefix the field name with a hyphen (e.g. ?sort=-updated_on).
	// Only one field can be sorted on. Compound fields (e.g. sort on state first, followed by updated_on) are not supported.
	Sort string `url:"sort,omitempty"`
}

FilterSortOpts represents the querying and sorting mechanism available to certain Bitbucket API resources that return multiple results in a response.

Bitbucket API Docs: https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering#query-sort

type ForkRequest

type ForkRequest struct {
	SCM         *string               `json:"scm,omitempty"`
	Name        *string               `json:"name,omitempty"`
	MainBranch  *RepositoryMainBranch `json:"main_branch,omitempty"`
	IsPrivate   *bool                 `json:"is_private,omitempty"`
	Language    *string               `json:"language,omitempty"`
	ForkPolicy  *string               `json:"fork_policy,omitempty"`
	Description *string               `json:"description,omitempty"`
	HasWiki     *bool                 `json:"has_wiki,omitempty"`
	HasIssues   *string               `json:"has_issues,omitempty"`
	Parent      *Repository           `json:"parent,omitempty"`
	Owner       *User                 `json:"owner,omitempty"`
}

ForkRequest represents a request to a create a new fork.

func (*ForkRequest) GetDescription

func (f *ForkRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*ForkRequest) GetForkPolicy

func (f *ForkRequest) GetForkPolicy() string

GetForkPolicy returns the ForkPolicy field if it's non-nil, zero value otherwise.

func (*ForkRequest) GetHasIssues

func (f *ForkRequest) GetHasIssues() string

GetHasIssues returns the HasIssues field if it's non-nil, zero value otherwise.

func (*ForkRequest) GetHasWiki

func (f *ForkRequest) GetHasWiki() bool

GetHasWiki returns the HasWiki field if it's non-nil, zero value otherwise.

func (*ForkRequest) GetIsPrivate

func (f *ForkRequest) GetIsPrivate() bool

GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise.

func (*ForkRequest) GetLanguage

func (f *ForkRequest) GetLanguage() string

GetLanguage returns the Language field if it's non-nil, zero value otherwise.

func (*ForkRequest) GetMainBranch

func (f *ForkRequest) GetMainBranch() *RepositoryMainBranch

GetMainBranch returns the MainBranch field.

func (*ForkRequest) GetName

func (f *ForkRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*ForkRequest) GetOwner

func (f *ForkRequest) GetOwner() *User

GetOwner returns the Owner field.

func (*ForkRequest) GetParent

func (f *ForkRequest) GetParent() *Repository

GetParent returns the Parent field.

func (*ForkRequest) GetSCM

func (f *ForkRequest) GetSCM() string

GetSCM returns the SCM field if it's non-nil, zero value otherwise.

type ForksService

type ForksService service

ForksService handles communication with the issue related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/forks

func (*ForksService) Create

func (f *ForksService) Create(owner, repoSlug string, fo *ForkRequest) (*Repository, *simpleresty.Response, error)

Create creates a new fork of the specified repository.

By default, forks are created under the authenticated user's account with the same name and slug of the original repository.

The 'owner' & 'repoSlug' parameters represent the repository you want to fork into your account.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/forks#post

func (*ForksService) List

func (f *ForksService) List(owner, repoSlug string, opts ...interface{}) (*Repositories, *simpleresty.Response, error)

List returns a paginated list of all the forks of the specified repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/forks#get

type GenericOpts

type GenericOpts struct {
	ListOpts
	FilterSortOpts
	PartialRespOpts
}

GenericOpts represents all of the available generic query parameters Bitbucket has to offer.

Each query parameter may or may not work so your mileage may vary for certain resources. This struct is available out of convenience.

type HookEvent

type HookEvent struct {
	Category    *string `json:"category,omitempty"`
	Description *string `json:"description,omitempty"`
	Event       *string `json:"event,omitempty"`
	Label       *string `json:"label,omitempty"`
}

HookEvent represents a hook event.

func (*HookEvent) GetCategory

func (h *HookEvent) GetCategory() string

GetCategory returns the Category field if it's non-nil, zero value otherwise.

func (*HookEvent) GetDescription

func (h *HookEvent) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*HookEvent) GetEvent

func (h *HookEvent) GetEvent() string

GetEvent returns the Event field if it's non-nil, zero value otherwise.

func (*HookEvent) GetLabel

func (h *HookEvent) GetLabel() string

GetLabel returns the Label field if it's non-nil, zero value otherwise.

type HookEventTypes

type HookEventTypes struct {
	Repository *HookEventTypesLinks `json:"repository,omitempty"`
	Team       *HookEventTypesLinks `json:"team,omitempty"`
	User       *HookEventTypesLinks `json:"user,omitempty"`
}

HookEventTypes represents hook events.

func (*HookEventTypes) GetRepository

func (h *HookEventTypes) GetRepository() *HookEventTypesLinks

GetRepository returns the Repository field.

func (*HookEventTypes) GetTeam

func (h *HookEventTypes) GetTeam() *HookEventTypesLinks

GetTeam returns the Team field.

func (*HookEventTypes) GetUser

func (h *HookEventTypes) GetUser() *HookEventTypesLinks

GetUser returns the User field.

type HookEventTypesLinks struct {
	Events *Link `json:"events,omitempty"`
}

HookEventTypesLinks represents the "links" object in a Bitbucket hook event type.

func (*HookEventTypesLinks) GetEvents

func (h *HookEventTypesLinks) GetEvents() *Link

GetEvents returns the Events field.

type HookEvents

type HookEvents struct {
	PaginationInfo

	Values []*HookEvent `json:"values,omitempty"`
}

HookEvents represents a collection of hook events.

func (*HookEvents) HasValues

func (h *HookEvents) HasValues() bool

HasValues checks if HookEvents has any Values.

type HookEventsService

type HookEventsService service

HookEventsService handles communication with the hook events related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/hook_events

func (*HookEventsService) Get

func (h *HookEventsService) Get(subjectType string, opts ...interface{}) (*HookEvents, *simpleresty.Response, error)

Get returns a paginated list of all valid webhook events for the specified entity.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/hook_events/%7Bsubject_type%7D#get

func (*HookEventsService) List

func (h *HookEventsService) List(opts ...interface{}) (*HookEventTypes, *simpleresty.Response, error)

List returns the webhook resource or subject types on which webhooks can be registered.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/hook_events#get

type Issue

type Issue struct {
	Priority   *string       `json:"priority,omitempty"`
	Kind       *string       `json:"kind,omitempty"`
	Repository *Repository   `json:"repository,omitempty"`
	Links      *IssueLinks   `json:"links,omitempty"`
	Reporter   *User         `json:"reporter,omitempty"`
	Title      *string       `json:"title,omitempty"`
	Component  *Component    `json:"component,omitempty"`
	Votes      *int          `json:"votes,omitempty"`
	Watches    *int          `json:"watches,omitempty"`
	Content    *IssueContent `json:"content,omitempty"`
	Assignee   *User         `json:"assignee,omitempty"`
	State      *string       `json:"state,omitempty"`
	Type       *string       `json:"type,omitempty"`
	Version    *Version      `json:"version,omitempty"`
	EditedOn   *time.Time    `json:"edited_on,omitempty"`
	CreatedOn  *time.Time    `json:"created_on,omitempty"`
	Milestone  *Milestone    `json:"milestone,omitempty"`
	UpdatedOn  *time.Time    `json:"updated_on,omitempty"`
	ID         *int64        `json:"id,omitempty"`
}

Issue represents a Bitbucket issue on a repository.

func (*Issue) GetAssignee

func (i *Issue) GetAssignee() *User

GetAssignee returns the Assignee field.

func (*Issue) GetComponent

func (i *Issue) GetComponent() *Component

GetComponent returns the Component field.

func (*Issue) GetContent

func (i *Issue) GetContent() *IssueContent

GetContent returns the Content field.

func (*Issue) GetCreatedOn

func (i *Issue) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*Issue) GetEditedOn

func (i *Issue) GetEditedOn() time.Time

GetEditedOn returns the EditedOn field if it's non-nil, zero value otherwise.

func (*Issue) GetID

func (i *Issue) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Issue) GetKind

func (i *Issue) GetKind() string

GetKind returns the Kind field if it's non-nil, zero value otherwise.

func (i *Issue) GetLinks() *IssueLinks

GetLinks returns the Links field.

func (*Issue) GetMilestone

func (i *Issue) GetMilestone() *Milestone

GetMilestone returns the Milestone field.

func (*Issue) GetPriority

func (i *Issue) GetPriority() string

GetPriority returns the Priority field if it's non-nil, zero value otherwise.

func (*Issue) GetReporter

func (i *Issue) GetReporter() *User

GetReporter returns the Reporter field.

func (*Issue) GetRepository

func (i *Issue) GetRepository() *Repository

GetRepository returns the Repository field.

func (*Issue) GetState

func (i *Issue) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*Issue) GetTitle

func (i *Issue) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

func (*Issue) GetType

func (i *Issue) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Issue) GetUpdatedOn

func (i *Issue) GetUpdatedOn() time.Time

GetUpdatedOn returns the UpdatedOn field if it's non-nil, zero value otherwise.

func (*Issue) GetVersion

func (i *Issue) GetVersion() *Version

GetVersion returns the Version field.

func (*Issue) GetVotes

func (i *Issue) GetVotes() int

GetVotes returns the Votes field if it's non-nil, zero value otherwise.

func (*Issue) GetWatches

func (i *Issue) GetWatches() int

GetWatches returns the Watches field if it's non-nil, zero value otherwise.

type IssueChange

type IssueChange struct {
	ID        *int64                        `json:"id,omitempty"`
	Links     *IssueChangeLinks             `json:"links,omitempty"`
	Issue     *Issue                        `json:"issue,omitempty"`
	CreatedOn *time.Time                    `json:"created_on,omitempty"`
	User      *User                         `json:"user,omitempty"`
	Message   *Content                      `json:"message,omitempty"`
	Type      *string                       `json:"type,omitempty"`
	Changes   *map[string]map[string]string `json:"changes,omitempty"`
}

IssueChange represents the individual change.

func (*IssueChange) GetChanges

func (i *IssueChange) GetChanges() map[string]map[string]string

GetChanges returns a map of all changes for the issue.

func (*IssueChange) GetCreatedOn

func (i *IssueChange) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*IssueChange) GetID

func (i *IssueChange) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*IssueChange) GetIssue

func (i *IssueChange) GetIssue() *Issue

GetIssue returns the Issue field.

func (i *IssueChange) GetLinks() *IssueChangeLinks

GetLinks returns the Links field.

func (*IssueChange) GetMessage

func (i *IssueChange) GetMessage() *Content

GetMessage returns the Message field.

func (*IssueChange) GetType

func (i *IssueChange) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*IssueChange) GetUser

func (i *IssueChange) GetUser() *User

GetUser returns the User field.

type IssueChangeLinks struct {
	Self *Link `json:"self,omitempty"`
	HTML *Link `json:"html,omitempty"`
}

IssueChangeLinks represents the "links" object in a Bitbucket issue change.

func (*IssueChangeLinks) GetHTML

func (i *IssueChangeLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*IssueChangeLinks) GetSelf

func (i *IssueChangeLinks) GetSelf() *Link

GetSelf returns the Self field.

type IssueChangeRequest

type IssueChangeRequest struct {
	AssigneeAccountID *string
	Kind              *string
	Priority          *string
	Component         *string
	Milestone         *string
	Version           *string
	Content           *string // represents the issue's description box.
	Message           *string
}

IssueChangeRequest represents a request to create change on an issue.

func (*IssueChangeRequest) GetAssigneeAccountID

func (i *IssueChangeRequest) GetAssigneeAccountID() string

GetAssigneeAccountID returns the AssigneeAccountID field if it's non-nil, zero value otherwise.

func (*IssueChangeRequest) GetComponent

func (i *IssueChangeRequest) GetComponent() string

GetComponent returns the Component field if it's non-nil, zero value otherwise.

func (*IssueChangeRequest) GetContent

func (i *IssueChangeRequest) GetContent() string

GetContent returns the Content field if it's non-nil, zero value otherwise.

func (*IssueChangeRequest) GetKind

func (i *IssueChangeRequest) GetKind() string

GetKind returns the Kind field if it's non-nil, zero value otherwise.

func (*IssueChangeRequest) GetMessage

func (i *IssueChangeRequest) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*IssueChangeRequest) GetMilestone

func (i *IssueChangeRequest) GetMilestone() string

GetMilestone returns the Milestone field if it's non-nil, zero value otherwise.

func (*IssueChangeRequest) GetPriority

func (i *IssueChangeRequest) GetPriority() string

GetPriority returns the Priority field if it's non-nil, zero value otherwise.

func (*IssueChangeRequest) GetVersion

func (i *IssueChangeRequest) GetVersion() string

GetVersion returns the Version field if it's non-nil, zero value otherwise.

type IssueChanges

type IssueChanges struct {
	PaginationInfo

	Values []*IssueChange `json:"values,omitempty"`
}

IssueChanges represents a collection of changes on an issue,

func (*IssueChanges) HasValues

func (i *IssueChanges) HasValues() bool

HasValues checks if IssueChanges has any Values.

type IssueComment

type IssueComment struct {
	ID        *int64             `json:"id,omitempty"`
	Type      *string            `json:"type,omitempty"`
	Links     *IssueCommentLinks `json:"links,omitempty"`
	Issue     *Issue             `json:"issue,omitempty"`
	Content   *Content           `json:"content,omitempty"`
	CreatedOn *time.Time         `json:"created_on,omitempty"`
	UpdatedOn *time.Time         `json:"updated_on,omitempty"`
	User      *User              `json:"user,omitempty"`
}

IssueComment represents a comment on an issue.

func (*IssueComment) GetContent

func (i *IssueComment) GetContent() *Content

GetContent returns the Content field.

func (*IssueComment) GetCreatedOn

func (i *IssueComment) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*IssueComment) GetID

func (i *IssueComment) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*IssueComment) GetIssue

func (i *IssueComment) GetIssue() *Issue

GetIssue returns the Issue field.

func (i *IssueComment) GetLinks() *IssueCommentLinks

GetLinks returns the Links field.

func (*IssueComment) GetType

func (i *IssueComment) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*IssueComment) GetUpdatedOn

func (i *IssueComment) GetUpdatedOn() time.Time

GetUpdatedOn returns the UpdatedOn field if it's non-nil, zero value otherwise.

func (*IssueComment) GetUser

func (i *IssueComment) GetUser() *User

GetUser returns the User field.

type IssueCommentLinks struct {
	Self *Link `json:"self,omitempty"`
	HTML *Link `json:"html,omitempty"`
}

IssueCommentLinks represents the "links" object in a Bitbucket issue comment.

func (*IssueCommentLinks) GetHTML

func (i *IssueCommentLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*IssueCommentLinks) GetSelf

func (i *IssueCommentLinks) GetSelf() *Link

GetSelf returns the Self field.

type IssueCommentRequest

type IssueCommentRequest struct {
	Content *Content `json:"content,omitempty"`
}

IssueCommentRequest represents a request to create/update an issue comment.

func (*IssueCommentRequest) GetContent

func (i *IssueCommentRequest) GetContent() *Content

GetContent returns the Content field.

type IssueComments

type IssueComments struct {
	PaginationInfo

	Values []*IssueChange `json:"values,omitempty"`
}

IssueComments represents a collection of issue comments.

func (*IssueComments) HasValues

func (i *IssueComments) HasValues() bool

HasValues checks if IssueComments has any Values.

type IssueContent

type IssueContent struct {
	Raw    *string `json:"raw,omitempty"`
	Markup *string `json:"markup,omitempty"`
	HTML   *string `json:"html,omitempty"`
	Type   *string `json:"type,omitempty"`
}

IssueContent represents the Description box in the Bitbucket issue UI.

func (*IssueContent) GetHTML

func (i *IssueContent) GetHTML() string

GetHTML returns the HTML field if it's non-nil, zero value otherwise.

func (*IssueContent) GetMarkup

func (i *IssueContent) GetMarkup() string

GetMarkup returns the Markup field if it's non-nil, zero value otherwise.

func (*IssueContent) GetRaw

func (i *IssueContent) GetRaw() string

GetRaw returns the Raw field if it's non-nil, zero value otherwise.

func (*IssueContent) GetType

func (i *IssueContent) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type IssueLinks struct {
	Self        *Link `json:"self,omitempty"`
	Attachments *Link `json:"attachments,omitempty"`
	Watch       *Link `json:"watch,omitempty"`
	Comments    *Link `json:"comments,omitempty"`
	HTML        *Link `json:"html,omitempty"`
	Vote        *Link `json:"vote,omitempty"`
}

IssueLinks represents the "links" object in a Bitbucket issue.

func (*IssueLinks) GetAttachments

func (i *IssueLinks) GetAttachments() *Link

GetAttachments returns the Attachments field.

func (*IssueLinks) GetComments

func (i *IssueLinks) GetComments() *Link

GetComments returns the Comments field.

func (*IssueLinks) GetHTML

func (i *IssueLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*IssueLinks) GetSelf

func (i *IssueLinks) GetSelf() *Link

GetSelf returns the Self field.

func (*IssueLinks) GetVote

func (i *IssueLinks) GetVote() *Link

GetVote returns the Vote field.

func (*IssueLinks) GetWatch

func (i *IssueLinks) GetWatch() *Link

GetWatch returns the Watch field.

type IssueRequest

type IssueRequest struct {
	Title     *string                   `json:"title,omitempty"`    // Required field.
	Kind      *string                   `json:"kind,omitempty"`     // Required field.
	Priority  *string                   `json:"priority,omitempty"` // Required field.
	Content   *IssueRequestContentOpts  `json:"content,omitempty"`
	Component *ComponentRequest         `json:"component,omitempty"`
	Milestone *MilestoneRequest         `json:"milestone,omitempty"`
	Version   *VersionRequest           `json:"version,omitempty"`
	Assignee  *IssueRequestAssigneeOpts `json:"assignee,omitempty"`
}

IssueRequest represents a request to create/update an issue.

func (*IssueRequest) GetAssignee

func (i *IssueRequest) GetAssignee() *IssueRequestAssigneeOpts

GetAssignee returns the Assignee field.

func (*IssueRequest) GetComponent

func (i *IssueRequest) GetComponent() *ComponentRequest

GetComponent returns the Component field.

func (*IssueRequest) GetContent

func (i *IssueRequest) GetContent() *IssueRequestContentOpts

GetContent returns the Content field.

func (*IssueRequest) GetKind

func (i *IssueRequest) GetKind() string

GetKind returns the Kind field if it's non-nil, zero value otherwise.

func (*IssueRequest) GetMilestone

func (i *IssueRequest) GetMilestone() *MilestoneRequest

GetMilestone returns the Milestone field.

func (*IssueRequest) GetPriority

func (i *IssueRequest) GetPriority() string

GetPriority returns the Priority field if it's non-nil, zero value otherwise.

func (*IssueRequest) GetTitle

func (i *IssueRequest) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

func (*IssueRequest) GetVersion

func (i *IssueRequest) GetVersion() *VersionRequest

GetVersion returns the Version field.

type IssueRequestAssigneeOpts

type IssueRequestAssigneeOpts struct {
	Username *string `json:"username,omitempty"`
}

IssueRequestAssigneeOpts represents the Bitbucket user to be assigned when creating/updating a new issue.

func (*IssueRequestAssigneeOpts) GetUsername

func (i *IssueRequestAssigneeOpts) GetUsername() string

GetUsername returns the Username field if it's non-nil, zero value otherwise.

type IssueRequestContentOpts

type IssueRequestContentOpts struct {
	Raw  *string `json:"raw,omitempty"`
	HTML *string `json:"html,omitempty"`
}

IssueRequestContentOpts represents the Description box when creating/updating a new issue.

func (*IssueRequestContentOpts) GetHTML

func (i *IssueRequestContentOpts) GetHTML() string

GetHTML returns the HTML field if it's non-nil, zero value otherwise.

func (*IssueRequestContentOpts) GetRaw

func (i *IssueRequestContentOpts) GetRaw() string

GetRaw returns the Raw field if it's non-nil, zero value otherwise.

type Issues

type Issues struct {
	PaginationInfo

	Values []*Issue `json:"values,omitempty"`
}

Issues represent a collection of issues.

func (*Issues) HasValues

func (i *Issues) HasValues() bool

HasValues checks if Issues has any Values.

type IssuesService

type IssuesService service

IssuesService handles communication with the issue related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues

func (*IssuesService) CreateChange

func (i *IssuesService) CreateChange(owner, repoSlug string, id int64, io *IssueChangeRequest) (*IssueChange, *simpleresty.Response, error)

CreateChange makes a change to the specified issue.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/changes#post

func (*IssuesService) Delete

func (i *IssuesService) Delete(owner, repoSlug string, issueID int64) (*simpleresty.Response, error)

Delete the specified issue. This requires write access to the repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D#delete

func (*IssuesService) DeleteComment

func (i *IssuesService) DeleteComment(owner, repoSlug string, id, commentID int64) (*simpleresty.Response, error)

DeleteComment deletes an existing issue comment.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/comments/%7Bcomment_id%7D#delete

func (*IssuesService) Get

func (i *IssuesService) Get(owner, repoSlug string, issueID int64, opts ...interface{}) (*Issue, *simpleresty.Response, error)

Get a single issue.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D#get

func (*IssuesService) GetChange

func (i *IssuesService) GetChange(owner, repoSlug string, id, changeID int64, opts ...interface{}) (*IssueChange, *simpleresty.Response, error)

GetChange returns the specified issue change object.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/changes/%7Bchange_id%7D#get

func (*IssuesService) GetComment

func (i *IssuesService) GetComment(owner, repoSlug string, id, commentID int64, opts ...interface{}) (*IssueComment, *simpleresty.Response, error)

GetComment returns the specified issue comment object.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/comments/%7Bcomment_id%7D#get

func (*IssuesService) HasCurrentUserVoted

func (i *IssuesService) HasCurrentUserVoted(owner, repoSlug string, id int64) (bool, *simpleresty.Response, error)

HasCurrentUserVoted check whether the authenticated user has voted for this issue.

A 204 status code indicates that the user has voted, while a 404 implies they haven't.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/vote#get

func (*IssuesService) IsAuthUserWatching

func (i *IssuesService) IsAuthUserWatching(owner, repoSlug string, id int64) (bool, *simpleresty.Response, error)

IsAuthUserWatching check whether the authenticated user is watching the specified issue.

A 204 status code indicates that the user is watching this issue.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/watch#get

func (*IssuesService) List

func (i *IssuesService) List(owner, repoSlug string, opts ...interface{}) (*Issues, *simpleresty.Response, error)

List returns all issues for a given repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues#get

func (*IssuesService) ListAttachments

func (i *IssuesService) ListAttachments(owner, repoSlug string, id int64, opts ...interface{}) (*Artifacts, *simpleresty.Response, error)

ListAttachments returns all attachments for this issue.

This returns the files' meta data. This does not return the files' actual contents.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/attachments#get

func (*IssuesService) ListChanges

func (i *IssuesService) ListChanges(owner, repoSlug string, id int64, opts ...interface{}) (*IssueChanges, *simpleresty.Response, error)

ListChanges returns the list of all changes that have been made to the specified issue. Changes are returned in chronological order with the oldest change first.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/changes#get

func (*IssuesService) ListComments

func (i *IssuesService) ListComments(owner, repoSlug string, id int64, opts ...interface{}) (*IssueComments, *simpleresty.Response, error)

ListComments returns a paginated list of all comments that were made on the specified issue.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/comments#get

func (*IssuesService) StopWatchingIssue

func (i *IssuesService) StopWatchingIssue(owner, repoSlug string, id int64) (*simpleresty.Response, error)

StopWatchingIssue stops watching the specified issue.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/watch#delete

func (*IssuesService) Vote

func (i *IssuesService) Vote(owner, repoSlug string, id int64) (*simpleresty.Response, error)

Vote adds a vote on behalf of the authenticated user only.

The 204 status code indicates that the operation was successful.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/vote#put

func (*IssuesService) WatchIssue

func (i *IssuesService) WatchIssue(owner, repoSlug string, id int64) (*simpleresty.Response, error)

WatchIssue starts watching the specified issue.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues/%7Bissue_id%7D/watch#put

type Link struct {
	Name *string `json:"name,omitempty"`
	HRef *string `json:"href,omitempty"`
}

Link represents a single link object from Bitbucket object links.

func (*Link) GetHRef

func (l *Link) GetHRef() string

GetHRef returns the HRef field if it's non-nil, zero value otherwise.

func (*Link) GetName

func (l *Link) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

type ListOpts

type ListOpts struct {
	// For paginated result sets, page of results to retrieve.
	Page int64 `url:"page,omitempty"`

	// For paginated result sets, the number of results to include per page.
	// Globally, the minimum length is 10 and the maximum is 100. Some APIs may specify a different default.
	Pagelen int64 `url:"pagelen,omitempty"`
}

ListOpts specifies the optional parameters to various List methods that support pagination.

type MergePrRequest added in v0.3.0

type MergePrRequest struct {
	// Type of merge. Required
	Type string `json:"type"`

	// The commit message that will be used on the resulting commit.
	Message string `json:"message,omitempty"`

	// Whether the source branch should be deleted. If this is not provided, we fallback to the value used when the
	// pull request was created, which defaults to False
	CloseSourceBranch *bool `json:"close_source_branch,omitempty"`

	// The merge strategy that will be used to merge the pull request. Default: merge_commit
	// Valid values: merge_commit, squash, fast_forward
	MergeStrategy string `json:"merge_strategy,omitempty"`
}

MergePrRequest represents a request to merge a pull request.

func (*MergePrRequest) GetCloseSourceBranch added in v0.3.0

func (m *MergePrRequest) GetCloseSourceBranch() bool

GetCloseSourceBranch returns the CloseSourceBranch field if it's non-nil, zero value otherwise.

type Milestone

type Milestone struct {
	ID         *int64          `json:"-"` // This field is not present in the API response.
	Repository *Repository     `json:"repository,omitempty"`
	Type       *string         `json:"type,omitempty"`
	Name       *string         `json:"name,omitempty"`
	Links      *MilestoneLinks `json:"links,omitempty"`
}

Milestone represents a Bitbucket repository milestone.

func (*Milestone) GetID

func (m *Milestone) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (m *Milestone) GetLinks() *MilestoneLinks

GetLinks returns the Links field.

func (*Milestone) GetName

func (m *Milestone) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Milestone) GetRepository

func (m *Milestone) GetRepository() *Repository

GetRepository returns the Repository field.

func (*Milestone) GetType

func (m *Milestone) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type MilestoneLinks struct {
	Self *Link `json:"self,omitempty"`
}

MilestoneLinks represents the "links" object in a Bitbucket milestone.

func (*MilestoneLinks) GetSelf

func (m *MilestoneLinks) GetSelf() *Link

GetSelf returns the Self field.

type MilestoneRequest

type MilestoneRequest struct {
	Name *string `json:"name,omitempty"`
}

MilestoneRequest represents an existing milestone to be added to an issue or pull request. There is no CREATE or UPDATE endpoint for the milestone resource.

func (*MilestoneRequest) GetName

func (m *MilestoneRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

type Milestones

type Milestones struct {
	PaginationInfo

	Values []*Milestone `json:"values,omitempty"`
}

Milestones represent a collection of milestones.

func (*Milestones) HasValues

func (m *Milestones) HasValues() bool

HasValues checks if Milestones has any Values.

type MilestonesService

type MilestonesService service

MilestonesService handles communication with the milestone related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/milestones

func (*MilestonesService) Get

func (m *MilestonesService) Get(owner, repoSlug string, milestoneID int64, opts ...interface{}) (*Milestone, *simpleresty.Response, error)

Get returns a single milestone. NOTE: The milestone ID is a numerical value, not the component name, that is visible in the links.self.href object.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/milestones/%7Bmilestone_id%7D#get

func (*MilestonesService) List

func (m *MilestonesService) List(owner, repoSlug string, opts ...interface{}) (*Milestones, *simpleresty.Response, error)

List all milestones that have been defined in the issue tracker.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/milestones#get

type Option added in v0.2.0

type Option func(*Client) error

Option is a functional option for configuring the API client.

func BaseURL added in v0.2.0

func BaseURL(baseURL string) Option

BaseURL allows overriding of the default base API URL.

func CustomHTTPHeaders added in v0.2.0

func CustomHTTPHeaders(headers map[string]string) Option

CustomHTTPHeaders sets additional HTTPHeaders

func HTTP added in v0.2.0

func HTTP(http *simpleresty.Client) Option

func OAuth added in v0.2.0

func OAuth(clientID, clientSecret string) Option

OAuth with oauth.

func OAuthBearerToken added in v0.2.0

func OAuthBearerToken(t string) Option

OAuthBearerToken sets the oauth grant.

func OAuthClientCredentials added in v0.2.0

func OAuthClientCredentials(clientID, clientSecret string) Option

OAuthClientCredentials uses the Client Credentials Grant oauth2 flow to authenticate to Bitbucket.

func OAuthToken added in v0.2.0

func OAuthToken(ot oauth2.Token) Option

OAuthToken sets the oauth grant.

func OAuthWithCode added in v0.2.0

func OAuthWithCode(clientID, clientSecret, code string) Option

OAuthWithCode does the OAuth handshake with a given code.

func UserAgent added in v0.2.0

func UserAgent(userAgent string) Option

UserAgent allows overriding of the default User Agent.

type PRActivities

type PRActivities struct {
	PaginationInfo

	Values []*PRActivity `json:"values,omitempty"`
}

PRActivities represents a collection of of pull request activity.

func (*PRActivities) HasValues

func (p *PRActivities) HasValues() bool

HasValues checks if PRActivities has any Values.

type PRActivity

type PRActivity struct {
	Update      *PRUpdateActivity   `json:"update,omitempty"`
	Approval    *PRApprovalActivity `json:"approval,omitempty"`
	PullRequest *PullRequest        `json:"pull_request,omitempty"`
}

PRActivity represents a pull request activity.

func (*PRActivity) GetActivityType

func (p *PRActivity) GetActivityType() (interface{}, string)

GetActivityType returns the non-nil field representing the activity: an update or approval. It returns the activity object and its type.

func (*PRActivity) GetApproval

func (p *PRActivity) GetApproval() *PRApprovalActivity

GetApproval returns the Approval field.

func (*PRActivity) GetPullRequest

func (p *PRActivity) GetPullRequest() *PullRequest

GetPullRequest returns the PullRequest field.

func (*PRActivity) GetUpdate

func (p *PRActivity) GetUpdate() *PRUpdateActivity

GetUpdate returns the Update field.

type PRApprovalActivity

type PRApprovalActivity struct {
	Date        *time.Time   `json:"date,omitempty"`
	PullRequest *PullRequest `json:"pull_request,omitempty"`
	User        *User        `json:"user,omitempty"`
}

PRApprovalActivity represents a pull request approval activity.

func (*PRApprovalActivity) GetDate

func (p *PRApprovalActivity) GetDate() time.Time

GetDate returns the Date field if it's non-nil, zero value otherwise.

func (*PRApprovalActivity) GetPullRequest

func (p *PRApprovalActivity) GetPullRequest() *PullRequest

GetPullRequest returns the PullRequest field.

func (*PRApprovalActivity) GetUser

func (p *PRApprovalActivity) GetUser() *User

GetUser returns the User field.

type PRComment

type PRComment struct {
	Comment

	PullRequest *PullRequest `json:"pullrequest,omitempty"`
	Deleted     *bool        `json:"deleted,omitempty"`
}

PRComment represents a pull request comment.

func (*PRComment) GetDeleted

func (p *PRComment) GetDeleted() bool

GetDeleted returns the Deleted field if it's non-nil, zero value otherwise.

func (*PRComment) GetPullRequest

func (p *PRComment) GetPullRequest() *PullRequest

GetPullRequest returns the PullRequest field.

type PRCommentRequest added in v0.1.3

type PRCommentRequest struct {
	Content *Content `json:"content,omitempty"`
}

PRCommentRequest represents a request to create or update a pull request comment.

func (*PRCommentRequest) GetContent added in v0.1.3

func (p *PRCommentRequest) GetContent() *Content

GetContent returns the Content field.

type PRComments

type PRComments struct {
	PaginationInfo

	Values []*PRComment `json:"values,omitempty"`
}

PRComments represents a collection of a PR's comments.

func (*PRComments) HasValues

func (p *PRComments) HasValues() bool

HasValues checks if PRComments has any Values.

type PRRequest

type PRRequest struct {
	Title             *string                   `json:"title,omitempty"`
	Source            *PRRequestSourceOpts      `json:"source,omitempty"`
	Destination       *PRRequestDestinationOpts `json:"destination,omitempty"`
	Reviewers         []*PRRequestReviewerOpts  `json:"reviewers"`
	Description       *string                   `json:"description,omitempty"`
	CloseSourceBranch *bool                     `json:"close_source_branch"`
}

PRRequest represents a request to create/update a pull request.

func (*PRRequest) GetCloseSourceBranch

func (p *PRRequest) GetCloseSourceBranch() bool

GetCloseSourceBranch returns the CloseSourceBranch field if it's non-nil, zero value otherwise.

func (*PRRequest) GetDescription

func (p *PRRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*PRRequest) GetDestination

func (p *PRRequest) GetDestination() *PRRequestDestinationOpts

GetDestination returns the Destination field.

func (*PRRequest) GetSource

func (p *PRRequest) GetSource() *PRRequestSourceOpts

GetSource returns the Source field.

func (*PRRequest) GetTitle

func (p *PRRequest) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

func (*PRRequest) HasReviewers

func (p *PRRequest) HasReviewers() bool

HasReviewers checks if PRRequest has any Reviewers.

type PRRequestDestinationOpts

type PRRequestDestinationOpts struct {
	Branch *Branch `json:"branch,omitempty"`
}

PRRequestDestinationOpts represents the destination branch for the pull request.

func (*PRRequestDestinationOpts) GetBranch

func (p *PRRequestDestinationOpts) GetBranch() *Branch

GetBranch returns the Branch field.

type PRRequestReviewerOpts

type PRRequestReviewerOpts struct {
	UUID *string `json:"uuid,omitempty"`
}

PRRequestReviewerOpts represent a reviewer for a pull request specified by the user's UUID.

func (*PRRequestReviewerOpts) GetUUID

func (p *PRRequestReviewerOpts) GetUUID() string

GetUUID returns the UUID field if it's non-nil, zero value otherwise.

type PRRequestSourceOpts

type PRRequestSourceOpts struct {
	Branch *Branch `json:"branch,omitempty"`
}

PRRequestSourceOpts represents the source branch for the pull request.

func (*PRRequestSourceOpts) GetBranch

func (p *PRRequestSourceOpts) GetBranch() *Branch

GetBranch returns the Branch field.

type PRUpdateActivity

type PRUpdateActivity struct {
	Description *string            `json:"description,omitempty"`
	Title       *string            `json:"title,omitempty"`
	Destination *PullRequestBranch `json:"destination,omitempty"`
	Reason      *string            `json:"reason,omitempty"`
	Source      *PullRequestBranch `json:"source,omitempty"`
	State       *string            `json:"state,omitempty"`
	Author      *User              `json:"author,omitempty"`
	Date        *time.Time         `json:"date,omitempty"`
}

PRUpdateActivity represents a pull request update activity.

func (*PRUpdateActivity) GetAuthor

func (p *PRUpdateActivity) GetAuthor() *User

GetAuthor returns the Author field.

func (*PRUpdateActivity) GetDate

func (p *PRUpdateActivity) GetDate() time.Time

GetDate returns the Date field if it's non-nil, zero value otherwise.

func (*PRUpdateActivity) GetDescription

func (p *PRUpdateActivity) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*PRUpdateActivity) GetDestination

func (p *PRUpdateActivity) GetDestination() *PullRequestBranch

GetDestination returns the Destination field.

func (*PRUpdateActivity) GetReason

func (p *PRUpdateActivity) GetReason() string

GetReason returns the Reason field if it's non-nil, zero value otherwise.

func (*PRUpdateActivity) GetSource

func (p *PRUpdateActivity) GetSource() *PullRequestBranch

GetSource returns the Source field.

func (*PRUpdateActivity) GetState

func (p *PRUpdateActivity) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*PRUpdateActivity) GetTitle

func (p *PRUpdateActivity) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

type PaginationInfo

type PaginationInfo struct {
	// Page number of the current results. This is an optional element that is not provided in all responses.
	Page *int64 `json:"page,omitempty"`

	//  Link to the next page if it exists. The last page of a collection does not have this value.
	//  Use this link to navigate the result set and refrain from constructing your own URLs.
	Next *string `json:"next,omitempty"`

	// Current number of objects on the existing page.
	Pagelen *int64 `json:"pagelen,omitempty"`

	// Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.
	Size *int64 `json:"size,omitempty"`

	//Link to previous page if it exists. A collections first page does not have this value.
	// This is an optional element that is not provided in all responses.
	// Some result sets strictly support forward navigation and never provide previous links.
	// Clients must anticipate that backwards navigation is not always available.
	// Use this link to navigate the result set and refrain from constructing your own URLs.
	Previous *string `json:"previous,omitempty"`
}

PaginationInfo represents the pagination data returned on most LIST functions.

Bitbucket API Docs: https://developer.atlassian.com/bitbucket/api/2/reference/meta/pagination

func (*PaginationInfo) GetNext

func (p *PaginationInfo) GetNext() string

GetNext returns the Next field if it's non-nil, zero value otherwise.

func (*PaginationInfo) GetPage

func (p *PaginationInfo) GetPage() int64

GetPage returns the Page field if it's non-nil, zero value otherwise.

func (*PaginationInfo) GetPagelen

func (p *PaginationInfo) GetPagelen() int64

GetPagelen returns the Pagelen field if it's non-nil, zero value otherwise.

func (*PaginationInfo) GetPrevious

func (p *PaginationInfo) GetPrevious() string

GetPrevious returns the Previous field if it's non-nil, zero value otherwise.

func (*PaginationInfo) GetSize

func (p *PaginationInfo) GetSize() int64

GetSize returns the Size field if it's non-nil, zero value otherwise.

type PartialRespOpts

type PartialRespOpts struct {
	// The fields parameter can contain a list of multiple comma-separated field names (e.g. fields=owner.username,uuid,links.self.href).
	Fields string `url:"fields,omitempty"`
}

PartialRespOpts represents the URL parameter to request a partial response and to add or remove specific fields from a response.

Bitbucket API Docs: https://developer.atlassian.com/bitbucket/api/2/reference/meta/partial-response

type Participant

type Participant struct {
	Role           *string    `json:"role,omitempty"`
	ParticipatedOn *time.Time `json:"participated_on,omitempty"`
	Type           *string    `json:"type,omitempty"`
	Approved       *bool      `json:"approved,omitempty"`
	User           *User      `json:"user,omitempty"`
}

Participant represents a user that interacted with a Bitbucket resource.

func (*Participant) GetApproved

func (p *Participant) GetApproved() bool

GetApproved returns the Approved field if it's non-nil, zero value otherwise.

func (*Participant) GetParticipatedOn

func (p *Participant) GetParticipatedOn() time.Time

GetParticipatedOn returns the ParticipatedOn field if it's non-nil, zero value otherwise.

func (*Participant) GetRole

func (p *Participant) GetRole() string

GetRole returns the Role field if it's non-nil, zero value otherwise.

func (*Participant) GetType

func (p *Participant) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Participant) GetUser

func (p *Participant) GetUser() *User

GetUser returns the User field.

type PatchService

type PatchService service

PatchService handles communication with the patch related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/patch

func (*PatchService) GetRaw

func (p *PatchService) GetRaw(owner, repoSlug, spec string) (*bytes.Buffer, *simpleresty.Response, error)

GetRaw produces a raw patch for a single commit (diffed against its first parent), or a patch-series for a revspec of 2 commits (e.g. 3a8b42..9ff173 where the first commit represents the source and the second commit the destination).

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/patch/%7Bspec%7D#get

type PullRequest

type PullRequest struct {
	Body              *PullRequestBody        `json:"rendered,omitempty"`
	Type              *string                 `json:"type,omitempty"`
	Description       *string                 `json:"description,omitempty"`
	Links             *PullRequestLinks       `json:"links,omitempty"`
	Title             *string                 `json:"title,omitempty"`
	CloseSourceBranch *bool                   `json:"close_source_branch,omitempty"`
	Reviewers         []*User                 `json:"reviewers,omitempty"`
	ID                *int64                  `json:"id,omitempty"`
	Destination       *PullRequestBranch      `json:"destination,omitempty"`
	CreatedOn         *time.Time              `json:"created_on,omitempty"`
	Summary           *Content                `json:"summary,omitempty"`
	Source            *PullRequestBranch      `json:"source,omitempty"`
	CommentCount      *int64                  `json:"comment_count,omitempty"`
	State             *string                 `json:"state,omitempty"`
	TaskCount         *int64                  `json:"task_count,omitempty"`
	Participants      []*Participant          `json:"participants,omitempty"`
	Reason            *string                 `json:"reason,omitempty"`
	UpdatedOn         *string                 `json:"updated_on,omitempty"`
	Author            *User                   `json:"author,omitempty"`
	MergeCommit       *PullRequestMergeCommit `json:"merge_commit,omitempty"`
	ClosedBy          *User                   `json:"closed_by,omitempty"`
}

PullRequest represents a Bitbucket pull request on a repository.

func (*PullRequest) GetAuthor

func (p *PullRequest) GetAuthor() *User

GetAuthor returns the Author field.

func (*PullRequest) GetBody

func (p *PullRequest) GetBody() *PullRequestBody

GetBody returns the Body field.

func (*PullRequest) GetCloseSourceBranch

func (p *PullRequest) GetCloseSourceBranch() bool

GetCloseSourceBranch returns the CloseSourceBranch field if it's non-nil, zero value otherwise.

func (*PullRequest) GetClosedBy

func (p *PullRequest) GetClosedBy() *User

GetClosedBy returns the ClosedBy field.

func (*PullRequest) GetCommentCount

func (p *PullRequest) GetCommentCount() int64

GetCommentCount returns the CommentCount field if it's non-nil, zero value otherwise.

func (*PullRequest) GetCreatedOn

func (p *PullRequest) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*PullRequest) GetDescription

func (p *PullRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*PullRequest) GetDestination

func (p *PullRequest) GetDestination() *PullRequestBranch

GetDestination returns the Destination field.

func (*PullRequest) GetID

func (p *PullRequest) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (p *PullRequest) GetLinks() *PullRequestLinks

GetLinks returns the Links field.

func (*PullRequest) GetMergeCommit

func (p *PullRequest) GetMergeCommit() *PullRequestMergeCommit

GetMergeCommit returns the MergeCommit field.

func (*PullRequest) GetReason

func (p *PullRequest) GetReason() string

GetReason returns the Reason field if it's non-nil, zero value otherwise.

func (*PullRequest) GetSource

func (p *PullRequest) GetSource() *PullRequestBranch

GetSource returns the Source field.

func (*PullRequest) GetState

func (p *PullRequest) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*PullRequest) GetSummary

func (p *PullRequest) GetSummary() *Content

GetSummary returns the Summary field.

func (*PullRequest) GetTaskCount

func (p *PullRequest) GetTaskCount() int64

GetTaskCount returns the TaskCount field if it's non-nil, zero value otherwise.

func (*PullRequest) GetTitle

func (p *PullRequest) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

func (*PullRequest) GetType

func (p *PullRequest) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*PullRequest) GetUpdatedOn

func (p *PullRequest) GetUpdatedOn() string

GetUpdatedOn returns the UpdatedOn field if it's non-nil, zero value otherwise.

func (*PullRequest) HasParticipants

func (p *PullRequest) HasParticipants() bool

HasParticipants checks if PullRequest has any Participants.

func (*PullRequest) HasReviewers

func (p *PullRequest) HasReviewers() bool

HasReviewers checks if PullRequest has any Reviewers.

type PullRequestBody

type PullRequestBody struct {
	Description *Content `json:"description,omitempty"`
	Title       *Content `json:"title,omitempty"`
}

PullRequestBody represents the body of a Bitbucket pull request.

func (*PullRequestBody) GetDescription

func (p *PullRequestBody) GetDescription() *Content

GetDescription returns the Description field.

func (*PullRequestBody) GetTitle

func (p *PullRequestBody) GetTitle() *Content

GetTitle returns the Title field.

type PullRequestBranch

type PullRequestBranch struct {
	Commit     *Commit     `json:"commit,omitempty"`
	Repository *Repository `json:"repository,omitempty"`
	Branch     *Branch     `json:"branch,omitempty"`
}

PullRequestBranch represents a branch associated with the pull request.

func (*PullRequestBranch) GetBranch

func (p *PullRequestBranch) GetBranch() *Branch

GetBranch returns the Branch field.

func (*PullRequestBranch) GetCommit

func (p *PullRequestBranch) GetCommit() *Commit

GetCommit returns the Commit field.

func (*PullRequestBranch) GetRepository

func (p *PullRequestBranch) GetRepository() *Repository

GetRepository returns the Repository field.

type PullRequestLinks struct {
	Decline  *Link `json:"decline,omitempty"`
	Commits  *Link `json:"commits,omitempty"`
	Self     *Link `json:"self,omitempty"`
	Comments *Link `json:"comments,omitempty"`
	Merge    *Link `json:"merge,omitempty"`
	HTML     *Link `json:"html,omitempty"`
	Activity *Link `json:"activity,omitempty"`
	Diff     *Link `json:"diff,omitempty"`
	Approve  *Link `json:"approve,omitempty"`
	Statuses *Link `json:"statuses,omitempty"`
}

PullRequestLinks represents the "links" object in a Bitbucket pull request.

func (*PullRequestLinks) GetActivity

func (p *PullRequestLinks) GetActivity() *Link

GetActivity returns the Activity field.

func (*PullRequestLinks) GetApprove

func (p *PullRequestLinks) GetApprove() *Link

GetApprove returns the Approve field.

func (*PullRequestLinks) GetComments

func (p *PullRequestLinks) GetComments() *Link

GetComments returns the Comments field.

func (*PullRequestLinks) GetCommits

func (p *PullRequestLinks) GetCommits() *Link

GetCommits returns the Commits field.

func (*PullRequestLinks) GetDecline

func (p *PullRequestLinks) GetDecline() *Link

GetDecline returns the Decline field.

func (*PullRequestLinks) GetDiff

func (p *PullRequestLinks) GetDiff() *Link

GetDiff returns the Diff field.

func (*PullRequestLinks) GetHTML

func (p *PullRequestLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*PullRequestLinks) GetMerge

func (p *PullRequestLinks) GetMerge() *Link

GetMerge returns the Merge field.

func (*PullRequestLinks) GetSelf

func (p *PullRequestLinks) GetSelf() *Link

GetSelf returns the Self field.

func (*PullRequestLinks) GetStatuses

func (p *PullRequestLinks) GetStatuses() *Link

GetStatuses returns the Statuses field.

type PullRequestListOpts

type PullRequestListOpts struct {
	// An array of pull request states that should be returned.
	// Valid options: MERGED, SUPERSEDED, OPEN, DECLINED. Case sensitive.
	// By default, only OPEN pull requests are returned.
	State []string `url:"state,omitempty"`
}

PullRequestListOpts represents the filters and query parameters available when listing pull requests.

func (*PullRequestListOpts) HasState

func (p *PullRequestListOpts) HasState() bool

HasState checks if PullRequestListOpts has any State.

type PullRequestMergeCommit added in v0.1.4

type PullRequestMergeCommit struct {
	Hash *string `json:"hash,omitempty"`
}

PullRequestMergeCommit represents the "merge_commit" object in a Bitbucket pull request.

func (*PullRequestMergeCommit) GetHash added in v0.1.4

func (p *PullRequestMergeCommit) GetHash() string

GetHash returns the Hash field if it's non-nil, zero value otherwise.

type PullRequests

type PullRequests struct {
	PaginationInfo

	Values []*PullRequest `json:"values,omitempty"`
}

PullRequests represents a collection of pull requests.

func (*PullRequests) HasValues

func (p *PullRequests) HasValues() bool

HasValues checks if PullRequests has any Values.

type PullRequestsService

type PullRequestsService service

PullRequestsService handles communication with the pull requests related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests

func (*PullRequestsService) Approve

func (p *PullRequestsService) Approve(owner, repoSlug string, pullRequestID int64) (*Participant, *simpleresty.Response, error)

Approve approves the specified pull request as the authenticated user.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/approve#post

func (*PullRequestsService) Create

func (p *PullRequestsService) Create(owner, repoSlug string, po *PRRequest) (*PullRequest, *simpleresty.Response, error)

Create a new pull request. The minimum required fields to create a pull request are title and source, specified by a branch name. If the pull request's destination is not specified, it will default to the repository.mainbranch.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests#post

func (*PullRequestsService) CreateComment

func (p *PullRequestsService) CreateComment(owner, repoSlug string, pullRequestID int64, po *PRCommentRequest) (*PRComment, *simpleresty.Response, error)

CreateComment creates a new pull request comment.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/comments#post

func (*PullRequestsService) DeclinePR

func (p *PullRequestsService) DeclinePR(owner, repoSlug string, pullRequestID int64) (*PullRequest, *simpleresty.Response, error)

DeclinePR declines the pull request.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/decline

func (*PullRequestsService) DeleteComment

func (p *PullRequestsService) DeleteComment(owner, repoSlug string, prID, cID int64) (*simpleresty.Response, error)

DeleteComment updates a specific pull request comment.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/comments#delete

func (*PullRequestsService) Get

func (p *PullRequestsService) Get(owner, repoSlug string, pullRequestID int64, opts ...interface{}) (*PullRequest, *simpleresty.Response, error)

Get returns a single pull request.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D

func (*PullRequestsService) GetActivity

func (p *PullRequestsService) GetActivity(owner, repoSlug string, pullRequestID int64, opts ...interface{}) (*PRActivities, *simpleresty.Response, error)

GetActivity returns a paginated list of a single pull request's activity log in a repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/activity#get

func (*PullRequestsService) GetComment

func (p *PullRequestsService) GetComment(owner, repoSlug string, prID, cID int64, opts ...interface{}) (*PRComment, *simpleresty.Response, error)

GetComment returns a specific pull request comment.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/comments/%7Bcomment_id%7D#get

func (*PullRequestsService) GetDiff

func (p *PullRequestsService) GetDiff(owner, repoSlug string, pid int64, opts ...interface{}) (*Diffs, *simpleresty.Response, error)

GetDiff returns the diff stat for the specified pull request.

Diff stat responses contain a record for every path modified by the commit and lists the number of lines added and removed for each file.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/diffstat#get

func (*PullRequestsService) GetDiffRaw

func (p *PullRequestsService) GetDiffRaw(owner, repoSlug string, pid int64) (*bytes.Buffer, *simpleresty.Response, error)

GetDiffRaw produces a raw, git-style diff for the pull requests

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/diff#get

func (*PullRequestsService) GetPatchRaw

func (p *PullRequestsService) GetPatchRaw(owner, repoSlug string, pid int64) (*bytes.Buffer, *simpleresty.Response, error)

GetPatchRaw produces a raw patch for the specified pull request.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/patch#get

func (*PullRequestsService) List

func (p *PullRequestsService) List(owner, repoSlug string, opts ...interface{}) (*PullRequests, *simpleresty.Response, error)

List returns all pull requests for a given repository. Supports filtering by passing in a non-URI encoded query string. Reference: https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering Example query string: source.repository.full_name != "main/repo" AND state = "OPEN" AND reviewers.username = "evzijst" AND destination.branch.name = "master"

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests#get

func (*PullRequestsService) ListActivity

func (p *PullRequestsService) ListActivity(owner, repoSlug string, opts ...interface{}) (*PRActivities, *simpleresty.Response, error)

ListActivity returns a paginated list of all pull requests' activity log on a specified repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/activity#get

func (*PullRequestsService) ListByUser

func (p *PullRequestsService) ListByUser(targetUser string, opts ...interface{}) (*PullRequests, *simpleresty.Response, error)

ListByUser returns all pull requests authored by the specified user.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/pullrequests/%7Btarget_user%7D#get

func (*PullRequestsService) ListComments

func (p *PullRequestsService) ListComments(owner, repoSlug string, pullRequestID int64, opts ...interface{}) (*PRComments, *simpleresty.Response, error)

ListComments returns a paginated list of the pull request's comments.

This includes both global, inline comments and replies.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/comments#get

func (*PullRequestsService) ListCommits

func (p *PullRequestsService) ListCommits(owner, repoSlug string, pullRequestID int64, opts ...interface{}) (*Commits, *simpleresty.Response, error)

ListCommits returns a paginated list of a pull request's commits.

These are the commits that are being merged into the destination branch when the pull requests gets accepted.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/commits#get

func (*PullRequestsService) ListStatuses

func (p *PullRequestsService) ListStatuses(owner, repoSlug string, pid int64, opts ...interface{}) (*CommitStatuses, *simpleresty.Response, error)

ListStatuses returns all statuses (e.g. build results) for the given pull request.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/statuses#get

func (*PullRequestsService) RemoveApproval

func (p *PullRequestsService) RemoveApproval(owner, repoSlug string, pullRequestID int64) (*simpleresty.Response, error)

RemoveApproval redact the authenticated user's approval of the specified pull request.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/approve#delete

func (*PullRequestsService) Update

func (p *PullRequestsService) Update(owner, repoSlug string, pullRequestID int64, po *PRRequest) (*PullRequest, *simpleresty.Response, error)

Update a pull request. This can be used to change the pull request's branches or description. Only open pull requests can be mutated.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D#put

func (*PullRequestsService) UpdateComment

func (p *PullRequestsService) UpdateComment(owner, repoSlug string, prID, cID int64, po *PRCommentRequest) (*PRComment, *simpleresty.Response, error)

UpdateComment updates a specific pull request comment.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/comments#put

type Ref

type Ref struct {
	Heads                []*Commit  `json:"heads,omitempty"`
	Date                 *time.Time `json:"date,omitempty"`
	Message              *string    `json:"message,omitempty"`
	Name                 *string    `json:"name,omitempty"`
	Links                *RefLinks  `json:"links,omitempty"`
	DefaultMergeStrategy *string    `json:"default_merge_strategy,omitempty"`
	MergeStrategies      []*string  `json:"merge_strategies,omitempty"`
	Type                 *string    `json:"type,omitempty"`
	Target               *Commit    `json:"target,omitempty"`
}

Ref represents the branches and tags in a repository.

func (*Ref) GetDate

func (r *Ref) GetDate() time.Time

GetDate returns the Date field if it's non-nil, zero value otherwise.

func (*Ref) GetDefaultMergeStrategy

func (r *Ref) GetDefaultMergeStrategy() string

GetDefaultMergeStrategy returns the DefaultMergeStrategy field if it's non-nil, zero value otherwise.

func (r *Ref) GetLinks() *RefLinks

GetLinks returns the Links field.

func (*Ref) GetMessage

func (r *Ref) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*Ref) GetName

func (r *Ref) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Ref) GetTarget

func (r *Ref) GetTarget() *Commit

GetTarget returns the Target field.

func (*Ref) GetType

func (r *Ref) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Ref) HasHeads

func (r *Ref) HasHeads() bool

HasHeads checks if Ref has any Heads.

func (*Ref) HasMergeStrategies

func (r *Ref) HasMergeStrategies() bool

HasMergeStrategies checks if Ref has any MergeStrategies.

type RefLinks struct {
	Commits *Link `json:"commits,omitempty"`
	Self    *Link `json:"self,omitempty"`
	HTML    *Link `json:"html,omitempty"`
}

RefLinks represents the "links" object in a ref.

func (*RefLinks) GetCommits

func (r *RefLinks) GetCommits() *Link

GetCommits returns the Commits field.

func (*RefLinks) GetHTML

func (r *RefLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*RefLinks) GetSelf

func (r *RefLinks) GetSelf() *Link

GetSelf returns the Self field.

type RefRequest

type RefRequest struct {
	Name   *string `json:"name,omitempty"`
	Target struct {
		Hash *string `json:"hash,omitempty"`
	} `json:"target,omitempty"`
}

RefRequest represents a request to create a new branch.

func (*RefRequest) GetName

func (r *RefRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

type Refs

type Refs struct {
	PaginationInfo

	Values []*Ref `json:"values,omitempty"`
}

Refs represents a collection of refs.

func (*Refs) HasValues

func (r *Refs) HasValues() bool

HasValues checks if Refs has any Values.

type RefsService

type RefsService service

RefsService handles communication with the refs related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs

func (*RefsService) CreateBranch

func (r *RefsService) CreateBranch(owner, repoSlug string, ro *RefRequest) (*Ref, *simpleresty.Response, error)

CreateBranch creates a new branch in the specified repository.

The branch name should not include any prefixes (e.g. refs/heads).

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/branches#post

func (*RefsService) CreateTag

func (r *RefsService) CreateTag(owner, repoSlug string, ro *RefRequest) (*Ref, *simpleresty.Response, error)

CreateTag creates a new tag in the specified repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/tags#post

func (*RefsService) DeleteBranch

func (r *RefsService) DeleteBranch(owner, repoSlug, name string) (*simpleresty.Response, error)

DeleteBranch deletes a branch in the specified repository.

The main branch is not allowed to be deleted and will return a 400 response.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/branches/%7Bname%7D#delete

func (*RefsService) DeleteTag

func (r *RefsService) DeleteTag(owner, repoSlug, name string) (*simpleresty.Response, error)

DeleteTag deletes a tag in the specified repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/tags/%7Bname%7D#delete

func (*RefsService) GetBranch

func (r *RefsService) GetBranch(owner, repoSlug, name string, opts ...interface{}) (*Ref, *simpleresty.Response, error)

GetBranch returns a branch object within the specified repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/branches/%7Bname%7D#get

func (*RefsService) GetTag

func (r *RefsService) GetTag(owner, repoSlug, name string, opts ...interface{}) (*Ref, *simpleresty.Response, error)

GetTag returns a tag object within the specified repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/tags/%7Bname%7D#get

func (*RefsService) ListAll

func (r *RefsService) ListAll(owner, repoSlug string, opts ...interface{}) (*Refs, *simpleresty.Response, error)

ListAll returns the branches and tags in the repository.

By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running "$ git show-ref". Note that this follows simple lexical ordering of the ref names.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs#get

func (*RefsService) ListBranches

func (r *RefsService) ListBranches(owner, repoSlug string, opts ...interface{}) (*Refs, *simpleresty.Response, error)

ListBranches returns a list of all open branches within the specified repository. Results will be in the order the source control manager returns them.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/branches#get

func (*RefsService) ListTags

func (r *RefsService) ListTags(owner, repoSlug string, opts ...interface{}) (*Refs, *simpleresty.Response, error)

ListTags returns the tags in the repository. Results will be in the order the source control manager returns them.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/tags#get

type Repositories

type Repositories struct {
	PaginationInfo

	Values []*Repository `json:"values,omitempty"`
}

Repositories represent a collection of repositories.

func (*Repositories) HasValues

func (r *Repositories) HasValues() bool

HasValues checks if Repositories has any Values.

type RepositoriesService

type RepositoriesService service

RepositoriesService handles communication with the repository related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories

func (*RepositoriesService) CreateHook

func (r *RepositoriesService) CreateHook(owner, repoSlug string, rho *RepositoryHookRequest) (*RepositoryHook, *simpleresty.Response, error)

CreateHook creates a new webhook on the specified repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/hooks#post

func (*RepositoriesService) Delete

func (r *RepositoriesService) Delete(owner, repoSlug string, deleteOpt *RepositoryDeleteQueryParam) (*simpleresty.Response, error)

Delete a repository. This is an irreversible operation.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D#delete

func (*RepositoriesService) DeleteHook

func (r *RepositoriesService) DeleteHook(owner, repoSlug, uid string) (*simpleresty.Response, error)

DeleteHook deletes the specified webhook subscription from the given repository. This is an irreversible operation.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/hooks/%7Buid%7D#delete

func (*RepositoriesService) Get

func (r *RepositoriesService) Get(owner, repoSlug string, opts ...interface{}) (*Repository, *simpleresty.Response, error)

Get a single repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D#get

func (*RepositoriesService) GetHook

func (r *RepositoriesService) GetHook(owner, repoSlug, uid string, opts ...interface{}) (*RepositoryHook, *simpleresty.Response, error)

GetHook returns the webhook with the specified id installed on the specified repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/hooks/%7Buid%7D#get

func (*RepositoriesService) List

func (r *RepositoriesService) List(owner string, opts ...interface{}) (*Repositories, *simpleresty.Response, error)

List all repositories owned by the specified account or UUID.

Accepts a query parameter for 'role.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D#get

func (*RepositoriesService) ListHooks

func (r *RepositoriesService) ListHooks(owner, repoSlug string, opts ...interface{}) (*RepositoryHooks, *simpleresty.Response, error)

ListHooks returns a paginated list of webhooks installed on a specified repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/hooks#get

func (*RepositoriesService) ListPublic

func (r *RepositoriesService) ListPublic(opts ...interface{}) (*Repositories, *simpleresty.Response, error)

ListPublic returns all public repositories.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories#get

func (*RepositoriesService) UpdateHook

func (r *RepositoriesService) UpdateHook(owner, repoSlug, uid string, rho *RepositoryHookRequest) (*RepositoryHook, *simpleresty.Response, error)

UpdateHook updates the specified webhook subscription.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/hooks/%7Buid%7D#put

type Repository

type Repository struct {
	UUID        *string               `json:"uuid,omitempty"`
	SCM         *string               `json:"scm,omitempty"`
	Website     *string               `json:"page,omitempty"`
	HasIssues   *bool                 `json:"has_issues,omitempty"`
	HasWiki     *bool                 `json:"has_wiki,omitempty"`
	Language    *string               `json:"language,omitempty"`
	ForkPolicy  *string               `json:"fork_policy,omitempty"`
	Links       *RepositoryLinks      `json:"links,omitempty"`
	Name        *string               `json:"name,omitempty"`
	CreatedOn   *time.Time            `json:"created_on,omitempty"`
	MainBranch  *RepositoryMainBranch `json:"main_branch,omitempty"`
	FullName    *string               `json:"full_name,omitempty"`
	Owner       *User                 `json:"owner,omitempty"`
	UpdatedOn   *time.Time            `json:"updated_on,omitempty"`
	Size        *int64                `json:"size,omitempty"`
	Type        *string               `json:"type,omitempty"`
	Slug        *string               `json:"slug,omitempty"`
	IsPrivate   *bool                 `json:"is_private,omitempty"`
	Description *string               `json:"description,omitempty"`
	Parent      *Repository           `json:"parent,omitempty"`
}

Repository represents a Bitbucket repository.

func (*Repository) GetCreatedOn

func (r *Repository) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*Repository) GetDescription

func (r *Repository) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*Repository) GetForkPolicy

func (r *Repository) GetForkPolicy() string

GetForkPolicy returns the ForkPolicy field if it's non-nil, zero value otherwise.

func (*Repository) GetFullName

func (r *Repository) GetFullName() string

GetFullName returns the FullName field if it's non-nil, zero value otherwise.

func (*Repository) GetHasIssues

func (r *Repository) GetHasIssues() bool

GetHasIssues returns the HasIssues field if it's non-nil, zero value otherwise.

func (*Repository) GetHasWiki

func (r *Repository) GetHasWiki() bool

GetHasWiki returns the HasWiki field if it's non-nil, zero value otherwise.

func (*Repository) GetIsPrivate

func (r *Repository) GetIsPrivate() bool

GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise.

func (*Repository) GetLanguage

func (r *Repository) GetLanguage() string

GetLanguage returns the Language field if it's non-nil, zero value otherwise.

func (r *Repository) GetLinks() *RepositoryLinks

GetLinks returns the Links field.

func (*Repository) GetMainBranch

func (r *Repository) GetMainBranch() *RepositoryMainBranch

GetMainBranch returns the MainBranch field.

func (*Repository) GetName

func (r *Repository) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Repository) GetOwner

func (r *Repository) GetOwner() *User

GetOwner returns the Owner field.

func (*Repository) GetParent

func (r *Repository) GetParent() *Repository

GetParent returns the Parent field.

func (*Repository) GetSCM

func (r *Repository) GetSCM() string

GetSCM returns the SCM field if it's non-nil, zero value otherwise.

func (*Repository) GetSize

func (r *Repository) GetSize() int64

GetSize returns the Size field if it's non-nil, zero value otherwise.

func (*Repository) GetSlug

func (r *Repository) GetSlug() string

GetSlug returns the Slug field if it's non-nil, zero value otherwise.

func (*Repository) GetType

func (r *Repository) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Repository) GetUUID

func (r *Repository) GetUUID() string

GetUUID returns the UUID field if it's non-nil, zero value otherwise.

func (*Repository) GetUpdatedOn

func (r *Repository) GetUpdatedOn() time.Time

GetUpdatedOn returns the UpdatedOn field if it's non-nil, zero value otherwise.

func (*Repository) GetWebsite

func (r *Repository) GetWebsite() string

GetWebsite returns the Website field if it's non-nil, zero value otherwise.

type RepositoryDeleteQueryParam

type RepositoryDeleteQueryParam struct {
	//If a repository has been moved to a new location, use this parameter to show users a friendly message
	// in the Bitbucket UI that the repository has moved to a new location.
	// However, a GET to this endpoint will still return a 404.
	RedirectTo string `url:"redirect_to,omitempty"`
}

RepositoryDeleteQueryParam represents the query parameter available when deleting a repository.

type RepositoryHook

type RepositoryHook struct {
	UUID        *string    `json:"uuid,omitempty"`
	URL         *string    `json:"url,omitempty"`
	Description *string    `json:"description,omitempty"`
	SubjectType []*string  `json:"subject_type,omitempty"`
	Active      *bool      `json:"active,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty"`
	Events      []*string  `json:"events,omitempty"`
}

RepositoryHook represents a repository hook.

func (*RepositoryHook) GetActive

func (r *RepositoryHook) GetActive() bool

GetActive returns the Active field if it's non-nil, zero value otherwise.

func (*RepositoryHook) GetCreatedAt

func (r *RepositoryHook) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*RepositoryHook) GetDescription

func (r *RepositoryHook) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*RepositoryHook) GetURL

func (r *RepositoryHook) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*RepositoryHook) GetUUID

func (r *RepositoryHook) GetUUID() string

GetUUID returns the UUID field if it's non-nil, zero value otherwise.

func (*RepositoryHook) HasEvents

func (r *RepositoryHook) HasEvents() bool

HasEvents checks if RepositoryHook has any Events.

func (*RepositoryHook) HasSubjectType

func (r *RepositoryHook) HasSubjectType() bool

HasSubjectType checks if RepositoryHook has any SubjectType.

type RepositoryHookRequest

type RepositoryHookRequest struct {
	Description *string   `json:"description,omitempty"`
	URL         *string   `json:"url,omitempty"`
	Active      *bool     `json:"active,omitempty"`
	Events      []*string `json:"events,omitempty"`
}

RepositoryHookRequest represents a request to create/update a hook.

func (*RepositoryHookRequest) GetActive

func (r *RepositoryHookRequest) GetActive() bool

GetActive returns the Active field if it's non-nil, zero value otherwise.

func (*RepositoryHookRequest) GetDescription

func (r *RepositoryHookRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*RepositoryHookRequest) GetURL

func (r *RepositoryHookRequest) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*RepositoryHookRequest) HasEvents

func (r *RepositoryHookRequest) HasEvents() bool

HasEvents checks if RepositoryHookRequest has any Events.

type RepositoryHooks

type RepositoryHooks struct {
	PaginationInfo

	Values []*RepositoryHook `json:"values,omitempty"`
}

RepositoryHooks represents a collection of repository hooks.

func (*RepositoryHooks) HasValues

func (r *RepositoryHooks) HasValues() bool

HasValues checks if RepositoryHooks has any Values.

type RepositoryLinks struct {
	Clone        []*Link `json:"clone,omitempty"`
	Watchers     *Link   `json:"watchers,omitempty"`
	Branches     *Link   `json:"branches,omitempty"`
	Tags         *Link   `json:"tags,omitempty"`
	Commits      *Link   `json:"commits,omitempty"`
	Downloads    *Link   `json:"downloads,omitempty"`
	Source       *Link   `json:"source,omitempty"`
	HTML         *Link   `json:"html,omitempty"`
	Avatar       *Link   `json:"avatar,omitempty"`
	Forks        *Link   `json:"forks,omitempty"`
	Self         *Link   `json:"self,omitempty"`
	PullRequests *Link   `json:"pull_requests,omitempty"`
}

RepositoryLinks represents the "links" object in a Bitbucket repository.

func (*RepositoryLinks) GetAvatar

func (r *RepositoryLinks) GetAvatar() *Link

GetAvatar returns the Avatar field.

func (*RepositoryLinks) GetBranches

func (r *RepositoryLinks) GetBranches() *Link

GetBranches returns the Branches field.

func (*RepositoryLinks) GetCommits

func (r *RepositoryLinks) GetCommits() *Link

GetCommits returns the Commits field.

func (*RepositoryLinks) GetDownloads

func (r *RepositoryLinks) GetDownloads() *Link

GetDownloads returns the Downloads field.

func (*RepositoryLinks) GetForks

func (r *RepositoryLinks) GetForks() *Link

GetForks returns the Forks field.

func (*RepositoryLinks) GetHTML

func (r *RepositoryLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*RepositoryLinks) GetHTTPSCloneURL

func (rl *RepositoryLinks) GetHTTPSCloneURL() string

GetHTTPSCloneURL get the HTTPS clone url. Returns empty string if not found.

func (*RepositoryLinks) GetPullRequests

func (r *RepositoryLinks) GetPullRequests() *Link

GetPullRequests returns the PullRequests field.

func (*RepositoryLinks) GetSSHCloneURL

func (rl *RepositoryLinks) GetSSHCloneURL() string

GetSSHCloneURL get the SSH clone url. Returns empty string if not found.

func (*RepositoryLinks) GetSelf

func (r *RepositoryLinks) GetSelf() *Link

GetSelf returns the Self field.

func (*RepositoryLinks) GetSource

func (r *RepositoryLinks) GetSource() *Link

GetSource returns the Source field.

func (*RepositoryLinks) GetTags

func (r *RepositoryLinks) GetTags() *Link

GetTags returns the Tags field.

func (*RepositoryLinks) GetWatchers

func (r *RepositoryLinks) GetWatchers() *Link

GetWatchers returns the Watchers field.

func (*RepositoryLinks) HasClone

func (r *RepositoryLinks) HasClone() bool

HasClone checks if RepositoryLinks has any Clone.

type RepositoryListQueryParams

type RepositoryListQueryParams struct {
	// Filters the result based on the authenticated user's role on each repository.
	// Valid roles:
	// - member: returns repositories to which the user has explicit read access
	// - contributor: returns repositories to which the user has explicit write access
	// - admin: returns repositories to which the user has explicit administrator access
	// - owner: returns all repositories owned by the current user
	Role string `url:"role,omitempty"`
}

RepositoryListQueryParams represents the filters and query parameters available when listing repositories.

type RepositoryMainBranch

type RepositoryMainBranch struct {
	Type *string `json:"type,omitempty"`
	Name *string `json:"name,omitempty"`
}

RepositoryMainBranch represents the primary branch set for a repository.

func (*RepositoryMainBranch) GetName

func (r *RepositoryMainBranch) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*RepositoryMainBranch) GetType

func (r *RepositoryMainBranch) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type RepositoryRequest

type RepositoryRequest struct {
	// Valid options for SCM are git or hg.
	SCM *string `json:"scm,omitempty"` // Required field.

	// Description of the new repository
	Description *string `json:"description,omitempty"`

	// Valid options: no_public_forks, no_forks, allow_forks
	ForkPolicy *string `json:"fork_policy,omitempty"`

	HasWiki   *bool   `json:"has_wiki,omitempty"`
	HasIssues *bool   `json:"has_issues,omitempty"`
	Name      *string `json:"name,omitempty"`

	// In order to set the project for the newly created repository,
	// pass in either the project key or the project UUID as part of the request body as shown in the examples below:
	Project struct {
		Key *string `json:"key,omitempty"`
	} `json:"project,omitempty"`
}

RepositoryRequest represents a request to create/update a repository. TODO: might need to break this apart as some fields aren't editable.

func (*RepositoryRequest) GetDescription

func (r *RepositoryRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*RepositoryRequest) GetForkPolicy

func (r *RepositoryRequest) GetForkPolicy() string

GetForkPolicy returns the ForkPolicy field if it's non-nil, zero value otherwise.

func (*RepositoryRequest) GetHasIssues

func (r *RepositoryRequest) GetHasIssues() bool

GetHasIssues returns the HasIssues field if it's non-nil, zero value otherwise.

func (*RepositoryRequest) GetHasWiki

func (r *RepositoryRequest) GetHasWiki() bool

GetHasWiki returns the HasWiki field if it's non-nil, zero value otherwise.

func (*RepositoryRequest) GetName

func (r *RepositoryRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*RepositoryRequest) GetSCM

func (r *RepositoryRequest) GetSCM() string

GetSCM returns the SCM field if it's non-nil, zero value otherwise.

type SRCGetOpts

type SRCGetOpts struct {
	// If provided, returns the contents of the repository and its subdirectories recursively
	// until the specified max_depth of nested directories. When omitted, this defaults to 1.
	MaxDepth int64 `url:"max_depth,omitempty"`
}

SRCGetOpts represents the query parameters available to SRC#Get requests.

type SRCMetadata

type SRCMetadata struct {
	Mimetype   *string           `json:"mimetype,omitempty"`
	Links      *FileHistoryLinks `json:"links,omitempty"`
	Commit     *Commit           `json:"commit,omitempty"`
	Attributes []*string         `json:"attributes,omitempty"`
	Path       *string           `json:"path,omitempty"`
	Type       *string           `json:"type,omitempty"`
	Size       *int64            `json:"size,omitempty"`
}

SRCMetadata represents a Bitbucket file/folder's metadata on a repository.

func (*SRCMetadata) GetCommit

func (s *SRCMetadata) GetCommit() *Commit

GetCommit returns the Commit field.

func (s *SRCMetadata) GetLinks() *FileHistoryLinks

GetLinks returns the Links field.

func (*SRCMetadata) GetMimetype

func (s *SRCMetadata) GetMimetype() string

GetMimetype returns the Mimetype field if it's non-nil, zero value otherwise.

func (*SRCMetadata) GetPath

func (s *SRCMetadata) GetPath() string

GetPath returns the Path field if it's non-nil, zero value otherwise.

func (*SRCMetadata) GetSize

func (s *SRCMetadata) GetSize() int64

GetSize returns the Size field if it's non-nil, zero value otherwise.

func (*SRCMetadata) GetType

func (s *SRCMetadata) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*SRCMetadata) HasAttributes

func (s *SRCMetadata) HasAttributes() bool

HasAttributes checks if SRCMetadata has any Attributes.

type SRCService

type SRCService service

SRCService handles communication with the src related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/src

func (*SRCService) GetMetadata

func (s *SRCService) GetMetadata(owner, repoSlug, nodeRev, path string, opts ...interface{}) (*SRCMetadata, *simpleresty.Response, error)

GetMetadata returns the JSON object describing the file or folder's properties, instead of returning the raw contents.

Supports the Bitbucket querying/filtering syntax and so you could filter a directory listing to only include entries that match certain criteria.

Bitbucket API docs:https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/src/%7Bnode%7D/%7Bpath%7D#get

func (*SRCService) GetRaw

func (s *SRCService) GetRaw(owner, repoSlug, nodeRev, path string,
	opts ...interface{}) (fileContent *bytes.Buffer, folderContent *FileHistory, resp *simpleresty.Response, err error)

GetRaw retrieves the contents of a single file, or the contents of a directory at a specified revision.

When path points to a file, this endpoint returns the raw contents. When path points to a directory instead of a file, the response is a paginated list of directory and file objects in the same order as the underlying SCM system would return them.

Bitbucket API docs:https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/src/%7Bnode%7D/%7Bpath%7D#get

type SSHKeyAddRequest

type SSHKeyAddRequest struct {
	Key   *string `json:"key,omitempty"`
	Label *string `json:"label,omitempty"`
}

SSHKeyAddRequest represents a request to add a SSH key.

func (*SSHKeyAddRequest) GetKey

func (s *SSHKeyAddRequest) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*SSHKeyAddRequest) GetLabel

func (s *SSHKeyAddRequest) GetLabel() string

GetLabel returns the Label field if it's non-nil, zero value otherwise.

type SearchCodeFileLinks struct {
	Self         *Link `json:"self,omitempty"`
	Repositories *Link `json:"repositories,omitempty"`
}

SearchCodeFileLinks represents the "links" object in a Bitbucket search code result file.

func (*SearchCodeFileLinks) GetRepositories

func (s *SearchCodeFileLinks) GetRepositories() *Link

GetRepositories returns the Repositories field.

func (*SearchCodeFileLinks) GetSelf

func (s *SearchCodeFileLinks) GetSelf() *Link

GetSelf returns the Self field.

type SearchCodeResult

type SearchCodeResult struct {
	Type              *string               `json:"type,omitempty"`
	ContentMatchCount *int64                `json:"content_match_count,omitempty"`
	ContentMatches    []*SearchContentMatch `json:"content_matches,omitempty"`
	PathMatches       []*SearchMatch        `json:"path_matches,omitempty"`
	File              *CodeFile             `json:"file,omitempty"`
}

SearchCodeResult represents the individual search query result.

func (*SearchCodeResult) GetContentMatchCount

func (s *SearchCodeResult) GetContentMatchCount() int64

GetContentMatchCount returns the ContentMatchCount field if it's non-nil, zero value otherwise.

func (*SearchCodeResult) GetFile

func (s *SearchCodeResult) GetFile() *CodeFile

GetFile returns the File field.

func (*SearchCodeResult) GetType

func (s *SearchCodeResult) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*SearchCodeResult) HasContentMatches

func (s *SearchCodeResult) HasContentMatches() bool

HasContentMatches checks if SearchCodeResult has any ContentMatches.

func (*SearchCodeResult) HasPathMatches

func (s *SearchCodeResult) HasPathMatches() bool

HasPathMatches checks if SearchCodeResult has any PathMatches.

type SearchCodeResults

type SearchCodeResults struct {
	PaginationInfo

	QuerySubstituted *bool             `json:"query_substituted,omitempty"`
	Values           *SearchCodeResult `json:"values,omitempty"`
}

SearchCodeResults represents the results from a search query.

func (*SearchCodeResults) GetQuerySubstituted

func (s *SearchCodeResults) GetQuerySubstituted() bool

GetQuerySubstituted returns the QuerySubstituted field if it's non-nil, zero value otherwise.

func (*SearchCodeResults) GetValues

func (s *SearchCodeResults) GetValues() *SearchCodeResult

GetValues returns the Values field.

type SearchContentMatch

type SearchContentMatch struct {
	Lines *SearchContentMatchLine `json:"lines,omitempty"`
}

SearchContentMatch represents the content code lines that match a search result.

func (*SearchContentMatch) GetLines

GetLines returns the Lines field.

type SearchContentMatchLine

type SearchContentMatchLine struct {
	Line     *int64         `json:"line,omitempty"`
	Segments []*SearchMatch `json:"segments,omitempty"`
}

SearchContentMatchLine represents the specific line(s) that match a content result.

func (*SearchContentMatchLine) GetLine

func (s *SearchContentMatchLine) GetLine() int64

GetLine returns the Line field if it's non-nil, zero value otherwise.

func (*SearchContentMatchLine) HasSegments

func (s *SearchContentMatchLine) HasSegments() bool

HasSegments checks if SearchContentMatchLine has any Segments.

type SearchMatch

type SearchMatch struct {
	Text  *string `json:"text,omitempty"`
	Match *bool   `json:"match,omitempty"`
}

SearchMatch represents the content of a search result code line.

func (*SearchMatch) GetMatch

func (s *SearchMatch) GetMatch() bool

GetMatch returns the Match field if it's non-nil, zero value otherwise.

func (*SearchMatch) GetText

func (s *SearchMatch) GetText() string

GetText returns the Text field if it's non-nil, zero value otherwise.

type Team

type Team struct {
	Username      *string    `json:"username,omitempty"`
	Nickname      *string    `json:"nickname,omitempty"`
	AccountStatus *string    `json:"account_status,omitempty"`
	DisplayName   *string    `json:"display_name,omitempty"`
	CreatedOn     *time.Time `json:"created_on,omitempty"`
	UUID          *string    `json:"uuid,omitempty"`
	Has2FAEnabled *string    `json:"has_2fa_enabled,omitempty"`
	Website       *string    `json:"website,omitempty"`
	Links         *TeamLinks `json:"links,omitempty"`
}

Team represents a Bitbucket team.

func (*Team) GetAccountStatus

func (t *Team) GetAccountStatus() string

GetAccountStatus returns the AccountStatus field if it's non-nil, zero value otherwise.

func (*Team) GetCreatedOn

func (t *Team) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*Team) GetDisplayName

func (t *Team) GetDisplayName() string

GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.

func (*Team) GetHas2FAEnabled

func (t *Team) GetHas2FAEnabled() string

GetHas2FAEnabled returns the Has2FAEnabled field if it's non-nil, zero value otherwise.

func (t *Team) GetLinks() *TeamLinks

GetLinks returns the Links field.

func (*Team) GetNickname

func (t *Team) GetNickname() string

GetNickname returns the Nickname field if it's non-nil, zero value otherwise.

func (*Team) GetUUID

func (t *Team) GetUUID() string

GetUUID returns the UUID field if it's non-nil, zero value otherwise.

func (*Team) GetUsername

func (t *Team) GetUsername() string

GetUsername returns the Username field if it's non-nil, zero value otherwise.

func (*Team) GetWebsite

func (t *Team) GetWebsite() string

GetWebsite returns the Website field if it's non-nil, zero value otherwise.

type TeamLinks struct {
	Self         *Link `json:"self,omitempty"`
	Hooks        *Link `json:"hooks,omitempty"`
	Repositories *Link `json:"repositories,omitempty"`
	Followers    *Link `json:"followers,omitempty"`
	HTML         *Link `json:"html,omitempty"`
	Avatar       *Link `json:"avatar,omitempty"`
	Following    *Link `json:"following,omitempty"`
	Members      *Link `json:"members,omitempty"`
	Projects     *Link `json:"projects,omitempty"`
	Snippets     *Link `json:"snippets,omitempty"`
}

TeamLinks represents the "links" object in a Bitbucket team.

func (*TeamLinks) GetAvatar

func (t *TeamLinks) GetAvatar() *Link

GetAvatar returns the Avatar field.

func (*TeamLinks) GetFollowers

func (t *TeamLinks) GetFollowers() *Link

GetFollowers returns the Followers field.

func (*TeamLinks) GetFollowing

func (t *TeamLinks) GetFollowing() *Link

GetFollowing returns the Following field.

func (*TeamLinks) GetHTML

func (t *TeamLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*TeamLinks) GetHooks

func (t *TeamLinks) GetHooks() *Link

GetHooks returns the Hooks field.

func (*TeamLinks) GetMembers

func (t *TeamLinks) GetMembers() *Link

GetMembers returns the Members field.

func (*TeamLinks) GetProjects

func (t *TeamLinks) GetProjects() *Link

GetProjects returns the Projects field.

func (*TeamLinks) GetRepositories

func (t *TeamLinks) GetRepositories() *Link

GetRepositories returns the Repositories field.

func (*TeamLinks) GetSelf

func (t *TeamLinks) GetSelf() *Link

GetSelf returns the Self field.

func (*TeamLinks) GetSnippets

func (t *TeamLinks) GetSnippets() *Link

GetSnippets returns the Snippets field.

type TeamListOpts

type TeamListOpts struct {
	// Filters the teams based on the authenticated user's role on each team:
	//  - member: returns a list of all the teams which the caller is a member of at least one team group or repository owned by the team.
	//  - contributor: returns a list of teams which the caller has write access to at least one repository owned by the team.
	//  - admin: returns a list teams which the caller has team administrator access.
	Role string `url:"role,omitempty"`
}

TeamListOpts represents the query parameters available to getting all Teams.

type TeamPermission

type TeamPermission struct {
	Permission *string `json:"permission,omitempty"`
	Type       *string `json:"type,omitempty"`
	User       *User   `json:"user,omitempty"`
	Team       *Team   `json:"team,omitempty"`
}

TeamPermission represents a team permission.

func (*TeamPermission) GetPermission

func (t *TeamPermission) GetPermission() string

GetPermission returns the Permission field if it's non-nil, zero value otherwise.

func (*TeamPermission) GetTeam

func (t *TeamPermission) GetTeam() *Team

GetTeam returns the Team field.

func (*TeamPermission) GetType

func (t *TeamPermission) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*TeamPermission) GetUser

func (t *TeamPermission) GetUser() *User

GetUser returns the User field.

type TeamPermissions

type TeamPermissions struct {
	PaginationInfo

	Values []*TeamPermission `json:"values,omitempty"`
}

TeamPermissions represents a collection of team permissions.

func (*TeamPermissions) HasValues

func (t *TeamPermissions) HasValues() bool

HasValues checks if TeamPermissions has any Values.

type TeamProject

type TeamProject struct {
	UUID        *string           `json:"uuid,omitempty"`
	Links       *TeamProjectLinks `json:"links,omitempty"`
	Description *string           `json:"description,omitempty"`
	CreatedOn   *time.Time        `json:"created_on,omitempty"`
	Key         *string           `json:"key,omitempty"`
	Owner       *User             `json:"owner,omitempty"`
	UpdatedOn   *time.Time        `json:"updated_on,omitempty"`
	Type        *string           `json:"type,omitempty"`
	IsPrivate   *bool             `json:"is_private,omitempty"`
	Name        *string           `json:"name,omitempty"`
}

TeamProject represents a team project in Bitbucket.

func (*TeamProject) GetCreatedOn

func (t *TeamProject) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*TeamProject) GetDescription

func (t *TeamProject) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*TeamProject) GetIsPrivate

func (t *TeamProject) GetIsPrivate() bool

GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise.

func (*TeamProject) GetKey

func (t *TeamProject) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (t *TeamProject) GetLinks() *TeamProjectLinks

GetLinks returns the Links field.

func (*TeamProject) GetName

func (t *TeamProject) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*TeamProject) GetOwner

func (t *TeamProject) GetOwner() *User

GetOwner returns the Owner field.

func (*TeamProject) GetType

func (t *TeamProject) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*TeamProject) GetUUID

func (t *TeamProject) GetUUID() string

GetUUID returns the UUID field if it's non-nil, zero value otherwise.

func (*TeamProject) GetUpdatedOn

func (t *TeamProject) GetUpdatedOn() time.Time

GetUpdatedOn returns the UpdatedOn field if it's non-nil, zero value otherwise.

type TeamProjectLinks struct {
	Self   *Link `json:"self,omitempty"`
	HTML   *Link `json:"html,omitempty"`
	Avatar *Link `json:"avatar,omitempty"`
}

TeamProjectLinks represents the "links" object in a Bitbucket team project.

func (*TeamProjectLinks) GetAvatar

func (t *TeamProjectLinks) GetAvatar() *Link

GetAvatar returns the Avatar field.

func (*TeamProjectLinks) GetHTML

func (t *TeamProjectLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*TeamProjectLinks) GetSelf

func (t *TeamProjectLinks) GetSelf() *Link

GetSelf returns the Self field.

type TeamProjectRequest

type TeamProjectRequest struct {
	Name        *string `json:"name,omitempty"`
	Key         *string `json:"key,omitempty"`
	Description *string `json:"description,omitempty"`
	IsPrivate   *bool   `json:"is_private,omitempty"`
}

TeamProjectRequest represents a request to create/update a team project.

func (*TeamProjectRequest) GetDescription

func (t *TeamProjectRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*TeamProjectRequest) GetIsPrivate

func (t *TeamProjectRequest) GetIsPrivate() bool

GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise.

func (*TeamProjectRequest) GetKey

func (t *TeamProjectRequest) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*TeamProjectRequest) GetName

func (t *TeamProjectRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

type TeamProjects

type TeamProjects struct {
	PaginationInfo

	Values []*TeamProject `json:"values,omitempty"`
}

TeamProjects represents a collection of team projects.

func (*TeamProjects) HasValues

func (t *TeamProjects) HasValues() bool

HasValues checks if TeamProjects has any Values.

type TeamRepoPermission

type TeamRepoPermission struct {
	Permission *string     `json:"permission,omitempty"`
	Type       *string     `json:"type,omitempty"`
	User       *User       `json:"user,omitempty"`
	Repository *Repository `json:"repository,omitempty"`
}

TeamRepoPermission represents a team repository permission.

func (*TeamRepoPermission) GetPermission

func (t *TeamRepoPermission) GetPermission() string

GetPermission returns the Permission field if it's non-nil, zero value otherwise.

func (*TeamRepoPermission) GetRepository

func (t *TeamRepoPermission) GetRepository() *Repository

GetRepository returns the Repository field.

func (*TeamRepoPermission) GetType

func (t *TeamRepoPermission) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*TeamRepoPermission) GetUser

func (t *TeamRepoPermission) GetUser() *User

GetUser returns the User field.

type TeamRepoPermissions

type TeamRepoPermissions struct {
	PaginationInfo

	Values []*TeamRepoPermission `json:"values,omitempty"`
}

TeamRepoPermissions represents a collection of team repository permissions.

func (*TeamRepoPermissions) HasValues

func (t *TeamRepoPermissions) HasValues() bool

HasValues checks if TeamRepoPermissions has any Values.

type Teams

type Teams struct {
	PaginationInfo

	Values []*Team `json:"values,omitempty"`
}

Teams represents a collection of teams.

func (*Teams) HasValues

func (t *Teams) HasValues() bool

HasValues checks if Teams has any Values.

type TeamsService

type TeamsService service

TeamsService handles communication with the teams related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams

func (*TeamsService) CreateProject

func (t *TeamsService) CreateProject(teamUsername string, po *TeamProjectRequest) (*TeamProject, *simpleresty.Response, error)

CreateProject creates a new project.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/projects/#post

func (*TeamsService) DeleteProject

func (t *TeamsService) DeleteProject(teamUsername, projectKey string) (*simpleresty.Response, error)

DeleteProject deletes the specified project.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/projects/%7Bproject_key%7D#delete

func (*TeamsService) Get

func (t *TeamsService) Get(teamUsername string, opts ...interface{}) (*Team, *simpleresty.Response, error)

Get the public information associated with a team.

If the team's profile is private, location, website and created_on elements are omitted.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D#get

func (*TeamsService) GetRepositoryPermissions

func (t *TeamsService) GetRepositoryPermissions(teamUsername, repoSlug string, opts ...interface{}) (*TeamRepoPermissions, *simpleresty.Response, error)

GetRepositoryPermissions returns each repository permission of a given repository.

If the username URL parameter refers to a user account instead of a team account, an object containing the repository permissions of the username's repository will be returned.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/permissions/repositories/%7Brepo_slug%7D#get

func (*TeamsService) List

func (t *TeamsService) List(opts ...interface{}) (*Teams, *simpleresty.Response, error)

List returns all the teams that the authenticated user is associated with.

Requires 'role' query parameter to be set.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams#get

func (*TeamsService) ListFollowers

func (t *TeamsService) ListFollowers(teamUsername string, opts ...interface{}) (*Users, *simpleresty.Response, error)

ListFollowers returns the list of accounts that are following this team.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/followers#get

func (*TeamsService) ListFollowing

func (t *TeamsService) ListFollowing(teamUsername string, opts ...interface{}) (*Users, *simpleresty.Response, error)

ListFollowing returns the list of accounts this team is following.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/following#get

func (*TeamsService) ListMembers

func (t *TeamsService) ListMembers(teamUsername string, opts ...interface{}) (*Users, *simpleresty.Response, error)

ListMembers returns all members of the specified team.

Any member of any of the team's groups is considered a member of the team. This includes users in groups that may not actually have access to any of the team's repositories.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/members#get

func (*TeamsService) ListPermissions

func (t *TeamsService) ListPermissions(teamUsername string, opts ...interface{}) (*TeamPermissions, *simpleresty.Response, error)

ListPermissions returns each team permission a user on the team has.

Permissions returned are effective permissions — if a user is a member of multiple groups with distinct roles, only the highest level is returned.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/permissions#get

func (*TeamsService) ListProjects

func (t *TeamsService) ListProjects(teamUsername string, opts ...interface{}) (*TeamProjects, *simpleresty.Response, error)

ListProjects returns each project a team has.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/projects/#get

func (*TeamsService) ListRepositoryPermissions

func (t *TeamsService) ListRepositoryPermissions(teamUsername string, opts ...interface{}) (*TeamRepoPermissions, *simpleresty.Response, error)

ListRepositoryPermissions returns each repository permission for all of a team’s repositories.

If the username URL parameter refers to a user account instead of a team account, an object containing the repository permissions of all the username's repositories will be returned.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/permissions/repositories#get

func (*TeamsService) ListTeamRepositories

func (t *TeamsService) ListTeamRepositories(teamUsername string, opts ...interface{}) (*Repositories, *simpleresty.Response, error)

ListTeamRepositories returns the list of accounts that are following this team.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/repositories#get

func (*TeamsService) SearchCode

func (t *TeamsService) SearchCode(teamUsername string, opts ...interface{}) (*SearchCodeResults, *simpleresty.Response, error)

SearchCode searches for code in the repositories of the specified team.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/search/code#get

func (*TeamsService) UpdateProject

func (t *TeamsService) UpdateProject(teamUsername, projectKey string, po *TeamProjectRequest) (*TeamProject, *simpleresty.Response, error)

UpdateProject updates an existing project

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/projects/%7Bproject_key%7D#put

type User

type User struct {
	Username      *string    `json:"username,omitempty"`
	Website       *string    `json:"website,omitempty"`
	DisplayName   *string    `json:"display_name,omitempty"`
	UUID          *string    `json:"uuid,omitempty"`
	Links         *UserLinks `json:"links,omitempty"`
	Nickname      *string    `json:"nickname,omitempty"`
	CreatedOn     *time.Time `json:"created_on,omitempty"`
	IsStaff       *bool      `json:"is_staff,omitempty"`
	Location      *string    `json:"location,omitempty"`
	AccountStatus *string    `json:"account_status,omitempty"`
	Type          *string    `json:"type,omitempty"`
	AccountID     *string    `json:"account_id,omitempty"`
}

User represents a Bitbucket user.

func (*User) GetAccountID

func (u *User) GetAccountID() string

GetAccountID returns the AccountID field if it's non-nil, zero value otherwise.

func (*User) GetAccountStatus

func (u *User) GetAccountStatus() string

GetAccountStatus returns the AccountStatus field if it's non-nil, zero value otherwise.

func (*User) GetCreatedOn

func (u *User) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*User) GetDisplayName

func (u *User) GetDisplayName() string

GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.

func (*User) GetIsStaff

func (u *User) GetIsStaff() bool

GetIsStaff returns the IsStaff field if it's non-nil, zero value otherwise.

func (u *User) GetLinks() *UserLinks

GetLinks returns the Links field.

func (*User) GetLocation

func (u *User) GetLocation() string

GetLocation returns the Location field if it's non-nil, zero value otherwise.

func (*User) GetNickname

func (u *User) GetNickname() string

GetNickname returns the Nickname field if it's non-nil, zero value otherwise.

func (*User) GetType

func (u *User) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*User) GetUUID

func (u *User) GetUUID() string

GetUUID returns the UUID field if it's non-nil, zero value otherwise.

func (*User) GetUsername

func (u *User) GetUsername() string

GetUsername returns the Username field if it's non-nil, zero value otherwise.

func (*User) GetWebsite

func (u *User) GetWebsite() string

GetWebsite returns the Website field if it's non-nil, zero value otherwise.

type UserEmail

type UserEmail struct {
	IsPrimary   *bool           `json:"is_primary,omitempty"`
	IsConfirmed *bool           `json:"is_confirmed,omitempty"`
	Type        *string         `json:"type,omitempty"`
	Email       *string         `json:"email,omitempty"`
	Links       *UserEmailLinks `json:"links,omitempty"`
}

UserEmail represents an individual user's email address.

func (*UserEmail) GetEmail

func (u *UserEmail) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*UserEmail) GetIsConfirmed

func (u *UserEmail) GetIsConfirmed() bool

GetIsConfirmed returns the IsConfirmed field if it's non-nil, zero value otherwise.

func (*UserEmail) GetIsPrimary

func (u *UserEmail) GetIsPrimary() bool

GetIsPrimary returns the IsPrimary field if it's non-nil, zero value otherwise.

func (u *UserEmail) GetLinks() *UserEmailLinks

GetLinks returns the Links field.

func (*UserEmail) GetType

func (u *UserEmail) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type UserEmailLinks struct {
	Self *Link `json:"self,omitempty"`
}

UserEmailLinks represents the "links" object in a Bitbucket user email.

func (*UserEmailLinks) GetSelf

func (u *UserEmailLinks) GetSelf() *Link

GetSelf returns the Self field.

type UserEmails

type UserEmails struct {
	PaginationInfo

	Values []*UserEmail `json:"values,omitempty"`
}

UserEmails represents a collection of user emails.

func (*UserEmails) HasValues

func (u *UserEmails) HasValues() bool

HasValues checks if UserEmails has any Values.

type UserHook

type UserHook struct {
	UUID        *string    `json:"uuid,omitempty"`
	URL         *string    `json:"url,omitempty"`
	Description *string    `json:"description,omitempty"`
	SubjectType *string    `json:"subject_type,omitempty"`
	Active      *bool      `json:"active,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty"`
	Events      []*string  `json:"events,omitempty"`
}

UserHook represents a user hook.

func (*UserHook) GetActive

func (u *UserHook) GetActive() bool

GetActive returns the Active field if it's non-nil, zero value otherwise.

func (*UserHook) GetCreatedAt

func (u *UserHook) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*UserHook) GetDescription

func (u *UserHook) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*UserHook) GetSubjectType

func (u *UserHook) GetSubjectType() string

GetSubjectType returns the SubjectType field if it's non-nil, zero value otherwise.

func (*UserHook) GetURL

func (u *UserHook) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*UserHook) GetUUID

func (u *UserHook) GetUUID() string

GetUUID returns the UUID field if it's non-nil, zero value otherwise.

func (*UserHook) HasEvents

func (u *UserHook) HasEvents() bool

HasEvents checks if UserHook has any Events.

type UserHooks

type UserHooks struct {
	PaginationInfo

	Values []*Issue `json:"values,omitempty"`
}

UserHooks represent a user's hooks.

func (*UserHooks) HasValues

func (u *UserHooks) HasValues() bool

HasValues checks if UserHooks has any Values.

type UserLinks struct {
	Hooks        *Link `json:"hooks,omitempty"`
	Self         *Link `json:"self,omitempty"`
	Repositories *Link `json:"repositories,omitempty"`
	HTML         *Link `json:"html,omitempty"`
	Followers    *Link `json:"followers,omitempty"`
	Avatar       *Link `json:"avatar,omitempty"`
	Following    *Link `json:"following,omitempty"`
	Snippets     *Link `json:"snippet,omitempty"`
}

UserLinks represents the "links" object in a Bitbucket user.

func (*UserLinks) GetAvatar

func (u *UserLinks) GetAvatar() *Link

GetAvatar returns the Avatar field.

func (*UserLinks) GetFollowers

func (u *UserLinks) GetFollowers() *Link

GetFollowers returns the Followers field.

func (*UserLinks) GetFollowing

func (u *UserLinks) GetFollowing() *Link

GetFollowing returns the Following field.

func (*UserLinks) GetHTML

func (u *UserLinks) GetHTML() *Link

GetHTML returns the HTML field.

func (*UserLinks) GetHooks

func (u *UserLinks) GetHooks() *Link

GetHooks returns the Hooks field.

func (*UserLinks) GetRepositories

func (u *UserLinks) GetRepositories() *Link

GetRepositories returns the Repositories field.

func (*UserLinks) GetSelf

func (u *UserLinks) GetSelf() *Link

GetSelf returns the Self field.

func (*UserLinks) GetSnippets

func (u *UserLinks) GetSnippets() *Link

GetSnippets returns the Snippets field.

type UserRepositoriesPermission

type UserRepositoriesPermission struct {
	Type       *string     `json:"type,omitempty"`
	User       *User       `json:"user,omitempty"`
	Repository *Repository `json:"repository,omitempty"`
	Permission *string     `json:"permission,omitempty"`
}

UserRepositoriesPermission represents a user's repository permission.

func (*UserRepositoriesPermission) GetPermission

func (u *UserRepositoriesPermission) GetPermission() string

GetPermission returns the Permission field if it's non-nil, zero value otherwise.

func (*UserRepositoriesPermission) GetRepository

func (u *UserRepositoriesPermission) GetRepository() *Repository

GetRepository returns the Repository field.

func (*UserRepositoriesPermission) GetType

func (u *UserRepositoriesPermission) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*UserRepositoriesPermission) GetUser

func (u *UserRepositoriesPermission) GetUser() *User

GetUser returns the User field.

type UserRepositoriesPermissions

type UserRepositoriesPermissions struct {
	PaginationInfo

	Values []*UserRepositoriesPermission `json:"values,omitempty"`
}

UserRepositoriesPermissions represents a collection of a user's permissions on repositories.

func (*UserRepositoriesPermissions) HasValues

func (u *UserRepositoriesPermissions) HasValues() bool

HasValues checks if UserRepositoriesPermissions has any Values.

type UserService

type UserService service

UserService handles communication with the user related methods of the Bitbucket API.

This service only deals with returning information about the authenticated user.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user

func (*UserService) Get

func (u *UserService) Get() (*User, *simpleresty.Response, error)

Get returns the currently authenticated user.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user#get

func (*UserService) GetEmails

func (u *UserService) GetEmails(opts ...interface{}) (*UserEmails, *simpleresty.Response, error)

GetEmails returns all the authenticated user's email addresses. Both confirmed and unconfirmed.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user/emails/%7Bemail%7D#get

func (*UserService) ListRepositoryPerms

func (u *UserService) ListRepositoryPerms(opts ...interface{}) (*UserRepositoriesPermissions, *simpleresty.Response, error)

ListRepositoryPerms returns permissions for each repository the caller has explicit access to and the highest level of permission the caller has.

This does not return public repositories that the user was not granted any specific permission in, and does not distinguish between direct and indirect privileges.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user/permissions/repositories#get

func (*UserService) ListTeamsPerms

func (u *UserService) ListTeamsPerms(opts ...interface{}) (*UserTeamsPermissions, *simpleresty.Response, error)

ListTeamsPerms returns permissions for each team the caller is a member of and the highest level of privilege the caller has.

If a user is a member of multiple groups with distinct roles, only the highest level is returned.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user/permissions/teams#get

type UserTeamsPermission

type UserTeamsPermission struct {
	Type       *string `json:"type,omitempty"`
	User       *User   `json:"user,omitempty"`
	Team       *Team   `json:"team,omitempty"`
	Permission *string `json:"permission,omitempty"`
}

UserTeamsPermission represents a user's team permission.

func (*UserTeamsPermission) GetPermission

func (u *UserTeamsPermission) GetPermission() string

GetPermission returns the Permission field if it's non-nil, zero value otherwise.

func (*UserTeamsPermission) GetTeam

func (u *UserTeamsPermission) GetTeam() *Team

GetTeam returns the Team field.

func (*UserTeamsPermission) GetType

func (u *UserTeamsPermission) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*UserTeamsPermission) GetUser

func (u *UserTeamsPermission) GetUser() *User

GetUser returns the User field.

type UserTeamsPermissions

type UserTeamsPermissions struct {
	PaginationInfo

	Values []*UserTeamsPermission `json:"values,omitempty"`
}

UserTeamsPermissions represents a collection of a user's permissions on repositories.

func (*UserTeamsPermissions) HasValues

func (u *UserTeamsPermissions) HasValues() bool

HasValues checks if UserTeamsPermissions has any Values.

type Users

type Users struct {
	PaginationInfo

	Values []*User `json:"values,omitempty"`
}

Users represents a collection of users.

func (*Users) HasValues

func (u *Users) HasValues() bool

HasValues checks if Users has any Values.

type UsersSSHKey

type UsersSSHKey struct {
	Comment   *string           `json:"comment,omitempty"`
	CreatedOn *time.Time        `json:"created_on,omitempty"`
	Key       *string           `json:"key,omitempty"`
	Label     *string           `json:"labels,omitempty"`
	LastUsed  *time.Time        `json:"last_used,omitempty"`
	Links     *UsersSSHKeyLinks `json:"links,omitempty"`
	Owner     *User             `json:"owner,omitempty"`
	Type      *string           `json:"values,omitempty"`
	UUID      *string           `json:"uuid,omitempty"`
}

UsersSSHKey represents a user ssh key added to Bitbucket.

func (*UsersSSHKey) GetComment

func (u *UsersSSHKey) GetComment() string

GetComment returns the Comment field if it's non-nil, zero value otherwise.

func (*UsersSSHKey) GetCreatedOn

func (u *UsersSSHKey) GetCreatedOn() time.Time

GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.

func (*UsersSSHKey) GetKey

func (u *UsersSSHKey) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*UsersSSHKey) GetLabel

func (u *UsersSSHKey) GetLabel() string

GetLabel returns the Label field if it's non-nil, zero value otherwise.

func (*UsersSSHKey) GetLastUsed

func (u *UsersSSHKey) GetLastUsed() time.Time

GetLastUsed returns the LastUsed field if it's non-nil, zero value otherwise.

func (u *UsersSSHKey) GetLinks() *UsersSSHKeyLinks

GetLinks returns the Links field.

func (*UsersSSHKey) GetOwner

func (u *UsersSSHKey) GetOwner() *User

GetOwner returns the Owner field.

func (*UsersSSHKey) GetType

func (u *UsersSSHKey) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*UsersSSHKey) GetUUID

func (u *UsersSSHKey) GetUUID() string

GetUUID returns the UUID field if it's non-nil, zero value otherwise.

type UsersSSHKeyLinks struct {
	Self *Link `json:"self,omitempty"`
}

UsersSSHKeyLinks represents the "links" object in a Bitbucket user ssh key.

func (*UsersSSHKeyLinks) GetSelf

func (u *UsersSSHKeyLinks) GetSelf() *Link

GetSelf returns the Self field.

type UsersSSHKeys

type UsersSSHKeys struct {
	PaginationInfo

	Values []*UsersSSHKey `json:"values,omitempty"`
}

UsersSSHKeys represents a collection of user ssh keys.

func (*UsersSSHKeys) HasValues

func (u *UsersSSHKeys) HasValues() bool

HasValues checks if UsersSSHKeys has any Values.

type UsersService

type UsersService service

UsersService handles communication with the users related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/users

func (*UsersService) AddSSHKey

func (u *UsersService) AddSSHKey(userID string, newKey *SSHKeyAddRequest) (*UsersSSHKey, *simpleresty.Response, error)

AddSSHKey adds a new SSH public key to the specified user account and returns the resulting key.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D/ssh-keys#post

func (*UsersService) DeleteHook

func (u *UsersService) DeleteHook(userID, hookID string) (*simpleresty.Response, error)

DeleteHook deletes a single hook for a user.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D/hooks/%7Buid%7D#delete

func (*UsersService) GetByID

func (u *UsersService) GetByID(userID string, opts ...interface{}) (*User, *simpleresty.Response, error)

GetByID fetches a single user.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D#get

func (*UsersService) GetHook

func (u *UsersService) GetHook(userID, hookID string, opts ...interface{}) (*UserHook, *simpleresty.Response, error)

GetHook fetches a single hook for a user.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D/hooks/%7Buid%7D#get

func (*UsersService) ListHooks

func (u *UsersService) ListHooks(userID string, opts ...interface{}) (*UserHooks, *simpleresty.Response, error)

ListHooks fetches all hooks for a user.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D/hooks#get

func (*UsersService) ListRepositories

func (u *UsersService) ListRepositories(userID string, opts ...interface{}) (*Repositories, *simpleresty.Response, error)

ListRepositories fetches all repositories owned by a user/team.

This includes private repositories, but filtered down to the ones that the calling user has access to.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D/repositories#get

func (*UsersService) ListSSHKeys

func (u *UsersService) ListSSHKeys(userID string, opts ...interface{}) (*UsersSSHKeys, *simpleresty.Response, error)

ListSSHKeys returns a paginated list of the user's SSH public keys.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D/ssh-keys#get

func (*UsersService) SearchCode

func (u *UsersService) SearchCode(userID string, opts ...interface{}) (*SearchCodeResults, *simpleresty.Response, error)

SearchCode searches for code in the repositories of the specified user.

Accepts the user's UUID, account_id, or username. Recommend to use UUID or account_id.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D/search/code#get

type Version

type Version struct {
	ID         *int64        `json:"-"` // This field is not present in the API response.
	Repository *Repository   `json:"repository,omitempty"`
	Type       *string       `json:"type,omitempty"`
	Name       *string       `json:"name,omitempty"`
	Links      *VersionLinks `json:"links,omitempty"`
}

Version represents a Bitbucket repository version.

func (*Version) GetID

func (v *Version) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (v *Version) GetLinks() *VersionLinks

GetLinks returns the Links field.

func (*Version) GetName

func (v *Version) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Version) GetRepository

func (v *Version) GetRepository() *Repository

GetRepository returns the Repository field.

func (*Version) GetType

func (v *Version) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type VersionLinks struct {
	Self *Link `json:"self,omitempty"`
}

VersionLinks represents the "links" object in a Bitbucket version.

func (*VersionLinks) GetSelf

func (v *VersionLinks) GetSelf() *Link

GetSelf returns the Self field.

type VersionRequest

type VersionRequest struct {
	Name *string `json:"name,omitempty"`
}

VersionRequest represents an EXISTING version to be added to an issue or pull request. There is no CREATE or UPDATE endpoint for the version resource.

func (*VersionRequest) GetName

func (v *VersionRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

type Versions

type Versions struct {
	PaginationInfo

	Values []*Version `json:"values,omitempty"`
}

Versions represents a collection of versions.

func (*Versions) HasValues

func (v *Versions) HasValues() bool

HasValues checks if Versions has any Values.

type VersionsService

type VersionsService service

VersionsService handles communication with the version related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/versions

func (*VersionsService) Get

func (v *VersionsService) Get(owner, repoSlug string, versionID int64, opts ...interface{}) (*Version, *simpleresty.Response, error)

Get a single version. NOTE: The version ID is a numerical value, not the version name, that is visible in the links.self.href object.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/versions/%7Bversion_id%7D#get

func (*VersionsService) List

func (v *VersionsService) List(owner, repoSlug string, opts ...interface{}) (*Versions, *simpleresty.Response, error)

List all versions that have been defined in the issue tracker.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/versions#get

type WatchersService

type WatchersService service

WatchersService handles communication with the watchers related methods of the Bitbucket API.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/watchers

func (*WatchersService) List

func (w *WatchersService) List(owner, repoSlug string, opts ...interface{}) (*Users, *simpleresty.Response, error)

List returns a paginated list of all the watchers on the specified repository.

Bitbucket API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/watchers#get

Jump to

Keyboard shortcuts

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