docstr: Delete a tagged object.
  ---
  delete:
    summary: Delete a tagged object
    parameters:
    - in: path
      schema:
        type: string
      name: tag
    - in: path
      schema:
        type: integer
      name: object_type
    - in: path
      schema:
        type: integer
      name: object_id
    responses:
      200:
        description: Chart 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: ["Delete","a","tagged","object",".","--","-","delete",":","summary",":","Delete","a","tagged","object","parameters",":","-","in",":","path","schema",":","type",":","string","name",":","tag","-","in",":","path","schema",":","type",":","integer","name",":","object_type","-","in",":","path","schema",":","type",":","integer","name",":","object_id","responses",":","200",":","description",":","Chart","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 delete_object(
      self, object_type: ObjectType, object_id: int, tag: str
  ) -> Response:
      """Delete a tagged object.
      ---
      delete:
        summary: Delete a tagged object
        parameters:
        - in: path
          schema:
            type: string
          name: tag
        - in: path
          schema:
            type: integer
          name: object_type
        - in: path
          schema:
            type: integer
          name: object_id
        responses:
          200:
            description: Chart 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'
      """
      try:
          DeleteTaggedObjectCommand(object_type, object_id, tag).run()
          return self.response(200, message="OK")
      except TagInvalidError:
          return self.response_422()
      except TagNotFoundError:
          return self.response_404()
      except TaggedObjectNotFoundError:
          return self.response_404()
      except TaggedObjectDeleteFailedError as ex:
          logger.error(
              "Error deleting tagged object %s: %s",
              self.__class__.__name__,
              str(ex),
              exc_info=True,
          )
          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 6 for calling the TagRestApi obj's underlying member method code with example usage: obj.delete_object(object_type, object_id, tag) and returns: self, self, self, self, self