Module: Slack::Endpoint::Files
- Included in:
- Slack::Endpoint
- Defined in:
- lib/slack/endpoint/files.rb
Instance Method Summary collapse
-
#files_comments(options = {}) ⇒ Object
Edit an existing comment on a file.
-
#files_delete(options = {}) ⇒ Object
This method deletes a file from your team.
-
#files_info(options = {}) ⇒ Object
This method returns information about a file in your team.
-
#files_list(options = {}) ⇒ Object
This method returns a list of files within the team.
-
#files_revokePublicURL(options = {}) ⇒ Object
This method disables public/external sharing for a file.
-
#files_sharedPublicURL(options = {}) ⇒ Object
This method enables public/external sharing for a file.
-
#files_startPartialUpload(options = {}) ⇒ Object
This is for starting the upload process of a file.
-
#files_upload(options = {}) ⇒ Object
This method allows you to create or upload an existing file.
Instance Method Details
#files_comments(options = {}) ⇒ Object
Edit an existing comment on a file. Only the user who created a comment may make edits. Teams may configure a limited time window during which file comment edits are allowed.
18 19 20 21 22 23 24 |
# File 'lib/slack/endpoint/files.rb', line 18 def files_comments(={}) throw ArgumentError.new("Required arguments :file missing") if [:file].nil? throw ArgumentError.new("Required arguments :id missing") if [:id].nil? throw ArgumentError.new("Required arguments :comment missing") if [:comment].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("files.comments", ) end |
#files_delete(options = {}) ⇒ Object
This method deletes a file from your team.
34 35 36 37 38 |
# File 'lib/slack/endpoint/files.rb', line 34 def files_delete(={}) throw ArgumentError.new("Required arguments :file missing") if [:file].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("files.delete", ) end |
#files_info(options = {}) ⇒ Object
This method returns information about a file in your team.
52 53 54 55 56 |
# File 'lib/slack/endpoint/files.rb', line 52 def files_info(={}) throw ArgumentError.new("Required arguments :file missing") if [:file].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("files.info", ) end |
#files_list(options = {}) ⇒ Object
This method returns a list of files within the team. It can be filtered and sliced in various ways.
90 91 92 93 |
# File 'lib/slack/endpoint/files.rb', line 90 def files_list(={}) [:attachments] = [:attachments].to_json if Hash === [:attachments] post("files.list", ) end |
#files_revokePublicURL(options = {}) ⇒ Object
This method disables public/external sharing for a file.
103 104 105 106 107 |
# File 'lib/slack/endpoint/files.rb', line 103 def files_revokePublicURL(={}) throw ArgumentError.new("Required arguments :file missing") if [:file].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("files.revokePublicURL", ) end |
#files_sharedPublicURL(options = {}) ⇒ Object
This method enables public/external sharing for a file.
117 118 119 120 121 |
# File 'lib/slack/endpoint/files.rb', line 117 def files_sharedPublicURL(={}) throw ArgumentError.new("Required arguments :file missing") if [:file].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("files.sharedPublicURL", ) end |
#files_startPartialUpload(options = {}) ⇒ Object
This is for starting the upload process of a file. It only requires a filename, and gives back a ticket ID so that later, the upload can be found and updated with all the remaining file info.
132 133 134 135 |
# File 'lib/slack/endpoint/files.rb', line 132 def files_startPartialUpload(={}) [:attachments] = [:attachments].to_json if Hash === [:attachments] post("files.startPartialUpload", ) end |
#files_upload(options = {}) ⇒ Object
This method allows you to create or upload an existing file.
157 158 159 160 161 |
# File 'lib/slack/endpoint/files.rb', line 157 def files_upload(={}) throw ArgumentError.new("Required arguments :filename missing") if [:filename].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("files.upload", ) end |