Sha256: 02ad1bacfefbc751681444f599821b86ef6f904a792c1847338887d5449bb36c

Contents?: true

Size: 1.49 KB

Versions: 17

Compression:

Stored size: 1.49 KB

Contents

module Fog
  module Storage
    class GoogleJSON
      class Real
        # Lists objects in a bucket matching some criteria.
        #
        # @param bucket [String] Name of bucket to list
        # @param options [Hash] Optional hash of options
        # @option options [String] :delimiter Delimiter to collapse objects
        #   under to emulate a directory-like mode
        # @option options [Integer] :max_results Maximum number of results to
        #   retrieve
        # @option options [String] :page_token Token to select a particular page
        #   of results
        # @option options [String] :prefix String that an object must begin with
        #   in order to be returned
        # @option options ["full", "noAcl"] :projection Set of properties to
        #   return (defaults to "noAcl")
        # @option options [Boolean] :versions If true, lists all versions of an
        #   object as distinct results (defaults to False)
        # @return [Google::Apis::StorageV1::Objects]
        def list_objects(bucket, options = {})
          allowed_opts = %i(
            delimiter
            max_results
            page_token
            prefix
            projection
            versions
          )

          @storage_json.list_objects(
            bucket,
            options.select { |k, _| allowed_opts.include? k }
          )
        end
      end

      class Mock
        def list_objects(_bucket, _options = {})
          Fog::Mock.not_implemented
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
fog-google-1.9.1 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.9.0 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.8.2 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.8.1 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.8.0 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.7.1 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.7.0 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.6.0 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.5.0 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.4.0 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.3.3 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.3.2 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.3.1 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.3.0 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.2.2 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.2.1 lib/fog/storage/google_json/requests/list_objects.rb
fog-google-1.2.0 lib/fog/storage/google_json/requests/list_objects.rb