Skip to content

Cloud pubsub topic

CloudPubsubTopic

Bases: BaseFormItem

A Pub/Sub topic.

Source code in pygsuite/forms/generated/cloud_pubsub_topic.py
class CloudPubsubTopic(BaseFormItem):
    """
    A Pub/Sub topic.
    """

    def __init__(  # noqa: C901
        self, topic_name: Optional[str] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if topic_name is not None:

            generated["topicName"] = topic_name
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def topic_name(self) -> str:
        return self._info.get("topicName")

    @topic_name.setter
    def topic_name(self, value: str):
        if self._info.get("topicName", None) == value:
            return
        self._info["topicName"] = value