mirror of
https://github.com/gfleury/go-bitbucket-v1.git
synced 2025-04-04 17:00:12 -05:00
Merge pull request #6 from sanketjpatel/feat/types
Add struct types for apiResponses
This commit is contained in:
commit
c7ca91b813
@ -31,6 +31,19 @@ type APIResponse struct {
|
||||
Values map[string]interface{}
|
||||
}
|
||||
|
||||
type SelfLink struct {
|
||||
Href string `json:"href"`
|
||||
}
|
||||
|
||||
type CloneLink struct {
|
||||
Href string `json:"href"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type Links struct {
|
||||
Self []SelfLink `json:"self"`
|
||||
}
|
||||
|
||||
type Project struct {
|
||||
Key string `json:"key"`
|
||||
ID int `json:"id"`
|
||||
@ -38,11 +51,7 @@ type Project struct {
|
||||
Description string `json:"description"`
|
||||
Public bool `json:"public"`
|
||||
Type string `json:"type"`
|
||||
Links struct {
|
||||
Self []struct {
|
||||
Href string `json:"href"`
|
||||
} `json:"self"`
|
||||
} `json:"links"`
|
||||
Links Links `json:"links"`
|
||||
}
|
||||
|
||||
// Repository contains data from a BitBucket Repository
|
||||
@ -57,16 +66,69 @@ type Repository struct {
|
||||
Project Project `json:"project"`
|
||||
Public bool `json:"public"`
|
||||
Links struct {
|
||||
Clone []struct {
|
||||
Href string `json:"href"`
|
||||
Name string `json:"name"`
|
||||
} `json:"clone"`
|
||||
Self []struct {
|
||||
Href string `json:"href"`
|
||||
} `json:"self"`
|
||||
Clone []CloneLink `json:"clone"`
|
||||
Self []SelfLink `json:"self"`
|
||||
} `json:"links"`
|
||||
}
|
||||
|
||||
type UserWithNameEmail struct {
|
||||
Name string `json:"name"`
|
||||
EmailAddress string `json:"emailAddress"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
Name string `json:"name"`
|
||||
Email string `json:"emailAddress"`
|
||||
ID string `json:"id"`
|
||||
DisplayName string `json:"displayName"`
|
||||
Active bool `json:"active"`
|
||||
Slug string `json:"slug"`
|
||||
Type string `json:"type"`
|
||||
Links Links `json:"links"`
|
||||
}
|
||||
|
||||
type UserWithMetadata struct {
|
||||
User User `json:"user"`
|
||||
Role string `json:"role"`
|
||||
Approved bool `json:"approved"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type MergeResult struct {
|
||||
Outcome string `json:"outcome"`
|
||||
Current bool `json:"current"`
|
||||
}
|
||||
|
||||
type PullRequestRef struct {
|
||||
ID string `json:"id"`
|
||||
DisplayID string `json:"displayId"`
|
||||
LatestCommit string `json:"latestCommit"`
|
||||
Repository Repository `json:"repository"`
|
||||
}
|
||||
|
||||
type PullRequest struct {
|
||||
ID int `json:"id"`
|
||||
Version int `json:"version"`
|
||||
Title string `json:"title"`
|
||||
State string `json:"state"`
|
||||
Open bool `json:"open"`
|
||||
Closed bool `json:"closed"`
|
||||
CreatedDate int64 `json:"createdDate"`
|
||||
UpdatedDate int64 `json:"updatedDate"`
|
||||
FromRef PullRequestRef `json:"fromRef"`
|
||||
ToRef PullRequestRef `json:"toRef"`
|
||||
Locked bool `json:"locked"`
|
||||
Author UserWithMetadata `json:"author"`
|
||||
Reviewers []UserWithMetadata `json:"reviewers"`
|
||||
Participants []UserWithMetadata `json:"participants"`
|
||||
Properties struct {
|
||||
MergeResult MergeResult `json:"mergeResult"`
|
||||
ResolvedTaskCount int `json:"resolvedTaskCount"`
|
||||
OpenTaskCount int `json:"openTaskCount"`
|
||||
} `json:"properties"`
|
||||
Links Links `json:"links"`
|
||||
}
|
||||
|
||||
// SSHKey contains data from a SSHKey in the BitBucket Server
|
||||
type SSHKey struct {
|
||||
ID int `json:"id"`
|
||||
@ -78,15 +140,9 @@ type SSHKey struct {
|
||||
type Commit struct {
|
||||
ID string `json:"id"`
|
||||
DisplayID string `json:"displayId"`
|
||||
Author struct {
|
||||
Name string `json:"name"`
|
||||
EmailAddress string `json:"emailAddress"`
|
||||
} `json:"author"`
|
||||
Author UserWithNameEmail `json:"author"`
|
||||
AuthorTimestamp int64 `json:"authorTimestamp"`
|
||||
Committer struct {
|
||||
Name string `json:"name"`
|
||||
EmailAddress string `json:"emailAddress"`
|
||||
} `json:"committer"`
|
||||
Committer UserWithNameEmail `json:"committer"`
|
||||
CommitterTimestamp int64 `json:"committerTimestamp"`
|
||||
Message string `json:"message"`
|
||||
Parents []struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user