Commit b0803b8f authored by Sander van Harmelen's avatar Sander van Harmelen

Again a few V3 to V4 changes (#197)

* Delete deprecated `upvote` and `downvote` fields

* Add http status `Accepted` (202) as successful status

* Rename the milestones field `iid` to `iids` (`[]int`)
parent 74dac12d
...@@ -474,7 +474,7 @@ func (e *ErrorResponse) Error() string { ...@@ -474,7 +474,7 @@ func (e *ErrorResponse) Error() string {
// CheckResponse checks the API response for errors, and returns them if present. // CheckResponse checks the API response for errors, and returns them if present.
func CheckResponse(r *http.Response) error { func CheckResponse(r *http.Response) error {
switch r.StatusCode { switch r.StatusCode {
case http.StatusOK, http.StatusCreated, http.StatusNoContent, http.StatusNotModified: case 200, 201, 202, 204, 304:
return nil return nil
} }
......
...@@ -58,7 +58,7 @@ func (m Milestone) String() string { ...@@ -58,7 +58,7 @@ func (m Milestone) String() string {
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#list-project-milestones // https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/milestones.md#list-project-milestones
type ListMilestonesOptions struct { type ListMilestonesOptions struct {
ListOptions ListOptions
IID *int `url:"iid,omitempty" json:"iid,omitempty"` IIDs []int `url:"iids,omitempty" json:"iids,omitempty"`
} }
// ListMilestones returns a list of project milestones. // ListMilestones returns a list of project milestones.
......
...@@ -47,6 +47,7 @@ type Note struct { ...@@ -47,6 +47,7 @@ type Note struct {
State string `json:"state"` State string `json:"state"`
CreatedAt *time.Time `json:"created_at"` CreatedAt *time.Time `json:"created_at"`
} `json:"author"` } `json:"author"`
System bool `json:"system"`
ExpiresAt *time.Time `json:"expires_at"` ExpiresAt *time.Time `json:"expires_at"`
UpdatedAt *time.Time `json:"updated_at"` UpdatedAt *time.Time `json:"updated_at"`
CreatedAt *time.Time `json:"created_at"` CreatedAt *time.Time `json:"created_at"`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment