slackline/api/pins
This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.
Pinned items (pins.*).
Types
Identifies pins.list in the slackline.Call that list returns.
pub type ListMethod
A successful response from pins.list.
pub type ListResponse {
ListResponse(items: option.Option(List(PinnedItem)))
}
Constructors
-
ListResponse(items: option.Option(List(PinnedItem)))Arguments
- items
-
The pinned items.
A comment on a file.
pub type PinnedFileComment {
PinnedFileComment(
id: option.Option(String),
created: option.Option(Int),
timestamp: option.Option(Int),
user: option.Option(String),
comment: option.Option(String),
is_intro: option.Option(Bool),
reactions: option.Option(List(common.Reaction)),
)
}
Constructors
-
PinnedFileComment( id: option.Option(String), created: option.Option(Int), timestamp: option.Option(Int), user: option.Option(String), comment: option.Option(String), is_intro: option.Option(Bool), reactions: option.Option(List(common.Reaction)), )Arguments
- id
-
The comment ID.
- created
-
Unix timestamp of when the comment was created.
- timestamp
-
Unix timestamp of the comment.
- user
-
The user who wrote the comment.
- comment
-
The comment text.
- is_intro
-
Whether this is the file’s initial comment.
- reactions
-
Reactions to the comment.
An item pinned to a channel. Which fields are set depends on type.
pub type PinnedItem {
PinnedItem(
item_type: option.Option(PinnedItemType),
channel: option.Option(String),
created: option.Option(Int),
created_by: option.Option(String),
message: option.Option(message.Message),
file: option.Option(file.File),
comment: option.Option(PinnedFileComment),
)
}
Constructors
-
PinnedItem( item_type: option.Option(PinnedItemType), channel: option.Option(String), created: option.Option(Int), created_by: option.Option(String), message: option.Option(message.Message), file: option.Option(file.File), comment: option.Option(PinnedFileComment), )Arguments
- item_type
-
message,fileorfile_comment. - channel
-
The channel the item is pinned to.
- created
-
Unix timestamp of when the item was pinned.
- created_by
-
The user who pinned the item.
- message
-
The pinned message, for
messageitems. - file
-
The pinned file, for
fileandfile_commentitems. - comment
-
The pinned comment, for
file_commentitems.
The kind of a pinned item.
pub type PinnedItemType {
PinnedMessageType
PinnedFileType
PinnedFileCommentType
UnknownPinnedItemType(String)
}
Constructors
-
PinnedMessageTypemessage -
PinnedFileTypefile -
PinnedFileCommentTypefile_comment -
UnknownPinnedItemType(String)A value that this version of slackline does not know.
Values
pub fn add(channel channel: String) -> slackline.Call(Add, Nil)
pins.add: Pins an
item to a channel.
pins.Add identifies this method in slackline.Call.
Set optional arguments with the functions in slackline/api/pins/add.
Bot token scopes: pins:write.
User token scopes: pins:write.
Rate limit tier: t2.
Documented errors: already_pinned, bad_timestamp, channel_not_found,
external_channel_migrating, file_not_found, file_not_shared,
message_not_found, no_item_specified, not_in_channel, not_pinnable,
restricted_action, too_many_pins.
pub fn list(
channel channel: String,
) -> slackline.Call(ListMethod, ListResponse)
pins.list: Lists
items pinned to a channel.
pins.ListMethod identifies this method in slackline.Call.
Bot token scopes: pins:read.
User token scopes: pins:read.
Rate limit tier: t2.
Documented errors: channel_not_found, restricted_action.
pub fn list_response_decoder() -> decode.Decoder(ListResponse)
Decodes the response from pins.list.
pub fn pinned_file_comment_decoder() -> decode.Decoder(
PinnedFileComment,
)
Decodes PinnedFileComment from json.
pub fn pinned_file_comment_to_json(
it: PinnedFileComment,
) -> json.Json
Encodes PinnedFileComment as json.
pub fn pinned_item_decoder() -> decode.Decoder(PinnedItem)
Decodes PinnedItem from json.
pub fn pinned_item_to_json(it: PinnedItem) -> json.Json
Encodes PinnedItem as json.
pub fn pinned_item_type_decoder() -> decode.Decoder(
PinnedItemType,
)
Decodes PinnedItemType from a json string.
pub fn pinned_item_type_from_string(
string: String,
) -> PinnedItemType
Parses PinnedItemType from its json string.
pub fn pinned_item_type_to_json(it: PinnedItemType) -> json.Json
Encodes PinnedItemType as a json string.
pub fn pinned_item_type_to_string(it: PinnedItemType) -> String
The json string of PinnedItemType.
pub fn remove(
channel channel: String,
) -> slackline.Call(Remove, Nil)
pins.remove:
Un-pins an item from a channel.
pins.Remove identifies this method in slackline.Call.
Set optional arguments with the functions in slackline/api/pins/remove.
Bot token scopes: pins:write.
User token scopes: pins:write.
Rate limit tier: t2.
Documented errors: bad_timestamp, channel_not_found,
external_channel_migrating, file_comment_not_found, file_not_found,
message_not_found, no_item_specified, no_pin, not_pinned,
restricted_action.