Skip to main content

slack_web_api/
response.rs

1use serde::{Deserialize, Serialize};
2
3/// The `response_metadata` of a response: the pagination cursor plus warning and error details.
4#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5#[serde(default)]
6pub struct ResponseMetadata {
7    /// Cursor for the next page. Empty or absent on the last page.
8    #[serde(skip_serializing_if = "Option::is_none")]
9    pub next_cursor: Option<String>,
10    /// Warning codes such as `missing_charset`.
11    #[serde(
12        skip_serializing_if = "Vec::is_empty",
13        deserialize_with = "crate::de::vec"
14    )]
15    pub warnings: Vec<String>,
16    /// Detailed reasons for an error or warning (for example, what is wrong with `invalid_blocks`).
17    #[serde(
18        skip_serializing_if = "Vec::is_empty",
19        deserialize_with = "crate::de::vec"
20    )]
21    pub messages: Vec<String>,
22    /// Scopes granted to the token.
23    #[serde(
24        skip_serializing_if = "Vec::is_empty",
25        deserialize_with = "crate::de::vec"
26    )]
27    pub scopes: Vec<String>,
28    /// Scopes accepted by the method.
29    #[serde(
30        rename = "acceptedScopes",
31        skip_serializing_if = "Vec::is_empty",
32        deserialize_with = "crate::de::vec"
33    )]
34    pub accepted_scopes: Vec<String>,
35}