use super::webhook::{
RESTDeleteAPIWebhookWithTokenMessageResult, RESTGetAPIWebhookWithTokenMessageResult,
RESTPatchAPIWebhookWithTokenMessageFormDataBody, RESTPatchAPIWebhookWithTokenMessageJSONBody,
RESTPatchAPIWebhookWithTokenMessageResult, RESTPostAPIWebhookWithTokenWaitResult,
};
use crate::models::payloads::{
APIApplicationCommand, APIApplicationCommandPermission, APIGuildApplicationCommandPermissions,
APIInteractionResponse, APIInteractionResponseCallbackData, APIMessage, ApplicationCommandType,
InteractionResponseType, InteractionType,
};
use serde::{Deserialize, Serialize};
use serde_json::Value;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub struct RESTGetAPIApplicationCommandsQuery {
#[serde(skip_serializing_if = "Option::is_none")]
pub with_localizations: Option<bool>,
}
pub type RESTGetAPIApplicationCommandsResult = Vec<APIApplicationCommand>;
pub type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub struct RESTPostAPIBaseApplicationCommandsJSONBody {
#[serde(skip_serializing_if = "Option::is_none")]
pub contexts: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub default_member_permissions: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub integration_types: Option<Value>,
#[serde(flatten)]
pub other: Value,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTPostAPIChatInputApplicationCommandsJSONBody {
#[serde(flatten)]
pub base: RESTPostAPIBaseApplicationCommandsJSONBody,
pub description: String,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<ApplicationCommandType>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTPostAPIContextMenuApplicationCommandsJSONBody {
#[serde(flatten)]
pub base: RESTPostAPIBaseApplicationCommandsJSONBody,
#[serde(rename = "type")]
pub r#type: ApplicationCommandType,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTPostAPIPrimaryEntryPointApplicationCommandJSONBody {
#[serde(flatten)]
pub base: RESTPostAPIBaseApplicationCommandsJSONBody,
#[serde(rename = "type")]
pub r#type: ApplicationCommandType,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(untagged)]
pub enum RESTPostAPIApplicationCommandsJSONBody {
ChatInput(RESTPostAPIChatInputApplicationCommandsJSONBody),
ContextMenu(RESTPostAPIContextMenuApplicationCommandsJSONBody),
PrimaryEntryPoint(RESTPostAPIPrimaryEntryPointApplicationCommandJSONBody),
}
pub type RESTPostAPIApplicationCommandsResult = APIApplicationCommand;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub struct RESTPatchAPIApplicationCommandJSONBody {
#[serde(flatten)]
pub data: Value,
}
pub type RESTPatchAPIApplicationCommandResult = APIApplicationCommand;
pub type RESTPutAPIApplicationCommandsJSONBody = Vec<RESTPostAPIApplicationCommandsJSONBody>;
pub type RESTPutAPIApplicationCommandsResult = Vec<APIApplicationCommand>;
pub type RESTGetAPIApplicationGuildCommandsQuery = RESTGetAPIApplicationCommandsQuery;
pub type RESTGetAPIApplicationGuildCommandsResult = Vec<APIApplicationCommand>;
pub type RESTGetAPIApplicationGuildCommandResult = APIApplicationCommand;
pub type RESTPostAPIApplicationGuildCommandsJSONBody = Value;
pub type RESTPostAPIApplicationGuildCommandsResult = APIApplicationCommand;
pub type RESTPatchAPIApplicationGuildCommandJSONBody = Value;
pub type RESTPatchAPIApplicationGuildCommandResult = APIApplicationCommand;
pub type RESTPutAPIApplicationGuildCommandsJSONBody = Vec<Value>;
pub type RESTPutAPIApplicationGuildCommandsResult = Vec<APIApplicationCommand>;
pub type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub struct RESTPostAPIInteractionCallbackQuery {
#[serde(skip_serializing_if = "Option::is_none")]
pub with_response: Option<bool>,
}
pub type RESTPostAPIInteractionCallbackFormDataBody = Value;
pub type RESTPostAPIInteractionCallbackResult = ();
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTPostAPIInteractionCallbackWithResponseResult {
pub interaction: RESTAPIInteractionCallbackObject,
#[serde(skip_serializing_if = "Option::is_none")]
pub resource: Option<RESTAPIInteractionCallbackResourceObject>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTAPIInteractionCallbackObject {
pub id: String,
pub r#type: InteractionType,
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_instance_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub response_message_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub response_message_loading: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub response_message_ephemeral: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTAPIInteractionCallbackResourceObject {
pub r#type: InteractionResponseType,
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_instance: Option<RESTAPIInteractionCallbackActivityInstanceResource>,
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<APIMessage>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTAPIInteractionCallbackActivityInstanceResource {
pub id: String,
}
pub type RESTGetAPIInteractionOriginalResponseResult = RESTGetAPIWebhookWithTokenMessageResult;
pub type RESTPatchAPIInteractionOriginalResponseJSONBody =
RESTPatchAPIWebhookWithTokenMessageJSONBody;
pub type RESTPatchAPIInteractionOriginalResponseFormDataBody =
RESTPatchAPIWebhookWithTokenMessageFormDataBody;
pub type RESTPatchAPIInteractionOriginalResponseResult = RESTPatchAPIWebhookWithTokenMessageResult;
pub type RESTDeleteAPIInteractionOriginalResponseResult =
RESTDeleteAPIWebhookWithTokenMessageResult;
pub type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallbackData;
pub type RESTPostAPIInteractionFollowupFormDataBody = Value;
pub type RESTPostAPIInteractionFollowupResult = RESTPostAPIWebhookWithTokenWaitResult;
pub type RESTGetAPIInteractionFollowupResult = RESTGetAPIWebhookWithTokenMessageResult;
pub type RESTPatchAPIInteractionFollowupJSONBody = RESTPatchAPIWebhookWithTokenMessageJSONBody;
pub type RESTPatchAPIInteractionFollowupFormDataBody =
RESTPatchAPIWebhookWithTokenMessageFormDataBody;
pub type RESTPatchAPIInteractionFollowupResult = RESTPatchAPIWebhookWithTokenMessageResult;
pub type RESTDeleteAPIInteractionFollowupResult = RESTDeleteAPIWebhookWithTokenMessageResult;
pub type RESTGetAPIGuildApplicationCommandsPermissionsResult =
Vec<APIGuildApplicationCommandPermissions>;
pub type RESTGetAPIApplicationCommandPermissionsResult = APIGuildApplicationCommandPermissions;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTPutAPIApplicationCommandPermissionsJSONBody {
pub permissions: Vec<APIApplicationCommandPermission>,
}
pub type RESTPutAPIApplicationCommandPermissionsResult = APIGuildApplicationCommandPermissions;
pub type RESTPutAPIGuildApplicationCommandsPermissionsJSONBody =
Vec<APIGuildApplicationCommandPermissions>;
pub type RESTPutAPIGuildApplicationCommandsPermissionsResult =
Vec<APIGuildApplicationCommandPermissions>;