@@ -19,6 +19,7 @@ type Repositories struct {
19
19
20
20
// Repository represents a Bitbucket repository.
21
21
type Repository struct {
22
+ UUID * string `json:"uuid,omitempty"`
22
23
SCM * string `json:"scm,omitempty"`
23
24
Website * string `json:"page,omitempty"`
24
25
HasIssues * bool `json:"has_issues,omitempty"`
@@ -46,26 +47,47 @@ type RepositoryMainBranch struct {
46
47
Name * string `json:"name,omitempty"`
47
48
}
48
49
49
- // RepositoryCloneLink represents the specific clone related links in a Bitbucket repository.
50
- type RepositoryCloneLink struct {
51
- HRef * string `json:"href,omitempty"`
52
- Name * string `json:"name,omitempty"`
50
+ // RepositoryCloneLinks represents a collection of repository clone links.
51
+ type RepositoryCloneLinks struct {
52
+ Values []* Link
53
+ }
54
+
55
+ // GetHTTPS get the HTTPS clone link. Returns empty string if not found.
56
+ func (rcl * RepositoryCloneLinks ) GetHTTPS () string {
57
+ for _ , link := range rcl .Values {
58
+ if link .GetName () == "https" {
59
+ return link .GetHRef ()
60
+ }
61
+ }
62
+
63
+ return ""
64
+ }
65
+
66
+ // GetSSH get the SSH clone link. Returns empty string if not found.
67
+ func (rcl * RepositoryCloneLinks ) GetSSH () string {
68
+ for _ , link := range rcl .Values {
69
+ if link .GetName () == "ssh" {
70
+ return link .GetHRef ()
71
+ }
72
+ }
73
+
74
+ return ""
53
75
}
54
76
55
77
// RepositoryLinks represents the "links" object in a Bitbucket repository.
56
78
type RepositoryLinks struct {
57
- Clone [] * RepositoryCloneLink `json:"clone,omitempty"`
58
- Watchers * Link `json:"watchers,omitempty"`
59
- Branches * Link `json:"branches,omitempty"`
60
- Tags * Link `json:"tags,omitempty"`
61
- Commits * Link `json:"commits,omitempty"`
62
- Downloads * Link `json:"downloads,omitempty"`
63
- Source * Link `json:"source,omitempty"`
64
- HTML * Link `json:"html,omitempty"`
65
- Avatar * Link `json:"avatar,omitempty"`
66
- Forks * Link `json:"forks,omitempty"`
67
- Self * Link `json:"self,omitempty"`
68
- PullRequests * Link `json:"pull_requests,omitempty"`
79
+ Clone RepositoryCloneLinks `json:"clone,omitempty"`
80
+ Watchers * Link `json:"watchers,omitempty"`
81
+ Branches * Link `json:"branches,omitempty"`
82
+ Tags * Link `json:"tags,omitempty"`
83
+ Commits * Link `json:"commits,omitempty"`
84
+ Downloads * Link `json:"downloads,omitempty"`
85
+ Source * Link `json:"source,omitempty"`
86
+ HTML * Link `json:"html,omitempty"`
87
+ Avatar * Link `json:"avatar,omitempty"`
88
+ Forks * Link `json:"forks,omitempty"`
89
+ Self * Link `json:"self,omitempty"`
90
+ PullRequests * Link `json:"pull_requests,omitempty"`
69
91
}
70
92
71
93
// RepositoryListQueryParams represents the filters and query parameters available when listing repositories.
0 commit comments