docstr: Bulk delete tags. This will remove all tagged objects with this tag.
  ---
  delete:
    summary: Bulk delete tags
    description: >-
      Bulk deletes tags. This will remove all tagged objects with this tag.
    parameters:
    - in: query
      name: q
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/delete_tags_schema'
  
    responses:
      200:
        description: Deletes multiple Tags
        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","tags",".","This","will","remove","all","tagged","objects","with","this","tag",".","--","-","delete",":","summary",":","Bulk","delete","tags","description",":",">","-","Bulk","deletes","tags",".","This","will","remove","all","tagged","objects","with","this","tag",".","parameters",":","-","in",":","query","name",":","q","content",":","application\/json",":","schema",":","$","ref",":","'","#","\/components\/schemas\/delete_tags_schema'","responses",":","200",":","description",":","Deletes","multiple","Tags","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 tags. This will remove all tagged objects with this tag.
      ---
      delete:
        summary: Bulk delete tags
        description: >-
          Bulk deletes tags. This will remove all tagged objects with this tag.
        parameters:
        - in: query
          name: q
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete_tags_schema'
  
        responses:
          200:
            description: Deletes multiple Tags
            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'
      """
      tags = kwargs["rison"]
      try:
          DeleteTagsCommand(tags).run()
          return self.response(200, message=f"Deleted {len(tags)} tags")
      except TagNotFoundError:
          return self.response_404()
      except TagInvalidError as ex:
          return self.response(
              422, message=f"Invalid tag parameters: {tags}. {ex}"
          )
      except TagDeleteFailedError as ex:
          return self.response_422(message=str(ex))
  
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 marshmallow import ValidationError
  from superset.commands.tag.create import CreateCustomTagCommand, CreateCustomTagWithRelationshipsCommand
  from superset.commands.tag.delete import DeleteTaggedObjectCommand, DeleteTagsCommand
  from superset.commands.tag.exceptions import TagDeleteFailedError, TaggedObjectDeleteFailedError, TaggedObjectNotFoundError, TagInvalidError, TagNotFoundError, TagUpdateFailedError
  from superset.commands.tag.update import UpdateTagCommand
  from superset.constants import MODEL_API_RW_METHOD_PERMISSION_MAP, RouteMethod
  from superset.daos.tag import TagDAO
  from superset.exceptions import MissingUserContextException
  from superset.extensions import event_logger
  from superset.tags.models import ObjectType, Tag
  from superset.tags.schemas import delete_tags_schema, openapi_spec_methods_override, TaggedObjectEntityResponseSchema, TagGetResponseSchema, TagPostBulkSchema, TagPostSchema, TagPutSchema
  from superset.views.base_api import BaseSupersetModelRestApi, RelatedFieldFilter, statsd_metrics
  from superset.views.filters import BaseFilterRelatedUsers, FilterRelatedOwners
label_desc: Use image node_id 7 for calling the TagRestApi obj's underlying member method code with example usage: obj.bulk_delete() and returns: self, self, self, self