2021-10-10 19:01:48 +02:00
|
|
|
package sonarqube
|
|
|
|
|
|
|
|
type PullRequest struct {
|
|
|
|
Key string `json:"key"`
|
|
|
|
Status struct {
|
|
|
|
QualityGateStatus string `json:"qualityGateStatus"`
|
|
|
|
} `json:"status"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type PullsResponse struct {
|
|
|
|
PullRequests []PullRequest `json:"pullRequests"`
|
2022-06-17 20:19:59 +02:00
|
|
|
Errors []Error `json:"errors"`
|
2021-10-10 19:01:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *PullsResponse) GetPullRequest(name string) *PullRequest {
|
|
|
|
for _, pr := range r.PullRequests {
|
|
|
|
if pr.Key == name {
|
|
|
|
return &pr
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|