Appearance returns the configuration that modifies the visual display of the dashboard.
(ctx context.Context)
| 5033 | // Appearance returns the configuration that modifies the visual |
| 5034 | // display of the dashboard. |
| 5035 | func (c *Client) Appearance(ctx context.Context) (AppearanceConfig, error) { |
| 5036 | res, err := c.Request(ctx, http.MethodGet, "/api/v2/appearance", nil) |
| 5037 | if err != nil { |
| 5038 | return AppearanceConfig{}, err |
| 5039 | } |
| 5040 | defer res.Body.Close() |
| 5041 | if res.StatusCode != http.StatusOK { |
| 5042 | return AppearanceConfig{}, ReadBodyAsError(res) |
| 5043 | } |
| 5044 | var cfg AppearanceConfig |
| 5045 | return cfg, json.NewDecoder(res.Body).Decode(&cfg) |
| 5046 | } |
| 5047 | |
| 5048 | func (c *Client) UpdateAppearance(ctx context.Context, appearance UpdateAppearanceConfig) error { |
| 5049 | res, err := c.Request(ctx, http.MethodPut, "/api/v2/appearance", appearance) |