"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/code.gitea.io/sdk/gitea/issue_tracked_time.go" between
gitea-1.13.1.tar.gz and gitea-1.13.2.tar.gz

About: Gitea allows to set up a self-hosted code hosting Git service (a fork of Gogs).

issue_tracked_time.go  (gitea-1.13.1):issue_tracked_time.go  (gitea-1.13.2)
skipping to change at line 30 skipping to change at line 30
// deprecated (only for backwards compatibility) // deprecated (only for backwards compatibility)
UserID int64 `json:"user_id"` UserID int64 `json:"user_id"`
UserName string `json:"user_name"` UserName string `json:"user_name"`
// deprecated (only for backwards compatibility) // deprecated (only for backwards compatibility)
IssueID int64 `json:"issue_id"` IssueID int64 `json:"issue_id"`
Issue *Issue `json:"issue"` Issue *Issue `json:"issue"`
} }
// GetUserTrackedTimes list tracked times of a user // GetUserTrackedTimes list tracked times of a user
func (c *Client) GetUserTrackedTimes(owner, repo, user string) ([]*TrackedTime, *Response, error) { func (c *Client) GetUserTrackedTimes(owner, repo, user string) ([]*TrackedTime, *Response, error) {
if err := c.CheckServerVersionConstraint(">=1.11.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_11_0); err != n il {
return nil, nil, err return nil, nil, err
} }
times := make([]*TrackedTime, 0, 10) times := make([]*TrackedTime, 0, 10)
resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/times/% s", owner, repo, user), nil, nil, &times) resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/times/% s", owner, repo, user), nil, nil, &times)
return times, resp, err return times, resp, err
} }
// GetRepoTrackedTimes list tracked times of a repository // GetRepoTrackedTimes list tracked times of a repository
func (c *Client) GetRepoTrackedTimes(owner, repo string) ([]*TrackedTime, *Respo nse, error) { func (c *Client) GetRepoTrackedTimes(owner, repo string) ([]*TrackedTime, *Respo nse, error) {
if err := c.CheckServerVersionConstraint(">=1.11.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_11_0); err != n il {
return nil, nil, err return nil, nil, err
} }
times := make([]*TrackedTime, 0, 10) times := make([]*TrackedTime, 0, 10)
resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/times", owner, repo), nil, nil, &times) resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/times", owner, repo), nil, nil, &times)
return times, resp, err return times, resp, err
} }
// GetMyTrackedTimes list tracked times of the current user // GetMyTrackedTimes list tracked times of the current user
func (c *Client) GetMyTrackedTimes() ([]*TrackedTime, *Response, error) { func (c *Client) GetMyTrackedTimes() ([]*TrackedTime, *Response, error) {
if err := c.CheckServerVersionConstraint(">=1.11.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_11_0); err != n il {
return nil, nil, err return nil, nil, err
} }
times := make([]*TrackedTime, 0, 10) times := make([]*TrackedTime, 0, 10)
resp, err := c.getParsedResponse("GET", "/user/times", nil, nil, &times) resp, err := c.getParsedResponse("GET", "/user/times", nil, nil, &times)
return times, resp, err return times, resp, err
} }
// AddTimeOption options for adding time to an issue // AddTimeOption options for adding time to an issue
type AddTimeOption struct { type AddTimeOption struct {
// time in seconds // time in seconds
skipping to change at line 78 skipping to change at line 78
// Validate the AddTimeOption struct // Validate the AddTimeOption struct
func (opt AddTimeOption) Validate() error { func (opt AddTimeOption) Validate() error {
if opt.Time == 0 { if opt.Time == 0 {
return fmt.Errorf("no time to add") return fmt.Errorf("no time to add")
} }
return nil return nil
} }
// AddTime adds time to issue with the given index // AddTime adds time to issue with the given index
func (c *Client) AddTime(owner, repo string, index int64, opt AddTimeOption) (*T rackedTime, *Response, error) { func (c *Client) AddTime(owner, repo string, index int64, opt AddTimeOption) (*T rackedTime, *Response, error) {
if err := c.CheckServerVersionConstraint(">=1.11.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_11_0); err != n il {
return nil, nil, err return nil, nil, err
} }
if err := opt.Validate(); err != nil { if err := opt.Validate(); err != nil {
return nil, nil, err return nil, nil, err
} }
body, err := json.Marshal(&opt) body, err := json.Marshal(&opt)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
t := new(TrackedTime) t := new(TrackedTime)
skipping to change at line 102 skipping to change at line 102
return t, resp, err return t, resp, err
} }
// ListTrackedTimesOptions options for listing repository's tracked times // ListTrackedTimesOptions options for listing repository's tracked times
type ListTrackedTimesOptions struct { type ListTrackedTimesOptions struct {
ListOptions ListOptions
} }
// ListTrackedTimes list tracked times of a single issue for a given repository // ListTrackedTimes list tracked times of a single issue for a given repository
func (c *Client) ListTrackedTimes(owner, repo string, index int64, opt ListTrack edTimesOptions) ([]*TrackedTime, *Response, error) { func (c *Client) ListTrackedTimes(owner, repo string, index int64, opt ListTrack edTimesOptions) ([]*TrackedTime, *Response, error) {
if err := c.CheckServerVersionConstraint(">=1.11.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_11_0); err != n il {
return nil, nil, err return nil, nil, err
} }
opt.setDefaults() opt.setDefaults()
times := make([]*TrackedTime, 0, opt.PageSize) times := make([]*TrackedTime, 0, opt.PageSize)
resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/issues/ %d/times?%s", owner, repo, index, opt.getURLQuery().Encode()), nil, nil, &times) resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/issues/ %d/times?%s", owner, repo, index, opt.getURLQuery().Encode()), nil, nil, &times)
return times, resp, err return times, resp, err
} }
// ResetIssueTime reset tracked time of a single issue for a given repository // ResetIssueTime reset tracked time of a single issue for a given repository
func (c *Client) ResetIssueTime(owner, repo string, index int64) (*Response, err or) { func (c *Client) ResetIssueTime(owner, repo string, index int64) (*Response, err or) {
if err := c.CheckServerVersionConstraint(">=1.11.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_11_0); err != n il {
return nil, err return nil, err
} }
_, resp, err := c.getResponse("DELETE", fmt.Sprintf("/repos/%s/%s/issues/ %d/times", owner, repo, index), nil, nil) _, resp, err := c.getResponse("DELETE", fmt.Sprintf("/repos/%s/%s/issues/ %d/times", owner, repo, index), nil, nil)
return resp, err return resp, err
} }
// DeleteTime delete a specific tracked time by id of a single issue for a given repository // DeleteTime delete a specific tracked time by id of a single issue for a given repository
func (c *Client) DeleteTime(owner, repo string, index, timeID int64) (*Response, error) { func (c *Client) DeleteTime(owner, repo string, index, timeID int64) (*Response, error) {
if err := c.CheckServerVersionConstraint(">=1.11.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_11_0); err != n il {
return nil, err return nil, err
} }
_, resp, err := c.getResponse("DELETE", fmt.Sprintf("/repos/%s/%s/issues/ %d/times/%d", owner, repo, index, timeID), nil, nil) _, resp, err := c.getResponse("DELETE", fmt.Sprintf("/repos/%s/%s/issues/ %d/times/%d", owner, repo, index, timeID), nil, nil)
return resp, err return resp, err
} }
 End of changes. 7 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)