| |
|
|
| use crate::JsonSchema; |
| use crate::TS; |
| use serde::Deserialize; |
| use serde::Serialize; |
| use serde_json::Value as JsonValue; |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ThreadAttachment { |
| pub id: String, |
| pub attachment_type: String, |
| pub identity_key: String, |
| pub payload: JsonValue, |
| #[ts(type = "number")] |
| pub created_at: i64, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ThreadAttachmentAddParams { |
| pub thread_id: String, |
| pub attachment_type: String, |
| pub identity_key: String, |
| pub payload: JsonValue, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(rename_all = "camelCase", export_to = "v2/")] |
| pub enum ThreadAttachmentAddOutcome { |
| Created, |
| Existing, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ThreadAttachmentAddResponse { |
| pub outcome: ThreadAttachmentAddOutcome, |
| pub attachment: ThreadAttachment, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ThreadAttachmentListParams { |
| pub thread_id: String, |
| #[ts(optional = nullable)] |
| pub cursor: Option<String>, |
| #[ts(optional = nullable)] |
| pub limit: Option<u32>, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ThreadAttachmentListResponse { |
| pub data: Vec<ThreadAttachment>, |
| pub next_cursor: Option<String>, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ThreadAttachmentRemoveParams { |
| pub thread_id: String, |
| pub attachment_type: String, |
| pub identity_key: String, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ThreadAttachmentRemoveResponse {} |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(rename_all = "camelCase", export_to = "v2/")] |
| pub enum ThreadAttachmentOperation { |
| Created, |
| Deleted, |
| } |
|
|
| |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ThreadAttachmentUpdatedNotification { |
| pub thread_id: String, |
| pub attachment_type: String, |
| pub identity_key: String, |
| pub attachment_id: String, |
| pub operation: ThreadAttachmentOperation, |
| } |
|
|