docstr: Bulk delete CSS templates.
  ---
  delete:
    summary: Bulk delete CSS templates
    parameters:
    - in: query
      name: q
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/get_delete_ids_schema'
    responses:
      200:
        description: CSS templates bulk delete
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
      401:
        $ref: '#/components/responses/401'
      404:
        $ref: '#/components/responses/404'
      422:
        $ref: '#/components/responses/422'
      500:
        $ref: '#/components/responses/500'
docstr_tok: ["Bulk","delete","CSS","templates",".","--","-","delete",":","summary",":","Bulk","delete","CSS","templates","parameters",":","-","in",":","query","name",":","q","content",":","application\/json",":","schema",":","$","ref",":","'","#","\/components\/schemas\/get_delete_ids_schema'","responses",":","200",":","description",":","CSS","templates","bulk","delete","content",":","application\/json",":","schema",":","type",":","object","properties",":","message",":","type",":","string","401",":","$","ref",":","'","#","\/components\/responses\/401'","404",":","$","ref",":","'","#","\/components\/responses\/404'","422",":","$","ref",":","'","#","\/components\/responses\/422'","500",":","$","ref",":","'","#","\/components\/responses\/500","'"]
code: def bulk_delete(self, **kwargs: Any) -> Response:
      """Bulk delete CSS templates.
      ---
      delete:
        summary: Bulk delete CSS templates
        parameters:
        - in: query
          name: q
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get_delete_ids_schema'
        responses:
          200:
            description: CSS templates bulk delete
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    message:
                      type: string
          401:
            $ref: '#/components/responses/401'
          404:
            $ref: '#/components/responses/404'
          422:
            $ref: '#/components/responses/422'
          500:
            $ref: '#/components/responses/500'
      """
      item_ids = kwargs["rison"]
      try:
          DeleteCssTemplateCommand(item_ids).run()
          return self.response(
              200,
              message=ngettext(
                  "Deleted %(num)d css template",
                  "Deleted %(num)d css templates",
                  num=len(item_ids),
              ),
          )
      except CssTemplateNotFoundError:
          return self.response_404()
      except CssTemplateDeleteFailedError as ex:
          return self.response_422(message=str(ex))
  
file_path: superset/superset/css_templates/api.py
imports: import logging
  from typing import Any
  from flask import Response
  from flask_appbuilder.api import expose, protect, rison, safe
  from flask_appbuilder.models.sqla.interface import SQLAInterface
  from flask_babel import ngettext
  from superset.commands.css.delete import DeleteCssTemplateCommand
  from superset.commands.css.exceptions import CssTemplateDeleteFailedError, CssTemplateNotFoundError
  from superset.constants import MODEL_API_RW_METHOD_PERMISSION_MAP, RouteMethod
  from superset.css_templates.filters import CssTemplateAllTextFilter
  from superset.css_templates.schemas import get_delete_ids_schema, openapi_spec_methods_override
  from superset.extensions import event_logger
  from superset.models.core import CssTemplate
  from superset.views.base_api import BaseSupersetModelRestApi, statsd_metrics
label_desc: Use image node_id 1 for calling the CssTemplateRestApi obj's underlying member method code with example usage: obj.bulk_delete() and returns: self, self, self