in apps.go [257:279]
func (c *Client) UpdateAppTag(appID, tagID string, updated AppTag) (*AppTag, error) {
type tag struct {
Tag string `json:"tag,omitempty"`
Desc string `json:"desc,omitempty"`
}
updateJSON, err := json.Marshal(tag{Tag: updated.Name, Desc: updated.Desc})
if err != nil {
return nil, err
}
resp, err := c.request(http.MethodPut, fmt.Sprintf("/apps/%s/tags/%s", url.PathEscape(appID), url.PathEscape(tagID)), "application/json", bytes.NewBuffer(updateJSON))
if err != nil {
return nil, err
}
defer resp.Close()
var tagResp tag
decoder := json.NewDecoder(resp)
err = decoder.Decode(&tagResp)
return &AppTag{Name: tagResp.Tag, Desc: tagResp.Desc}, err
}