Add serde attributes to Option and Vec, and missing #[derive]s
This commit is contained in:
parent
6da028c0fe
commit
3c324d526c
@ -7,8 +7,10 @@ pub mod register {
|
|||||||
/// This API endpoint's body parameters.
|
/// This API endpoint's body parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub bind_email: Option<bool>,
|
pub bind_email: Option<bool>,
|
||||||
pub password: String,
|
pub password: String,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub username: Option<String>,
|
pub username: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,8 +18,9 @@ pub mod register {
|
|||||||
pub struct Endpoint;
|
pub struct Endpoint;
|
||||||
|
|
||||||
/// This API endpoint's query string parameters.
|
/// This API endpoint's query string parameters.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct QueryParams {
|
pub struct QueryParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub kind: Option<RegistrationKind>,
|
pub kind: Option<RegistrationKind>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,6 +70,7 @@ pub mod request_password_change_token {
|
|||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
pub client_secret: String,
|
pub client_secret: String,
|
||||||
pub email: String,
|
pub email: String,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub id_server: Option<String>,
|
pub id_server: Option<String>,
|
||||||
pub send_attempt: u64,
|
pub send_attempt: u64,
|
||||||
}
|
}
|
||||||
@ -163,6 +167,7 @@ pub mod request_register_token {
|
|||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
pub client_secret: String,
|
pub client_secret: String,
|
||||||
pub email: String,
|
pub email: String,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub id_server: Option<String>,
|
pub id_server: Option<String>,
|
||||||
pub send_attempt: u64,
|
pub send_attempt: u64,
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,7 @@ pub mod get {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// These API endpoints' path parameters.
|
/// These API endpoints' path parameters.
|
||||||
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct PathParams {
|
pub struct PathParams {
|
||||||
pub room_alias: RoomAliasId,
|
pub room_alias: RoomAliasId,
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ pub mod add_contact {
|
|||||||
/// This API endpoint's body parameters.
|
/// This API endpoint's body parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub bind: Option<bool>,
|
pub bind: Option<bool>,
|
||||||
pub three_pid_creds: ThreePidCredentials,
|
pub three_pid_creds: ThreePidCredentials,
|
||||||
}
|
}
|
||||||
@ -98,6 +99,7 @@ pub mod request_contact_verification_token {
|
|||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
pub client_secret: String,
|
pub client_secret: String,
|
||||||
pub email: String,
|
pub email: String,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub id_server: Option<String>,
|
pub id_server: Option<String>,
|
||||||
pub send_attempt: u64,
|
pub send_attempt: u64,
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ pub mod get_context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// This API endpoint's query string parameters.
|
/// This API endpoint's query string parameters.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct QueryParams {
|
pub struct QueryParams {
|
||||||
pub limit: u8,
|
pub limit: u8,
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,15 @@ pub mod public_rooms {
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct PublicRoomsChunk {
|
pub struct PublicRoomsChunk {
|
||||||
pub world_readable: bool,
|
pub world_readable: bool,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub topic: Option<String>,
|
pub topic: Option<String>,
|
||||||
pub num_joined_members: u64,
|
pub num_joined_members: u64,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub avatar_url: Option<String>,
|
pub avatar_url: Option<String>,
|
||||||
pub room_id: RoomId,
|
pub room_id: RoomId,
|
||||||
pub guest_can_join: bool,
|
pub guest_can_join: bool,
|
||||||
pub aliases: Vec<RoomAliasId>,
|
pub aliases: Vec<RoomAliasId>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub name: Option<String>
|
pub name: Option<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,8 +196,10 @@ pub mod get_messages {
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct QueryParams {
|
pub struct QueryParams {
|
||||||
pub from: String,
|
pub from: String,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub to: Option<String>,
|
pub to: Option<String>,
|
||||||
pub dir: Direction,
|
pub dir: Direction,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub limit: Option<u64>
|
pub limit: Option<u64>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,44 +16,81 @@ pub enum EventFormat {
|
|||||||
/// Filters to be applied to room events
|
/// Filters to be applied to room events
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct RoomEventFilter {
|
pub struct RoomEventFilter {
|
||||||
pub not_types: Option<Vec<String>>,
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
pub not_rooms: Option<Vec<String>>,
|
#[serde(default)]
|
||||||
|
pub not_types: Vec<String>,
|
||||||
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub not_rooms: Vec<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub limit: Option<u64>,
|
pub limit: Option<u64>,
|
||||||
pub rooms: Option<Vec<RoomId>>,
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
pub not_senders: Option<Vec<UserId>>,
|
#[serde(default)]
|
||||||
pub senders: Option<Vec<UserId>>,
|
pub rooms: Vec<RoomId>,
|
||||||
pub types: Option<Vec<String>>
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub not_senders: Vec<UserId>,
|
||||||
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub senders: Vec<UserId>,
|
||||||
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub types: Vec<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Filters to be applied to room data
|
/// Filters to be applied to room data
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct RoomFilter {
|
pub struct RoomFilter {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub include_leave: Option<bool>,
|
pub include_leave: Option<bool>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub account_data: Option<RoomEventFilter>,
|
pub account_data: Option<RoomEventFilter>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub timeline: Option<RoomEventFilter>,
|
pub timeline: Option<RoomEventFilter>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub ephemeral: Option<RoomEventFilter>,
|
pub ephemeral: Option<RoomEventFilter>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub state: Option<RoomEventFilter>,
|
pub state: Option<RoomEventFilter>,
|
||||||
pub not_rooms: Option<Vec<RoomId>>,
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
pub room: Option<Vec<RoomId>>
|
#[serde(default)]
|
||||||
|
pub not_rooms: Vec<RoomId>,
|
||||||
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub room: Vec<RoomId>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Filter for not-room data
|
/// Filter for not-room data
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct Filter {
|
pub struct Filter {
|
||||||
pub not_types: Option<Vec<String>>,
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub not_types: Vec<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub limit: Option<u64>,
|
pub limit: Option<u64>,
|
||||||
pub senders: Option<Vec<UserId>>,
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
pub types: Option<Vec<String>>,
|
#[serde(default)]
|
||||||
pub not_senders: Option<Vec<UserId>>
|
pub senders: Vec<UserId>,
|
||||||
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub types: Vec<String>,
|
||||||
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub not_senders: Vec<UserId>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A filter definition
|
/// A filter definition
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct FilterDefinition {
|
pub struct FilterDefinition {
|
||||||
pub event_fields: Option<Vec<String>>,
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub event_fields: Vec<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub event_format: Option<EventFormat>,
|
pub event_format: Option<EventFormat>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub account_data: Option<Filter>,
|
pub account_data: Option<Filter>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub room: Option<RoomFilter>,
|
pub room: Option<RoomFilter>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub presence: Option<Filter>
|
pub presence: Option<Filter>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +69,7 @@ pub mod join_by_room_id_or_alias {
|
|||||||
/// The request type.
|
/// The request type.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub third_party_signed: Option<ThirdPartySigned>,
|
pub third_party_signed: Option<ThirdPartySigned>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,6 +131,7 @@ pub mod join_by_room_id {
|
|||||||
/// The request type.
|
/// The request type.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub third_party_signed: Option<ThirdPartySigned>,
|
pub third_party_signed: Option<ThirdPartySigned>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,6 +259,7 @@ pub mod kick {
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
pub user_id: String,
|
pub user_id: String,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,6 +348,7 @@ pub mod ban {
|
|||||||
/// The request type.
|
/// The request type.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
pub user_id: String,
|
pub user_id: String,
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ pub mod set_presence {
|
|||||||
/// This API endpoint's body parameters.
|
/// This API endpoint's body parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
status_msg: Option<String>,
|
status_msg: Option<String>,
|
||||||
presence: PresenceState
|
presence: PresenceState
|
||||||
}
|
}
|
||||||
@ -65,8 +66,11 @@ pub mod get_presence {
|
|||||||
/// This API endpoint's response.
|
/// This API endpoint's response.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct Response {
|
pub struct Response {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub status_msg: Option<String>,
|
pub status_msg: Option<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub currently_active: Option<bool>,
|
pub currently_active: Option<bool>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub last_active_ago: Option<u64>,
|
pub last_active_ago: Option<u64>,
|
||||||
pub presence: PresenceState
|
pub presence: PresenceState
|
||||||
}
|
}
|
||||||
@ -112,8 +116,12 @@ pub mod update_presence_list {
|
|||||||
/// This API endpoint's body parameters.
|
/// This API endpoint's body parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
drop: Option<Vec<UserId>>,
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
invite: Option<Vec<UserId>>
|
#[serde(default)]
|
||||||
|
drop: Vec<UserId>,
|
||||||
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
invite: Vec<UserId>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ::Endpoint for Endpoint {
|
impl ::Endpoint for Endpoint {
|
||||||
|
@ -15,6 +15,7 @@ pub mod get_display_name {
|
|||||||
/// This API endpoint's body parameters.
|
/// This API endpoint's body parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct Response {
|
pub struct Response {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub displayname: Option<String>
|
pub displayname: Option<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,6 +61,7 @@ pub mod set_display_name {
|
|||||||
/// This API endpoint's body parameters.
|
/// This API endpoint's body parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub displayname: Option<String>
|
pub displayname: Option<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,6 +106,7 @@ pub mod get_avatar_url {
|
|||||||
/// This API endpoint's body parameters.
|
/// This API endpoint's body parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct Response {
|
pub struct Response {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub avatar_url: Option<String>
|
pub avatar_url: Option<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,6 +151,7 @@ pub mod set_avatar_url {
|
|||||||
/// This API endpoint's body parameters.
|
/// This API endpoint's body parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub avatar_url: Option<String>
|
pub avatar_url: Option<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,7 +196,9 @@ pub mod get_profile {
|
|||||||
/// This API endpoint's body parameters.
|
/// This API endpoint's body parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct Response {
|
pub struct Response {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub avatar_url: Option<String>,
|
pub avatar_url: Option<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub displayname: Option<String>
|
pub displayname: Option<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ pub mod send_event {
|
|||||||
/// This API endpoint's path parameters.
|
/// This API endpoint's path parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub reason: Option<String>
|
pub reason: Option<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,12 +9,20 @@ pub mod create_room {
|
|||||||
/// The request type.
|
/// The request type.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub creation_content: Option<CreationContent>,
|
pub creation_content: Option<CreationContent>,
|
||||||
pub invite: Option<Vec<String>>,
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
|
#[serde(default)]
|
||||||
|
pub invite: Vec<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub preset: Option<RoomPreset>,
|
pub preset: Option<RoomPreset>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub room_alias_name: Option<String>,
|
pub room_alias_name: Option<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub topic: Option<String>,
|
pub topic: Option<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub visibility: Option<String>,
|
pub visibility: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,6 +30,7 @@ pub mod create_room {
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct CreationContent {
|
pub struct CreationContent {
|
||||||
#[serde(rename="m.federate")]
|
#[serde(rename="m.federate")]
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub federate: Option<bool>,
|
pub federate: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ pub mod login {
|
|||||||
pub struct Response {
|
pub struct Response {
|
||||||
pub access_token: String,
|
pub access_token: String,
|
||||||
pub home_server: String,
|
pub home_server: String,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub refresh_token: Option<String>,
|
pub refresh_token: Option<String>,
|
||||||
pub user_id: String,
|
pub user_id: String,
|
||||||
}
|
}
|
||||||
@ -80,6 +81,7 @@ pub mod refresh_access_token {
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct Response {
|
pub struct Response {
|
||||||
pub access_token: String,
|
pub access_token: String,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub refresh_token: Option<String>,
|
pub refresh_token: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,10 +21,15 @@ pub mod sync {
|
|||||||
/// This API endpoint's query parameters.
|
/// This API endpoint's query parameters.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct QueryParams {
|
pub struct QueryParams {
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub filter: Option<String>,
|
pub filter: Option<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub since: Option<String>,
|
pub since: Option<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub full_state: Option<bool>,
|
pub full_state: Option<bool>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub set_presence: Option<SetPresence>,
|
pub set_presence: Option<SetPresence>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub timeout: Option<u64>
|
pub timeout: Option<u64>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ pub mod set_typing {
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct BodyParams {
|
pub struct BodyParams {
|
||||||
pub typing: bool,
|
pub typing: bool,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub timeout: Option<u64>
|
pub timeout: Option<u64>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user