# frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake module Slack module Web module Api module Endpoints module FilesRemote # # Adds a file from a remote service # # @option options [Object] :external_id # Creator defined GUID for the file. # @option options [Object] :external_url # URL of the remote file. # @option options [Object] :title # Title of the file being shared. # @option options [Object] :filetype # type of file. # @option options [Object] :indexable_file_contents # A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file. # @option options [Object] :preview_image # Preview of the document via multipart/form-data. # @see https://api.slack.com/methods/files.remote.add # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.add.json def files_remote_add(options = {}) throw ArgumentError.new('Required arguments :external_id missing') if options[:external_id].nil? throw ArgumentError.new('Required arguments :external_url missing') if options[:external_url].nil? throw ArgumentError.new('Required arguments :title missing') if options[:title].nil? post('files.remote.add', options) end # # Retrieve information about a remote file added to Slack # # @option options [Object] :external_id # Creator defined GUID for the file. # @option options [file] :file # Specify a file by providing its ID. # @see https://api.slack.com/methods/files.remote.info # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.info.json def files_remote_info(options = {}) post('files.remote.info', options) end # # Retrieve information about a remote file added to Slack # # @option options [channel] :channel # Filter files appearing in a specific channel, indicated by its ID. # @option options [Object] :cursor # Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail. # @option options [Object] :limit # The maximum number of items to return. # @option options [Object] :ts_from # Filter files created after this timestamp (inclusive). # @option options [Object] :ts_to # Filter files created before this timestamp (inclusive). # @see https://api.slack.com/methods/files.remote.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.list.json def files_remote_list(options = {}) options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel] if block_given? Pagination::Cursor.new(self, :files_remote_list, options).each do |page| yield page end else post('files.remote.list', options) end end # # Remove a remote file. # # @option options [Object] :external_id # Creator defined GUID for the file. # @option options [file] :file # Specify a file by providing its ID. # @see https://api.slack.com/methods/files.remote.remove # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.remove.json def files_remote_remove(options = {}) post('files.remote.remove', options) end # # Share a remote file into a channel. # # @option options [Object] :channels # Comma-separated list of channel IDs where the file will be shared. # @option options [Object] :external_id # Creator defined GUID for the file. # @option options [file] :file # Specify a file by providing its ID. # @see https://api.slack.com/methods/files.remote.share # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.share.json def files_remote_share(options = {}) throw ArgumentError.new('Required arguments :channels missing') if options[:channels].nil? post('files.remote.share', options) end # # Updates an existing remote file. # # @option options [Object] :external_id # Creator defined GUID for the file. # @option options [Object] :external_url # URL of the remote file. # @option options [file] :file # Specify a file by providing its ID. # @option options [Object] :filetype # type of file. # @option options [Object] :indexable_file_contents # File containing contents that can be used to improve searchability for the remote file. # @option options [Object] :preview_image # Preview of the document via multipart/form-data. # @option options [Object] :title # Title of the file being shared. # @see https://api.slack.com/methods/files.remote.update # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.update.json def files_remote_update(options = {}) post('files.remote.update', options) end end end end end end