code: def as_payload_class(cls):
      
  
      Item.register_child(
          Item.registered_payload,
          cls,
      )
  
      EventItem.register_child(
          EventItem.registered_payload,
          cls,
      )
  
      return cls
docs: Register the given class `cls` as Publish-Subscribe payload on both
      :class:`Item` and :class:`EventItem`.
  
      Return the class, to allow this to be used as decorator.