code: func (r *Client) SetDashboard(board Board, overwrite bool) error {
  	var (
  		isBoardFromDB bool
  		newBoard      struct {
  			Dashboard Board `json:"dashboard"`
  			Overwrite bool  `json:"overwrite"`
  		}
  		raw  []byte
  		resp StatusMessage
  		code int
  		err  error
  	)
  	if board.Slug, isBoardFromDB = cleanPrefix(board.Slug); !isBoardFromDB {
  		return errors.New("only database dashboard (with 'db/' prefix in a slug) can be set")
  	}
  	newBoard.Dashboard = board
  	newBoard.Overwrite = overwrite
  	if !overwrite {
  		newBoard.Dashboard.ID = 0
  	}
  	if raw, err = json.Marshal(newBoard); err != nil {
  		return err
  	}
  	if raw, code, err = r.post("api/dashboards/db", nil, raw); err != nil {
  		return err
  	}
  	if err = json.Unmarshal(raw, &resp); err != nil {
  		return err
  	}
  	switch code {
  	case 401:
  		return fmt.Errorf("%d %s", code, *resp.Message)
  	case 412:
  		return fmt.Errorf("%d %s", code, *resp.Message)
  	}
  	return nil
  }
docs: // SetDashboard updates existing dashboard or creates a new one.
  // Set dasboard ID to nil to create a new dashboard.
  // Set overwrite to true if you want to overwrite existing dashboard with
  // newer version or with same dashboard title.
  // Grafana only can create or update a dashboard in a database. File dashboards
  // may be only loaded with HTTP API but not created or updated.