mirror of
https://github.com/gfleury/go-bitbucket-v1.git
synced 2025-07-05 05:22:52 -05:00
Adding GetPullRequestResponse and fixing Create (PullRequest)
This commit is contained in:
@ -125,7 +125,7 @@ type PullRequestRef struct {
|
||||
|
||||
type PullRequest struct {
|
||||
ID int `json:"id"`
|
||||
Version int32 `json:"version"`
|
||||
Version int32 `json:"version"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
State string `json:"state"`
|
||||
@ -299,6 +299,13 @@ func GetSSHKeysResponse(r *APIResponse) ([]SSHKey, error) {
|
||||
return m, err
|
||||
}
|
||||
|
||||
// GetPullRequestResponse cast PullRequest into structure
|
||||
func GetPullRequestResponse(r *APIResponse) (PullRequest, error) {
|
||||
var m PullRequest
|
||||
err := mapstructure.Decode(r.Values["values"], &m)
|
||||
return m, err
|
||||
}
|
||||
|
||||
// NewAPIResponse create new APIResponse from http.Response
|
||||
func NewAPIResponse(r *http.Response) *APIResponse {
|
||||
|
||||
|
Reference in New Issue
Block a user