Sha256: 01f0d53ab439722e4e841a1ebeb13a17bc1d1330f361c49247cfc47c85ee38d8

Contents?: true

Size: 1.47 KB

Versions: 8

Compression:

Stored size: 1.47 KB

Contents

module DropboxApi::Endpoints::Files
  class ListFolderLongpoll < DropboxApi::Endpoints::RpcNotify
    Method      = :post
    Path        = "/2/files/list_folder/longpoll".freeze
    ResultType  = DropboxApi::Results::ListFolderLongpollResult
    ErrorType   = DropboxApi::Errors::ListFolderLongpollError

    include DropboxApi::OptionsValidator

    # A longpoll endpoint to wait for changes on an account. In conjunction
    # with list_folder, this call gives you a low-latency way to monitor an
    # account for file changes. The connection will block until there are
    # changes available or a timeout occurs. This endpoint is useful mostly
    # for client-side apps. If you're looking for server-side notifications,
    # check out our webhooks documentation.
    #
    # @param cursor [String] A cursor as returned by list_folder or
    #   list_folder_continue.
    # @option options timeout [Numeric] A timeout in seconds. The request will
    #   block for at most this length of time, plus up to 90 seconds of random
    #   jitter added to avoid the thundering herd problem. Care should be taken
    #   when using this parameter, as some network infrastructure does not
    #   support long timeouts. The default for this field is 30.
    add_endpoint :list_folder_longpoll do |cursor, options = {}|
      validate_options([
        :timeout
      ], options)
      options[:timeout] ||= 30

      perform_request options.merge({
        :cursor => cursor
      })
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dropbox_api-0.1.18 lib/dropbox_api/endpoints/files/list_folder_longpoll.rb
dropbox_api-0.1.17 lib/dropbox_api/endpoints/files/list_folder_longpoll.rb
dropbox_api-0.1.16 lib/dropbox_api/endpoints/files/list_folder_longpoll.rb
dropbox_api-0.1.15 lib/dropbox_api/endpoints/files/list_folder_longpoll.rb
dropbox_api-0.1.14 lib/dropbox_api/endpoints/files/list_folder_longpoll.rb
dropbox_api-0.1.13 lib/dropbox_api/endpoints/files/list_folder_longpoll.rb
dropbox_api-0.1.12 lib/dropbox_api/endpoints/files/list_folder_longpoll.rb
dropbox_api-0.1.11 lib/dropbox_api/endpoints/files/list_folder_longpoll.rb