APIv4 DELETE /commands/{command_id} (#6012)

Этот коммит содержится в:
Saturnino Abril
2017-04-10 22:27:10 +09:00
коммит произвёл Harrison Healey
родитель 38eced0290
Коммит 3b1088f3bd
3 изменённых файлов: 111 добавлений и 0 удалений

Просмотреть файл

@@ -2212,6 +2212,16 @@ func (c *Client4) UpdateCommand(cmd *Command) (*Command, *Response) {
}
}
// DeleteCommand deletes a command based on the provided command id string
func (c *Client4) DeleteCommand(commandId string) (bool, *Response) {
if r, err := c.DoApiDelete(c.GetCommandRoute(commandId)); err != nil {
return false, &Response{StatusCode: r.StatusCode, Error: err}
} else {
defer closeBody(r)
return CheckStatusOK(r), BuildResponse(r)
}
}
// ListCommands will retrieve a list of commands available in the team.
func (c *Client4) ListCommands(teamId string, customOnly bool) ([]*Command, *Response) {
query := fmt.Sprintf("?team_id=%v&custom_only=%v", teamId, customOnly)