docstr: Bulk delete RLS rules.
  ---
  delete:
    summary: Bulk delete RLS rules
    parameters:
    - in: query
      name: q
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/get_delete_ids_schema'
    responses:
      200:
        description: RLS Rule bulk delete
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
      401:
        $ref: '#/components/responses/401'
      403:
        $ref: '#/components/responses/403'
      404:
        $ref: '#/components/responses/404'
      422:
        $ref: '#/components/responses/422'
      500:
        $ref: '#/components/responses/500'
docstr_tok: ["Bulk","delete","RLS","rules",".","--","-","delete",":","summary",":","Bulk","delete","RLS","rules","parameters",":","-","in",":","query","name",":","q","content",":","application\/json",":","schema",":","$","ref",":","'","#","\/components\/schemas\/get_delete_ids_schema'","responses",":","200",":","description",":","RLS","Rule","bulk","delete","content",":","application\/json",":","schema",":","type",":","object","properties",":","message",":","type",":","string","401",":","$","ref",":","'","#","\/components\/responses\/401'","403",":","$","ref",":","'","#","\/components\/responses\/403'","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 RLS rules.
      ---
      delete:
        summary: Bulk delete RLS rules
        parameters:
        - in: query
          name: q
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get_delete_ids_schema'
        responses:
          200:
            description: RLS Rule bulk delete
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    message:
                      type: string
          401:
            $ref: '#/components/responses/401'
          403:
            $ref: '#/components/responses/403'
          404:
            $ref: '#/components/responses/404'
          422:
            $ref: '#/components/responses/422'
          500:
            $ref: '#/components/responses/500'
      """
      item_ids = kwargs["rison"]
      try:
          DeleteRLSRuleCommand(item_ids).run()
          return self.response(
              200,
              message=ngettext(
                  "Deleted %(num)d rules",
                  "Deleted %(num)d rules",
                  num=len(item_ids),
              ),
          )
      except RLSRuleNotFoundError:
          return self.response_404()
  
imports: import logging
  from typing import Any
  from flask import request, Response
  from flask_appbuilder.api import expose, protect, rison, safe
  from flask_appbuilder.models.sqla.interface import SQLAInterface
  from flask_babel import ngettext
  from marshmallow import ValidationError
  from superset.commands.exceptions import DatasourceNotFoundValidationError, RolesNotFoundValidationError
  from superset.commands.security.create import CreateRLSRuleCommand
  from superset.commands.security.delete import DeleteRLSRuleCommand
  from superset.commands.security.exceptions import RLSRuleNotFoundError
  from superset.commands.security.update import UpdateRLSRuleCommand
  from superset.connectors.sqla.models import RowLevelSecurityFilter
  from superset.constants import MODEL_API_RW_METHOD_PERMISSION_MAP, RouteMethod
  from superset.daos.exceptions import DAOCreateFailedError, DAOUpdateFailedError
  from superset.extensions import event_logger
  from superset.row_level_security.schemas import get_delete_ids_schema, openapi_spec_methods_override, RLSListSchema, RLSPostSchema, RLSPutSchema, RLSShowSchema
  from superset.views.base import DatasourceFilter
  from superset.views.base_api import BaseSupersetModelRestApi, requires_json, statsd_metrics
  from superset.views.filters import BaseFilterRelatedRoles
label_desc: Use image node_id 3 for calling the RLSRestApi obj's underlying member method code with example usage: obj.bulk_delete() and returns: self, self