func()

in apps.go [290:319]


func (c *Client) MoveAppTag(appID, tagID string, to string, updated *AppTag) (*MovedAppTag, error) {
	type tag struct {
		Tag    string `json:"tag,omitempty"`
		Desc   string `json:"desc,omitempty"`
		MoveTo string `json:"move_to,omitempty"`
	}

	updateReq := tag{MoveTo: to}
	if updated != nil {
		updateReq.Tag = updated.Name
		updateReq.Desc = updated.Desc
	}

	updateJSON, err := json.Marshal(updateReq)
	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 *MovedAppTag
	decoder := json.NewDecoder(resp)
	err = decoder.Decode(&tagResp)
	return tagResp, err
}