Module: Slack::Web::Api::Endpoints::Files
- Included in:
- Slack::Web::Api::Endpoints
- Defined in:
- lib/slack/web/api/endpoints/files.rb
Instance Method Summary collapse
-
#files_completeUploadExternal(options = {}) ⇒ Object
Finishes an upload started with files.getUploadURLExternal.
-
#files_delete(options = {}) ⇒ Object
Deletes a file.
-
#files_edit(options = {}) ⇒ Object
Change the properties of a file (undocumented).
-
#files_getUploadURLExternal(options = {}) ⇒ Object
Gets a URL for an edge external file upload.
-
#files_info(options = {}) ⇒ Object
Gets information about a file.
-
#files_list(options = {}) ⇒ Object
List for a team, in a channel, or from a user with applied filters.
-
#files_revokePublicURL(options = {}) ⇒ Object
Revokes public/external sharing access for a file.
-
#files_share(options = {}) ⇒ Object
Share an existing file in a channel (undocumented).
-
#files_sharedPublicURL(options = {}) ⇒ Object
Enables a file for public/external sharing.
-
#files_upload(options = {}) ⇒ Object
Uploads or creates a file.
Instance Method Details
#files_completeUploadExternal(options = {}) ⇒ Object
Finishes an upload started with files.getUploadURLExternal
26 27 28 29 30 |
# File 'lib/slack/web/api/endpoints/files.rb', line 26 def files_completeUploadExternal( = {}) raise ArgumentError, 'Required arguments :files missing' if [:files].nil? = (, i[blocks]) post('files.completeUploadExternal', ) end |
#files_delete(options = {}) ⇒ Object
Deletes a file.
39 40 41 42 |
# File 'lib/slack/web/api/endpoints/files.rb', line 39 def files_delete( = {}) raise ArgumentError, 'Required arguments :file missing' if [:file].nil? post('files.delete', ) end |
#files_edit(options = {}) ⇒ Object
Change the properties of a file (undocumented)
54 55 56 57 58 59 |
# File 'lib/slack/web/api/endpoints/files.rb', line 54 def files_edit( = {}) raise ArgumentError, 'Required arguments :file missing' if [:file].nil? raise ArgumentError, 'Required arguments :title missing' if [:title].nil? logger.warn('The files.edit method is undocumented.') post('files.edit', ) end |
#files_getUploadURLExternal(options = {}) ⇒ Object
Gets a URL for an edge external file upload
74 75 76 77 78 |
# File 'lib/slack/web/api/endpoints/files.rb', line 74 def files_getUploadURLExternal( = {}) raise ArgumentError, 'Required arguments :length missing' if [:length].nil? raise ArgumentError, 'Required arguments :filename missing' if [:filename].nil? post('files.getUploadURLExternal', ) end |
#files_info(options = {}) ⇒ Object
Gets information about a file.
91 92 93 94 95 96 97 98 99 100 |
# File 'lib/slack/web/api/endpoints/files.rb', line 91 def files_info( = {}) raise ArgumentError, 'Required arguments :file missing' if [:file].nil? if block_given? Pagination::Cursor.new(self, :files_info, ).each do |page| yield page end else post('files.info', ) end end |
#files_list(options = {}) ⇒ Object
List for a team, in a channel, or from a user with applied filters.
121 122 123 124 125 |
# File 'lib/slack/web/api/endpoints/files.rb', line 121 def files_list( = {}) = .merge(channel: conversations_id()['channel']['id']) if [:channel] = .merge(user: users_id()['user']['id']) if [:user] post('files.list', ) end |
#files_revokePublicURL(options = {}) ⇒ Object
Revokes public/external sharing access for a file
134 135 136 137 |
# File 'lib/slack/web/api/endpoints/files.rb', line 134 def files_revokePublicURL( = {}) raise ArgumentError, 'Required arguments :file missing' if [:file].nil? post('files.revokePublicURL', ) end |
#files_share(options = {}) ⇒ Object
Share an existing file in a channel (undocumented)
147 148 149 150 151 152 153 |
# File 'lib/slack/web/api/endpoints/files.rb', line 147 def files_share( = {}) raise ArgumentError, 'Required arguments :file missing' if [:file].nil? raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] logger.warn('The files.share method is undocumented.') post('files.share', ) end |
#files_sharedPublicURL(options = {}) ⇒ Object
Enables a file for public/external sharing.
162 163 164 165 |
# File 'lib/slack/web/api/endpoints/files.rb', line 162 def files_sharedPublicURL( = {}) raise ArgumentError, 'Required arguments :file missing' if [:file].nil? post('files.sharedPublicURL', ) end |
#files_upload(options = {}) ⇒ Object
Uploads or creates a file.
188 189 190 |
# File 'lib/slack/web/api/endpoints/files.rb', line 188 def files_upload( = {}) post('files.upload', ) end |