def publish(self, message, client=None, **attrs):
        client = self._require_client(client)
        api = client.publisher_api

        self._timestamp_message(attrs)
        message_b = base64.b64encode(message).decode('ascii')
        message_data = {'data': message_b, 'attributes': attrs}
        message_ids = api.topic_publish(self.full_name, [message_data])
        return message_ids[0]
API call:  publish a message to a topic via a POST request
dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/pubsub/topic.py/Topic.publish