code: def validate(self) -> None:
      exceptions: list[ValidationError] = []
      owners_ids: Optional[list[int]] = self._properties.get("owners")
      roles_ids: Optional[list[int]] = self._properties.get("roles")
      slug: Optional[str] = self._properties.get("slug")
  
      # Validate/populate model exists
      self._model = DashboardDAO.find_by_id(self._model_id)
      if not self._model:
          raise DashboardNotFoundError()
      # Check ownership
      try:
          security_manager.raise_for_ownership(self._model)
      except SupersetSecurityException as ex:
          raise DashboardForbiddenError() from ex
  
      # Validate slug uniqueness
      if not DashboardDAO.validate_update_slug_uniqueness(
          self._model_id, slug
      ):
          exceptions.append(DashboardSlugExistsValidationError())
  
      # Validate/Populate owner
      if owners_ids is None:
          owners_ids = [owner.id for owner in self._model.owners]
      try:
          owners = self.populate_owners(owners_ids)
          self._properties["owners"] = owners
      except ValidationError as ex:
          exceptions.append(ex)
      if exceptions:
          raise DashboardInvalidError(exceptions=exceptions)
  
      # Validate/Populate role
      if roles_ids is None:
          roles_ids = [role.id for role in self._model.roles]
      try:
          roles = populate_roles(roles_ids)
          self._properties["roles"] = roles
      except ValidationError as ex:
          exceptions.append(ex)
      if exceptions:
          raise DashboardInvalidError(exceptions=exceptions)
  
file_path: superset/superset/commands/dashboard/update.py
imports: import json
  import logging
  from typing import Any, Optional
  from flask_appbuilder.models.sqla import Model
  from marshmallow import ValidationError
  from superset import security_manager
  from superset.commands.base import BaseCommand, UpdateMixin
  from superset.commands.dashboard.exceptions import DashboardForbiddenError, DashboardInvalidError, DashboardNotFoundError, DashboardSlugExistsValidationError, DashboardUpdateFailedError
  from superset.commands.utils import populate_roles
  from superset.daos.dashboard import DashboardDAO
  from superset.daos.exceptions import DAOUpdateFailedError
  from superset.exceptions import SupersetSecurityException
  from superset.extensions import db
  from superset.models.dashboard import Dashboard
label_desc: Use image node_id 3 for calling the UpdateDashboardCommand obj's underlying member method code with example usage: obj.validate() without return types