slackline/api/search
This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.
Legacy search (search.*). Slack recommends the Real-time Search API
(assistant.search.context) instead.
Types
A successful response from search.all.
pub type AllResponse {
AllResponse(
query: option.Option(String),
messages: option.Option(SearchMessages),
files: option.Option(SearchFiles),
posts: option.Option(SearchPosts),
)
}
Constructors
-
AllResponse( query: option.Option(String), messages: option.Option(SearchMessages), files: option.Option(SearchFiles), posts: option.Option(SearchPosts), )Arguments
- query
-
The query that was run.
- messages
-
Matching messages.
- files
-
Matching files.
- posts
-
Matching posts.
A successful response from search.files.
pub type FilesResponse {
FilesResponse(
query: option.Option(String),
files: option.Option(SearchFiles),
)
}
Constructors
-
FilesResponse( query: option.Option(String), files: option.Option(SearchFiles), )Arguments
- query
-
The query that was run.
- files
-
Matching files.
Identifies search.messages in the slackline.Call that messages
returns.
pub type Messages
A successful response from search.messages.
pub type MessagesResponse {
MessagesResponse(
query: option.Option(String),
messages: option.Option(SearchMessages),
)
}
Constructors
-
MessagesResponse( query: option.Option(String), messages: option.Option(SearchMessages), )Arguments
- query
-
The query that was run.
- messages
-
Matching messages.
A message next to a match, provided for context. Deprecated by Slack since December 3, 2020.
pub type SearchContextMessage {
SearchContextMessage(
iid: option.Option(String),
ts: option.Option(String),
message_type: option.Option(String),
user: option.Option(String),
username: option.Option(String),
text: option.Option(String),
)
}
Constructors
-
SearchContextMessage( iid: option.Option(String), ts: option.Option(String), message_type: option.Option(String), user: option.Option(String), username: option.Option(String), text: option.Option(String), )Arguments
- iid
-
The message ID within the search results.
- ts
-
The message timestamp.
- message_type
-
The message type.
- user
-
The user who posted the message.
- username
-
The username of the poster.
- text
-
The message text.
Files matching a search query.
pub type SearchFiles {
SearchFiles(
matches: option.Option(List(file.File)),
pagination: option.Option(SearchPagination),
paging: option.Option(SearchPaging),
total: option.Option(Int),
)
}
Constructors
-
SearchFiles( matches: option.Option(List(file.File)), pagination: option.Option(SearchPagination), paging: option.Option(SearchPaging), total: option.Option(Int), )Arguments
- matches
-
The matching files on this page.
- pagination
-
Pagination details by record position.
- paging
-
Page-based pagination details.
- total
-
The (estimated) total number of matches.
The conversation a matched message was posted in. For DMs name holds
the other user’s ID.
pub type SearchMatchChannel {
SearchMatchChannel(
id: String,
name: option.Option(String),
is_ext_shared: option.Option(Bool),
is_mpim: option.Option(Bool),
is_org_shared: option.Option(Bool),
is_pending_ext_shared: option.Option(Bool),
is_private: option.Option(Bool),
is_shared: option.Option(Bool),
pending_shared: option.Option(List(String)),
)
}
Constructors
-
SearchMatchChannel( id: String, name: option.Option(String), is_ext_shared: option.Option(Bool), is_mpim: option.Option(Bool), is_org_shared: option.Option(Bool), is_pending_ext_shared: option.Option(Bool), is_private: option.Option(Bool), is_shared: option.Option(Bool), pending_shared: option.Option(List(String)), )Arguments
- id
-
The conversation ID.
- name
-
The conversation name.
- is_ext_shared
-
Whether the channel is shared with an external organization.
- is_mpim
-
Whether the conversation is a multi-person DM.
- is_org_shared
-
Whether the channel is shared across an Enterprise organization.
- is_pending_ext_shared
-
Whether the channel is waiting to be shared externally.
- is_private
-
Whether the channel is private.
- is_shared
-
Whether the channel is shared.
- pending_shared
-
Teams the channel is waiting to be shared with.
A message matching a search query.
pub type SearchMessageMatch {
SearchMessageMatch(
ts: String,
iid: option.Option(String),
match_type: option.Option(String),
user: option.Option(String),
username: option.Option(String),
text: option.Option(String),
team: option.Option(String),
permalink: option.Option(String),
channel: option.Option(SearchMatchChannel),
blocks: option.Option(List(block.Block)),
attachments: option.Option(List(attachment.Attachment)),
previous: option.Option(SearchContextMessage),
previous_2: option.Option(SearchContextMessage),
next: option.Option(SearchContextMessage),
next_2: option.Option(SearchContextMessage),
)
}
Constructors
-
SearchMessageMatch( ts: String, iid: option.Option(String), match_type: option.Option(String), user: option.Option(String), username: option.Option(String), text: option.Option(String), team: option.Option(String), permalink: option.Option(String), channel: option.Option(SearchMatchChannel), blocks: option.Option(List(block.Block)), attachments: option.Option(List(attachment.Attachment)), previous: option.Option(SearchContextMessage), previous_2: option.Option(SearchContextMessage), next: option.Option(SearchContextMessage), next_2: option.Option(SearchContextMessage), )Arguments
- ts
-
The message timestamp.
- iid
-
The message ID within the search results.
- match_type
-
message, orimandgroupfor DM and private group results. - user
-
The user who posted the message.
- username
-
The username of the poster.
- text
-
The message text, with highlight markers when
highlightistrue. - team
-
The team the message belongs to.
- permalink
-
A permalink to the message.
- channel
-
The conversation the message was posted in.
- blocks
-
The message blocks.
- attachments
-
The message attachments.
- previous
-
Deprecated context message before the match.
- previous_2
-
Deprecated context message two before the match.
- next
-
Deprecated context message after the match.
- next_2
-
Deprecated context message two after the match.
Messages matching a search query.
pub type SearchMessages {
SearchMessages(
matches: option.Option(List(SearchMessageMatch)),
pagination: option.Option(SearchPagination),
paging: option.Option(SearchPaging),
total: option.Option(Int),
)
}
Constructors
-
SearchMessages( matches: option.Option(List(SearchMessageMatch)), pagination: option.Option(SearchPagination), paging: option.Option(SearchPaging), total: option.Option(Int), )Arguments
- matches
-
The matching messages on this page.
- pagination
-
Pagination details by record position.
- paging
-
Page-based pagination details.
- total
-
The (estimated) total number of matches.
Pagination details by record position.
pub type SearchPagination {
SearchPagination(
first: option.Option(Int),
last: option.Option(Int),
page: option.Option(Int),
page_count: option.Option(Int),
per_page: option.Option(Int),
total_count: option.Option(Int),
)
}
Constructors
-
SearchPagination( first: option.Option(Int), last: option.Option(Int), page: option.Option(Int), page_count: option.Option(Int), per_page: option.Option(Int), total_count: option.Option(Int), )Arguments
- first
-
Position of the first record on this page.
- last
-
Position of the last record on this page.
- page
-
The page of records returned.
- page_count
-
Total number of pages.
- per_page
-
Number of records per page.
- total_count
-
Total number of records matching the query.
Page-based pagination details.
pub type SearchPaging {
SearchPaging(
count: option.Option(Int),
total: option.Option(Int),
page: option.Option(Int),
pages: option.Option(Int),
)
}
Constructors
-
SearchPaging( count: option.Option(Int), total: option.Option(Int), page: option.Option(Int), pages: option.Option(Int), )Arguments
- count
-
Number of records per page.
- total
-
Total number of records matching the query.
- page
-
The page of records returned.
- pages
-
Total number of pages.
Posts that match a search query.
pub type SearchPosts {
SearchPosts(
matches: option.Option(List(value.Value)),
total: option.Option(Int),
)
}
Constructors
-
SearchPosts( matches: option.Option(List(value.Value)), total: option.Option(Int), )Arguments
- matches
-
The matching posts.
- total
-
The total number of matches.
Values
pub fn all(
query query: String,
) -> slackline.Call(All, AllResponse)
search.all:
Searches for messages and files matching a query.
search.All identifies this method in slackline.Call.
Set optional arguments with the functions in slackline/api/search/all.
User token scopes: search:read.
Rate limit tier: t2.
Documented errors: no_query.
pub fn all_response_decoder() -> decode.Decoder(AllResponse)
Decodes the response from search.all.
pub fn files(
query query: String,
) -> slackline.Call(Files, FilesResponse)
search.files:
Searches for files matching a query.
search.Files identifies this method in slackline.Call.
Set optional arguments with the functions in slackline/api/search/files.
User token scopes: search:read.
Rate limit tier: t2.
Documented errors: no_query.
pub fn files_response_decoder() -> decode.Decoder(FilesResponse)
Decodes the response from search.files.
pub fn messages(
query query: String,
) -> slackline.Call(Messages, MessagesResponse)
search.messages:
Searches for messages matching a query.
search.Messages identifies this method in slackline.Call.
Set optional arguments with the functions in
slackline/api/search/messages.
User token scopes: search:read.
Rate limit tier: t2.
Documented errors: no_query.
pub fn messages_response_decoder() -> decode.Decoder(
MessagesResponse,
)
Decodes the response from search.messages.
pub fn search_context_message_decoder() -> decode.Decoder(
SearchContextMessage,
)
Decodes SearchContextMessage from json.
pub fn search_context_message_to_json(
it: SearchContextMessage,
) -> json.Json
Encodes SearchContextMessage as json.
pub fn search_files_decoder() -> decode.Decoder(SearchFiles)
Decodes SearchFiles from json.
pub fn search_files_to_json(it: SearchFiles) -> json.Json
Encodes SearchFiles as json.
pub fn search_match_channel_decoder() -> decode.Decoder(
SearchMatchChannel,
)
Decodes SearchMatchChannel from json.
pub fn search_match_channel_to_json(
it: SearchMatchChannel,
) -> json.Json
Encodes SearchMatchChannel as json.
pub fn search_message_match_decoder() -> decode.Decoder(
SearchMessageMatch,
)
Decodes SearchMessageMatch from json.
pub fn search_message_match_to_json(
it: SearchMessageMatch,
) -> json.Json
Encodes SearchMessageMatch as json.
pub fn search_messages_decoder() -> decode.Decoder(SearchMessages)
Decodes SearchMessages from json.
pub fn search_messages_to_json(it: SearchMessages) -> json.Json
Encodes SearchMessages as json.
pub fn search_pagination_decoder() -> decode.Decoder(
SearchPagination,
)
Decodes SearchPagination from json.
pub fn search_pagination_to_json(
it: SearchPagination,
) -> json.Json
Encodes SearchPagination as json.
pub fn search_paging_decoder() -> decode.Decoder(SearchPaging)
Decodes SearchPaging from json.
pub fn search_paging_to_json(it: SearchPaging) -> json.Json
Encodes SearchPaging as json.
pub fn search_posts_decoder() -> decode.Decoder(SearchPosts)
Decodes SearchPosts from json.
pub fn search_posts_to_json(it: SearchPosts) -> json.Json
Encodes SearchPosts as json.