code: def ensure_topic(self):
          
          client = self.session.client('pubsub', 'v1', 'projects.topics')
          topic = self.get_topic_param()
          try:
              client.execute_command('get', {'topic': topic})
          except HttpError as e:
              if e.resp.status != 404:
                  raise
          else:
              return topic
  
          # bug in discovery doc.. apis say body must be empty but its required in the
          # discovery api for create.
          client.execute_command('create', {'name': topic, 'body': {}})
          return topic
docs: Verify the pub/sub topic exists.
  
          Returns the topic qualified name.