code: def getMetadata(self, objectId=None, **filters):
          
          if objectId is not None:
              filters["urn"] = objectId
  
          ti = XmlCtsTextInventoryMetadata.parse(self.endpoint.getCapabilities(**filters))
          if objectId:
              return [x for x in [ti] + ti.descendants if x.id == objectId][0]
          return ti
docs: Request metadata about a text or a collection
  
          :param objectId: Object Identifier to filter on
          :type objectId: str
          :param filters: Kwargs parameters.
          :type filters: dict
          :return: Collection