diff options
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index 214c31865..3aef5019c 100644 --- a/model/client4.go +++ b/model/client4.go @@ -190,6 +190,10 @@ func (c *Client4) GetPreferencesRoute(userId string) string { return fmt.Sprintf(c.GetUserRoute(userId) + "/preferences") } +func (c *Client4) GetStatusRoute(userId string) string { + return fmt.Sprintf(c.GetUserRoute(userId) + "/status") +} + func (c *Client4) GetSamlRoute() string { return fmt.Sprintf("/saml") } @@ -1764,3 +1768,15 @@ func (c *Client4) CreateCommand(cmd *Command) (*Command, *Response) { return CommandFromJson(r.Body), BuildResponse(r) } } + +// Status Section + +// GetUserStatus returns a user based on the provided user id string. +func (c *Client4) GetUserStatus(userId, etag string) (*Status, *Response) { + if r, err := c.DoApiGet(c.GetStatusRoute(userId), etag); err != nil { + return nil, &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return StatusFromJson(r.Body), BuildResponse(r) + } +} |