Sha256: 175496ffd288ba8498a275529d9894b562083d22bb5f1f3a93422dc3648951a1

Contents?: true

Size: 940 Bytes

Versions: 13

Compression:

Stored size: 940 Bytes

Contents

module Fog
  module Google
    class Pubsub
      class Real
        # Gets a list of all topics for a given project.
        #
        # @param_name project [#to_s] Project path to list topics under; must
        #   be a project url prefix (e.g. 'projects/my-project'). If nil, the
        #   project configured on the client is used.
        # @see https://cloud.google.com/pubsub/reference/rest/v1/projects.topics/list
        def list_topics(project = nil)
          api_method = @pubsub.projects.topics.list
          parameters = {
            "project" => (project.nil? ? "projects/#{@project}" : project.to_s)
          }

          request(api_method, parameters)
        end
      end

      class Mock
        def list_topics(_project = nil)
          body = {
            "topics" => data[:topics].values
          }
          status = 200

          build_excon_response(body, status)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fog-google-0.6.0 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.5.5 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.5.4 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.5.3 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.5.2 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.5.1 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.5.0 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.4.2 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.4.1 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.4.0 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.3.2 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.3.1 lib/fog/google/requests/pubsub/list_topics.rb
fog-google-0.3.0 lib/fog/google/requests/pubsub/list_topics.rb