docstr: Get all objects associated with a tag.
  ---
  get:
    summary: Get all objects associated with a tag
    parameters:
    - in: path
      schema:
        type: integer
      name: tag_id
    responses:
      200:
        description: List of tagged objects associated with a Tag
        content:
          application/json:
            schema:
              type: object
              properties:
                result:
                  type: array
                  items:
                    $ref: '#/components/schemas/TaggedObjectEntityResponseSchema'
      302:
        description: Redirects to the current digest
      400:
        $ref: '#/components/responses/400'
      401:
        $ref: '#/components/responses/401'
      404:
        $ref: '#/components/responses/404'
      500:
        $ref: '#/components/responses/500'
docstr_tok: ["Get","all","objects","associated","with","a","tag",".","--","-","get",":","summary",":","Get","all","objects","associated","with","a","tag","parameters",":","-","in",":","path","schema",":","type",":","integer","name",":","tag_id","responses",":","200",":","description",":","List","of","tagged","objects","associated","with","a","Tag","content",":","application\/json",":","schema",":","type",":","object","properties",":","result",":","type",":","array","items",":","$","ref",":","'","#","\/components\/schemas\/TaggedObjectEntityResponseSchema'","302",":","description",":","Redirects","to","the","current","digest","400",":","$","ref",":","'","#","\/components\/responses\/400'","401",":","$","ref",":","'","#","\/components\/responses\/401'","404",":","$","ref",":","'","#","\/components\/responses\/404'","500",":","$","ref",":","'","#","\/components\/responses\/500","'"]
code: def get_objects(self) -> Response:
      """Get all objects associated with a tag.
      ---
      get:
        summary: Get all objects associated with a tag
        parameters:
        - in: path
          schema:
            type: integer
          name: tag_id
        responses:
          200:
            description: List of tagged objects associated with a Tag
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    result:
                      type: array
                      items:
                        $ref: '#/components/schemas/TaggedObjectEntityResponseSchema'
          302:
            description: Redirects to the current digest
          400:
            $ref: '#/components/responses/400'
          401:
            $ref: '#/components/responses/401'
          404:
            $ref: '#/components/responses/404'
          500:
            $ref: '#/components/responses/500'
      """
      tag_ids = [
          tag_id
          for tag_id in request.args.get("tagIds", "").split(",")
          if tag_id
      ]
      tags = [
          tag for tag in request.args.get("tags", "").split(",") if tag
      ]
      # filter types
      types = [
          type_
          for type_ in request.args.get("types", "").split(",")
          if type_
      ]
  
      try:
          if tag_ids:
              # priotize using ids for lookups vs. names mainly using this
              # for backward compatibility
              tagged_objects = TagDAO.get_tagged_objects_by_tag_id(
                  tag_ids, types
              )
          else:
              tagged_objects = TagDAO.get_tagged_objects_for_tags(
                  tags, types
              )
  
          result = [
              self.object_entity_response_schema.dump(tagged_object)
              for tagged_object in tagged_objects
          ]
          return self.response(200, result=result)
      except TagInvalidError as ex:
          return self.response_422(message=ex.normalized_messages())
  
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 8 for calling the TagRestApi obj's underlying member method code with example usage: obj.get_objects() and returns: self, self