slackline/api/files
This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.
Slack Web API methods for uploading, sharing and managing files and remote files.
Types
Identifies files.comments.delete in the slackline.Call that
comments_delete returns.
pub type CommentsDelete
Identifies files.completeUploadExternal in the slackline.Call that
complete_upload_external returns.
pub type CompleteUploadExternal
A successful response from files.completeUploadExternal.
pub type CompleteUploadExternalResponse {
CompleteUploadExternalResponse(
files: option.Option(List(CompletedFile)),
)
}
Constructors
-
CompleteUploadExternalResponse( files: option.Option(List(CompletedFile)), )Arguments
- files
-
The uploaded files.
A file returned by files.completeUploadExternal.
pub type CompletedFile {
CompletedFile(id: String, title: option.Option(String))
}
Constructors
-
CompletedFile(id: String, title: option.Option(String))Arguments
- id
-
The file ID.
- title
-
The title of the file.
Page-based paging details.
pub type FilesPaging {
FilesPaging(
count: option.Option(Int),
total: option.Option(Int),
page: option.Option(Int),
pages: option.Option(Int),
)
}
Constructors
-
FilesPaging( count: option.Option(Int), total: option.Option(Int), page: option.Option(Int), pages: option.Option(Int), )Arguments
- count
-
The number of items returned.
- total
-
The total number of items.
- page
-
The page of results returned.
- pages
-
The total number of pages.
Identifies files.getUploadURLExternal in the slackline.Call that
get_upload_url_external returns.
pub type GetUploadUrlExternal
A successful response from files.getUploadURLExternal.
pub type GetUploadUrlExternalResponse {
GetUploadUrlExternalResponse(
upload_url: String,
file_id: String,
)
}
Constructors
-
GetUploadUrlExternalResponse(upload_url: String, file_id: String)Arguments
- upload_url
-
The URL to POST the file contents to.
- file_id
-
The ID of the file being uploaded, for
files.completeUploadExternal.
A successful response from files.info.
pub type InfoResponse {
InfoResponse(
file: option.Option(file.File),
comments: option.Option(List(file.FileComment)),
paging: option.Option(FilesPaging),
response_metadata: option.Option(slackline.ResponseMetadata),
)
}
Constructors
-
InfoResponse( file: option.Option(file.File), comments: option.Option(List(file.FileComment)), paging: option.Option(FilesPaging), response_metadata: option.Option(slackline.ResponseMetadata), )Arguments
- file
-
The file.
- comments
-
Comments on the file, oldest first.
- paging
-
Page-based paging for the comments.
Identifies files.list in the slackline.Call that list returns.
pub type ListMethod
A successful response from files.list.
pub type ListResponse {
ListResponse(
files: option.Option(List(file.File)),
paging: option.Option(FilesPaging),
response_metadata: option.Option(slackline.ResponseMetadata),
)
}
Constructors
-
ListResponse( files: option.Option(List(file.File)), paging: option.Option(FilesPaging), response_metadata: option.Option(slackline.ResponseMetadata), )Arguments
- files
-
The files.
- paging
-
Page-based paging information.
Identifies files.remote.add in the slackline.Call that remote_add
returns.
pub type RemoteAdd
A successful response from files.remote.add.
pub type RemoteAddResponse {
RemoteAddResponse(file: option.Option(file.File))
}
Constructors
-
RemoteAddResponse(file: option.Option(file.File))Arguments
- file
-
The remote file.
Identifies files.remote.info in the slackline.Call that remote_info
returns.
pub type RemoteInfo
A successful response from files.remote.info.
pub type RemoteInfoResponse {
RemoteInfoResponse(file: option.Option(file.File))
}
Constructors
-
RemoteInfoResponse(file: option.Option(file.File))Arguments
- file
-
The remote file.
Identifies files.remote.list in the slackline.Call that remote_list
returns.
pub type RemoteList
A successful response from files.remote.list.
pub type RemoteListResponse {
RemoteListResponse(
files: option.Option(List(file.File)),
response_metadata: option.Option(slackline.ResponseMetadata),
)
}
Constructors
-
RemoteListResponse( files: option.Option(List(file.File)), response_metadata: option.Option(slackline.ResponseMetadata), )Arguments
- files
-
The remote files.
Identifies files.remote.remove in the slackline.Call that
remote_remove returns.
pub type RemoteRemove
Identifies files.remote.share in the slackline.Call that remote_share
returns.
pub type RemoteShare
A successful response from files.remote.share.
pub type RemoteShareResponse {
RemoteShareResponse(file: option.Option(file.File))
}
Constructors
-
RemoteShareResponse(file: option.Option(file.File))Arguments
- file
-
The shared remote file.
Identifies files.remote.update in the slackline.Call that
remote_update returns.
pub type RemoteUpdate
A successful response from files.remote.update.
pub type RemoteUpdateResponse {
RemoteUpdateResponse(file: option.Option(file.File))
}
Constructors
-
RemoteUpdateResponse(file: option.Option(file.File))Arguments
- file
-
The updated remote file.
Identifies files.revokePublicURL in the slackline.Call that
revoke_public_url returns.
pub type RevokePublicUrl
Identifies files.sharedPublicURL in the slackline.Call that
shared_public_url returns.
pub type SharedPublicUrl
A successful response from files.sharedPublicURL.
pub type SharedPublicUrlResponse {
SharedPublicUrlResponse(
file: option.Option(file.File),
comments: option.Option(List(file.FileComment)),
paging: option.Option(FilesPaging),
)
}
Constructors
-
SharedPublicUrlResponse( file: option.Option(file.File), comments: option.Option(List(file.FileComment)), paging: option.Option(FilesPaging), )Arguments
- file
-
The file, including its
permalink_publicURL. - comments
-
Comments on the file, oldest first.
- paging
-
Page-based paging for the comments.
A successful response from files.upload.
pub type UploadResponse {
UploadResponse(file: option.Option(file.File))
}
Constructors
-
UploadResponse(file: option.Option(file.File))Arguments
- file
-
The uploaded file.
A file to finish uploading with files.completeUploadExternal.
pub type UploadedFile {
UploadedFile(id: String, title: option.Option(String))
}
Constructors
-
UploadedFile(id: String, title: option.Option(String))Arguments
- id
-
The file ID returned by
files.getUploadURLExternal. - title
-
The title of the file.
Values
pub fn comments_delete(
file file: String,
id id: String,
) -> slackline.Call(CommentsDelete, Nil)
files.comments.delete:
Deletes an existing comment on a file.
files.CommentsDelete identifies this method in slackline.Call.
Bot token scopes: files:write.
User token scopes: files:write.
Rate limit tier: t2.
Documented errors: cant_delete, file_deleted, file_not_found.
pub fn complete_upload_external(
files files: List(UploadedFile),
) -> slackline.Call(
CompleteUploadExternal,
CompleteUploadExternalResponse,
)
files.completeUploadExternal:
Finishes an upload started with files.getUploadURLExternal
files.CompleteUploadExternal identifies this method in slackline.Call.
Set optional arguments with the functions in
slackline/api/files/complete_upload_external.
Bot token scopes: files:write.
User token scopes: files:write.
Rate limit tier: t4.
Documented errors: channel_not_found, channels_limit_exceeded,
file_not_found, file_type_not_allowed, file_update_failed,
file_uploads_except_images_disabled, invalid_blocks, invalid_channel,
not_in_channel, posting_to_channel_denied, user_is_external_guest.
pub fn complete_upload_external_response_decoder() -> decode.Decoder(
CompleteUploadExternalResponse,
)
Decodes the response from files.completeUploadExternal.
pub fn completed_file_decoder() -> decode.Decoder(CompletedFile)
Decodes CompletedFile from json.
pub fn completed_file_to_json(it: CompletedFile) -> json.Json
Encodes CompletedFile as json.
pub fn delete(file file: String) -> slackline.Call(Delete, Nil)
files.delete:
Deletes a file.
files.Delete identifies this method in slackline.Call.
Bot token scopes: files:write.
User token scopes: files:write.
Rate limit tier: t3.
Documented errors: cant_delete_file, delete_not_allowed, file_deleted,
file_deleting_disabled, file_not_found, use_skills_api.
pub fn files_paging_decoder() -> decode.Decoder(FilesPaging)
Decodes FilesPaging from json.
pub fn files_paging_to_json(it: FilesPaging) -> json.Json
Encodes FilesPaging as json.
pub fn get_upload_url_external(
length length: Int,
filename filename: String,
) -> slackline.Call(
GetUploadUrlExternal,
GetUploadUrlExternalResponse,
)
files.getUploadURLExternal:
Gets a URL for an edge external file upload
files.GetUploadUrlExternal identifies this method in slackline.Call.
Set optional arguments with the functions in
slackline/api/files/get_upload_url_external.
Bot token scopes: files:write.
User token scopes: files:write.
Rate limit tier: t4.
Documented errors: alt_txt_too_large, file_type_not_allowed,
file_upload_size_restricted, file_uploads_disabled,
file_uploads_except_images_disabled, snippet_too_large,
storage_limit_reached, unknown_snippet_type, unknown_subtype,
user_is_external_guest.
pub fn get_upload_url_external_response_decoder() -> decode.Decoder(
GetUploadUrlExternalResponse,
)
Decodes the response from files.getUploadURLExternal.
pub fn info(
file file: String,
) -> slackline.Call(Info, InfoResponse)
files.info: Gets
information about a file.
files.Info identifies this method in slackline.Call.
Set optional arguments with the functions in slackline/api/files/info.
Bot token scopes: files:read.
User token scopes: files:read.
Rate limit tier: t4.
Documented errors: canvas_disabled_file_team, canvas_disabled_user_team,
canvas_globally_disabled, file_deleted, file_not_found, not_visible,
slack_connect_canvas_sharing_blocked, template_not_visible.
pub fn info_response_decoder() -> decode.Decoder(InfoResponse)
Decodes the response from files.info.
pub fn list() -> slackline.Call(ListMethod, ListResponse)
files.list: List
for a team, in a channel, or from a user with applied filters.
files.ListMethod identifies this method in slackline.Call.
Set optional arguments with the functions in slackline/api/files/list.
Bot token scopes: files:read.
User token scopes: files:read.
Rate limit tier: t3.
Documented errors: slack_connect_canvas_sharing_blocked, unknown_type,
user_not_found.
pub fn list_response_decoder() -> decode.Decoder(ListResponse)
Decodes the response from files.list.
pub fn remote_add(
external_id external_id: String,
external_url external_url: String,
title title: String,
) -> slackline.Call(RemoteAdd, RemoteAddResponse)
files.remote.add:
Adds a file from a remote service
files.RemoteAdd identifies this method in slackline.Call.
preview_image and indexable_file_contents are binary
multipart/form-data uploads, which
slackline cannot send yet, so they are left out.
Set optional arguments with the functions in
slackline/api/files/remote_add.
Bot token scopes: remote_files:write.
Rate limit tier: t2.
Documented errors: bad_image, bad_title, bot_user_required,
invalid_external_id, too_large.
pub fn remote_add_response_decoder() -> decode.Decoder(
RemoteAddResponse,
)
Decodes the response from files.remote.add.
pub fn remote_info() -> slackline.Call(
RemoteInfo,
RemoteInfoResponse,
)
files.remote.info:
Retrieve information about a remote file added to Slack
files.RemoteInfo identifies this method in slackline.Call.
Set optional arguments with the functions in
slackline/api/files/remote_info.
Bot token scopes: remote_files:read.
User token scopes: remote_files:read.
Rate limit tier: t2.
Documented errors: file_not_found, invalid_args, no_bot_user_for_app,
too_many_ids.
pub fn remote_info_response_decoder() -> decode.Decoder(
RemoteInfoResponse,
)
Decodes the response from files.remote.info.
pub fn remote_list() -> slackline.Call(
RemoteList,
RemoteListResponse,
)
files.remote.list:
Retrieve information about a remote file added to Slack
files.RemoteList identifies this method in slackline.Call.
Set optional arguments with the functions in
slackline/api/files/remote_list.
Bot token scopes: remote_files:read.
User token scopes: remote_files:read.
Rate limit tier: t2.
Documented errors: invalid_cursor, no_bot_user_for_app.
pub fn remote_list_response_decoder() -> decode.Decoder(
RemoteListResponse,
)
Decodes the response from files.remote.list.
pub fn remote_remove() -> slackline.Call(RemoteRemove, Nil)
files.remote.remove:
Remove a remote file.
files.RemoteRemove identifies this method in slackline.Call.
Set optional arguments with the functions in
slackline/api/files/remote_remove.
Bot token scopes: remote_files:write.
Rate limit tier: t2.
Documented errors: bot_user_required, file_not_found,
file_under_review, invalid_args, too_many_ids.
pub fn remote_share(
channels channels: List(String),
) -> slackline.Call(RemoteShare, RemoteShareResponse)
files.remote.share:
Share a remote file into a channel.
files.RemoteShare identifies this method in slackline.Call.
Set optional arguments with the functions in
slackline/api/files/remote_share.
Bot token scopes: remote_files:share.
User token scopes: remote_files:share.
Rate limit tier: t2.
Documented errors: channel_not_found, file_not_found, invalid_args,
no_bot_user_for_app, not_in_channel.
pub fn remote_share_response_decoder() -> decode.Decoder(
RemoteShareResponse,
)
Decodes the response from files.remote.share.
pub fn remote_update() -> slackline.Call(
RemoteUpdate,
RemoteUpdateResponse,
)
files.remote.update:
Updates an existing remote file.
files.RemoteUpdate identifies this method in slackline.Call.
preview_image and indexable_file_contents are binary
multipart/form-data uploads, which
slackline cannot send yet, so they are left out.
Set optional arguments with the functions in
slackline/api/files/remote_update.
Bot token scopes: remote_files:write.
Rate limit tier: t2.
Documented errors: bad_image, bot_user_required, failed_to_unshare,
file_not_found, invalid_title, invalid_type, invalid_url,
too_large.
pub fn remote_update_response_decoder() -> decode.Decoder(
RemoteUpdateResponse,
)
Decodes the response from files.remote.update.
pub fn revoke_public_url(
file file: String,
) -> slackline.Call(RevokePublicUrl, Nil)
files.revokePublicURL:
Revokes public/external sharing access for a file
files.RevokePublicUrl identifies this method in slackline.Call.
Bot token scopes: files:write.
User token scopes: files:write.
Rate limit tier: t3.
Documented errors: file_not_found.
pub fn shared_public_url(
file file: String,
) -> slackline.Call(SharedPublicUrl, SharedPublicUrlResponse)
files.sharedPublicURL:
Enables a file for public/external sharing.
files.SharedPublicUrl identifies this method in slackline.Call.
User token scopes: files:write.
Rate limit tier: t3.
Documented errors: file_not_found, not_allowed,
public_file_type_not_allowed, public_video_not_allowed.
pub fn shared_public_url_response_decoder() -> decode.Decoder(
SharedPublicUrlResponse,
)
Decodes the response from files.sharedPublicURL.
pub fn upload() -> slackline.Call(Upload, UploadResponse)
files.upload:
Uploads or creates a file.
files.Upload identifies this method in slackline.Call.
slackline supports only the content form of this method. The file
argument is a binary
multipart/form-data upload, which slackline cannot send. Prefer
get_upload_url_external and complete_upload_external.
Set optional arguments with the functions in slackline/api/files/upload.
Bot token scopes: files:write.
User token scopes: files:write.
Rate limit tier: t2.
Documented errors: blocked_file_type, channel_not_found,
invalid_channel, invalid_thread_ts, malware_detected,
not_in_channel, post_contents_too_large,
posting_to_general_channel_denied, slack_connect_blocked_file_type,
slack_connect_clip_sharing_blocked,
slack_connect_file_upload_sharing_blocked.
pub fn upload_response_decoder() -> decode.Decoder(UploadResponse)
Decodes the response from files.upload.
pub fn uploaded_file_decoder() -> decode.Decoder(UploadedFile)
Decodes UploadedFile from json.
pub fn uploaded_file_to_json(it: UploadedFile) -> json.Json
Encodes UploadedFile as json.