class_docstr: Sets up an Amazon SageMaker Collection.
docstr: Lists the contents of the specified Collection.
  
  If there is no Collection with the name ``collection_name``, lists all the
  Collections at the root level.
  
  Args:
      collection_name (str): The name of the Collection whose contents are listed.
docstr_tok: ["Lists","the","contents","of","the","specified","Collection",".","If","there","is","no","Collection","with","the","name","``","collection_name","``",",","lists","all","the","Collections","at","the","root","level",".","Args",":","collection_name","(","str",")",":","The","name","of","the","Collection","whose","contents","are","listed","."]
code: def list_collection(self, collection_name: str = None):
      """Lists the contents of the specified Collection.
  
      If there is no Collection with the name ``collection_name``, lists all the
      Collections at the root level.
  
      Args:
          collection_name (str): The name of the Collection whose contents are listed.
      """
      collection_content = []
      if collection_name is None:
          tag_filters = [
              {
                  "Key": "sagemaker:collection-path:root",
                  "Values": ["true"],
              },
          ]
          resource_type_filters = ["resource-groups:group"]
          tag_collections = (
              self.sagemaker_session.get_tagging_resources(
                  tag_filters=tag_filters,
                  resource_type_filters=resource_type_filters,
              )
          )
  
          return self._convert_tag_collection_response(tag_collections)
  
      collection_filter = [
          {
              "Name": "resource-type",
              "Values": ["AWS::ResourceGroups::Group"],
          },
      ]
      list_group_response = self._get_full_list_resource(
          collection_name=collection_name,
          collection_filter=collection_filter,
      )
      collection_content = self._convert_group_resource_response(
          list_group_response
      )
  
      collection_filter = [
          {
              "Name": "resource-type",
              "Values": ["AWS::SageMaker::ModelPackageGroup"],
          },
      ]
      list_group_response = self._get_full_list_resource(
          collection_name=collection_name,
          collection_filter=collection_filter,
      )
  
      collection_content = (
          collection_content
          + self._convert_group_resource_response(
              list_group_response, True
          )
      )
  
      return collection_content
  
imports: from __future__ import absolute_import
  import json
  import time
  from typing import List
  from botocore.exceptions import ClientError
  from sagemaker.session import Session
label_desc: Use image node_id 14 for calling the Collection obj's underlying member method code with example usage: obj.list_collection(collection_name) and returns: collection_content, self