diff --git a/atrium-api/README.md b/atrium-api/README.md index 8a079459..378c24fb 100644 --- a/atrium-api/README.md +++ b/atrium-api/README.md @@ -14,7 +14,6 @@ Any HTTP client that implements [`atrium_xrpc::HttpClient`](https://docs.rs/atri ```rust,no_run use atrium_api::client::AtpServiceClient; -use atrium_api::com::atproto::server::create_session::Input; use atrium_xrpc_client::reqwest::ReqwestClient; #[tokio::main] @@ -25,11 +24,14 @@ async fn main() -> Result<(), Box> { .com .atproto .server - .create_session(Input { - auth_factor_token: None, - identifier: "alice@mail.com".into(), - password: "hunter2".into(), - }) + .create_session( + atrium_api::com::atproto::server::create_session::InputData { + auth_factor_token: None, + identifier: "alice@mail.com".into(), + password: "hunter2".into(), + } + .into(), + ) .await; println!("{:?}", result); Ok(()) diff --git a/atrium-api/src/agent.rs b/atrium-api/src/agent.rs index 3d003986..97de8ae3 100644 --- a/atrium-api/src/agent.rs +++ b/atrium-api/src/agent.rs @@ -67,11 +67,14 @@ where .com .atproto .server - .create_session(crate::com::atproto::server::create_session::Input { - auth_factor_token: None, - identifier: identifier.as_ref().into(), - password: password.as_ref().into(), - }) + .create_session( + crate::com::atproto::server::create_session::InputData { + auth_factor_token: None, + identifier: identifier.as_ref().into(), + password: password.as_ref().into(), + } + .into(), + ) .await?; self.store.set_session(result.clone()).await; if let Some(did_doc) = &result.did_doc { @@ -88,15 +91,15 @@ where let result = self.api.com.atproto.server.get_session().await; match result { Ok(output) => { - assert_eq!(output.did, session.did); + assert_eq!(output.data.did, session.data.did); if let Some(mut session) = self.store.get_session().await { - session.did_doc = output.did_doc.clone(); - session.email = output.email; - session.email_confirmed = output.email_confirmed; - session.handle = output.handle; + session.did_doc = output.data.did_doc.clone(); + session.email = output.data.email; + session.email_confirmed = output.data.email_confirmed; + session.handle = output.data.handle; self.store.set_session(session).await; } - if let Some(did_doc) = &output.did_doc { + if let Some(did_doc) = &output.data.did_doc { self.store.update_endpoint(did_doc); } Ok(()) @@ -151,6 +154,7 @@ where mod tests { use super::*; use crate::agent::store::MemorySessionStore; + use crate::com::atproto::server::create_session::OutputData; use crate::did_doc::{DidDocument, Service, VerificationMethod}; use async_trait::async_trait; use atrium_xrpc::HttpClient; @@ -162,8 +166,8 @@ mod tests { #[derive(Default)] struct MockResponses { - create_session: Option, - get_session: Option, + create_session: Option, + get_session: Option, } #[derive(Default)] @@ -218,7 +222,7 @@ mod tests { crate::com::atproto::server::refresh_session::NSID => { if token == Some("refresh") { body.extend(serde_json::to_vec( - &crate::com::atproto::server::refresh_session::Output { + &crate::com::atproto::server::refresh_session::OutputData { access_jwt: String::from("access"), active: None, did: "did:web:example.com".parse().expect("valid"), @@ -232,7 +236,7 @@ mod tests { } crate::com::atproto::server::describe_server::NSID => { body.extend(serde_json::to_vec( - &crate::com::atproto::server::describe_server::Output { + &crate::com::atproto::server::describe_server::OutputData { available_user_domains: Vec::new(), contact: None, did: "did:web:example.com".parse().expect("valid"), @@ -266,8 +270,8 @@ mod tests { } } - fn session() -> Session { - Session { + fn session_data() -> OutputData { + OutputData { access_jwt: String::from("access"), active: None, did: "did:web:example.com".parse().expect("valid"), @@ -291,13 +295,13 @@ mod tests { #[tokio::test] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] async fn test_login() { - let session = session(); + let session_data = session_data(); // success { let client = MockClient { responses: MockResponses { - create_session: Some(crate::com::atproto::server::create_session::Output { - ..session.clone() + create_session: Some(crate::com::atproto::server::create_session::OutputData { + ..session_data.clone() }), ..Default::default() }, @@ -308,7 +312,7 @@ mod tests { .login("test", "pass") .await .expect("login should be succeeded"); - assert_eq!(agent.get_session().await, Some(session)); + assert_eq!(agent.get_session().await, Some(session_data.into())); } // failure with `createSession` error { @@ -330,25 +334,25 @@ mod tests { #[tokio::test] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] async fn test_xrpc_get_session() { - let session = session(); + let session_data = session_data(); let client = MockClient { responses: MockResponses { - get_session: Some(crate::com::atproto::server::get_session::Output { - active: session.active.clone(), - did: session.did.clone(), - did_doc: session.did_doc.clone(), - email: session.email.clone(), - email_auth_factor: session.email_auth_factor, - email_confirmed: session.email_confirmed, - handle: session.handle.clone(), - status: session.status.clone(), + get_session: Some(crate::com::atproto::server::get_session::OutputData { + active: session_data.active, + did: session_data.did.clone(), + did_doc: session_data.did_doc.clone(), + email: session_data.email.clone(), + email_auth_factor: session_data.email_auth_factor, + email_confirmed: session_data.email_confirmed, + handle: session_data.handle.clone(), + status: session_data.status.clone(), }), ..Default::default() }, ..Default::default() }; let agent = AtpAgent::new(client, MemorySessionStore::default()); - agent.store.set_session(session).await; + agent.store.set_session(session_data.clone().into()).await; let output = agent .api .com @@ -363,26 +367,26 @@ mod tests { #[tokio::test] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] async fn test_xrpc_get_session_with_refresh() { - let mut session = session(); - session.access_jwt = String::from("expired"); + let mut session_data = session_data(); + session_data.access_jwt = String::from("expired"); let client = MockClient { responses: MockResponses { - get_session: Some(crate::com::atproto::server::get_session::Output { - active: session.active.clone(), - did: session.did.clone(), - did_doc: session.did_doc.clone(), - email: session.email.clone(), - email_auth_factor: session.email_auth_factor, - email_confirmed: session.email_confirmed, - handle: session.handle.clone(), - status: session.status.clone(), + get_session: Some(crate::com::atproto::server::get_session::OutputData { + active: session_data.active, + did: session_data.did.clone(), + did_doc: session_data.did_doc.clone(), + email: session_data.email.clone(), + email_auth_factor: session_data.email_auth_factor, + email_confirmed: session_data.email_confirmed, + handle: session_data.handle.clone(), + status: session_data.status.clone(), }), ..Default::default() }, ..Default::default() }; let agent = AtpAgent::new(client, MemorySessionStore::default()); - agent.store.set_session(session).await; + agent.store.set_session(session_data.clone().into()).await; let output = agent .api .com @@ -397,7 +401,7 @@ mod tests { .store .get_session() .await - .map(|session| session.access_jwt), + .map(|session| session.data.access_jwt), Some("access".into()) ); } @@ -405,19 +409,19 @@ mod tests { #[cfg(not(target_arch = "wasm32"))] #[tokio::test] async fn test_xrpc_get_session_with_duplicated_refresh() { - let mut session = session(); - session.access_jwt = String::from("expired"); + let mut session_data = session_data(); + session_data.access_jwt = String::from("expired"); let client = MockClient { responses: MockResponses { - get_session: Some(crate::com::atproto::server::get_session::Output { - active: session.active.clone(), - did: session.did.clone(), - did_doc: session.did_doc.clone(), - email: session.email.clone(), - email_auth_factor: session.email_auth_factor, - email_confirmed: session.email_confirmed, - handle: session.handle.clone(), - status: session.status.clone(), + get_session: Some(crate::com::atproto::server::get_session::OutputData { + active: session_data.active, + did: session_data.did.clone(), + did_doc: session_data.did_doc.clone(), + email: session_data.email.clone(), + email_auth_factor: session_data.email_auth_factor, + email_confirmed: session_data.email_confirmed, + handle: session_data.handle.clone(), + status: session_data.status.clone(), }), ..Default::default() }, @@ -425,7 +429,7 @@ mod tests { }; let counts = Arc::clone(&client.counts); let agent = Arc::new(AtpAgent::new(client, MemorySessionStore::default())); - agent.store.set_session(session).await; + agent.store.set_session(session_data.clone().into()).await; let handles = (0..3).map(|_| { let agent = Arc::clone(&agent); tokio::spawn(async move { agent.api.com.atproto.server.get_session().await }) @@ -444,7 +448,7 @@ mod tests { .store .get_session() .await - .map(|session| session.access_jwt), + .map(|session| session.data.access_jwt), Some("access".into()) ); assert_eq!( @@ -459,20 +463,20 @@ mod tests { #[tokio::test] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] async fn test_resume_session() { - let session = session(); + let session_data = session_data(); // success { let client = MockClient { responses: MockResponses { - get_session: Some(crate::com::atproto::server::get_session::Output { - active: session.active.clone(), - did: session.did.clone(), - did_doc: session.did_doc.clone(), - email: session.email.clone(), - email_auth_factor: session.email_auth_factor, - email_confirmed: session.email_confirmed, - handle: session.handle.clone(), - status: session.status.clone(), + get_session: Some(crate::com::atproto::server::get_session::OutputData { + active: session_data.active, + did: session_data.did.clone(), + did_doc: session_data.did_doc.clone(), + email: session_data.email.clone(), + email_auth_factor: session_data.email_auth_factor, + email_confirmed: session_data.email_confirmed, + handle: session_data.handle.clone(), + status: session_data.status.clone(), }), ..Default::default() }, @@ -481,13 +485,16 @@ mod tests { let agent = AtpAgent::new(client, MemorySessionStore::default()); assert_eq!(agent.get_session().await, None); agent - .resume_session(Session { - email: Some(String::from("test@example.com")), - ..session.clone() - }) + .resume_session( + OutputData { + email: Some(String::from("test@example.com")), + ..session_data.clone() + } + .into(), + ) .await .expect("resume_session should be succeeded"); - assert_eq!(agent.get_session().await, Some(session.clone())); + assert_eq!(agent.get_session().await, Some(session_data.clone().into())); } // failure with `getSession` error { @@ -500,7 +507,7 @@ mod tests { let agent = AtpAgent::new(client, MemorySessionStore::default()); assert_eq!(agent.get_session().await, None); agent - .resume_session(session) + .resume_session(session_data.clone().into()) .await .expect_err("resume_session should be failed"); assert_eq!(agent.get_session().await, None); @@ -510,18 +517,18 @@ mod tests { #[tokio::test] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] async fn test_resume_session_with_refresh() { - let session = session(); + let session_data = session_data(); let client = MockClient { responses: MockResponses { - get_session: Some(crate::com::atproto::server::get_session::Output { - active: session.active.clone(), - did: session.did.clone(), - did_doc: session.did_doc.clone(), - email: session.email.clone(), - email_auth_factor: session.email_auth_factor, - email_confirmed: session.email_confirmed, - handle: session.handle.clone(), - status: session.status.clone(), + get_session: Some(crate::com::atproto::server::get_session::OutputData { + active: session_data.active, + did: session_data.did.clone(), + did_doc: session_data.did_doc.clone(), + email: session_data.email.clone(), + email_auth_factor: session_data.email_auth_factor, + email_confirmed: session_data.email_confirmed, + handle: session_data.handle.clone(), + status: session_data.status.clone(), }), ..Default::default() }, @@ -529,19 +536,22 @@ mod tests { }; let agent = AtpAgent::new(client, MemorySessionStore::default()); agent - .resume_session(Session { - access_jwt: "expired".into(), - ..session.clone() - }) + .resume_session( + OutputData { + access_jwt: "expired".into(), + ..session_data.clone() + } + .into(), + ) .await .expect("resume_session should be succeeded"); - assert_eq!(agent.get_session().await, Some(session)); + assert_eq!(agent.get_session().await, Some(session_data.clone().into())); } #[tokio::test] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] async fn test_login_with_diddoc() { - let session = session(); + let session_data = session_data(); let did_doc = DidDocument { id: "did:plc:ewvi7nxzyoun6zhxrhs64oiz".into(), also_known_as: Some(vec!["at://atproto.com".into()]), @@ -563,9 +573,9 @@ mod tests { { let client = MockClient { responses: MockResponses { - create_session: Some(crate::com::atproto::server::create_session::Output { + create_session: Some(crate::com::atproto::server::create_session::OutputData { did_doc: Some(did_doc.clone()), - ..session.clone() + ..session_data.clone() }), ..Default::default() }, @@ -586,7 +596,7 @@ mod tests { { let client = MockClient { responses: MockResponses { - create_session: Some(crate::com::atproto::server::create_session::Output { + create_session: Some(crate::com::atproto::server::create_session::OutputData { did_doc: Some(DidDocument { service: Some(vec![ Service { @@ -602,7 +612,7 @@ mod tests { ]), ..did_doc.clone() }), - ..session.clone() + ..session_data.clone() }), ..Default::default() }, diff --git a/atrium-api/src/agent/inner.rs b/atrium-api/src/agent/inner.rs index 8b8869f5..e7257f34 100644 --- a/atrium-api/src/agent/inner.rs +++ b/atrium-api/src/agent/inner.rs @@ -86,9 +86,9 @@ where async fn authentication_token(&self, is_refresh: bool) -> Option { self.store.get_session().await.map(|session| { if is_refresh { - session.refresh_jwt + session.data.refresh_jwt } else { - session.access_jwt + session.data.access_jwt } }) } @@ -178,14 +178,14 @@ where async fn refresh_session_inner(&self) { if let Ok(output) = self.call_refresh_session().await { if let Some(mut session) = self.store.get_session().await { - session.access_jwt = output.access_jwt; - session.did = output.did; - session.did_doc = output.did_doc.clone(); - session.handle = output.handle; - session.refresh_jwt = output.refresh_jwt; + session.access_jwt = output.data.access_jwt; + session.did = output.data.did; + session.did_doc = output.data.did_doc.clone(); + session.handle = output.data.handle; + session.refresh_jwt = output.data.refresh_jwt; self.store.set_session(session).await; } - if let Some(did_doc) = &output.did_doc { + if let Some(did_doc) = &output.data.did_doc { self.store.update_endpoint(did_doc); } } else { diff --git a/atrium-api/src/app/bsky/actor/defs.rs b/atrium-api/src/app/bsky/actor/defs.rs index c7052b24..d2d25324 100644 --- a/atrium-api/src/app/bsky/actor/defs.rs +++ b/atrium-api/src/app/bsky/actor/defs.rs @@ -2,21 +2,23 @@ //!Definitions for the `app.bsky.actor.defs` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct AdultContentPref { +pub struct AdultContentPrefData { pub enabled: bool, } +pub type AdultContentPref = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ContentLabelPref { +pub struct ContentLabelPrefData { pub label: String, ///Which labeler does this preference apply to? If undefined, applies globally. #[serde(skip_serializing_if = "Option::is_none")] pub labeler_did: Option, pub visibility: String, } +pub type ContentLabelPref = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct FeedViewPref { +pub struct FeedViewPrefData { ///The URI of the feed, or an identifier which describes the feed. pub feed: String, ///Hide quote posts in the feed. @@ -35,62 +37,71 @@ pub struct FeedViewPref { #[serde(skip_serializing_if = "Option::is_none")] pub hide_reposts: Option, } +pub type FeedViewPref = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct HiddenPostsPref { +pub struct HiddenPostsPrefData { ///A list of URIs of posts the account owner has hidden. pub items: Vec, } +pub type HiddenPostsPref = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct InterestsPref { +pub struct InterestsPrefData { ///A list of tags which describe the account owner's interests gathered during onboarding. pub tags: Vec, } +pub type InterestsPref = crate::types::Object; ///The subject's followers whom you also follow #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct KnownFollowers { +pub struct KnownFollowersData { pub count: i64, pub followers: Vec, } +pub type KnownFollowers = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LabelerPrefItem { +pub struct LabelerPrefItemData { pub did: crate::types::string::Did, } +pub type LabelerPrefItem = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LabelersPref { +pub struct LabelersPrefData { pub labelers: Vec, } +pub type LabelersPref = crate::types::Object; ///A word that the account owner has muted. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct MutedWord { +pub struct MutedWordData { ///The intended targets of the muted word. pub targets: Vec, ///The muted word itself. pub value: String, } +pub type MutedWord = crate::types::Object; pub type MutedWordTarget = String; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct MutedWordsPref { +pub struct MutedWordsPrefData { ///A list of words the account owner has muted. pub items: Vec, } +pub type MutedWordsPref = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct PersonalDetailsPref { +pub struct PersonalDetailsPrefData { ///The birth date of account owner. #[serde(skip_serializing_if = "Option::is_none")] pub birth_date: Option, } +pub type PersonalDetailsPref = crate::types::Object; pub type Preferences = Vec>; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ProfileAssociated { +pub struct ProfileAssociatedData { #[serde(skip_serializing_if = "Option::is_none")] pub chat: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -100,14 +111,16 @@ pub struct ProfileAssociated { #[serde(skip_serializing_if = "Option::is_none")] pub lists: Option, } +pub type ProfileAssociated = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ProfileAssociatedChat { +pub struct ProfileAssociatedChatData { pub allow_incoming: String, } +pub type ProfileAssociatedChat = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ProfileView { +pub struct ProfileViewData { #[serde(skip_serializing_if = "Option::is_none")] pub associated: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -125,9 +138,10 @@ pub struct ProfileView { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type ProfileView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ProfileViewBasic { +pub struct ProfileViewBasicData { #[serde(skip_serializing_if = "Option::is_none")] pub associated: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -141,9 +155,10 @@ pub struct ProfileViewBasic { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type ProfileViewBasic = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ProfileViewDetailed { +pub struct ProfileViewDetailedData { #[serde(skip_serializing_if = "Option::is_none")] pub associated: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -169,30 +184,34 @@ pub struct ProfileViewDetailed { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type ProfileViewDetailed = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct SavedFeed { +pub struct SavedFeedData { pub id: String, pub pinned: bool, pub r#type: String, pub value: String, } +pub type SavedFeed = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct SavedFeedsPref { +pub struct SavedFeedsPrefData { pub pinned: Vec, pub saved: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub timeline_index: Option, } +pub type SavedFeedsPref = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct SavedFeedsPrefV2 { +pub struct SavedFeedsPrefV2Data { pub items: Vec, } +pub type SavedFeedsPrefV2 = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ThreadViewPref { +pub struct ThreadViewPrefData { ///Show followed users at the top of all replies. #[serde(skip_serializing_if = "Option::is_none")] pub prioritize_followed_users: Option, @@ -200,10 +219,11 @@ pub struct ThreadViewPref { #[serde(skip_serializing_if = "Option::is_none")] pub sort: Option, } +pub type ThreadViewPref = crate::types::Object; ///Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ViewerState { +pub struct ViewerStateData { #[serde(skip_serializing_if = "Option::is_none")] pub blocked_by: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -221,6 +241,7 @@ pub struct ViewerState { #[serde(skip_serializing_if = "Option::is_none")] pub muted_by_list: Option, } +pub type ViewerState = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum PreferencesItem { diff --git a/atrium-api/src/app/bsky/actor/get_preferences.rs b/atrium-api/src/app/bsky/actor/get_preferences.rs index 6d00f5fb..ad2d354b 100644 --- a/atrium-api/src/app/bsky/actor/get_preferences.rs +++ b/atrium-api/src/app/bsky/actor/get_preferences.rs @@ -3,12 +3,14 @@ pub const NSID: &str = "app.bsky.actor.getPreferences"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters {} +pub struct ParametersData {} +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub preferences: crate::app::bsky::actor::defs::Preferences, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/actor/get_profile.rs b/atrium-api/src/app/bsky/actor/get_profile.rs index 7f6bb809..bb123f61 100644 --- a/atrium-api/src/app/bsky/actor/get_profile.rs +++ b/atrium-api/src/app/bsky/actor/get_profile.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "app.bsky.actor.getProfile"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///Handle or DID of account to fetch profile of. pub actor: crate::types::string::AtIdentifier, } +pub type Parameters = crate::types::Object; pub type Output = crate::app::bsky::actor::defs::ProfileViewDetailed; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] diff --git a/atrium-api/src/app/bsky/actor/get_profiles.rs b/atrium-api/src/app/bsky/actor/get_profiles.rs index 01db5a12..0ecfcc01 100644 --- a/atrium-api/src/app/bsky/actor/get_profiles.rs +++ b/atrium-api/src/app/bsky/actor/get_profiles.rs @@ -3,14 +3,16 @@ pub const NSID: &str = "app.bsky.actor.getProfiles"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub actors: Vec, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub profiles: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/actor/get_suggestions.rs b/atrium-api/src/app/bsky/actor/get_suggestions.rs index ce6c9997..d17c5065 100644 --- a/atrium-api/src/app/bsky/actor/get_suggestions.rs +++ b/atrium-api/src/app/bsky/actor/get_suggestions.rs @@ -3,19 +3,21 @@ pub const NSID: &str = "app.bsky.actor.getSuggestions"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub actors: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/actor/profile.rs b/atrium-api/src/app/bsky/actor/profile.rs index a72c0622..538fd942 100644 --- a/atrium-api/src/app/bsky/actor/profile.rs +++ b/atrium-api/src/app/bsky/actor/profile.rs @@ -2,7 +2,7 @@ //!Definitions for the `app.bsky.actor.profile` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { ///Small image to be displayed next to posts from account. AKA, 'profile picture' #[serde(skip_serializing_if = "Option::is_none")] pub avatar: Option, @@ -18,6 +18,7 @@ pub struct Record { #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option>, } +pub type Record = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum RecordLabelsRefs { diff --git a/atrium-api/src/app/bsky/actor/put_preferences.rs b/atrium-api/src/app/bsky/actor/put_preferences.rs index 69ca8177..92d2f70b 100644 --- a/atrium-api/src/app/bsky/actor/put_preferences.rs +++ b/atrium-api/src/app/bsky/actor/put_preferences.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "app.bsky.actor.putPreferences"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub preferences: crate::app::bsky::actor::defs::Preferences, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/actor/search_actors.rs b/atrium-api/src/app/bsky/actor/search_actors.rs index eae2643d..93cb69be 100644 --- a/atrium-api/src/app/bsky/actor/search_actors.rs +++ b/atrium-api/src/app/bsky/actor/search_actors.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.actor.searchActors"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -15,13 +15,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub term: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub actors: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/actor/search_actors_typeahead.rs b/atrium-api/src/app/bsky/actor/search_actors_typeahead.rs index 78ada613..37b37d4a 100644 --- a/atrium-api/src/app/bsky/actor/search_actors_typeahead.rs +++ b/atrium-api/src/app/bsky/actor/search_actors_typeahead.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.actor.searchActorsTypeahead"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, ///Search query prefix; not a full query string. @@ -13,11 +13,13 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub term: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub actors: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/embed/external.rs b/atrium-api/src/app/bsky/embed/external.rs index 08699c1e..b59cd018 100644 --- a/atrium-api/src/app/bsky/embed/external.rs +++ b/atrium-api/src/app/bsky/embed/external.rs @@ -3,29 +3,33 @@ ///A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Main { +pub struct MainData { pub external: External, } +pub type Main = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct External { +pub struct ExternalData { pub description: String, #[serde(skip_serializing_if = "Option::is_none")] pub thumb: Option, pub title: String, pub uri: String, } +pub type External = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct View { +pub struct ViewData { pub external: ViewExternal, } +pub type View = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ViewExternal { +pub struct ViewExternalData { pub description: String, #[serde(skip_serializing_if = "Option::is_none")] pub thumb: Option, pub title: String, pub uri: String, } +pub type ViewExternal = crate::types::Object; diff --git a/atrium-api/src/app/bsky/embed/images.rs b/atrium-api/src/app/bsky/embed/images.rs index 0acdba67..52aefc49 100644 --- a/atrium-api/src/app/bsky/embed/images.rs +++ b/atrium-api/src/app/bsky/embed/images.rs @@ -3,33 +3,37 @@ //!A set of images embedded in a Bluesky record (eg, a post). #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Main { +pub struct MainData { pub images: Vec, } +pub type Main = crate::types::Object; ///width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct AspectRatio { +pub struct AspectRatioData { pub height: core::num::NonZeroU64, pub width: core::num::NonZeroU64, } +pub type AspectRatio = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Image { +pub struct ImageData { ///Alt text description of the image, for accessibility. pub alt: String, #[serde(skip_serializing_if = "Option::is_none")] pub aspect_ratio: Option, pub image: crate::types::BlobRef, } +pub type Image = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct View { +pub struct ViewData { pub images: Vec, } +pub type View = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ViewImage { +pub struct ViewImageData { ///Alt text description of the image, for accessibility. pub alt: String, #[serde(skip_serializing_if = "Option::is_none")] @@ -39,3 +43,4 @@ pub struct ViewImage { ///Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. pub thumb: String, } +pub type ViewImage = crate::types::Object; diff --git a/atrium-api/src/app/bsky/embed/record.rs b/atrium-api/src/app/bsky/embed/record.rs index f7d5d87a..73224947 100644 --- a/atrium-api/src/app/bsky/embed/record.rs +++ b/atrium-api/src/app/bsky/embed/record.rs @@ -3,30 +3,34 @@ //!A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Main { +pub struct MainData { pub record: crate::com::atproto::repo::strong_ref::Main, } +pub type Main = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct View { +pub struct ViewData { pub record: crate::types::Union, } +pub type View = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ViewBlocked { +pub struct ViewBlockedData { pub author: crate::app::bsky::feed::defs::BlockedAuthor, pub blocked: bool, pub uri: String, } +pub type ViewBlocked = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ViewNotFound { +pub struct ViewNotFoundData { pub not_found: bool, pub uri: String, } +pub type ViewNotFound = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ViewRecord { +pub struct ViewRecordData { pub author: crate::app::bsky::actor::defs::ProfileViewBasic, pub cid: crate::types::string::Cid, #[serde(skip_serializing_if = "Option::is_none")] @@ -44,6 +48,7 @@ pub struct ViewRecord { ///The record data itself. pub value: crate::records::Record, } +pub type ViewRecord = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum ViewRecordEmbedsItem { diff --git a/atrium-api/src/app/bsky/embed/record_with_media.rs b/atrium-api/src/app/bsky/embed/record_with_media.rs index b233e887..8f363b68 100644 --- a/atrium-api/src/app/bsky/embed/record_with_media.rs +++ b/atrium-api/src/app/bsky/embed/record_with_media.rs @@ -3,16 +3,18 @@ //!A representation of a record embedded in a Bluesky record (eg, a post), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Main { +pub struct MainData { pub media: crate::types::Union, pub record: crate::app::bsky::embed::record::Main, } +pub type Main = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct View { +pub struct ViewData { pub media: crate::types::Union, pub record: crate::app::bsky::embed::record::View, } +pub type View = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum MainMediaRefs { diff --git a/atrium-api/src/app/bsky/feed/defs.rs b/atrium-api/src/app/bsky/feed/defs.rs index 825f2fba..d737e709 100644 --- a/atrium-api/src/app/bsky/feed/defs.rs +++ b/atrium-api/src/app/bsky/feed/defs.rs @@ -2,18 +2,20 @@ //!Definitions for the `app.bsky.feed.defs` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct BlockedAuthor { +pub struct BlockedAuthorData { pub did: crate::types::string::Did, #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type BlockedAuthor = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct BlockedPost { +pub struct BlockedPostData { pub author: BlockedAuthor, pub blocked: bool, pub uri: String, } +pub type BlockedPost = crate::types::Object; ///User clicked through to the author of the feed item pub const CLICKTHROUGH_AUTHOR: &str = "app.bsky.feed.defs#clickthroughAuthor"; ///User clicked through to the embedded content of the feed item @@ -24,7 +26,7 @@ pub const CLICKTHROUGH_ITEM: &str = "app.bsky.feed.defs#clickthroughItem"; pub const CLICKTHROUGH_REPOSTER: &str = "app.bsky.feed.defs#clickthroughReposter"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct FeedViewPost { +pub struct FeedViewPostData { ///Context provided by feed generator that may be passed back alongside interactions. #[serde(skip_serializing_if = "Option::is_none")] pub feed_context: Option, @@ -34,9 +36,10 @@ pub struct FeedViewPost { #[serde(skip_serializing_if = "Option::is_none")] pub reply: Option, } +pub type FeedViewPost = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct GeneratorView { +pub struct GeneratorViewData { #[serde(skip_serializing_if = "Option::is_none")] pub accepts_interactions: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -58,15 +61,17 @@ pub struct GeneratorView { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type GeneratorView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct GeneratorViewerState { +pub struct GeneratorViewerStateData { #[serde(skip_serializing_if = "Option::is_none")] pub like: Option, } +pub type GeneratorViewerState = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Interaction { +pub struct InteractionData { #[serde(skip_serializing_if = "Option::is_none")] pub event: Option, ///Context on a feed item that was orginally supplied by the feed generator on getFeedSkeleton. @@ -75,6 +80,7 @@ pub struct Interaction { #[serde(skip_serializing_if = "Option::is_none")] pub item: Option, } +pub type Interaction = crate::types::Object; ///User liked the feed item pub const INTERACTION_LIKE: &str = "app.bsky.feed.defs#interactionLike"; ///User quoted the feed item @@ -89,13 +95,14 @@ pub const INTERACTION_SEEN: &str = "app.bsky.feed.defs#interactionSeen"; pub const INTERACTION_SHARE: &str = "app.bsky.feed.defs#interactionShare"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct NotFoundPost { +pub struct NotFoundPostData { pub not_found: bool, pub uri: String, } +pub type NotFoundPost = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct PostView { +pub struct PostViewData { pub author: crate::app::bsky::actor::defs::ProfileViewBasic, pub cid: crate::types::string::Cid, #[serde(skip_serializing_if = "Option::is_none")] @@ -116,28 +123,31 @@ pub struct PostView { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type PostView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ReasonRepost { +pub struct ReasonRepostData { pub by: crate::app::bsky::actor::defs::ProfileViewBasic, pub indexed_at: crate::types::string::Datetime, } +pub type ReasonRepost = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ReplyRef { +pub struct ReplyRefData { ///When parent is a reply to another post, this is the author of that post. #[serde(skip_serializing_if = "Option::is_none")] pub grandparent_author: Option, pub parent: crate::types::Union, pub root: crate::types::Union, } +pub type ReplyRef = crate::types::Object; ///Request that less content like the given feed item be shown in the feed pub const REQUEST_LESS: &str = "app.bsky.feed.defs#requestLess"; ///Request that more content like the given feed item be shown in the feed pub const REQUEST_MORE: &str = "app.bsky.feed.defs#requestMore"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct SkeletonFeedPost { +pub struct SkeletonFeedPostData { ///Context that will be passed through to client and may be passed to feed generator back alongside interactions. #[serde(skip_serializing_if = "Option::is_none")] pub feed_context: Option, @@ -145,23 +155,26 @@ pub struct SkeletonFeedPost { #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option>, } +pub type SkeletonFeedPost = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct SkeletonReasonRepost { +pub struct SkeletonReasonRepostData { pub repost: String, } +pub type SkeletonReasonRepost = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ThreadViewPost { +pub struct ThreadViewPostData { #[serde(skip_serializing_if = "Option::is_none")] pub parent: Option>, pub post: PostView, #[serde(skip_serializing_if = "Option::is_none")] pub replies: Option>>, } +pub type ThreadViewPost = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ThreadgateView { +pub struct ThreadgateViewData { #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -171,10 +184,11 @@ pub struct ThreadgateView { #[serde(skip_serializing_if = "Option::is_none")] pub uri: Option, } +pub type ThreadgateView = crate::types::Object; ///Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ViewerState { +pub struct ViewerStateData { #[serde(skip_serializing_if = "Option::is_none")] pub like: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -184,6 +198,7 @@ pub struct ViewerState { #[serde(skip_serializing_if = "Option::is_none")] pub thread_muted: Option, } +pub type ViewerState = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum FeedViewPostReasonRefs { diff --git a/atrium-api/src/app/bsky/feed/describe_feed_generator.rs b/atrium-api/src/app/bsky/feed/describe_feed_generator.rs index 541f2733..f3b33c8b 100644 --- a/atrium-api/src/app/bsky/feed/describe_feed_generator.rs +++ b/atrium-api/src/app/bsky/feed/describe_feed_generator.rs @@ -3,12 +3,13 @@ pub const NSID: &str = "app.bsky.feed.describeFeedGenerator"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub did: crate::types::string::Did, pub feeds: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub links: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -19,14 +20,16 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Feed { +pub struct FeedData { pub uri: String, } +pub type Feed = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Links { +pub struct LinksData { #[serde(skip_serializing_if = "Option::is_none")] pub privacy_policy: Option, #[serde(skip_serializing_if = "Option::is_none")] pub terms_of_service: Option, } +pub type Links = crate::types::Object; diff --git a/atrium-api/src/app/bsky/feed/generator.rs b/atrium-api/src/app/bsky/feed/generator.rs index d6c6b137..7afc571d 100644 --- a/atrium-api/src/app/bsky/feed/generator.rs +++ b/atrium-api/src/app/bsky/feed/generator.rs @@ -2,7 +2,7 @@ //!Definitions for the `app.bsky.feed.generator` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { ///Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions #[serde(skip_serializing_if = "Option::is_none")] pub accepts_interactions: Option, @@ -19,6 +19,7 @@ pub struct Record { #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option>, } +pub type Record = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum RecordLabelsRefs { diff --git a/atrium-api/src/app/bsky/feed/get_actor_feeds.rs b/atrium-api/src/app/bsky/feed/get_actor_feeds.rs index 5a76d486..8c710576 100644 --- a/atrium-api/src/app/bsky/feed/get_actor_feeds.rs +++ b/atrium-api/src/app/bsky/feed/get_actor_feeds.rs @@ -3,20 +3,22 @@ pub const NSID: &str = "app.bsky.feed.getActorFeeds"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub actor: crate::types::string::AtIdentifier, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub feeds: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/feed/get_actor_likes.rs b/atrium-api/src/app/bsky/feed/get_actor_likes.rs index 2d8762fa..0d88ec77 100644 --- a/atrium-api/src/app/bsky/feed/get_actor_likes.rs +++ b/atrium-api/src/app/bsky/feed/get_actor_likes.rs @@ -3,20 +3,22 @@ pub const NSID: &str = "app.bsky.feed.getActorLikes"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub actor: crate::types::string::AtIdentifier, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub feed: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/app/bsky/feed/get_author_feed.rs b/atrium-api/src/app/bsky/feed/get_author_feed.rs index 2c478850..e6bc4b1a 100644 --- a/atrium-api/src/app/bsky/feed/get_author_feed.rs +++ b/atrium-api/src/app/bsky/feed/get_author_feed.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.feed.getAuthorFeed"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub actor: crate::types::string::AtIdentifier, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, @@ -13,13 +13,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub feed: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/app/bsky/feed/get_feed.rs b/atrium-api/src/app/bsky/feed/get_feed.rs index 54629da6..7e586de8 100644 --- a/atrium-api/src/app/bsky/feed/get_feed.rs +++ b/atrium-api/src/app/bsky/feed/get_feed.rs @@ -3,20 +3,22 @@ pub const NSID: &str = "app.bsky.feed.getFeed"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub feed: String, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub feed: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/app/bsky/feed/get_feed_generator.rs b/atrium-api/src/app/bsky/feed/get_feed_generator.rs index 5e261e4f..7a111a82 100644 --- a/atrium-api/src/app/bsky/feed/get_feed_generator.rs +++ b/atrium-api/src/app/bsky/feed/get_feed_generator.rs @@ -3,19 +3,21 @@ pub const NSID: &str = "app.bsky.feed.getFeedGenerator"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///AT-URI of the feed generator record. pub feed: String, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { ///Indicates whether the feed generator service has been online recently, or else seems to be inactive. pub is_online: bool, ///Indicates whether the feed generator service is compatible with the record declaration. pub is_valid: bool, pub view: crate::app::bsky::feed::defs::GeneratorView, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/feed/get_feed_generators.rs b/atrium-api/src/app/bsky/feed/get_feed_generators.rs index da491b8b..977b93ea 100644 --- a/atrium-api/src/app/bsky/feed/get_feed_generators.rs +++ b/atrium-api/src/app/bsky/feed/get_feed_generators.rs @@ -3,14 +3,16 @@ pub const NSID: &str = "app.bsky.feed.getFeedGenerators"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub feeds: Vec, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub feeds: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/feed/get_feed_skeleton.rs b/atrium-api/src/app/bsky/feed/get_feed_skeleton.rs index 825c909e..eef28c2f 100644 --- a/atrium-api/src/app/bsky/feed/get_feed_skeleton.rs +++ b/atrium-api/src/app/bsky/feed/get_feed_skeleton.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.feed.getFeedSkeleton"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, ///Reference to feed generator record describing the specific feed being requested. @@ -11,13 +11,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub feed: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/app/bsky/feed/get_likes.rs b/atrium-api/src/app/bsky/feed/get_likes.rs index 9056977d..b6d0998d 100644 --- a/atrium-api/src/app/bsky/feed/get_likes.rs +++ b/atrium-api/src/app/bsky/feed/get_likes.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.feed.getLikes"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///CID of the subject record (aka, specific version of record), to filter likes. #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, @@ -14,9 +14,10 @@ pub struct Parameters { ///AT-URI of the subject (eg, a post record). pub uri: String, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -24,6 +25,7 @@ pub struct Output { pub likes: Vec, pub uri: String, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -34,8 +36,9 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Like { +pub struct LikeData { pub actor: crate::app::bsky::actor::defs::ProfileView, pub created_at: crate::types::string::Datetime, pub indexed_at: crate::types::string::Datetime, } +pub type Like = crate::types::Object; diff --git a/atrium-api/src/app/bsky/feed/get_list_feed.rs b/atrium-api/src/app/bsky/feed/get_list_feed.rs index 5be27703..8fa01276 100644 --- a/atrium-api/src/app/bsky/feed/get_list_feed.rs +++ b/atrium-api/src/app/bsky/feed/get_list_feed.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.feed.getListFeed"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -11,13 +11,15 @@ pub struct Parameters { ///Reference (AT-URI) to the list record. pub list: String, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub feed: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/app/bsky/feed/get_post_thread.rs b/atrium-api/src/app/bsky/feed/get_post_thread.rs index 03259c52..5cd466f0 100644 --- a/atrium-api/src/app/bsky/feed/get_post_thread.rs +++ b/atrium-api/src/app/bsky/feed/get_post_thread.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.feed.getPostThread"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///How many levels of reply depth should be included in response. #[serde(skip_serializing_if = "Option::is_none")] pub depth: Option>, @@ -13,11 +13,13 @@ pub struct Parameters { ///Reference (AT-URI) to post record. pub uri: String, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub thread: crate::types::Union, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/app/bsky/feed/get_posts.rs b/atrium-api/src/app/bsky/feed/get_posts.rs index d0d68205..5b3f3561 100644 --- a/atrium-api/src/app/bsky/feed/get_posts.rs +++ b/atrium-api/src/app/bsky/feed/get_posts.rs @@ -3,15 +3,17 @@ pub const NSID: &str = "app.bsky.feed.getPosts"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///List of post AT-URIs to return hydrated views for. pub uris: Vec, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub posts: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/feed/get_reposted_by.rs b/atrium-api/src/app/bsky/feed/get_reposted_by.rs index f61a90d0..8fbb6f56 100644 --- a/atrium-api/src/app/bsky/feed/get_reposted_by.rs +++ b/atrium-api/src/app/bsky/feed/get_reposted_by.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.feed.getRepostedBy"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///If supplied, filters to reposts of specific version (by CID) of the post record. #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, @@ -14,9 +14,10 @@ pub struct Parameters { ///Reference (AT-URI) of post record pub uri: String, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -24,6 +25,7 @@ pub struct Output { pub reposted_by: Vec, pub uri: String, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/feed/get_suggested_feeds.rs b/atrium-api/src/app/bsky/feed/get_suggested_feeds.rs index a31b166c..5d304842 100644 --- a/atrium-api/src/app/bsky/feed/get_suggested_feeds.rs +++ b/atrium-api/src/app/bsky/feed/get_suggested_feeds.rs @@ -3,19 +3,21 @@ pub const NSID: &str = "app.bsky.feed.getSuggestedFeeds"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub feeds: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/feed/get_timeline.rs b/atrium-api/src/app/bsky/feed/get_timeline.rs index 44c812ea..60f4947b 100644 --- a/atrium-api/src/app/bsky/feed/get_timeline.rs +++ b/atrium-api/src/app/bsky/feed/get_timeline.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.feed.getTimeline"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism. #[serde(skip_serializing_if = "Option::is_none")] pub algorithm: Option, @@ -12,13 +12,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub feed: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/feed/like.rs b/atrium-api/src/app/bsky/feed/like.rs index 54597025..20603865 100644 --- a/atrium-api/src/app/bsky/feed/like.rs +++ b/atrium-api/src/app/bsky/feed/like.rs @@ -2,7 +2,8 @@ //!Definitions for the `app.bsky.feed.like` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { pub created_at: crate::types::string::Datetime, pub subject: crate::com::atproto::repo::strong_ref::Main, } +pub type Record = crate::types::Object; diff --git a/atrium-api/src/app/bsky/feed/post.rs b/atrium-api/src/app/bsky/feed/post.rs index f60e8a5d..602ecb1f 100644 --- a/atrium-api/src/app/bsky/feed/post.rs +++ b/atrium-api/src/app/bsky/feed/post.rs @@ -2,7 +2,7 @@ //!Definitions for the `app.bsky.feed.post` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { ///Client-declared timestamp when this post was originally created. pub created_at: crate::types::string::Datetime, #[serde(skip_serializing_if = "Option::is_none")] @@ -27,28 +27,32 @@ pub struct Record { ///The primary post content. May be an empty string, if there are embeds. pub text: String, } +pub type Record = crate::types::Object; ///Deprecated: use facets instead. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Entity { +pub struct EntityData { pub index: TextSlice, ///Expected values are 'mention' and 'link'. pub r#type: String, pub value: String, } +pub type Entity = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ReplyRef { +pub struct ReplyRefData { pub parent: crate::com::atproto::repo::strong_ref::Main, pub root: crate::com::atproto::repo::strong_ref::Main, } +pub type ReplyRef = crate::types::Object; ///Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct TextSlice { +pub struct TextSliceData { pub end: usize, pub start: usize, } +pub type TextSlice = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum RecordEmbedRefs { diff --git a/atrium-api/src/app/bsky/feed/repost.rs b/atrium-api/src/app/bsky/feed/repost.rs index d85bfaa4..0c865df1 100644 --- a/atrium-api/src/app/bsky/feed/repost.rs +++ b/atrium-api/src/app/bsky/feed/repost.rs @@ -2,7 +2,8 @@ //!Definitions for the `app.bsky.feed.repost` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { pub created_at: crate::types::string::Datetime, pub subject: crate::com::atproto::repo::strong_ref::Main, } +pub type Record = crate::types::Object; diff --git a/atrium-api/src/app/bsky/feed/search_posts.rs b/atrium-api/src/app/bsky/feed/search_posts.rs index 5aa0801d..33cf427b 100644 --- a/atrium-api/src/app/bsky/feed/search_posts.rs +++ b/atrium-api/src/app/bsky/feed/search_posts.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.feed.searchPosts"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///Filter to posts by the given account. Handles are resolved to DID before query-time. #[serde(skip_serializing_if = "Option::is_none")] pub author: Option, @@ -39,9 +39,10 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub url: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, ///Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. @@ -49,6 +50,7 @@ pub struct Output { pub hits_total: Option, pub posts: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/app/bsky/feed/send_interactions.rs b/atrium-api/src/app/bsky/feed/send_interactions.rs index 14f4b980..a8e48ae4 100644 --- a/atrium-api/src/app/bsky/feed/send_interactions.rs +++ b/atrium-api/src/app/bsky/feed/send_interactions.rs @@ -3,12 +3,14 @@ pub const NSID: &str = "app.bsky.feed.sendInteractions"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub interactions: Vec, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output {} +pub struct OutputData {} +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/feed/threadgate.rs b/atrium-api/src/app/bsky/feed/threadgate.rs index 756301ac..c5f9f554 100644 --- a/atrium-api/src/app/bsky/feed/threadgate.rs +++ b/atrium-api/src/app/bsky/feed/threadgate.rs @@ -2,27 +2,31 @@ //!Definitions for the `app.bsky.feed.threadgate` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { #[serde(skip_serializing_if = "Option::is_none")] pub allow: Option>>, pub created_at: crate::types::string::Datetime, ///Reference (AT-URI) to the post record. pub post: String, } +pub type Record = crate::types::Object; ///Allow replies from actors you follow. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct FollowingRule {} +pub struct FollowingRuleData {} +pub type FollowingRule = crate::types::Object; ///Allow replies from actors on a list. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ListRule { +pub struct ListRuleData { pub list: String, } +pub type ListRule = crate::types::Object; ///Allow replies from actors mentioned in your post. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct MentionRule {} +pub struct MentionRuleData {} +pub type MentionRule = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum RecordAllowItem { diff --git a/atrium-api/src/app/bsky/graph/block.rs b/atrium-api/src/app/bsky/graph/block.rs index 512c34c4..b22aca99 100644 --- a/atrium-api/src/app/bsky/graph/block.rs +++ b/atrium-api/src/app/bsky/graph/block.rs @@ -2,8 +2,9 @@ //!Definitions for the `app.bsky.graph.block` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { pub created_at: crate::types::string::Datetime, ///DID of the account to be blocked. pub subject: crate::types::string::Did, } +pub type Record = crate::types::Object; diff --git a/atrium-api/src/app/bsky/graph/defs.rs b/atrium-api/src/app/bsky/graph/defs.rs index 47e1ecfb..a5ef5003 100644 --- a/atrium-api/src/app/bsky/graph/defs.rs +++ b/atrium-api/src/app/bsky/graph/defs.rs @@ -4,14 +4,15 @@ pub const CURATELIST: &str = "app.bsky.graph.defs#curatelist"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ListItemView { +pub struct ListItemViewData { pub subject: crate::app::bsky::actor::defs::ProfileView, pub uri: String, } +pub type ListItemView = crate::types::Object; pub type ListPurpose = String; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ListView { +pub struct ListViewData { #[serde(skip_serializing_if = "Option::is_none")] pub avatar: Option, pub cid: crate::types::string::Cid, @@ -29,9 +30,10 @@ pub struct ListView { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type ListView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ListViewBasic { +pub struct ListViewBasicData { #[serde(skip_serializing_if = "Option::is_none")] pub avatar: Option, pub cid: crate::types::string::Cid, @@ -45,27 +47,30 @@ pub struct ListViewBasic { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type ListViewBasic = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ListViewerState { +pub struct ListViewerStateData { #[serde(skip_serializing_if = "Option::is_none")] pub blocked: Option, #[serde(skip_serializing_if = "Option::is_none")] pub muted: Option, } +pub type ListViewerState = crate::types::Object; ///A list of actors to apply an aggregate moderation action (mute/block) on. pub const MODLIST: &str = "app.bsky.graph.defs#modlist"; ///indicates that a handle or DID could not be resolved #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct NotFoundActor { +pub struct NotFoundActorData { pub actor: crate::types::string::AtIdentifier, pub not_found: bool, } +pub type NotFoundActor = crate::types::Object; ///lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object) #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Relationship { +pub struct RelationshipData { pub did: crate::types::string::Did, ///if the actor is followed by this DID, contains the AT-URI of the follow record #[serde(skip_serializing_if = "Option::is_none")] @@ -74,3 +79,4 @@ pub struct Relationship { #[serde(skip_serializing_if = "Option::is_none")] pub following: Option, } +pub type Relationship = crate::types::Object; diff --git a/atrium-api/src/app/bsky/graph/follow.rs b/atrium-api/src/app/bsky/graph/follow.rs index 6becc533..e025641d 100644 --- a/atrium-api/src/app/bsky/graph/follow.rs +++ b/atrium-api/src/app/bsky/graph/follow.rs @@ -2,7 +2,8 @@ //!Definitions for the `app.bsky.graph.follow` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { pub created_at: crate::types::string::Datetime, pub subject: crate::types::string::Did, } +pub type Record = crate::types::Object; diff --git a/atrium-api/src/app/bsky/graph/get_blocks.rs b/atrium-api/src/app/bsky/graph/get_blocks.rs index 66c59923..6591cb5f 100644 --- a/atrium-api/src/app/bsky/graph/get_blocks.rs +++ b/atrium-api/src/app/bsky/graph/get_blocks.rs @@ -3,19 +3,21 @@ pub const NSID: &str = "app.bsky.graph.getBlocks"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub blocks: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/get_followers.rs b/atrium-api/src/app/bsky/graph/get_followers.rs index e78189ee..f0c17f7c 100644 --- a/atrium-api/src/app/bsky/graph/get_followers.rs +++ b/atrium-api/src/app/bsky/graph/get_followers.rs @@ -3,21 +3,23 @@ pub const NSID: &str = "app.bsky.graph.getFollowers"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub actor: crate::types::string::AtIdentifier, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub followers: Vec, pub subject: crate::app::bsky::actor::defs::ProfileView, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/get_follows.rs b/atrium-api/src/app/bsky/graph/get_follows.rs index 02752bcd..ee242423 100644 --- a/atrium-api/src/app/bsky/graph/get_follows.rs +++ b/atrium-api/src/app/bsky/graph/get_follows.rs @@ -3,21 +3,23 @@ pub const NSID: &str = "app.bsky.graph.getFollows"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub actor: crate::types::string::AtIdentifier, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub follows: Vec, pub subject: crate::app::bsky::actor::defs::ProfileView, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/get_known_followers.rs b/atrium-api/src/app/bsky/graph/get_known_followers.rs index c525e109..8e4d69a9 100644 --- a/atrium-api/src/app/bsky/graph/get_known_followers.rs +++ b/atrium-api/src/app/bsky/graph/get_known_followers.rs @@ -3,21 +3,23 @@ pub const NSID: &str = "app.bsky.graph.getKnownFollowers"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub actor: crate::types::string::AtIdentifier, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub followers: Vec, pub subject: crate::app::bsky::actor::defs::ProfileView, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/get_list.rs b/atrium-api/src/app/bsky/graph/get_list.rs index deb87e67..38cd0428 100644 --- a/atrium-api/src/app/bsky/graph/get_list.rs +++ b/atrium-api/src/app/bsky/graph/get_list.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.graph.getList"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -11,14 +11,16 @@ pub struct Parameters { ///Reference (AT-URI) of the list record to hydrate. pub list: String, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub items: Vec, pub list: crate::app::bsky::graph::defs::ListView, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/get_list_blocks.rs b/atrium-api/src/app/bsky/graph/get_list_blocks.rs index 2d343dbf..af6db9cf 100644 --- a/atrium-api/src/app/bsky/graph/get_list_blocks.rs +++ b/atrium-api/src/app/bsky/graph/get_list_blocks.rs @@ -3,19 +3,21 @@ pub const NSID: &str = "app.bsky.graph.getListBlocks"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub lists: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/get_list_mutes.rs b/atrium-api/src/app/bsky/graph/get_list_mutes.rs index 1aed6c3b..b60c7d0d 100644 --- a/atrium-api/src/app/bsky/graph/get_list_mutes.rs +++ b/atrium-api/src/app/bsky/graph/get_list_mutes.rs @@ -3,19 +3,21 @@ pub const NSID: &str = "app.bsky.graph.getListMutes"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub lists: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/get_lists.rs b/atrium-api/src/app/bsky/graph/get_lists.rs index 6a47cfe1..f091d00e 100644 --- a/atrium-api/src/app/bsky/graph/get_lists.rs +++ b/atrium-api/src/app/bsky/graph/get_lists.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.graph.getLists"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The account (actor) to enumerate lists from. pub actor: crate::types::string::AtIdentifier, #[serde(skip_serializing_if = "Option::is_none")] @@ -11,13 +11,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub lists: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/get_mutes.rs b/atrium-api/src/app/bsky/graph/get_mutes.rs index e4aa7a46..5df51933 100644 --- a/atrium-api/src/app/bsky/graph/get_mutes.rs +++ b/atrium-api/src/app/bsky/graph/get_mutes.rs @@ -3,19 +3,21 @@ pub const NSID: &str = "app.bsky.graph.getMutes"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub mutes: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/get_relationships.rs b/atrium-api/src/app/bsky/graph/get_relationships.rs index 607f04d7..d9908215 100644 --- a/atrium-api/src/app/bsky/graph/get_relationships.rs +++ b/atrium-api/src/app/bsky/graph/get_relationships.rs @@ -3,20 +3,22 @@ pub const NSID: &str = "app.bsky.graph.getRelationships"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///Primary account requesting relationships for. pub actor: crate::types::string::AtIdentifier, ///List of 'other' accounts to be related back to the primary. #[serde(skip_serializing_if = "Option::is_none")] pub others: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub actor: Option, pub relationships: Vec>, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/app/bsky/graph/get_suggested_follows_by_actor.rs b/atrium-api/src/app/bsky/graph/get_suggested_follows_by_actor.rs index 60a50713..c59b6cc3 100644 --- a/atrium-api/src/app/bsky/graph/get_suggested_follows_by_actor.rs +++ b/atrium-api/src/app/bsky/graph/get_suggested_follows_by_actor.rs @@ -3,14 +3,16 @@ pub const NSID: &str = "app.bsky.graph.getSuggestedFollowsByActor"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub actor: crate::types::string::AtIdentifier, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub suggestions: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/list.rs b/atrium-api/src/app/bsky/graph/list.rs index e5f1c731..a18d9ce1 100644 --- a/atrium-api/src/app/bsky/graph/list.rs +++ b/atrium-api/src/app/bsky/graph/list.rs @@ -2,7 +2,7 @@ //!Definitions for the `app.bsky.graph.list` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { #[serde(skip_serializing_if = "Option::is_none")] pub avatar: Option, pub created_at: crate::types::string::Datetime, @@ -17,6 +17,7 @@ pub struct Record { ///Defines the purpose of the list (aka, moderation-oriented or curration-oriented) pub purpose: crate::app::bsky::graph::defs::ListPurpose, } +pub type Record = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum RecordLabelsRefs { diff --git a/atrium-api/src/app/bsky/graph/listblock.rs b/atrium-api/src/app/bsky/graph/listblock.rs index 3adf2006..f9fad5ee 100644 --- a/atrium-api/src/app/bsky/graph/listblock.rs +++ b/atrium-api/src/app/bsky/graph/listblock.rs @@ -2,8 +2,9 @@ //!Definitions for the `app.bsky.graph.listblock` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { pub created_at: crate::types::string::Datetime, ///Reference (AT-URI) to the mod list record. pub subject: String, } +pub type Record = crate::types::Object; diff --git a/atrium-api/src/app/bsky/graph/listitem.rs b/atrium-api/src/app/bsky/graph/listitem.rs index c7dda14b..4fa88395 100644 --- a/atrium-api/src/app/bsky/graph/listitem.rs +++ b/atrium-api/src/app/bsky/graph/listitem.rs @@ -2,10 +2,11 @@ //!Definitions for the `app.bsky.graph.listitem` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { pub created_at: crate::types::string::Datetime, ///Reference (AT-URI) to the list record (app.bsky.graph.list). pub list: String, ///The account which is included on the list. pub subject: crate::types::string::Did, } +pub type Record = crate::types::Object; diff --git a/atrium-api/src/app/bsky/graph/mute_actor.rs b/atrium-api/src/app/bsky/graph/mute_actor.rs index 60c9a429..f2b88707 100644 --- a/atrium-api/src/app/bsky/graph/mute_actor.rs +++ b/atrium-api/src/app/bsky/graph/mute_actor.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "app.bsky.graph.muteActor"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub actor: crate::types::string::AtIdentifier, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/mute_actor_list.rs b/atrium-api/src/app/bsky/graph/mute_actor_list.rs index 4b55ebf1..2c89ca43 100644 --- a/atrium-api/src/app/bsky/graph/mute_actor_list.rs +++ b/atrium-api/src/app/bsky/graph/mute_actor_list.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "app.bsky.graph.muteActorList"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub list: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/mute_thread.rs b/atrium-api/src/app/bsky/graph/mute_thread.rs index 2ff7d900..e78d8925 100644 --- a/atrium-api/src/app/bsky/graph/mute_thread.rs +++ b/atrium-api/src/app/bsky/graph/mute_thread.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "app.bsky.graph.muteThread"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub root: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/unmute_actor.rs b/atrium-api/src/app/bsky/graph/unmute_actor.rs index f60b1833..b5d381fd 100644 --- a/atrium-api/src/app/bsky/graph/unmute_actor.rs +++ b/atrium-api/src/app/bsky/graph/unmute_actor.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "app.bsky.graph.unmuteActor"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub actor: crate::types::string::AtIdentifier, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/unmute_actor_list.rs b/atrium-api/src/app/bsky/graph/unmute_actor_list.rs index d2b1bd96..11bef81a 100644 --- a/atrium-api/src/app/bsky/graph/unmute_actor_list.rs +++ b/atrium-api/src/app/bsky/graph/unmute_actor_list.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "app.bsky.graph.unmuteActorList"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub list: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/graph/unmute_thread.rs b/atrium-api/src/app/bsky/graph/unmute_thread.rs index f0212d51..a0f904a4 100644 --- a/atrium-api/src/app/bsky/graph/unmute_thread.rs +++ b/atrium-api/src/app/bsky/graph/unmute_thread.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "app.bsky.graph.unmuteThread"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub root: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/labeler/defs.rs b/atrium-api/src/app/bsky/labeler/defs.rs index 4d9fedb6..ca11f840 100644 --- a/atrium-api/src/app/bsky/labeler/defs.rs +++ b/atrium-api/src/app/bsky/labeler/defs.rs @@ -2,7 +2,7 @@ //!Definitions for the `app.bsky.labeler.defs` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LabelerPolicies { +pub struct LabelerPoliciesData { ///Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. #[serde(skip_serializing_if = "Option::is_none")] pub label_value_definitions: Option< @@ -11,9 +11,10 @@ pub struct LabelerPolicies { ///The label values which this labeler publishes. May include global or custom labels. pub label_values: Vec, } +pub type LabelerPolicies = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LabelerView { +pub struct LabelerViewData { pub cid: crate::types::string::Cid, pub creator: crate::app::bsky::actor::defs::ProfileView, pub indexed_at: crate::types::string::Datetime, @@ -25,9 +26,10 @@ pub struct LabelerView { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type LabelerView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LabelerViewDetailed { +pub struct LabelerViewDetailedData { pub cid: crate::types::string::Cid, pub creator: crate::app::bsky::actor::defs::ProfileView, pub indexed_at: crate::types::string::Datetime, @@ -40,9 +42,11 @@ pub struct LabelerViewDetailed { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type LabelerViewDetailed = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LabelerViewerState { +pub struct LabelerViewerStateData { #[serde(skip_serializing_if = "Option::is_none")] pub like: Option, } +pub type LabelerViewerState = crate::types::Object; diff --git a/atrium-api/src/app/bsky/labeler/get_services.rs b/atrium-api/src/app/bsky/labeler/get_services.rs index a7019651..8c50fa9d 100644 --- a/atrium-api/src/app/bsky/labeler/get_services.rs +++ b/atrium-api/src/app/bsky/labeler/get_services.rs @@ -3,16 +3,18 @@ pub const NSID: &str = "app.bsky.labeler.getServices"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub detailed: Option, pub dids: Vec, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub views: Vec>, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/labeler/service.rs b/atrium-api/src/app/bsky/labeler/service.rs index 55f6bc6c..c5ffd00c 100644 --- a/atrium-api/src/app/bsky/labeler/service.rs +++ b/atrium-api/src/app/bsky/labeler/service.rs @@ -2,12 +2,13 @@ //!Definitions for the `app.bsky.labeler.service` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { pub created_at: crate::types::string::Datetime, #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option>, pub policies: crate::app::bsky::labeler::defs::LabelerPolicies, } +pub type Record = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum RecordLabelsRefs { diff --git a/atrium-api/src/app/bsky/notification/get_unread_count.rs b/atrium-api/src/app/bsky/notification/get_unread_count.rs index edde6028..6ed2d83c 100644 --- a/atrium-api/src/app/bsky/notification/get_unread_count.rs +++ b/atrium-api/src/app/bsky/notification/get_unread_count.rs @@ -3,15 +3,17 @@ pub const NSID: &str = "app.bsky.notification.getUnreadCount"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub seen_at: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub count: i64, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/notification/list_notifications.rs b/atrium-api/src/app/bsky/notification/list_notifications.rs index eba978ff..95979f3d 100644 --- a/atrium-api/src/app/bsky/notification/list_notifications.rs +++ b/atrium-api/src/app/bsky/notification/list_notifications.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.notification.listNotifications"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -11,15 +11,17 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub seen_at: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub notifications: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub seen_at: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -30,7 +32,7 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Notification { +pub struct NotificationData { pub author: crate::app::bsky::actor::defs::ProfileView, pub cid: crate::types::string::Cid, pub indexed_at: crate::types::string::Datetime, @@ -44,3 +46,4 @@ pub struct Notification { pub record: crate::records::Record, pub uri: String, } +pub type Notification = crate::types::Object; diff --git a/atrium-api/src/app/bsky/notification/register_push.rs b/atrium-api/src/app/bsky/notification/register_push.rs index 37dc2b10..adb868e0 100644 --- a/atrium-api/src/app/bsky/notification/register_push.rs +++ b/atrium-api/src/app/bsky/notification/register_push.rs @@ -3,12 +3,13 @@ pub const NSID: &str = "app.bsky.notification.registerPush"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub app_id: String, pub platform: String, pub service_did: crate::types::string::Did, pub token: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/notification/update_seen.rs b/atrium-api/src/app/bsky/notification/update_seen.rs index 1da03d7f..9bc378b5 100644 --- a/atrium-api/src/app/bsky/notification/update_seen.rs +++ b/atrium-api/src/app/bsky/notification/update_seen.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "app.bsky.notification.updateSeen"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub seen_at: crate::types::string::Datetime, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/richtext/facet.rs b/atrium-api/src/app/bsky/richtext/facet.rs index 287130fe..0ff45588 100644 --- a/atrium-api/src/app/bsky/richtext/facet.rs +++ b/atrium-api/src/app/bsky/richtext/facet.rs @@ -3,35 +3,40 @@ ///Annotation of a sub-string within rich text. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Main { +pub struct MainData { pub features: Vec>, pub index: ByteSlice, } +pub type Main = crate::types::Object; ///Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ByteSlice { +pub struct ByteSliceData { pub byte_end: usize, pub byte_start: usize, } +pub type ByteSlice = crate::types::Object; ///Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Link { +pub struct LinkData { pub uri: String, } +pub type Link = crate::types::Object; ///Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Mention { +pub struct MentionData { pub did: crate::types::string::Did, } +pub type Mention = crate::types::Object; ///Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Tag { +pub struct TagData { pub tag: String, } +pub type Tag = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum MainFeaturesItem { diff --git a/atrium-api/src/app/bsky/unspecced/defs.rs b/atrium-api/src/app/bsky/unspecced/defs.rs index 5b49e23a..4a0495c6 100644 --- a/atrium-api/src/app/bsky/unspecced/defs.rs +++ b/atrium-api/src/app/bsky/unspecced/defs.rs @@ -2,11 +2,13 @@ //!Definitions for the `app.bsky.unspecced.defs` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct SkeletonSearchActor { +pub struct SkeletonSearchActorData { pub did: crate::types::string::Did, } +pub type SkeletonSearchActor = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct SkeletonSearchPost { +pub struct SkeletonSearchPostData { pub uri: String, } +pub type SkeletonSearchPost = crate::types::Object; diff --git a/atrium-api/src/app/bsky/unspecced/get_popular_feed_generators.rs b/atrium-api/src/app/bsky/unspecced/get_popular_feed_generators.rs index 95553d7d..e7bede62 100644 --- a/atrium-api/src/app/bsky/unspecced/get_popular_feed_generators.rs +++ b/atrium-api/src/app/bsky/unspecced/get_popular_feed_generators.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.unspecced.getPopularFeedGenerators"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -11,13 +11,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub query: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub feeds: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/unspecced/get_suggestions_skeleton.rs b/atrium-api/src/app/bsky/unspecced/get_suggestions_skeleton.rs index 1fb10f95..2ded4712 100644 --- a/atrium-api/src/app/bsky/unspecced/get_suggestions_skeleton.rs +++ b/atrium-api/src/app/bsky/unspecced/get_suggestions_skeleton.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.unspecced.getSuggestionsSkeleton"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -12,13 +12,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub actors: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/app/bsky/unspecced/get_tagged_suggestions.rs b/atrium-api/src/app/bsky/unspecced/get_tagged_suggestions.rs index 61957a71..d2b148ab 100644 --- a/atrium-api/src/app/bsky/unspecced/get_tagged_suggestions.rs +++ b/atrium-api/src/app/bsky/unspecced/get_tagged_suggestions.rs @@ -3,12 +3,14 @@ pub const NSID: &str = "app.bsky.unspecced.getTaggedSuggestions"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters {} +pub struct ParametersData {} +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub suggestions: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -19,8 +21,9 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Suggestion { +pub struct SuggestionData { pub subject: String, pub subject_type: String, pub tag: String, } +pub type Suggestion = crate::types::Object; diff --git a/atrium-api/src/app/bsky/unspecced/search_actors_skeleton.rs b/atrium-api/src/app/bsky/unspecced/search_actors_skeleton.rs index 63e73d6e..b3b8d0b8 100644 --- a/atrium-api/src/app/bsky/unspecced/search_actors_skeleton.rs +++ b/atrium-api/src/app/bsky/unspecced/search_actors_skeleton.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.unspecced.searchActorsSkeleton"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///Optional pagination mechanism; may not necessarily allow scrolling through entire result set. #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, @@ -18,9 +18,10 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub actors: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, @@ -28,6 +29,7 @@ pub struct Output { #[serde(skip_serializing_if = "Option::is_none")] pub hits_total: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/app/bsky/unspecced/search_posts_skeleton.rs b/atrium-api/src/app/bsky/unspecced/search_posts_skeleton.rs index 06be04f2..8235aa53 100644 --- a/atrium-api/src/app/bsky/unspecced/search_posts_skeleton.rs +++ b/atrium-api/src/app/bsky/unspecced/search_posts_skeleton.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "app.bsky.unspecced.searchPostsSkeleton"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///Filter to posts by the given account. Handles are resolved to DID before query-time. #[serde(skip_serializing_if = "Option::is_none")] pub author: Option, @@ -42,9 +42,10 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, ///Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. @@ -52,6 +53,7 @@ pub struct Output { pub hits_total: Option, pub posts: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/chat/bsky/actor/declaration.rs b/atrium-api/src/chat/bsky/actor/declaration.rs index ab646953..e2630419 100644 --- a/atrium-api/src/chat/bsky/actor/declaration.rs +++ b/atrium-api/src/chat/bsky/actor/declaration.rs @@ -2,6 +2,7 @@ //!Definitions for the `chat.bsky.actor.declaration` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { pub allow_incoming: String, } +pub type Record = crate::types::Object; diff --git a/atrium-api/src/chat/bsky/actor/defs.rs b/atrium-api/src/chat/bsky/actor/defs.rs index 95595e3c..ce9ded75 100644 --- a/atrium-api/src/chat/bsky/actor/defs.rs +++ b/atrium-api/src/chat/bsky/actor/defs.rs @@ -2,7 +2,7 @@ //!Definitions for the `chat.bsky.actor.defs` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ProfileViewBasic { +pub struct ProfileViewBasicData { #[serde(skip_serializing_if = "Option::is_none")] pub associated: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -19,3 +19,4 @@ pub struct ProfileViewBasic { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type ProfileViewBasic = crate::types::Object; diff --git a/atrium-api/src/chat/bsky/actor/delete_account.rs b/atrium-api/src/chat/bsky/actor/delete_account.rs index 5bd1b384..b79ce693 100644 --- a/atrium-api/src/chat/bsky/actor/delete_account.rs +++ b/atrium-api/src/chat/bsky/actor/delete_account.rs @@ -3,7 +3,8 @@ pub const NSID: &str = "chat.bsky.actor.deleteAccount"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output {} +pub struct OutputData {} +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/convo/defs.rs b/atrium-api/src/chat/bsky/convo/defs.rs index 6f7c8376..fe1b5c56 100644 --- a/atrium-api/src/chat/bsky/convo/defs.rs +++ b/atrium-api/src/chat/bsky/convo/defs.rs @@ -2,7 +2,7 @@ //!Definitions for the `chat.bsky.convo.defs` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ConvoView { +pub struct ConvoViewData { pub id: String, #[serde(skip_serializing_if = "Option::is_none")] pub last_message: Option>, @@ -11,43 +11,49 @@ pub struct ConvoView { pub rev: String, pub unread_count: i64, } +pub type ConvoView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct DeletedMessageView { +pub struct DeletedMessageViewData { pub id: String, pub rev: String, pub sender: MessageViewSender, pub sent_at: crate::types::string::Datetime, } +pub type DeletedMessageView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LogBeginConvo { +pub struct LogBeginConvoData { pub convo_id: String, pub rev: String, } +pub type LogBeginConvo = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LogCreateMessage { +pub struct LogCreateMessageData { pub convo_id: String, pub message: crate::types::Union, pub rev: String, } +pub type LogCreateMessage = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LogDeleteMessage { +pub struct LogDeleteMessageData { pub convo_id: String, pub message: crate::types::Union, pub rev: String, } +pub type LogDeleteMessage = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LogLeaveConvo { +pub struct LogLeaveConvoData { pub convo_id: String, pub rev: String, } +pub type LogLeaveConvo = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct MessageInput { +pub struct MessageInputData { #[serde(skip_serializing_if = "Option::is_none")] pub embed: Option>, ///Annotations of text (mentions, URLs, hashtags, etc) @@ -55,16 +61,18 @@ pub struct MessageInput { pub facets: Option>, pub text: String, } +pub type MessageInput = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct MessageRef { +pub struct MessageRefData { pub convo_id: String, pub did: crate::types::string::Did, pub message_id: String, } +pub type MessageRef = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct MessageView { +pub struct MessageViewData { #[serde(skip_serializing_if = "Option::is_none")] pub embed: Option>, ///Annotations of text (mentions, URLs, hashtags, etc) @@ -76,11 +84,13 @@ pub struct MessageView { pub sent_at: crate::types::string::Datetime, pub text: String, } +pub type MessageView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct MessageViewSender { +pub struct MessageViewSenderData { pub did: crate::types::string::Did, } +pub type MessageViewSender = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum ConvoViewLastMessageRefs { diff --git a/atrium-api/src/chat/bsky/convo/delete_message_for_self.rs b/atrium-api/src/chat/bsky/convo/delete_message_for_self.rs index 4b90480b..47ab8baf 100644 --- a/atrium-api/src/chat/bsky/convo/delete_message_for_self.rs +++ b/atrium-api/src/chat/bsky/convo/delete_message_for_self.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "chat.bsky.convo.deleteMessageForSelf"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub convo_id: String, pub message_id: String, } +pub type Input = crate::types::Object; pub type Output = crate::chat::bsky::convo::defs::DeletedMessageView; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] diff --git a/atrium-api/src/chat/bsky/convo/get_convo.rs b/atrium-api/src/chat/bsky/convo/get_convo.rs index b70654d0..c2e6ab26 100644 --- a/atrium-api/src/chat/bsky/convo/get_convo.rs +++ b/atrium-api/src/chat/bsky/convo/get_convo.rs @@ -3,14 +3,16 @@ pub const NSID: &str = "chat.bsky.convo.getConvo"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub convo_id: String, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub convo: crate::chat::bsky::convo::defs::ConvoView, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/convo/get_convo_for_members.rs b/atrium-api/src/chat/bsky/convo/get_convo_for_members.rs index a0e8457f..d128a003 100644 --- a/atrium-api/src/chat/bsky/convo/get_convo_for_members.rs +++ b/atrium-api/src/chat/bsky/convo/get_convo_for_members.rs @@ -3,14 +3,16 @@ pub const NSID: &str = "chat.bsky.convo.getConvoForMembers"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub members: Vec, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub convo: crate::chat::bsky::convo::defs::ConvoView, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/convo/get_log.rs b/atrium-api/src/chat/bsky/convo/get_log.rs index cc007f2e..49d5897e 100644 --- a/atrium-api/src/chat/bsky/convo/get_log.rs +++ b/atrium-api/src/chat/bsky/convo/get_log.rs @@ -3,17 +3,19 @@ pub const NSID: &str = "chat.bsky.convo.getLog"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub logs: Vec>, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/convo/get_messages.rs b/atrium-api/src/chat/bsky/convo/get_messages.rs index e1003a66..8abe1658 100644 --- a/atrium-api/src/chat/bsky/convo/get_messages.rs +++ b/atrium-api/src/chat/bsky/convo/get_messages.rs @@ -3,20 +3,22 @@ pub const NSID: &str = "chat.bsky.convo.getMessages"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub convo_id: String, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub messages: Vec>, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/convo/leave_convo.rs b/atrium-api/src/chat/bsky/convo/leave_convo.rs index a7f073de..c23ceb3f 100644 --- a/atrium-api/src/chat/bsky/convo/leave_convo.rs +++ b/atrium-api/src/chat/bsky/convo/leave_convo.rs @@ -3,15 +3,17 @@ pub const NSID: &str = "chat.bsky.convo.leaveConvo"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub convo_id: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub convo_id: String, pub rev: String, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/convo/list_convos.rs b/atrium-api/src/chat/bsky/convo/list_convos.rs index 0aea8d2b..e2484b71 100644 --- a/atrium-api/src/chat/bsky/convo/list_convos.rs +++ b/atrium-api/src/chat/bsky/convo/list_convos.rs @@ -3,19 +3,21 @@ pub const NSID: &str = "chat.bsky.convo.listConvos"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub convos: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/convo/mute_convo.rs b/atrium-api/src/chat/bsky/convo/mute_convo.rs index 842d03e6..bf9ec580 100644 --- a/atrium-api/src/chat/bsky/convo/mute_convo.rs +++ b/atrium-api/src/chat/bsky/convo/mute_convo.rs @@ -3,14 +3,16 @@ pub const NSID: &str = "chat.bsky.convo.muteConvo"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub convo_id: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub convo: crate::chat::bsky::convo::defs::ConvoView, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/convo/send_message.rs b/atrium-api/src/chat/bsky/convo/send_message.rs index 98a4237b..ce867315 100644 --- a/atrium-api/src/chat/bsky/convo/send_message.rs +++ b/atrium-api/src/chat/bsky/convo/send_message.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "chat.bsky.convo.sendMessage"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub convo_id: String, pub message: crate::chat::bsky::convo::defs::MessageInput, } +pub type Input = crate::types::Object; pub type Output = crate::chat::bsky::convo::defs::MessageView; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] diff --git a/atrium-api/src/chat/bsky/convo/send_message_batch.rs b/atrium-api/src/chat/bsky/convo/send_message_batch.rs index 389c478c..d038f8e0 100644 --- a/atrium-api/src/chat/bsky/convo/send_message_batch.rs +++ b/atrium-api/src/chat/bsky/convo/send_message_batch.rs @@ -3,14 +3,16 @@ pub const NSID: &str = "chat.bsky.convo.sendMessageBatch"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub items: Vec, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub items: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -21,7 +23,8 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct BatchItem { +pub struct BatchItemData { pub convo_id: String, pub message: crate::chat::bsky::convo::defs::MessageInput, } +pub type BatchItem = crate::types::Object; diff --git a/atrium-api/src/chat/bsky/convo/unmute_convo.rs b/atrium-api/src/chat/bsky/convo/unmute_convo.rs index 6fa19eac..e04e012f 100644 --- a/atrium-api/src/chat/bsky/convo/unmute_convo.rs +++ b/atrium-api/src/chat/bsky/convo/unmute_convo.rs @@ -3,14 +3,16 @@ pub const NSID: &str = "chat.bsky.convo.unmuteConvo"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub convo_id: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub convo: crate::chat::bsky::convo::defs::ConvoView, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/convo/update_read.rs b/atrium-api/src/chat/bsky/convo/update_read.rs index e69ee90b..f3f82db3 100644 --- a/atrium-api/src/chat/bsky/convo/update_read.rs +++ b/atrium-api/src/chat/bsky/convo/update_read.rs @@ -3,16 +3,18 @@ pub const NSID: &str = "chat.bsky.convo.updateRead"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub convo_id: String, #[serde(skip_serializing_if = "Option::is_none")] pub message_id: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub convo: crate::chat::bsky::convo::defs::ConvoView, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/moderation/get_actor_metadata.rs b/atrium-api/src/chat/bsky/moderation/get_actor_metadata.rs index 537fc06d..fb53cd7a 100644 --- a/atrium-api/src/chat/bsky/moderation/get_actor_metadata.rs +++ b/atrium-api/src/chat/bsky/moderation/get_actor_metadata.rs @@ -3,16 +3,18 @@ pub const NSID: &str = "chat.bsky.moderation.getActorMetadata"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub actor: crate::types::string::Did, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub all: Metadata, pub day: Metadata, pub month: Metadata, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -23,9 +25,10 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Metadata { +pub struct MetadataData { pub convos: i64, pub convos_started: i64, pub messages_received: i64, pub messages_sent: i64, } +pub type Metadata = crate::types::Object; diff --git a/atrium-api/src/chat/bsky/moderation/get_message_context.rs b/atrium-api/src/chat/bsky/moderation/get_message_context.rs index 207ff797..c313a5f8 100644 --- a/atrium-api/src/chat/bsky/moderation/get_message_context.rs +++ b/atrium-api/src/chat/bsky/moderation/get_message_context.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "chat.bsky.moderation.getMessageContext"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub after: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -13,11 +13,13 @@ pub struct Parameters { pub convo_id: Option, pub message_id: String, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub messages: Vec>, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/chat/bsky/moderation/update_actor_access.rs b/atrium-api/src/chat/bsky/moderation/update_actor_access.rs index be373a74..d94bf171 100644 --- a/atrium-api/src/chat/bsky/moderation/update_actor_access.rs +++ b/atrium-api/src/chat/bsky/moderation/update_actor_access.rs @@ -3,12 +3,13 @@ pub const NSID: &str = "chat.bsky.moderation.updateActorAccess"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub actor: crate::types::string::Did, pub allow_access: bool, #[serde(skip_serializing_if = "Option::is_none")] pub r#ref: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/defs.rs b/atrium-api/src/com/atproto/admin/defs.rs index 0ad2f6b5..5706e520 100644 --- a/atrium-api/src/com/atproto/admin/defs.rs +++ b/atrium-api/src/com/atproto/admin/defs.rs @@ -2,7 +2,7 @@ //!Definitions for the `com.atproto.admin.defs` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct AccountView { +pub struct AccountViewData { #[serde(skip_serializing_if = "Option::is_none")] pub deactivated_at: Option, pub did: crate::types::string::Did, @@ -23,23 +23,27 @@ pub struct AccountView { #[serde(skip_serializing_if = "Option::is_none")] pub related_records: Option>, } +pub type AccountView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct RepoBlobRef { +pub struct RepoBlobRefData { pub cid: crate::types::string::Cid, pub did: crate::types::string::Did, #[serde(skip_serializing_if = "Option::is_none")] pub record_uri: Option, } +pub type RepoBlobRef = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct RepoRef { +pub struct RepoRefData { pub did: crate::types::string::Did, } +pub type RepoRef = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct StatusAttr { +pub struct StatusAttrData { pub applied: bool, #[serde(skip_serializing_if = "Option::is_none")] pub r#ref: Option, } +pub type StatusAttr = crate::types::Object; diff --git a/atrium-api/src/com/atproto/admin/delete_account.rs b/atrium-api/src/com/atproto/admin/delete_account.rs index 673e06f6..cb434c16 100644 --- a/atrium-api/src/com/atproto/admin/delete_account.rs +++ b/atrium-api/src/com/atproto/admin/delete_account.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "com.atproto.admin.deleteAccount"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub did: crate::types::string::Did, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/disable_account_invites.rs b/atrium-api/src/com/atproto/admin/disable_account_invites.rs index a37e3e19..b4b13469 100644 --- a/atrium-api/src/com/atproto/admin/disable_account_invites.rs +++ b/atrium-api/src/com/atproto/admin/disable_account_invites.rs @@ -3,12 +3,13 @@ pub const NSID: &str = "com.atproto.admin.disableAccountInvites"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub account: crate::types::string::Did, ///Optional reason for disabled invites. #[serde(skip_serializing_if = "Option::is_none")] pub note: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/disable_invite_codes.rs b/atrium-api/src/com/atproto/admin/disable_invite_codes.rs index 58f7bd74..821e455e 100644 --- a/atrium-api/src/com/atproto/admin/disable_invite_codes.rs +++ b/atrium-api/src/com/atproto/admin/disable_invite_codes.rs @@ -3,12 +3,13 @@ pub const NSID: &str = "com.atproto.admin.disableInviteCodes"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { #[serde(skip_serializing_if = "Option::is_none")] pub accounts: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub codes: Option>, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/enable_account_invites.rs b/atrium-api/src/com/atproto/admin/enable_account_invites.rs index 526b452e..c6fc0445 100644 --- a/atrium-api/src/com/atproto/admin/enable_account_invites.rs +++ b/atrium-api/src/com/atproto/admin/enable_account_invites.rs @@ -3,12 +3,13 @@ pub const NSID: &str = "com.atproto.admin.enableAccountInvites"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub account: crate::types::string::Did, ///Optional reason for enabled invites. #[serde(skip_serializing_if = "Option::is_none")] pub note: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/get_account_info.rs b/atrium-api/src/com/atproto/admin/get_account_info.rs index ec16f2ea..3a5fb822 100644 --- a/atrium-api/src/com/atproto/admin/get_account_info.rs +++ b/atrium-api/src/com/atproto/admin/get_account_info.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "com.atproto.admin.getAccountInfo"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub did: crate::types::string::Did, } +pub type Parameters = crate::types::Object; pub type Output = crate::com::atproto::admin::defs::AccountView; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] diff --git a/atrium-api/src/com/atproto/admin/get_account_infos.rs b/atrium-api/src/com/atproto/admin/get_account_infos.rs index b6116082..b353516a 100644 --- a/atrium-api/src/com/atproto/admin/get_account_infos.rs +++ b/atrium-api/src/com/atproto/admin/get_account_infos.rs @@ -3,14 +3,16 @@ pub const NSID: &str = "com.atproto.admin.getAccountInfos"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub dids: Vec, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub infos: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/get_invite_codes.rs b/atrium-api/src/com/atproto/admin/get_invite_codes.rs index 08f744e2..82505147 100644 --- a/atrium-api/src/com/atproto/admin/get_invite_codes.rs +++ b/atrium-api/src/com/atproto/admin/get_invite_codes.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.admin.getInviteCodes"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -11,13 +11,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub sort: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub codes: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/get_subject_status.rs b/atrium-api/src/com/atproto/admin/get_subject_status.rs index e32dd291..51a645c9 100644 --- a/atrium-api/src/com/atproto/admin/get_subject_status.rs +++ b/atrium-api/src/com/atproto/admin/get_subject_status.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.admin.getSubjectStatus"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub blob: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -11,15 +11,17 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub uri: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub deactivated: Option, pub subject: crate::types::Union, #[serde(skip_serializing_if = "Option::is_none")] pub takedown: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/search_accounts.rs b/atrium-api/src/com/atproto/admin/search_accounts.rs index f22ca2b6..6dc64c46 100644 --- a/atrium-api/src/com/atproto/admin/search_accounts.rs +++ b/atrium-api/src/com/atproto/admin/search_accounts.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.admin.searchAccounts"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -11,13 +11,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub accounts: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/send_email.rs b/atrium-api/src/com/atproto/admin/send_email.rs index 253412d5..0193e922 100644 --- a/atrium-api/src/com/atproto/admin/send_email.rs +++ b/atrium-api/src/com/atproto/admin/send_email.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.admin.sendEmail"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, @@ -13,11 +13,13 @@ pub struct Input { #[serde(skip_serializing_if = "Option::is_none")] pub subject: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub sent: bool, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/update_account_email.rs b/atrium-api/src/com/atproto/admin/update_account_email.rs index a70d1c81..6b2f058a 100644 --- a/atrium-api/src/com/atproto/admin/update_account_email.rs +++ b/atrium-api/src/com/atproto/admin/update_account_email.rs @@ -3,11 +3,12 @@ pub const NSID: &str = "com.atproto.admin.updateAccountEmail"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///The handle or DID of the repo. pub account: crate::types::string::AtIdentifier, pub email: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/update_account_handle.rs b/atrium-api/src/com/atproto/admin/update_account_handle.rs index 8e20e390..43735f6a 100644 --- a/atrium-api/src/com/atproto/admin/update_account_handle.rs +++ b/atrium-api/src/com/atproto/admin/update_account_handle.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "com.atproto.admin.updateAccountHandle"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub did: crate::types::string::Did, pub handle: crate::types::string::Handle, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/update_account_password.rs b/atrium-api/src/com/atproto/admin/update_account_password.rs index 81859706..3db189c7 100644 --- a/atrium-api/src/com/atproto/admin/update_account_password.rs +++ b/atrium-api/src/com/atproto/admin/update_account_password.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "com.atproto.admin.updateAccountPassword"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub did: crate::types::string::Did, pub password: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/admin/update_subject_status.rs b/atrium-api/src/com/atproto/admin/update_subject_status.rs index 6815b56e..71fa619b 100644 --- a/atrium-api/src/com/atproto/admin/update_subject_status.rs +++ b/atrium-api/src/com/atproto/admin/update_subject_status.rs @@ -3,20 +3,22 @@ pub const NSID: &str = "com.atproto.admin.updateSubjectStatus"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { #[serde(skip_serializing_if = "Option::is_none")] pub deactivated: Option, pub subject: crate::types::Union, #[serde(skip_serializing_if = "Option::is_none")] pub takedown: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub subject: crate::types::Union, #[serde(skip_serializing_if = "Option::is_none")] pub takedown: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/identity/get_recommended_did_credentials.rs b/atrium-api/src/com/atproto/identity/get_recommended_did_credentials.rs index 8cd9cb51..dbbef5a2 100644 --- a/atrium-api/src/com/atproto/identity/get_recommended_did_credentials.rs +++ b/atrium-api/src/com/atproto/identity/get_recommended_did_credentials.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.identity.getRecommendedDidCredentials"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub also_known_as: Option>, ///Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs. @@ -14,6 +14,7 @@ pub struct Output { #[serde(skip_serializing_if = "Option::is_none")] pub verification_methods: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/identity/resolve_handle.rs b/atrium-api/src/com/atproto/identity/resolve_handle.rs index 6aa6785e..42218b2c 100644 --- a/atrium-api/src/com/atproto/identity/resolve_handle.rs +++ b/atrium-api/src/com/atproto/identity/resolve_handle.rs @@ -3,15 +3,17 @@ pub const NSID: &str = "com.atproto.identity.resolveHandle"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The handle to resolve. pub handle: crate::types::string::Handle, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub did: crate::types::string::Did, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/identity/sign_plc_operation.rs b/atrium-api/src/com/atproto/identity/sign_plc_operation.rs index d789e768..15d7282b 100644 --- a/atrium-api/src/com/atproto/identity/sign_plc_operation.rs +++ b/atrium-api/src/com/atproto/identity/sign_plc_operation.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.identity.signPlcOperation"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { #[serde(skip_serializing_if = "Option::is_none")] pub also_known_as: Option>, #[serde(skip_serializing_if = "Option::is_none")] @@ -16,12 +16,14 @@ pub struct Input { #[serde(skip_serializing_if = "Option::is_none")] pub verification_methods: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { ///A signed DID PLC operation. pub operation: crate::records::Record, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/identity/submit_plc_operation.rs b/atrium-api/src/com/atproto/identity/submit_plc_operation.rs index 5d57b310..22ab75ba 100644 --- a/atrium-api/src/com/atproto/identity/submit_plc_operation.rs +++ b/atrium-api/src/com/atproto/identity/submit_plc_operation.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "com.atproto.identity.submitPlcOperation"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub operation: crate::records::Record, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/identity/update_handle.rs b/atrium-api/src/com/atproto/identity/update_handle.rs index 6d351592..a54d5763 100644 --- a/atrium-api/src/com/atproto/identity/update_handle.rs +++ b/atrium-api/src/com/atproto/identity/update_handle.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "com.atproto.identity.updateHandle"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///The new handle. pub handle: crate::types::string::Handle, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/label/defs.rs b/atrium-api/src/com/atproto/label/defs.rs index c0bd0b3a..55f69e8b 100644 --- a/atrium-api/src/com/atproto/label/defs.rs +++ b/atrium-api/src/com/atproto/label/defs.rs @@ -3,7 +3,7 @@ ///Metadata tag on an atproto resource (eg, repo or record). #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Label { +pub struct LabelData { ///Optionally, CID specifying the specific version of 'uri' resource this label applies to. #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, @@ -30,11 +30,12 @@ pub struct Label { #[serde(skip_serializing_if = "Option::is_none")] pub ver: Option, } +pub type Label = crate::types::Object; pub type LabelValue = String; ///Declares a label value and its expected interpertations and behaviors. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LabelValueDefinition { +pub struct LabelValueDefinitionData { ///Does the user need to have adult content enabled in order to configure this label? #[serde(skip_serializing_if = "Option::is_none")] pub adult_only: Option, @@ -49,10 +50,11 @@ pub struct LabelValueDefinition { ///How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. pub severity: String, } +pub type LabelValueDefinition = crate::types::Object; ///Strings which describe the label in the UI, localized into a specific language. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct LabelValueDefinitionStrings { +pub struct LabelValueDefinitionStringsData { ///A longer description of what the label means and why it might be applied. pub description: String, ///The code of the language these strings are written in. @@ -60,16 +62,21 @@ pub struct LabelValueDefinitionStrings { ///A short human-readable name for the label. pub name: String, } +pub type LabelValueDefinitionStrings = crate::types::Object< + LabelValueDefinitionStringsData, +>; ///Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct SelfLabel { +pub struct SelfLabelData { ///The short string name of the value or type of this label. pub val: String, } +pub type SelfLabel = crate::types::Object; ///Metadata tags on an atproto record, published by the author within the record. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct SelfLabels { +pub struct SelfLabelsData { pub values: Vec, } +pub type SelfLabels = crate::types::Object; diff --git a/atrium-api/src/com/atproto/label/query_labels.rs b/atrium-api/src/com/atproto/label/query_labels.rs index 9485778a..de1c279c 100644 --- a/atrium-api/src/com/atproto/label/query_labels.rs +++ b/atrium-api/src/com/atproto/label/query_labels.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.label.queryLabels"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -14,13 +14,15 @@ pub struct Parameters { ///List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI. pub uri_patterns: Vec, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub labels: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/label/subscribe_labels.rs b/atrium-api/src/com/atproto/label/subscribe_labels.rs index af9aed4f..452cf346 100644 --- a/atrium-api/src/com/atproto/label/subscribe_labels.rs +++ b/atrium-api/src/com/atproto/label/subscribe_labels.rs @@ -3,11 +3,12 @@ pub const NSID: &str = "com.atproto.label.subscribeLabels"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The last known event seq number to backfill from. #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { @@ -28,17 +29,19 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Info { +pub struct InfoData { #[serde(skip_serializing_if = "Option::is_none")] pub message: Option, pub name: String, } +pub type Info = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Labels { +pub struct LabelsData { pub labels: Vec, pub seq: i64, } +pub type Labels = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum Message { diff --git a/atrium-api/src/com/atproto/moderation/create_report.rs b/atrium-api/src/com/atproto/moderation/create_report.rs index e1be5a38..b9197428 100644 --- a/atrium-api/src/com/atproto/moderation/create_report.rs +++ b/atrium-api/src/com/atproto/moderation/create_report.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.moderation.createReport"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///Additional context about the content and violation. #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option, @@ -11,9 +11,10 @@ pub struct Input { pub reason_type: crate::com::atproto::moderation::defs::ReasonType, pub subject: crate::types::Union, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub created_at: crate::types::string::Datetime, pub id: i64, #[serde(skip_serializing_if = "Option::is_none")] @@ -22,6 +23,7 @@ pub struct Output { pub reported_by: crate::types::string::Did, pub subject: crate::types::Union, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/repo/apply_writes.rs b/atrium-api/src/com/atproto/repo/apply_writes.rs index 79c5f9bb..f1172f5f 100644 --- a/atrium-api/src/com/atproto/repo/apply_writes.rs +++ b/atrium-api/src/com/atproto/repo/apply_writes.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.repo.applyWrites"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///The handle or DID of the repo (aka, current account). pub repo: crate::types::string::AtIdentifier, ///If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations. @@ -14,6 +14,7 @@ pub struct Input { pub validate: Option, pub writes: Vec, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { @@ -36,27 +37,30 @@ impl std::fmt::Display for Error { ///Operation which creates a new record. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Create { +pub struct CreateData { pub collection: crate::types::string::Nsid, #[serde(skip_serializing_if = "Option::is_none")] pub rkey: Option, pub value: crate::records::Record, } +pub type Create = crate::types::Object; ///Operation which deletes an existing record. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Delete { +pub struct DeleteData { pub collection: crate::types::string::Nsid, pub rkey: String, } +pub type Delete = crate::types::Object; ///Operation which updates an existing record. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Update { +pub struct UpdateData { pub collection: crate::types::string::Nsid, pub rkey: String, pub value: crate::records::Record, } +pub type Update = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum InputWritesItem { diff --git a/atrium-api/src/com/atproto/repo/create_record.rs b/atrium-api/src/com/atproto/repo/create_record.rs index 36de794b..a53f0727 100644 --- a/atrium-api/src/com/atproto/repo/create_record.rs +++ b/atrium-api/src/com/atproto/repo/create_record.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.repo.createRecord"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///The NSID of the record collection. pub collection: crate::types::string::Nsid, ///The record itself. Must contain a $type field. @@ -20,12 +20,14 @@ pub struct Input { #[serde(skip_serializing_if = "Option::is_none")] pub validate: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub cid: crate::types::string::Cid, pub uri: String, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/repo/delete_record.rs b/atrium-api/src/com/atproto/repo/delete_record.rs index 7eafe296..9b65ae30 100644 --- a/atrium-api/src/com/atproto/repo/delete_record.rs +++ b/atrium-api/src/com/atproto/repo/delete_record.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.repo.deleteRecord"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///The NSID of the record collection. pub collection: crate::types::string::Nsid, ///The handle or DID of the repo (aka, current account). @@ -17,6 +17,7 @@ pub struct Input { #[serde(skip_serializing_if = "Option::is_none")] pub swap_record: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/repo/describe_repo.rs b/atrium-api/src/com/atproto/repo/describe_repo.rs index ffb2451d..b2da43ac 100644 --- a/atrium-api/src/com/atproto/repo/describe_repo.rs +++ b/atrium-api/src/com/atproto/repo/describe_repo.rs @@ -3,13 +3,14 @@ pub const NSID: &str = "com.atproto.repo.describeRepo"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The handle or DID of the repo. pub repo: crate::types::string::AtIdentifier, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { ///List of all the collections (NSIDs) for which this repo contains at least one record. pub collections: Vec, pub did: crate::types::string::Did, @@ -19,6 +20,7 @@ pub struct Output { ///Indicates if handle is currently valid (resolves bi-directionally) pub handle_is_correct: bool, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/repo/get_record.rs b/atrium-api/src/com/atproto/repo/get_record.rs index 0565c76e..df7d5aad 100644 --- a/atrium-api/src/com/atproto/repo/get_record.rs +++ b/atrium-api/src/com/atproto/repo/get_record.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.repo.getRecord"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The CID of the version of the record. If not specified, then return the most recent version. #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, @@ -14,14 +14,16 @@ pub struct Parameters { ///The Record Key. pub rkey: String, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, pub uri: String, pub value: crate::records::Record, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/repo/list_missing_blobs.rs b/atrium-api/src/com/atproto/repo/list_missing_blobs.rs index bad7fcd1..83246e72 100644 --- a/atrium-api/src/com/atproto/repo/list_missing_blobs.rs +++ b/atrium-api/src/com/atproto/repo/list_missing_blobs.rs @@ -3,19 +3,21 @@ pub const NSID: &str = "com.atproto.repo.listMissingBlobs"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub blobs: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -26,7 +28,8 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct RecordBlob { +pub struct RecordBlobData { pub cid: crate::types::string::Cid, pub record_uri: String, } +pub type RecordBlob = crate::types::Object; diff --git a/atrium-api/src/com/atproto/repo/list_records.rs b/atrium-api/src/com/atproto/repo/list_records.rs index f41ed437..d6fd21ae 100644 --- a/atrium-api/src/com/atproto/repo/list_records.rs +++ b/atrium-api/src/com/atproto/repo/list_records.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.repo.listRecords"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The NSID of the record type. pub collection: crate::types::string::Nsid, #[serde(skip_serializing_if = "Option::is_none")] @@ -23,13 +23,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub rkey_start: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub records: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -40,8 +42,9 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Record { +pub struct RecordData { pub cid: crate::types::string::Cid, pub uri: String, pub value: crate::records::Record, } +pub type Record = crate::types::Object; diff --git a/atrium-api/src/com/atproto/repo/put_record.rs b/atrium-api/src/com/atproto/repo/put_record.rs index 7d9c9060..2abd4b57 100644 --- a/atrium-api/src/com/atproto/repo/put_record.rs +++ b/atrium-api/src/com/atproto/repo/put_record.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.repo.putRecord"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///The NSID of the record collection. pub collection: crate::types::string::Nsid, ///The record to write. @@ -22,12 +22,14 @@ pub struct Input { #[serde(skip_serializing_if = "Option::is_none")] pub validate: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub cid: crate::types::string::Cid, pub uri: String, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/repo/strong_ref.rs b/atrium-api/src/com/atproto/repo/strong_ref.rs index 5492e9ec..1849b7da 100644 --- a/atrium-api/src/com/atproto/repo/strong_ref.rs +++ b/atrium-api/src/com/atproto/repo/strong_ref.rs @@ -3,7 +3,8 @@ //!A URI with a content-hash fingerprint. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Main { +pub struct MainData { pub cid: crate::types::string::Cid, pub uri: String, } +pub type Main = crate::types::Object; diff --git a/atrium-api/src/com/atproto/repo/upload_blob.rs b/atrium-api/src/com/atproto/repo/upload_blob.rs index f27576a1..5068981a 100644 --- a/atrium-api/src/com/atproto/repo/upload_blob.rs +++ b/atrium-api/src/com/atproto/repo/upload_blob.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "com.atproto.repo.uploadBlob"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub blob: crate::types::BlobRef, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/server/check_account_status.rs b/atrium-api/src/com/atproto/server/check_account_status.rs index 1f8787f7..4f8b7811 100644 --- a/atrium-api/src/com/atproto/server/check_account_status.rs +++ b/atrium-api/src/com/atproto/server/check_account_status.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.server.checkAccountStatus"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub activated: bool, pub expected_blobs: i64, pub imported_blobs: i64, @@ -14,6 +14,7 @@ pub struct Output { pub repo_rev: String, pub valid_did: bool, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/server/confirm_email.rs b/atrium-api/src/com/atproto/server/confirm_email.rs index ba7fe78f..a7bd0deb 100644 --- a/atrium-api/src/com/atproto/server/confirm_email.rs +++ b/atrium-api/src/com/atproto/server/confirm_email.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "com.atproto.server.confirmEmail"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub email: String, pub token: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/server/create_account.rs b/atrium-api/src/com/atproto/server/create_account.rs index 424fa220..034928ec 100644 --- a/atrium-api/src/com/atproto/server/create_account.rs +++ b/atrium-api/src/com/atproto/server/create_account.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.server.createAccount"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///Pre-existing atproto DID, being imported to a new account. #[serde(skip_serializing_if = "Option::is_none")] pub did: Option, @@ -27,10 +27,11 @@ pub struct Input { #[serde(skip_serializing_if = "Option::is_none")] pub verification_phone: Option, } +pub type Input = crate::types::Object; ///Account login session returned on successful account creation. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub access_jwt: String, ///The DID of the new account. pub did: crate::types::string::Did, @@ -40,6 +41,7 @@ pub struct Output { pub handle: crate::types::string::Handle, pub refresh_jwt: String, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/server/create_app_password.rs b/atrium-api/src/com/atproto/server/create_app_password.rs index 97663bc4..56c39fa7 100644 --- a/atrium-api/src/com/atproto/server/create_app_password.rs +++ b/atrium-api/src/com/atproto/server/create_app_password.rs @@ -3,13 +3,14 @@ pub const NSID: &str = "com.atproto.server.createAppPassword"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///A short name for the App Password, to help distinguish them. pub name: String, ///If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients. #[serde(skip_serializing_if = "Option::is_none")] pub privileged: Option, } +pub type Input = crate::types::Object; pub type Output = AppPassword; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] @@ -31,10 +32,11 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct AppPassword { +pub struct AppPasswordData { pub created_at: crate::types::string::Datetime, pub name: String, pub password: String, #[serde(skip_serializing_if = "Option::is_none")] pub privileged: Option, } +pub type AppPassword = crate::types::Object; diff --git a/atrium-api/src/com/atproto/server/create_invite_code.rs b/atrium-api/src/com/atproto/server/create_invite_code.rs index 2e16584b..2458e9f8 100644 --- a/atrium-api/src/com/atproto/server/create_invite_code.rs +++ b/atrium-api/src/com/atproto/server/create_invite_code.rs @@ -3,16 +3,18 @@ pub const NSID: &str = "com.atproto.server.createInviteCode"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { #[serde(skip_serializing_if = "Option::is_none")] pub for_account: Option, pub use_count: i64, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub code: String, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/server/create_invite_codes.rs b/atrium-api/src/com/atproto/server/create_invite_codes.rs index bbba52c1..124383fc 100644 --- a/atrium-api/src/com/atproto/server/create_invite_codes.rs +++ b/atrium-api/src/com/atproto/server/create_invite_codes.rs @@ -3,17 +3,19 @@ pub const NSID: &str = "com.atproto.server.createInviteCodes"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub code_count: i64, #[serde(skip_serializing_if = "Option::is_none")] pub for_accounts: Option>, pub use_count: i64, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub codes: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -24,7 +26,8 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct AccountCodes { +pub struct AccountCodesData { pub account: String, pub codes: Vec, } +pub type AccountCodes = crate::types::Object; diff --git a/atrium-api/src/com/atproto/server/create_session.rs b/atrium-api/src/com/atproto/server/create_session.rs index c6ff499d..7bb4a9f3 100644 --- a/atrium-api/src/com/atproto/server/create_session.rs +++ b/atrium-api/src/com/atproto/server/create_session.rs @@ -3,16 +3,17 @@ pub const NSID: &str = "com.atproto.server.createSession"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { #[serde(skip_serializing_if = "Option::is_none")] pub auth_factor_token: Option, ///Handle or other identifier supported by the server for the authenticating user. pub identifier: String, pub password: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub access_jwt: String, #[serde(skip_serializing_if = "Option::is_none")] pub active: Option, @@ -31,6 +32,7 @@ pub struct Output { #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/server/deactivate_account.rs b/atrium-api/src/com/atproto/server/deactivate_account.rs index af7b5a08..3a757019 100644 --- a/atrium-api/src/com/atproto/server/deactivate_account.rs +++ b/atrium-api/src/com/atproto/server/deactivate_account.rs @@ -3,11 +3,12 @@ pub const NSID: &str = "com.atproto.server.deactivateAccount"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///A recommendation to server as to how long they should hold onto the deactivated account before deleting. #[serde(skip_serializing_if = "Option::is_none")] pub delete_after: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/server/defs.rs b/atrium-api/src/com/atproto/server/defs.rs index 8bf3146e..3b11a988 100644 --- a/atrium-api/src/com/atproto/server/defs.rs +++ b/atrium-api/src/com/atproto/server/defs.rs @@ -2,7 +2,7 @@ //!Definitions for the `com.atproto.server.defs` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct InviteCode { +pub struct InviteCodeData { pub available: i64, pub code: String, pub created_at: crate::types::string::Datetime, @@ -11,9 +11,11 @@ pub struct InviteCode { pub for_account: String, pub uses: Vec, } +pub type InviteCode = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct InviteCodeUse { +pub struct InviteCodeUseData { pub used_at: crate::types::string::Datetime, pub used_by: crate::types::string::Did, } +pub type InviteCodeUse = crate::types::Object; diff --git a/atrium-api/src/com/atproto/server/delete_account.rs b/atrium-api/src/com/atproto/server/delete_account.rs index eaa4e955..fa982f69 100644 --- a/atrium-api/src/com/atproto/server/delete_account.rs +++ b/atrium-api/src/com/atproto/server/delete_account.rs @@ -3,11 +3,12 @@ pub const NSID: &str = "com.atproto.server.deleteAccount"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub did: crate::types::string::Did, pub password: String, pub token: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/server/describe_server.rs b/atrium-api/src/com/atproto/server/describe_server.rs index 4d205645..40945aaf 100644 --- a/atrium-api/src/com/atproto/server/describe_server.rs +++ b/atrium-api/src/com/atproto/server/describe_server.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.server.describeServer"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { ///List of domain suffixes that can be used in account handles. pub available_user_domains: Vec, ///Contact information @@ -20,6 +20,7 @@ pub struct Output { #[serde(skip_serializing_if = "Option::is_none")] pub phone_verification_required: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -30,15 +31,17 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Contact { +pub struct ContactData { #[serde(skip_serializing_if = "Option::is_none")] pub email: Option, } +pub type Contact = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Links { +pub struct LinksData { #[serde(skip_serializing_if = "Option::is_none")] pub privacy_policy: Option, #[serde(skip_serializing_if = "Option::is_none")] pub terms_of_service: Option, } +pub type Links = crate::types::Object; diff --git a/atrium-api/src/com/atproto/server/get_account_invite_codes.rs b/atrium-api/src/com/atproto/server/get_account_invite_codes.rs index 0443ca84..fcf1a4d2 100644 --- a/atrium-api/src/com/atproto/server/get_account_invite_codes.rs +++ b/atrium-api/src/com/atproto/server/get_account_invite_codes.rs @@ -3,18 +3,20 @@ pub const NSID: &str = "com.atproto.server.getAccountInviteCodes"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///Controls whether any new 'earned' but not 'created' invites should be created. #[serde(skip_serializing_if = "Option::is_none")] pub create_available: Option, #[serde(skip_serializing_if = "Option::is_none")] pub include_used: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub codes: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/server/get_service_auth.rs b/atrium-api/src/com/atproto/server/get_service_auth.rs index 6bcdb668..2505f01d 100644 --- a/atrium-api/src/com/atproto/server/get_service_auth.rs +++ b/atrium-api/src/com/atproto/server/get_service_auth.rs @@ -3,15 +3,17 @@ pub const NSID: &str = "com.atproto.server.getServiceAuth"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The DID of the service that the token will be used to authenticate with pub aud: crate::types::string::Did, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub token: String, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/server/get_session.rs b/atrium-api/src/com/atproto/server/get_session.rs index 45d62788..c738c56c 100644 --- a/atrium-api/src/com/atproto/server/get_session.rs +++ b/atrium-api/src/com/atproto/server/get_session.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.server.getSession"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub active: Option, pub did: crate::types::string::Did, @@ -20,6 +20,7 @@ pub struct Output { #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/server/list_app_passwords.rs b/atrium-api/src/com/atproto/server/list_app_passwords.rs index 7778af05..220b38c8 100644 --- a/atrium-api/src/com/atproto/server/list_app_passwords.rs +++ b/atrium-api/src/com/atproto/server/list_app_passwords.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "com.atproto.server.listAppPasswords"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub passwords: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { @@ -26,9 +27,10 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct AppPassword { +pub struct AppPasswordData { pub created_at: crate::types::string::Datetime, pub name: String, #[serde(skip_serializing_if = "Option::is_none")] pub privileged: Option, } +pub type AppPassword = crate::types::Object; diff --git a/atrium-api/src/com/atproto/server/refresh_session.rs b/atrium-api/src/com/atproto/server/refresh_session.rs index c932cd25..35af09fb 100644 --- a/atrium-api/src/com/atproto/server/refresh_session.rs +++ b/atrium-api/src/com/atproto/server/refresh_session.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.server.refreshSession"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub access_jwt: String, #[serde(skip_serializing_if = "Option::is_none")] pub active: Option, @@ -16,6 +16,7 @@ pub struct Output { #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/server/request_email_update.rs b/atrium-api/src/com/atproto/server/request_email_update.rs index 1f569e07..690369c1 100644 --- a/atrium-api/src/com/atproto/server/request_email_update.rs +++ b/atrium-api/src/com/atproto/server/request_email_update.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "com.atproto.server.requestEmailUpdate"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub token_required: bool, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/server/request_password_reset.rs b/atrium-api/src/com/atproto/server/request_password_reset.rs index 661a693b..d87ef3fb 100644 --- a/atrium-api/src/com/atproto/server/request_password_reset.rs +++ b/atrium-api/src/com/atproto/server/request_password_reset.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "com.atproto.server.requestPasswordReset"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub email: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/server/reserve_signing_key.rs b/atrium-api/src/com/atproto/server/reserve_signing_key.rs index a24787cb..a11123ac 100644 --- a/atrium-api/src/com/atproto/server/reserve_signing_key.rs +++ b/atrium-api/src/com/atproto/server/reserve_signing_key.rs @@ -3,17 +3,19 @@ pub const NSID: &str = "com.atproto.server.reserveSigningKey"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///The DID to reserve a key for. #[serde(skip_serializing_if = "Option::is_none")] pub did: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { ///The public key for the reserved signing key, in did:key serialization. pub signing_key: String, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/server/reset_password.rs b/atrium-api/src/com/atproto/server/reset_password.rs index 6e5784d0..97c4b39b 100644 --- a/atrium-api/src/com/atproto/server/reset_password.rs +++ b/atrium-api/src/com/atproto/server/reset_password.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "com.atproto.server.resetPassword"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub password: String, pub token: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/server/revoke_app_password.rs b/atrium-api/src/com/atproto/server/revoke_app_password.rs index 4c003a43..c7b3d52f 100644 --- a/atrium-api/src/com/atproto/server/revoke_app_password.rs +++ b/atrium-api/src/com/atproto/server/revoke_app_password.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "com.atproto.server.revokeAppPassword"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub name: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/server/update_email.rs b/atrium-api/src/com/atproto/server/update_email.rs index 966b99f1..b6748fb0 100644 --- a/atrium-api/src/com/atproto/server/update_email.rs +++ b/atrium-api/src/com/atproto/server/update_email.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.server.updateEmail"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub email: String, #[serde(skip_serializing_if = "Option::is_none")] pub email_auth_factor: Option, @@ -11,6 +11,7 @@ pub struct Input { #[serde(skip_serializing_if = "Option::is_none")] pub token: Option, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/sync/get_blob.rs b/atrium-api/src/com/atproto/sync/get_blob.rs index 95cbdab1..c6f906b0 100644 --- a/atrium-api/src/com/atproto/sync/get_blob.rs +++ b/atrium-api/src/com/atproto/sync/get_blob.rs @@ -3,12 +3,13 @@ pub const NSID: &str = "com.atproto.sync.getBlob"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The CID of the blob to fetch pub cid: crate::types::string::Cid, ///The DID of the account. pub did: crate::types::string::Did, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/sync/get_blocks.rs b/atrium-api/src/com/atproto/sync/get_blocks.rs index 3879c352..b7f03e27 100644 --- a/atrium-api/src/com/atproto/sync/get_blocks.rs +++ b/atrium-api/src/com/atproto/sync/get_blocks.rs @@ -3,11 +3,12 @@ pub const NSID: &str = "com.atproto.sync.getBlocks"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub cids: Vec, ///The DID of the repo. pub did: crate::types::string::Did, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/sync/get_checkout.rs b/atrium-api/src/com/atproto/sync/get_checkout.rs index a15c3b00..415dfc86 100644 --- a/atrium-api/src/com/atproto/sync/get_checkout.rs +++ b/atrium-api/src/com/atproto/sync/get_checkout.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "com.atproto.sync.getCheckout"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The DID of the repo. pub did: crate::types::string::Did, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/sync/get_head.rs b/atrium-api/src/com/atproto/sync/get_head.rs index 4a575012..09a67262 100644 --- a/atrium-api/src/com/atproto/sync/get_head.rs +++ b/atrium-api/src/com/atproto/sync/get_head.rs @@ -3,15 +3,17 @@ pub const NSID: &str = "com.atproto.sync.getHead"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The DID of the repo. pub did: crate::types::string::Did, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub root: crate::types::string::Cid, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/sync/get_latest_commit.rs b/atrium-api/src/com/atproto/sync/get_latest_commit.rs index 746b7087..b778b97c 100644 --- a/atrium-api/src/com/atproto/sync/get_latest_commit.rs +++ b/atrium-api/src/com/atproto/sync/get_latest_commit.rs @@ -3,16 +3,18 @@ pub const NSID: &str = "com.atproto.sync.getLatestCommit"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The DID of the repo. pub did: crate::types::string::Did, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub cid: crate::types::string::Cid, pub rev: String, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/sync/get_record.rs b/atrium-api/src/com/atproto/sync/get_record.rs index e6b1abb2..03893139 100644 --- a/atrium-api/src/com/atproto/sync/get_record.rs +++ b/atrium-api/src/com/atproto/sync/get_record.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.sync.getRecord"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub collection: crate::types::string::Nsid, ///DEPRECATED: referenced a repo commit by CID, and retrieved record as of that commit #[serde(skip_serializing_if = "Option::is_none")] @@ -13,6 +13,7 @@ pub struct Parameters { ///Record Key pub rkey: String, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/sync/get_repo.rs b/atrium-api/src/com/atproto/sync/get_repo.rs index 41076d68..64804bbc 100644 --- a/atrium-api/src/com/atproto/sync/get_repo.rs +++ b/atrium-api/src/com/atproto/sync/get_repo.rs @@ -3,13 +3,14 @@ pub const NSID: &str = "com.atproto.sync.getRepo"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The DID of the repo. pub did: crate::types::string::Did, ///The revision ('rev') of the repo to create a diff from. #[serde(skip_serializing_if = "Option::is_none")] pub since: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/sync/get_repo_status.rs b/atrium-api/src/com/atproto/sync/get_repo_status.rs index b8e2af84..a0c43d8b 100644 --- a/atrium-api/src/com/atproto/sync/get_repo_status.rs +++ b/atrium-api/src/com/atproto/sync/get_repo_status.rs @@ -3,13 +3,14 @@ pub const NSID: &str = "com.atproto.sync.getRepoStatus"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The DID of the repo. pub did: crate::types::string::Did, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub active: bool, pub did: crate::types::string::Did, ///Optional field, the current rev of the repo, if active=true @@ -19,6 +20,7 @@ pub struct Output { #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/sync/list_blobs.rs b/atrium-api/src/com/atproto/sync/list_blobs.rs index c4b887e9..54371033 100644 --- a/atrium-api/src/com/atproto/sync/list_blobs.rs +++ b/atrium-api/src/com/atproto/sync/list_blobs.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "com.atproto.sync.listBlobs"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, ///The DID of the repo. @@ -14,13 +14,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub since: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub cids: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { diff --git a/atrium-api/src/com/atproto/sync/list_repos.rs b/atrium-api/src/com/atproto/sync/list_repos.rs index 87bb14a8..b4604ef7 100644 --- a/atrium-api/src/com/atproto/sync/list_repos.rs +++ b/atrium-api/src/com/atproto/sync/list_repos.rs @@ -3,19 +3,21 @@ pub const NSID: &str = "com.atproto.sync.listRepos"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub repos: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -26,7 +28,7 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Repo { +pub struct RepoData { #[serde(skip_serializing_if = "Option::is_none")] pub active: Option, pub did: crate::types::string::Did, @@ -37,3 +39,4 @@ pub struct Repo { #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, } +pub type Repo = crate::types::Object; diff --git a/atrium-api/src/com/atproto/sync/notify_of_update.rs b/atrium-api/src/com/atproto/sync/notify_of_update.rs index f046b12d..be138437 100644 --- a/atrium-api/src/com/atproto/sync/notify_of_update.rs +++ b/atrium-api/src/com/atproto/sync/notify_of_update.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "com.atproto.sync.notifyOfUpdate"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///Hostname of the current service (usually a PDS) that is notifying of update. pub hostname: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/sync/request_crawl.rs b/atrium-api/src/com/atproto/sync/request_crawl.rs index bd33a06f..ec7ee700 100644 --- a/atrium-api/src/com/atproto/sync/request_crawl.rs +++ b/atrium-api/src/com/atproto/sync/request_crawl.rs @@ -3,10 +3,11 @@ pub const NSID: &str = "com.atproto.sync.requestCrawl"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///Hostname of the current service (eg, PDS) that is requesting to be crawled. pub hostname: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/sync/subscribe_repos.rs b/atrium-api/src/com/atproto/sync/subscribe_repos.rs index 4d033307..938a2d7e 100644 --- a/atrium-api/src/com/atproto/sync/subscribe_repos.rs +++ b/atrium-api/src/com/atproto/sync/subscribe_repos.rs @@ -3,11 +3,12 @@ pub const NSID: &str = "com.atproto.sync.subscribeRepos"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///The last known event seq number to backfill from. #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { @@ -37,7 +38,7 @@ impl std::fmt::Display for Error { ///Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Account { +pub struct AccountData { ///Indicates that the account has a repository which can be fetched from the host that emitted this event. pub active: bool, pub did: crate::types::string::Did, @@ -47,10 +48,11 @@ pub struct Account { pub status: Option, pub time: crate::types::string::Datetime, } +pub type Account = crate::types::Object; ///Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Commit { +pub struct CommitData { pub blobs: Vec, ///CAR file containing relevant blocks, as a diff since the previous repo state. #[serde(with = "serde_bytes")] @@ -77,19 +79,21 @@ pub struct Commit { ///Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. pub too_big: bool, } +pub type Commit = crate::types::Object; ///DEPRECATED -- Use #identity event instead #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Handle { +pub struct HandleData { pub did: crate::types::string::Did, pub handle: crate::types::string::Handle, pub seq: i64, pub time: crate::types::string::Datetime, } +pub type Handle = crate::types::Object; ///Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Identity { +pub struct IdentityData { pub did: crate::types::string::Did, ///The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details. #[serde(skip_serializing_if = "Option::is_none")] @@ -97,41 +101,46 @@ pub struct Identity { pub seq: i64, pub time: crate::types::string::Datetime, } +pub type Identity = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Info { +pub struct InfoData { #[serde(skip_serializing_if = "Option::is_none")] pub message: Option, pub name: String, } +pub type Info = crate::types::Object; ///DEPRECATED -- Use #account event instead #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Migrate { +pub struct MigrateData { pub did: crate::types::string::Did, #[serde(skip_serializing_if = "Option::is_none")] pub migrate_to: Option, pub seq: i64, pub time: crate::types::string::Datetime, } +pub type Migrate = crate::types::Object; ///A repo operation, ie a mutation of a single record. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct RepoOp { +pub struct RepoOpData { pub action: String, ///For creates and updates, the new record CID. For deletions, null. #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, pub path: String, } +pub type RepoOp = crate::types::Object; ///DEPRECATED -- Use #account event instead #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Tombstone { +pub struct TombstoneData { pub did: crate::types::string::Did, pub seq: i64, pub time: crate::types::string::Datetime, } +pub type Tombstone = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum Message { diff --git a/atrium-api/src/com/atproto/temp/check_signup_queue.rs b/atrium-api/src/com/atproto/temp/check_signup_queue.rs index 7cd8f5a8..8571dd7b 100644 --- a/atrium-api/src/com/atproto/temp/check_signup_queue.rs +++ b/atrium-api/src/com/atproto/temp/check_signup_queue.rs @@ -3,13 +3,14 @@ pub const NSID: &str = "com.atproto.temp.checkSignupQueue"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub activated: bool, #[serde(skip_serializing_if = "Option::is_none")] pub estimated_time_ms: Option, #[serde(skip_serializing_if = "Option::is_none")] pub place_in_queue: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/temp/fetch_labels.rs b/atrium-api/src/com/atproto/temp/fetch_labels.rs index 2dd2e465..b70cfa43 100644 --- a/atrium-api/src/com/atproto/temp/fetch_labels.rs +++ b/atrium-api/src/com/atproto/temp/fetch_labels.rs @@ -3,17 +3,19 @@ pub const NSID: &str = "com.atproto.temp.fetchLabels"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub since: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub labels: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/com/atproto/temp/request_phone_verification.rs b/atrium-api/src/com/atproto/temp/request_phone_verification.rs index 89b54c5d..61306905 100644 --- a/atrium-api/src/com/atproto/temp/request_phone_verification.rs +++ b/atrium-api/src/com/atproto/temp/request_phone_verification.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "com.atproto.temp.requestPhoneVerification"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub phone_number: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/tools/ozone/communication/create_template.rs b/atrium-api/src/tools/ozone/communication/create_template.rs index 9a85d8d4..50ab264e 100644 --- a/atrium-api/src/tools/ozone/communication/create_template.rs +++ b/atrium-api/src/tools/ozone/communication/create_template.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "tools.ozone.communication.createTemplate"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///Content of the template, markdown supported, can contain variable placeholders. pub content_markdown: String, ///DID of the user who is creating the template. @@ -14,6 +14,7 @@ pub struct Input { ///Subject of the message, used in emails. pub subject: String, } +pub type Input = crate::types::Object; pub type Output = crate::tools::ozone::communication::defs::TemplateView; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] diff --git a/atrium-api/src/tools/ozone/communication/defs.rs b/atrium-api/src/tools/ozone/communication/defs.rs index 6a56982b..4957ac7a 100644 --- a/atrium-api/src/tools/ozone/communication/defs.rs +++ b/atrium-api/src/tools/ozone/communication/defs.rs @@ -2,7 +2,7 @@ //!Definitions for the `tools.ozone.communication.defs` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct TemplateView { +pub struct TemplateViewData { ///Subject of the message, used in emails. pub content_markdown: String, pub created_at: crate::types::string::Datetime, @@ -17,3 +17,4 @@ pub struct TemplateView { pub subject: Option, pub updated_at: crate::types::string::Datetime, } +pub type TemplateView = crate::types::Object; diff --git a/atrium-api/src/tools/ozone/communication/delete_template.rs b/atrium-api/src/tools/ozone/communication/delete_template.rs index 871577d4..7fa9cb6a 100644 --- a/atrium-api/src/tools/ozone/communication/delete_template.rs +++ b/atrium-api/src/tools/ozone/communication/delete_template.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "tools.ozone.communication.deleteTemplate"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub id: String, } +pub type Input = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/tools/ozone/communication/list_templates.rs b/atrium-api/src/tools/ozone/communication/list_templates.rs index 62555439..db978660 100644 --- a/atrium-api/src/tools/ozone/communication/list_templates.rs +++ b/atrium-api/src/tools/ozone/communication/list_templates.rs @@ -3,11 +3,12 @@ pub const NSID: &str = "tools.ozone.communication.listTemplates"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { pub communication_templates: Vec< crate::tools::ozone::communication::defs::TemplateView, >, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/tools/ozone/communication/update_template.rs b/atrium-api/src/tools/ozone/communication/update_template.rs index aed5022c..7dac6036 100644 --- a/atrium-api/src/tools/ozone/communication/update_template.rs +++ b/atrium-api/src/tools/ozone/communication/update_template.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "tools.ozone.communication.updateTemplate"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { ///Content of the template, markdown supported, can contain variable placeholders. #[serde(skip_serializing_if = "Option::is_none")] pub content_markdown: Option, @@ -21,6 +21,7 @@ pub struct Input { #[serde(skip_serializing_if = "Option::is_none")] pub updated_by: Option, } +pub type Input = crate::types::Object; pub type Output = crate::tools::ozone::communication::defs::TemplateView; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] diff --git a/atrium-api/src/tools/ozone/moderation/defs.rs b/atrium-api/src/tools/ozone/moderation/defs.rs index 18ce24b7..5989b6b7 100644 --- a/atrium-api/src/tools/ozone/moderation/defs.rs +++ b/atrium-api/src/tools/ozone/moderation/defs.rs @@ -2,7 +2,7 @@ //!Definitions for the `tools.ozone.moderation.defs` namespace. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct BlobView { +pub struct BlobViewData { pub cid: crate::types::string::Cid, pub created_at: crate::types::string::Datetime, #[serde(skip_serializing_if = "Option::is_none")] @@ -12,38 +12,43 @@ pub struct BlobView { pub moderation: Option, pub size: i64, } +pub type BlobView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ImageDetails { +pub struct ImageDetailsData { pub height: i64, pub width: i64, } +pub type ImageDetails = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventAcknowledge { +pub struct ModEventAcknowledgeData { #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, } +pub type ModEventAcknowledge = crate::types::Object; ///Add a comment to a subject #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventComment { +pub struct ModEventCommentData { pub comment: String, ///Make the comment persistent on the subject #[serde(skip_serializing_if = "Option::is_none")] pub sticky: Option, } +pub type ModEventComment = crate::types::Object; ///Divert a record's blobs to a 3rd party service for further scanning/tagging #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventDivert { +pub struct ModEventDivertData { #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, } +pub type ModEventDivert = crate::types::Object; ///Keep a log of outgoing email to a user #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventEmail { +pub struct ModEventEmailData { ///Additional comment about the outgoing comm. #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, @@ -53,43 +58,48 @@ pub struct ModEventEmail { ///The subject line of the email sent to the user. pub subject_line: String, } +pub type ModEventEmail = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventEscalate { +pub struct ModEventEscalateData { #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, } +pub type ModEventEscalate = crate::types::Object; ///Apply/Negate labels on a subject #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventLabel { +pub struct ModEventLabelData { #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, pub create_label_vals: Vec, pub negate_label_vals: Vec, } +pub type ModEventLabel = crate::types::Object; ///Mute incoming reports on a subject #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventMute { +pub struct ModEventMuteData { #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, ///Indicates how long the subject should remain muted. pub duration_in_hours: i64, } +pub type ModEventMute = crate::types::Object; ///Mute incoming reports from an account #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventMuteReporter { +pub struct ModEventMuteReporterData { #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, ///Indicates how long the account should remain muted. pub duration_in_hours: i64, } +pub type ModEventMuteReporter = crate::types::Object; ///Report a subject #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventReport { +pub struct ModEventReportData { #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, ///Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject. @@ -97,26 +107,29 @@ pub struct ModEventReport { pub is_reporter_muted: Option, pub report_type: crate::com::atproto::moderation::defs::ReasonType, } +pub type ModEventReport = crate::types::Object; ///Resolve appeal on a subject #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventResolveAppeal { +pub struct ModEventResolveAppealData { ///Describe resolution. #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, } +pub type ModEventResolveAppeal = crate::types::Object; ///Revert take down action on a subject #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventReverseTakedown { +pub struct ModEventReverseTakedownData { ///Describe reasoning behind the reversal. #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, } +pub type ModEventReverseTakedown = crate::types::Object; ///Add/Remove a tag on a subject #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventTag { +pub struct ModEventTagData { ///Tags to be added to the subject. If already exists, won't be duplicated. pub add: Vec, ///Additional comment about added/removed tags. @@ -125,35 +138,39 @@ pub struct ModEventTag { ///Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. pub remove: Vec, } +pub type ModEventTag = crate::types::Object; ///Take down a subject permanently or temporarily #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventTakedown { +pub struct ModEventTakedownData { #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, ///Indicates how long the takedown should be in effect before automatically expiring. #[serde(skip_serializing_if = "Option::is_none")] pub duration_in_hours: Option, } +pub type ModEventTakedown = crate::types::Object; ///Unmute action on a subject #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventUnmute { +pub struct ModEventUnmuteData { ///Describe reasoning behind the reversal. #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, } +pub type ModEventUnmute = crate::types::Object; ///Unmute incoming reports from an account #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventUnmuteReporter { +pub struct ModEventUnmuteReporterData { ///Describe reasoning behind the reversal. #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, } +pub type ModEventUnmuteReporter = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventView { +pub struct ModEventViewData { pub created_at: crate::types::string::Datetime, pub created_by: crate::types::string::Did, #[serde(skip_serializing_if = "Option::is_none")] @@ -165,9 +182,10 @@ pub struct ModEventView { #[serde(skip_serializing_if = "Option::is_none")] pub subject_handle: Option, } +pub type ModEventView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModEventViewDetail { +pub struct ModEventViewDetailData { pub created_at: crate::types::string::Datetime, pub created_by: crate::types::string::Did, pub event: crate::types::Union, @@ -175,21 +193,24 @@ pub struct ModEventViewDetail { pub subject: crate::types::Union, pub subject_blobs: Vec, } +pub type ModEventViewDetail = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Moderation { +pub struct ModerationData { #[serde(skip_serializing_if = "Option::is_none")] pub subject_status: Option, } +pub type Moderation = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModerationDetail { +pub struct ModerationDetailData { #[serde(skip_serializing_if = "Option::is_none")] pub subject_status: Option, } +pub type ModerationDetail = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct RecordView { +pub struct RecordViewData { pub blob_cids: Vec, pub cid: crate::types::string::Cid, pub indexed_at: crate::types::string::Datetime, @@ -198,9 +219,10 @@ pub struct RecordView { pub uri: String, pub value: crate::records::Record, } +pub type RecordView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct RecordViewDetail { +pub struct RecordViewDetailData { pub blobs: Vec, pub cid: crate::types::string::Cid, pub indexed_at: crate::types::string::Datetime, @@ -211,14 +233,16 @@ pub struct RecordViewDetail { pub uri: String, pub value: crate::records::Record, } +pub type RecordViewDetail = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct RecordViewNotFound { +pub struct RecordViewNotFoundData { pub uri: String, } +pub type RecordViewNotFound = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct RepoView { +pub struct RepoViewData { #[serde(skip_serializing_if = "Option::is_none")] pub deactivated_at: Option, pub did: crate::types::string::Did, @@ -235,9 +259,10 @@ pub struct RepoView { pub moderation: Moderation, pub related_records: Vec, } +pub type RepoView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct RepoViewDetail { +pub struct RepoViewDetailData { #[serde(skip_serializing_if = "Option::is_none")] pub deactivated_at: Option, pub did: crate::types::string::Did, @@ -260,11 +285,13 @@ pub struct RepoViewDetail { pub moderation: ModerationDetail, pub related_records: Vec, } +pub type RepoViewDetail = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct RepoViewNotFound { +pub struct RepoViewNotFoundData { pub did: crate::types::string::Did, } +pub type RepoViewNotFound = crate::types::Object; ///Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator pub const REVIEW_CLOSED: &str = "tools.ozone.moderation.defs#reviewClosed"; ///Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator @@ -276,7 +303,7 @@ pub const REVIEW_OPEN: &str = "tools.ozone.moderation.defs#reviewOpen"; pub type SubjectReviewState = String; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct SubjectStatusView { +pub struct SubjectStatusViewData { ///True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. #[serde(skip_serializing_if = "Option::is_none")] pub appealed: Option, @@ -314,13 +341,15 @@ pub struct SubjectStatusView { ///Timestamp referencing when the last update was made to the moderation status of the subject pub updated_at: crate::types::string::Datetime, } +pub type SubjectStatusView = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct VideoDetails { +pub struct VideoDetailsData { pub height: i64, pub length: i64, pub width: i64, } +pub type VideoDetails = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] pub enum BlobViewDetailsRefs { diff --git a/atrium-api/src/tools/ozone/moderation/emit_event.rs b/atrium-api/src/tools/ozone/moderation/emit_event.rs index ac6e17d8..0633f011 100644 --- a/atrium-api/src/tools/ozone/moderation/emit_event.rs +++ b/atrium-api/src/tools/ozone/moderation/emit_event.rs @@ -3,13 +3,14 @@ pub const NSID: &str = "tools.ozone.moderation.emitEvent"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Input { +pub struct InputData { pub created_by: crate::types::string::Did, pub event: crate::types::Union, pub subject: crate::types::Union, #[serde(skip_serializing_if = "Option::is_none")] pub subject_blob_cids: Option>, } +pub type Input = crate::types::Object; pub type Output = crate::tools::ozone::moderation::defs::ModEventView; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] diff --git a/atrium-api/src/tools/ozone/moderation/get_event.rs b/atrium-api/src/tools/ozone/moderation/get_event.rs index 32fe4ff9..c654d0c6 100644 --- a/atrium-api/src/tools/ozone/moderation/get_event.rs +++ b/atrium-api/src/tools/ozone/moderation/get_event.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "tools.ozone.moderation.getEvent"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub id: i64, } +pub type Parameters = crate::types::Object; pub type Output = crate::tools::ozone::moderation::defs::ModEventViewDetail; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] diff --git a/atrium-api/src/tools/ozone/moderation/get_record.rs b/atrium-api/src/tools/ozone/moderation/get_record.rs index 1b6083fc..a7742b35 100644 --- a/atrium-api/src/tools/ozone/moderation/get_record.rs +++ b/atrium-api/src/tools/ozone/moderation/get_record.rs @@ -3,11 +3,12 @@ pub const NSID: &str = "tools.ozone.moderation.getRecord"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, pub uri: String, } +pub type Parameters = crate::types::Object; pub type Output = crate::tools::ozone::moderation::defs::RecordViewDetail; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] diff --git a/atrium-api/src/tools/ozone/moderation/get_repo.rs b/atrium-api/src/tools/ozone/moderation/get_repo.rs index 0d0e6b92..9a432168 100644 --- a/atrium-api/src/tools/ozone/moderation/get_repo.rs +++ b/atrium-api/src/tools/ozone/moderation/get_repo.rs @@ -3,9 +3,10 @@ pub const NSID: &str = "tools.ozone.moderation.getRepo"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { pub did: crate::types::string::Did, } +pub type Parameters = crate::types::Object; pub type Output = crate::tools::ozone::moderation::defs::RepoViewDetail; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] diff --git a/atrium-api/src/tools/ozone/moderation/query_events.rs b/atrium-api/src/tools/ozone/moderation/query_events.rs index 02dca69f..6978d3da 100644 --- a/atrium-api/src/tools/ozone/moderation/query_events.rs +++ b/atrium-api/src/tools/ozone/moderation/query_events.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "tools.ozone.moderation.queryEvents"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///If specified, only events where all of these labels were added are returned #[serde(skip_serializing_if = "Option::is_none")] pub added_labels: Option>, @@ -48,13 +48,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub types: Option>, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub events: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/tools/ozone/moderation/query_statuses.rs b/atrium-api/src/tools/ozone/moderation/query_statuses.rs index 864e605c..1ffc065b 100644 --- a/atrium-api/src/tools/ozone/moderation/query_statuses.rs +++ b/atrium-api/src/tools/ozone/moderation/query_statuses.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "tools.ozone.moderation.queryStatuses"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { ///Get subjects in unresolved appealed status #[serde(skip_serializing_if = "Option::is_none")] pub appealed: Option, @@ -54,13 +54,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub takendown: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub subject_statuses: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/tools/ozone/moderation/search_repos.rs b/atrium-api/src/tools/ozone/moderation/search_repos.rs index 3102ecc7..3eb9319d 100644 --- a/atrium-api/src/tools/ozone/moderation/search_repos.rs +++ b/atrium-api/src/tools/ozone/moderation/search_repos.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "tools.ozone.moderation.searchRepos"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Parameters { +pub struct ParametersData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -14,13 +14,15 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub term: Option, } +pub type Parameters = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub repos: Vec, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} diff --git a/atrium-api/src/tools/ozone/server/get_config.rs b/atrium-api/src/tools/ozone/server/get_config.rs index 6f46bf7d..a58555d6 100644 --- a/atrium-api/src/tools/ozone/server/get_config.rs +++ b/atrium-api/src/tools/ozone/server/get_config.rs @@ -3,7 +3,7 @@ pub const NSID: &str = "tools.ozone.server.getConfig"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct Output { +pub struct OutputData { #[serde(skip_serializing_if = "Option::is_none")] pub appview: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -15,6 +15,7 @@ pub struct Output { #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option, } +pub type Output = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error {} @@ -25,13 +26,15 @@ impl std::fmt::Display for Error { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ServiceConfig { +pub struct ServiceConfigData { #[serde(skip_serializing_if = "Option::is_none")] pub url: Option, } +pub type ServiceConfig = crate::types::Object; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ViewerConfig { +pub struct ViewerConfigData { #[serde(skip_serializing_if = "Option::is_none")] pub role: Option, } +pub type ViewerConfig = crate::types::Object; diff --git a/atrium-api/src/types.rs b/atrium-api/src/types.rs index 57201936..73d1d2b4 100644 --- a/atrium-api/src/types.rs +++ b/atrium-api/src/types.rs @@ -3,6 +3,7 @@ use ipld_core::ipld::Ipld; use std::fmt; +use std::ops::{Deref, DerefMut}; mod cid_link; pub use cid_link::CidLink; @@ -87,6 +88,38 @@ pub struct Blob { pub size: usize, // TODO } +/// A generic object type. +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] +pub struct Object { + #[serde(flatten)] + pub data: T, + #[serde(flatten)] + pub extra_data: Ipld, +} + +impl From for Object { + fn from(data: T) -> Self { + Self { + data, + extra_data: Ipld::Map(std::collections::BTreeMap::new()), + } + } +} + +impl Deref for Object { + type Target = T; + + fn deref(&self) -> &Self::Target { + &self.data + } +} + +impl DerefMut for Object { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.data + } +} + /// An "open" union type. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(untagged)] @@ -96,7 +129,7 @@ pub enum Union { } /// The data of variants represented by a map and include a `$type` field indicating the variant type. -#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] pub struct UnknownData { #[serde(rename = "$type")] pub r#type: String, @@ -104,8 +137,6 @@ pub struct UnknownData { pub data: Ipld, } -impl Eq for UnknownData {} - #[cfg(test)] mod tests { use super::*; diff --git a/atrium-cli/src/runner.rs b/atrium-cli/src/runner.rs index c6124a89..4213dbe3 100644 --- a/atrium-cli/src/runner.rs +++ b/atrium-cli/src/runner.rs @@ -58,11 +58,14 @@ impl Runner { .app .bsky .feed - .get_timeline(atrium_api::app::bsky::feed::get_timeline::Parameters { - algorithm: None, - cursor: None, - limit: Some(limit), - }) + .get_timeline( + atrium_api::app::bsky::feed::get_timeline::ParametersData { + algorithm: None, + cursor: None, + limit: Some(limit), + } + .into(), + ) .await?, ), Command::GetAuthorFeed(args) => self.print( @@ -72,15 +75,18 @@ impl Runner { .app .bsky .feed - .get_author_feed(atrium_api::app::bsky::feed::get_author_feed::Parameters { - actor: args - .actor - .or(self.handle.clone().map(AtIdentifier::Handle)) - .with_context(|| "Not logged in")?, - cursor: None, - filter: None, - limit: Some(limit), - }) + .get_author_feed( + atrium_api::app::bsky::feed::get_author_feed::ParametersData { + actor: args + .actor + .or(self.handle.clone().map(AtIdentifier::Handle)) + .with_context(|| "Not logged in")?, + cursor: None, + filter: None, + limit: Some(limit), + } + .into(), + ) .await?, ), Command::GetLikes(args) => self.print( @@ -90,12 +96,15 @@ impl Runner { .app .bsky .feed - .get_likes(atrium_api::app::bsky::feed::get_likes::Parameters { - cid: None, - cursor: None, - limit: Some(limit), - uri: args.uri.to_string(), - }) + .get_likes( + atrium_api::app::bsky::feed::get_likes::ParametersData { + cid: None, + cursor: None, + limit: Some(limit), + uri: args.uri.to_string(), + } + .into(), + ) .await?, ), Command::GetRepostedBy(args) => self.print( @@ -105,12 +114,15 @@ impl Runner { .app .bsky .feed - .get_reposted_by(atrium_api::app::bsky::feed::get_reposted_by::Parameters { - cid: None, - cursor: None, - limit: Some(limit), - uri: args.uri.to_string(), - }) + .get_reposted_by( + atrium_api::app::bsky::feed::get_reposted_by::ParametersData { + cid: None, + cursor: None, + limit: Some(limit), + uri: args.uri.to_string(), + } + .into(), + ) .await?, ), Command::GetActorFeeds(args) => self.print( @@ -120,14 +132,17 @@ impl Runner { .app .bsky .feed - .get_actor_feeds(atrium_api::app::bsky::feed::get_actor_feeds::Parameters { - actor: args - .actor - .or(self.handle.clone().map(AtIdentifier::Handle)) - .with_context(|| "Not logged in")?, - cursor: None, - limit: Some(limit), - }) + .get_actor_feeds( + atrium_api::app::bsky::feed::get_actor_feeds::ParametersData { + actor: args + .actor + .or(self.handle.clone().map(AtIdentifier::Handle)) + .with_context(|| "Not logged in")?, + cursor: None, + limit: Some(limit), + } + .into(), + ) .await?, ), Command::GetFeed(args) => self.print( @@ -137,11 +152,14 @@ impl Runner { .app .bsky .feed - .get_feed(atrium_api::app::bsky::feed::get_feed::Parameters { - cursor: None, - feed: args.uri.to_string(), - limit: Some(limit), - }) + .get_feed( + atrium_api::app::bsky::feed::get_feed::ParametersData { + cursor: None, + feed: args.uri.to_string(), + limit: Some(limit), + } + .into(), + ) .await?, ), Command::GetListFeed(args) => self.print( @@ -151,11 +169,14 @@ impl Runner { .app .bsky .feed - .get_list_feed(atrium_api::app::bsky::feed::get_list_feed::Parameters { - cursor: None, - limit: Some(limit), - list: args.uri.to_string(), - }) + .get_list_feed( + atrium_api::app::bsky::feed::get_list_feed::ParametersData { + cursor: None, + limit: Some(limit), + list: args.uri.to_string(), + } + .into(), + ) .await?, ), Command::GetFollows(args) => self.print( @@ -165,14 +186,17 @@ impl Runner { .app .bsky .graph - .get_follows(atrium_api::app::bsky::graph::get_follows::Parameters { - actor: args - .actor - .or(self.handle.clone().map(AtIdentifier::Handle)) - .with_context(|| "Not logged in")?, - cursor: None, - limit: Some(limit), - }) + .get_follows( + atrium_api::app::bsky::graph::get_follows::ParametersData { + actor: args + .actor + .or(self.handle.clone().map(AtIdentifier::Handle)) + .with_context(|| "Not logged in")?, + cursor: None, + limit: Some(limit), + } + .into(), + ) .await?, ), Command::GetFollowers(args) => self.print( @@ -182,14 +206,17 @@ impl Runner { .app .bsky .graph - .get_followers(atrium_api::app::bsky::graph::get_followers::Parameters { - actor: args - .actor - .or(self.handle.clone().map(AtIdentifier::Handle)) - .with_context(|| "Not logged in")?, - cursor: None, - limit: Some(limit), - }) + .get_followers( + atrium_api::app::bsky::graph::get_followers::ParametersData { + actor: args + .actor + .or(self.handle.clone().map(AtIdentifier::Handle)) + .with_context(|| "Not logged in")?, + cursor: None, + limit: Some(limit), + } + .into(), + ) .await?, ), Command::GetLists(args) => self.print( @@ -199,14 +226,17 @@ impl Runner { .app .bsky .graph - .get_lists(atrium_api::app::bsky::graph::get_lists::Parameters { - actor: args - .actor - .or(self.handle.clone().map(AtIdentifier::Handle)) - .with_context(|| "Not logged in")?, - cursor: None, - limit: Some(limit), - }) + .get_lists( + atrium_api::app::bsky::graph::get_lists::ParametersData { + actor: args + .actor + .or(self.handle.clone().map(AtIdentifier::Handle)) + .with_context(|| "Not logged in")?, + cursor: None, + limit: Some(limit), + } + .into(), + ) .await?, ), Command::GetList(args) => self.print( @@ -216,11 +246,14 @@ impl Runner { .app .bsky .graph - .get_list(atrium_api::app::bsky::graph::get_list::Parameters { - cursor: None, - limit: Some(limit), - list: args.uri.to_string(), - }) + .get_list( + atrium_api::app::bsky::graph::get_list::ParametersData { + cursor: None, + limit: Some(limit), + list: args.uri.to_string(), + } + .into(), + ) .await?, ), Command::GetProfile(args) => self.print( @@ -230,12 +263,15 @@ impl Runner { .app .bsky .actor - .get_profile(atrium_api::app::bsky::actor::get_profile::Parameters { - actor: args - .actor - .or(self.handle.clone().map(AtIdentifier::Handle)) - .with_context(|| "Not logged in")?, - }) + .get_profile( + atrium_api::app::bsky::actor::get_profile::ParametersData { + actor: args + .actor + .or(self.handle.clone().map(AtIdentifier::Handle)) + .with_context(|| "Not logged in")?, + } + .into(), + ) .await?, ), Command::GetPreferences => self.print( @@ -245,7 +281,9 @@ impl Runner { .app .bsky .actor - .get_preferences(atrium_api::app::bsky::actor::get_preferences::Parameters {}) + .get_preferences( + atrium_api::app::bsky::actor::get_preferences::ParametersData {}.into(), + ) .await?, ), Command::ListNotifications => self.print( @@ -256,11 +294,12 @@ impl Runner { .bsky .notification .list_notifications( - atrium_api::app::bsky::notification::list_notifications::Parameters { + atrium_api::app::bsky::notification::list_notifications::ParametersData { cursor: None, limit: Some(limit), seen_at: None, - }, + } + .into(), ) .await?, ), @@ -274,28 +313,32 @@ impl Runner { .chat .bsky .convo - .list_convos(atrium_api::chat::bsky::convo::list_convos::Parameters { - cursor: None, - limit: Some(limit), - }) + .list_convos( + atrium_api::chat::bsky::convo::list_convos::ParametersData { + cursor: None, + limit: Some(limit), + } + .into(), + ) .await?, ), Command::SendConvoMessage(args) => { let did = match args.actor { - AtIdentifier::Handle(handle) => { - self.agent - .api - .com - .atproto - .identity - .resolve_handle( - atrium_api::com::atproto::identity::resolve_handle::Parameters { - handle: handle.clone(), - }, - ) - .await? - .did - } + AtIdentifier::Handle(handle) => self + .agent + .api + .com + .atproto + .identity + .resolve_handle( + atrium_api::com::atproto::identity::resolve_handle::ParametersData { + handle: handle.clone(), + } + .into(), + ) + .await? + .data + .did, AtIdentifier::Did(did) => did, }; let chat = &self @@ -309,23 +352,28 @@ impl Runner { .bsky .convo .get_convo_for_members( - atrium_api::chat::bsky::convo::get_convo_for_members::Parameters { + atrium_api::chat::bsky::convo::get_convo_for_members::ParametersData { members: vec![did], - }, + } + .into(), ) .await?; self.print( &chat .bsky .convo - .send_message(atrium_api::chat::bsky::convo::send_message::Input { - convo_id: convo.convo.id, - message: atrium_api::chat::bsky::convo::defs::MessageInput { - embed: None, - facets: None, - text: args.text, - }, - }) + .send_message( + atrium_api::chat::bsky::convo::send_message::InputData { + convo_id: convo.data.convo.data.id, + message: atrium_api::chat::bsky::convo::defs::MessageInputData { + embed: None, + facets: None, + text: args.text, + } + .into(), + } + .into(), + ) .await?, ) } @@ -344,20 +392,23 @@ impl Runner { .upload_blob(buf) .await .expect("upload blob"); - images.push(atrium_api::app::bsky::embed::images::Image { - alt: image - .file_name() - .map(OsStr::to_string_lossy) - .unwrap_or_default() - .into(), - aspect_ratio: None, - image: output.blob, - }) + images.push( + atrium_api::app::bsky::embed::images::ImageData { + alt: image + .file_name() + .map(OsStr::to_string_lossy) + .unwrap_or_default() + .into(), + aspect_ratio: None, + image: output.data.blob, + } + .into(), + ) } } let embed = Some(atrium_api::types::Union::Refs( atrium_api::app::bsky::feed::post::RecordEmbedRefs::AppBskyEmbedImagesMain( - Box::new(atrium_api::app::bsky::embed::images::Main { images }), + Box::new(atrium_api::app::bsky::embed::images::MainData { images }.into()), ), )); self.print( @@ -367,26 +418,30 @@ impl Runner { .com .atproto .repo - .create_record(atrium_api::com::atproto::repo::create_record::Input { - collection: "app.bsky.feed.post".parse().expect("valid"), - record: Record::Known(KnownRecord::AppBskyFeedPost(Box::new( - atrium_api::app::bsky::feed::post::Record { - created_at: Datetime::now(), - embed, - entities: None, - facets: None, - labels: None, - langs: None, - reply: None, - tags: None, - text: args.text, - }, - ))), - repo: self.handle.clone().with_context(|| "Not logged in")?.into(), - rkey: None, - swap_commit: None, - validate: None, - }) + .create_record( + atrium_api::com::atproto::repo::create_record::InputData { + collection: "app.bsky.feed.post".parse().expect("valid"), + record: Record::Known(KnownRecord::AppBskyFeedPost(Box::new( + atrium_api::app::bsky::feed::post::RecordData { + created_at: Datetime::now(), + embed, + entities: None, + facets: None, + labels: None, + langs: None, + reply: None, + tags: None, + text: args.text, + } + .into(), + ))), + repo: self.handle.clone().with_context(|| "Not logged in")?.into(), + rkey: None, + swap_commit: None, + validate: None, + } + .into(), + ) .await?, ) } @@ -397,13 +452,16 @@ impl Runner { .com .atproto .repo - .delete_record(atrium_api::com::atproto::repo::delete_record::Input { - collection: "app.bsky.feed.post".parse().expect("valid"), - repo: self.handle.clone().with_context(|| "Not logged in")?.into(), - rkey: args.uri.rkey, - swap_commit: None, - swap_record: None, - }) + .delete_record( + atrium_api::com::atproto::repo::delete_record::InputData { + collection: "app.bsky.feed.post".parse().expect("valid"), + repo: self.handle.clone().with_context(|| "Not logged in")?.into(), + rkey: args.uri.rkey, + swap_commit: None, + swap_record: None, + } + .into(), + ) .await?, ), } diff --git a/bsky-sdk/README.md b/bsky-sdk/README.md index b18b1f69..f8d1946b 100644 --- a/bsky-sdk/README.md +++ b/bsky-sdk/README.md @@ -80,19 +80,21 @@ async fn main() -> Result<(), Box> { let moderator = agent.moderator(&preferences).await?; // in feeds - for feed_view_post in agent + let output = agent .api .app .bsky .feed - .get_timeline(atrium_api::app::bsky::feed::get_timeline::Parameters { - algorithm: None, - cursor: None, - limit: None, - }) - .await? - .feed - { + .get_timeline( + atrium_api::app::bsky::feed::get_timeline::ParametersData { + algorithm: None, + cursor: None, + limit: None, + } + .into(), + ) + .await?; + for feed_view_post in &output.feed { // We call the appropriate moderation function for the content let post_mod = moderator.moderate_post(&feed_view_post.post); // don't include in feeds? @@ -127,7 +129,7 @@ async fn main() -> Result<(), Box> { assert!(segments[2].text == ", check out this link: "); assert!(segments[3].text == "https://example.com" && segments[3].link().is_some()); - let post_record = atrium_api::app::bsky::feed::post::Record { + let record_data = atrium_api::app::bsky::feed::post::RecordData { created_at: atrium_api::types::string::Datetime::now(), embed: None, entities: None, @@ -138,7 +140,7 @@ async fn main() -> Result<(), Box> { tags: None, text: rt.text, }; - println!("{:?}", post_record); + println!("{:?}", record_data); Ok(()) } ``` diff --git a/bsky-sdk/src/agent.rs b/bsky-sdk/src/agent.rs index cc4d761e..455e4a94 100644 --- a/bsky-sdk/src/agent.rs +++ b/bsky-sdk/src/agent.rs @@ -7,11 +7,11 @@ use self::config::Config; use crate::error::Result; use crate::moderation::util::interpret_label_value_definitions; use crate::moderation::{ModerationPrefsLabeler, Moderator}; -use crate::preference::Preferences; +use crate::preference::{FeedViewPreferenceData, Preferences, ThreadViewPreferenceData}; use atrium_api::agent::store::MemorySessionStore; use atrium_api::agent::{store::SessionStore, AtpAgent}; use atrium_api::app::bsky::actor::defs::{LabelersPref, PreferencesItem}; -use atrium_api::types::Union; +use atrium_api::types::{Object, Union}; use atrium_api::xrpc::XrpcClient; #[cfg(feature = "default-client")] use atrium_xrpc_client::reqwest::ReqwestClient; @@ -78,6 +78,8 @@ where } /// Get the logged-in user's [`Preferences`]. /// + /// This implementation does not perform migration of `SavedFeedsPref` to V2. + /// /// # Arguments /// /// `enable_bsky_labeler` - If `true`, the [Bluesky's moderation labeler](atrium_api::agent::bluesky::BSKY_LABELER_DID) will be included in the moderation preferences. @@ -95,8 +97,11 @@ where .app .bsky .actor - .get_preferences(atrium_api::app::bsky::actor::get_preferences::Parameters {}) + .get_preferences( + atrium_api::app::bsky::actor::get_preferences::ParametersData {}.into(), + ) .await? + .data .preferences { match pref { @@ -106,20 +111,62 @@ where Union::Refs(PreferencesItem::ContentLabelPref(p)) => { label_prefs.push(p); } + Union::Refs(PreferencesItem::SavedFeedsPrefV2(p)) => { + prefs.saved_feeds = p.data.items; + } + Union::Refs(PreferencesItem::FeedViewPref(p)) => { + let mut pref = FeedViewPreferenceData::default(); + if let Some(v) = p.hide_replies { + pref.hide_replies = v; + } + if let Some(v) = p.hide_replies_by_unfollowed { + pref.hide_replies_by_unfollowed = v; + } + if let Some(v) = p.hide_replies_by_like_count { + pref.hide_replies_by_like_count = v; + } + if let Some(v) = p.hide_reposts { + pref.hide_reposts = v; + } + if let Some(v) = p.hide_quote_posts { + pref.hide_quote_posts = v; + } + prefs.feed_view_prefs.insert( + p.data.feed, + Object { + data: pref, + extra_data: p.extra_data, // pass through extra data + }, + ); + } + Union::Refs(PreferencesItem::ThreadViewPref(p)) => { + let mut pref = ThreadViewPreferenceData::default(); + if let Some(v) = &p.sort { + pref.sort = v.clone(); + } + if let Some(v) = p.prioritize_followed_users { + pref.prioritize_followed_users = v; + } + prefs.thread_view_prefs = Object { + data: pref, + extra_data: p.extra_data, // pass through extra data + }; + } Union::Refs(PreferencesItem::MutedWordsPref(p)) => { - prefs.moderation_prefs.muted_words = p.items; + prefs.moderation_prefs.muted_words = p.data.items; } Union::Refs(PreferencesItem::HiddenPostsPref(p)) => { - prefs.moderation_prefs.hidden_posts = p.items; + prefs.moderation_prefs.hidden_posts = p.data.items; } Union::Unknown(u) => { if u.r#type == "app.bsky.actor.defs#labelersPref" { prefs.moderation_prefs.labelers.extend( from_ipld::(u.data)? + .data .labelers .into_iter() .map(|item| ModerationPrefsLabeler { - did: item.did, + did: item.data.did, labels: HashMap::default(), is_default_labeler: false, }), @@ -132,7 +179,7 @@ where } } for pref in label_prefs { - if let Some(did) = pref.labeler_did { + if let Some(did) = pref.data.labeler_did { if let Some(l) = prefs .moderation_prefs .labelers @@ -140,14 +187,14 @@ where .find(|l| l.did == did) { l.labels.insert( - pref.label, - pref.visibility.parse().expect("invalid visibility"), + pref.data.label, + pref.data.visibility.parse().expect("invalid visibility"), ); } } else { prefs.moderation_prefs.labels.insert( - pref.label, - pref.visibility.parse().expect("invalid visibility"), + pref.data.label, + pref.data.visibility.parse().expect("invalid visibility"), ); } } @@ -171,24 +218,26 @@ where } /// Make a [`Moderator`] instance with the provided [`Preferences`]. pub async fn moderator(&self, preferences: &Preferences) -> Result { - let labelers = self + let output = self .api .app .bsky .labeler - .get_services(atrium_api::app::bsky::labeler::get_services::Parameters { - detailed: Some(true), - dids: preferences - .moderation_prefs - .labelers - .iter() - .map(|labeler| labeler.did.clone()) - .collect(), - }) - .await? - .views; - let mut label_defs = HashMap::with_capacity(labelers.len()); - for labeler in &labelers { + .get_services( + atrium_api::app::bsky::labeler::get_services::ParametersData { + detailed: Some(true), + dids: preferences + .moderation_prefs + .labelers + .iter() + .map(|labeler| labeler.did.clone()) + .collect(), + } + .into(), + ) + .await?; + let mut label_defs = HashMap::with_capacity(output.views.len()); + for labeler in &output.views { let Union::Refs(atrium_api::app::bsky::labeler::get_services::OutputViewsItem::AppBskyLabelerDefsLabelerViewDetailed(labeler_view)) = labeler else { continue; }; @@ -198,7 +247,7 @@ where ); } Ok(Moderator::new( - self.get_session().await.map(|s| s.did), + self.get_session().await.map(|s| s.data.did), preferences.moderation_prefs.clone(), label_defs, )) diff --git a/bsky-sdk/src/agent/builder.rs b/bsky-sdk/src/agent/builder.rs index 67ebcf18..06f312d6 100644 --- a/bsky-sdk/src/agent/builder.rs +++ b/bsky-sdk/src/agent/builder.rs @@ -116,9 +116,10 @@ mod tests { use super::*; use async_trait::async_trait; use atrium_api::agent::Session; + use atrium_api::com::atproto::server::create_session::OutputData; fn session() -> Session { - Session { + OutputData { access_jwt: String::new(), active: None, did: "did:fake:handle.test".parse().expect("invalid did"), @@ -130,6 +131,7 @@ mod tests { refresh_jwt: String::new(), status: None, } + .into() } struct MockSessionStore; @@ -160,7 +162,7 @@ mod tests { .await?; assert_eq!(agent.get_endpoint().await, "https://bsky.social"); assert_eq!( - agent.get_session().await.map(|session| session.handle), + agent.get_session().await.map(|session| session.data.handle), Some("handle.test".parse().expect("invalid handle")) ); } @@ -197,7 +199,7 @@ mod tests { .await?; assert_eq!(agent.get_endpoint().await, "https://bsky.social"); assert_eq!( - agent.get_session().await.map(|session| session.handle), + agent.get_session().await.map(|session| session.data.handle), Some("handle.test".parse().expect("invalid handle")) ); } diff --git a/bsky-sdk/src/moderation.rs b/bsky-sdk/src/moderation.rs index 69088a05..2168df7c 100644 --- a/bsky-sdk/src/moderation.rs +++ b/bsky-sdk/src/moderation.rs @@ -46,16 +46,19 @@ impl Moderator { self.decide_post(post) } /// Calculate the moderation decision for a notification. - pub fn moderate_notification(&self) -> ModerationDecision { - todo!() + pub fn moderate_notification(&self, notification: &SubjectNotification) -> ModerationDecision { + self.decide_notification(notification) } /// Calculate the moderation decision for a feed generator. - pub fn moderate_feed_generator(&self) -> ModerationDecision { - todo!() + pub fn moderate_feed_generator( + &self, + feed_generator: &SubjectFeedGenerator, + ) -> ModerationDecision { + self.decide_feed_generator(feed_generator) } /// Calculate the moderation decision for a user list. - pub fn moderate_user_list(&self) -> ModerationDecision { - todo!() + pub fn moderate_user_list(&self, user_list: &SubjectUserList) -> ModerationDecision { + self.decide_user_list(user_list) } } diff --git a/bsky-sdk/src/moderation/mutewords.rs b/bsky-sdk/src/moderation/mutewords.rs index 6ae63c2a..22879759 100644 --- a/bsky-sdk/src/moderation/mutewords.rs +++ b/bsky-sdk/src/moderation/mutewords.rs @@ -45,8 +45,8 @@ pub fn has_muted_word( tags.extend( facets .iter() - .filter_map(|facet| { - facet.features.iter().find_map(|feature| { + .flat_map(|facet| { + facet.features.iter().filter_map(|feature| { if let Union::Refs(MainFeaturesItem::Tag(tag)) = feature { Some(&tag.tag) } else { diff --git a/bsky-sdk/src/moderation/subjects.rs b/bsky-sdk/src/moderation/subjects.rs index f998b650..925932a3 100644 --- a/bsky-sdk/src/moderation/subjects.rs +++ b/bsky-sdk/src/moderation/subjects.rs @@ -1,3 +1,6 @@ mod account; +mod feed_generator; +mod notification; mod post; mod profile; +mod user_list; diff --git a/bsky-sdk/src/moderation/subjects/feed_generator.rs b/bsky-sdk/src/moderation/subjects/feed_generator.rs new file mode 100644 index 00000000..990e95c0 --- /dev/null +++ b/bsky-sdk/src/moderation/subjects/feed_generator.rs @@ -0,0 +1,24 @@ +use super::super::decision::ModerationDecision; +use super::super::types::{LabelTarget, SubjectFeedGenerator}; +use super::super::Moderator; + +impl Moderator { + pub(crate) fn decide_feed_generator( + &self, + subject: &SubjectFeedGenerator, + ) -> ModerationDecision { + let mut acc = ModerationDecision::new(); + acc.set_did(subject.creator.did.clone()); + acc.set_is_me(self.user_did.as_ref() == Some(&subject.creator.did)); + if let Some(labels) = &subject.labels { + for label in labels { + acc.add_label(LabelTarget::Content, label, self); + } + } + ModerationDecision::merge(&[ + acc, + self.decide_account(&subject.creator.clone().into()), + self.decide_profile(&subject.creator.clone().into()), + ]) + } +} diff --git a/bsky-sdk/src/moderation/subjects/notification.rs b/bsky-sdk/src/moderation/subjects/notification.rs new file mode 100644 index 00000000..dc4bc5dd --- /dev/null +++ b/bsky-sdk/src/moderation/subjects/notification.rs @@ -0,0 +1,21 @@ +use super::super::decision::ModerationDecision; +use super::super::types::{LabelTarget, SubjectNotification}; +use super::super::Moderator; + +impl Moderator { + pub(crate) fn decide_notification(&self, subject: &SubjectNotification) -> ModerationDecision { + let mut acc = ModerationDecision::new(); + acc.set_did(subject.author.did.clone()); + acc.set_is_me(self.user_did.as_ref() == Some(&subject.author.did)); + if let Some(labels) = &subject.labels { + for label in labels { + acc.add_label(LabelTarget::Content, label, self); + } + } + ModerationDecision::merge(&[ + acc, + self.decide_account(&subject.author.clone().into()), + self.decide_profile(&subject.author.clone().into()), + ]) + } +} diff --git a/bsky-sdk/src/moderation/subjects/user_list.rs b/bsky-sdk/src/moderation/subjects/user_list.rs new file mode 100644 index 00000000..1faa2f98 --- /dev/null +++ b/bsky-sdk/src/moderation/subjects/user_list.rs @@ -0,0 +1,45 @@ +use super::super::decision::ModerationDecision; +use super::super::types::{LabelTarget, SubjectUserList}; +use super::super::Moderator; +use atrium_api::types::string::Did; + +impl Moderator { + pub(crate) fn decide_user_list(&self, subject: &SubjectUserList) -> ModerationDecision { + let mut acc = ModerationDecision::new(); + match subject { + SubjectUserList::ListView(list_view) => { + acc.set_did(list_view.creator.did.clone()); + acc.set_is_me(self.user_did.as_ref() == Some(&list_view.creator.did)); + if let Some(labels) = &list_view.labels { + for label in labels { + acc.add_label(LabelTarget::Content, label, self); + } + } + ModerationDecision::merge(&[ + acc, + self.decide_account(&list_view.creator.clone().into()), + self.decide_profile(&list_view.creator.clone().into()), + ]) + } + SubjectUserList::ListViewBasic(list_view_basic) => { + let did = list_view_basic + .uri + .strip_prefix("at://") + .expect("invalid at-uri") + .split_once('/') + .expect("invalid at-uri") + .0 + .parse::() + .expect("invalid did"); + acc.set_did(did.clone()); + acc.set_is_me(self.user_did.as_ref() == Some(&did)); + if let Some(labels) = &list_view_basic.labels { + for label in labels { + acc.add_label(LabelTarget::Content, label, self); + } + } + acc + } + } + } +} diff --git a/bsky-sdk/src/moderation/tests.rs b/bsky-sdk/src/moderation/tests.rs index 6b970446..1595f989 100644 --- a/bsky-sdk/src/moderation/tests.rs +++ b/bsky-sdk/src/moderation/tests.rs @@ -7,9 +7,9 @@ use crate::moderation::decision::{DecisionContext, ModerationDecision}; use crate::moderation::types::*; use crate::moderation::util::interpret_label_value_definition; use crate::moderation::Moderator; -use atrium_api::app::bsky::actor::defs::ProfileViewBasic; -use atrium_api::app::bsky::feed::defs::PostView; -use atrium_api::com::atproto::label::defs::{Label, LabelValueDefinition}; +use atrium_api::app::bsky::actor::defs::{ProfileViewBasic, ProfileViewBasicData}; +use atrium_api::app::bsky::feed::defs::{PostView, PostViewData}; +use atrium_api::com::atproto::label::defs::{Label, LabelData, LabelValueDefinitionData}; use atrium_api::records::{KnownRecord, Record}; use atrium_api::types::string::Datetime; use std::collections::HashMap; @@ -57,7 +57,7 @@ fn profile_view_basic( display_name: Option<&str>, labels: Option>, ) -> ProfileViewBasic { - ProfileViewBasic { + ProfileViewBasicData { associated: None, avatar: None, did: format!("did:web:{handle}").parse().expect("invalid did"), @@ -66,10 +66,11 @@ fn profile_view_basic( labels, viewer: None, } + .into() } fn post_view(author: &ProfileViewBasic, text: &str, labels: Option>) -> PostView { - PostView { + PostViewData { author: author.clone(), cid: FAKE_CID.parse().expect("invalid cid"), embed: None, @@ -77,7 +78,7 @@ fn post_view(author: &ProfileViewBasic, text: &str, labels: Option>) labels, like_count: None, record: Record::Known(KnownRecord::AppBskyFeedPost(Box::new( - atrium_api::app::bsky::feed::post::Record { + atrium_api::app::bsky::feed::post::RecordData { created_at: Datetime::now(), embed: None, entities: None, @@ -87,7 +88,8 @@ fn post_view(author: &ProfileViewBasic, text: &str, labels: Option>) reply: None, tags: None, text: text.into(), - }, + } + .into(), ))), reply_count: None, repost_count: None, @@ -95,10 +97,11 @@ fn post_view(author: &ProfileViewBasic, text: &str, labels: Option>) uri: format!("at://{}/app.bsky.feed.post/fake", author.did.as_ref()), viewer: None, } + .into() } fn label(src: &str, uri: &str, val: &str) -> Label { - Label { + LabelData { cid: None, cts: Datetime::now(), exp: None, @@ -109,6 +112,7 @@ fn label(src: &str, uri: &str, val: &str) -> Label { val: val.into(), ver: None, } + .into() } fn assert_ui(decision: &ModerationDecision, expected: &[ResultFlag], context: DecisionContext) { @@ -319,14 +323,15 @@ fn prioritize_custom_labels() { HashMap::from_iter([( "did:web:labeler.test".parse().expect("invalid did"), vec![interpret_label_value_definition( - &LabelValueDefinition { + &LabelValueDefinitionData { identifier: String::from("porn"), default_setting: Some(String::from("warn")), severity: String::from("inform"), blurs: String::from("none"), adult_only: None, locales: Vec::new(), - }, + } + .into(), Some("did:web:labeler.test".parse().expect("invalid did")), ) .expect("invalid label value definition")], @@ -368,14 +373,15 @@ fn does_not_override_imperative_labels() { HashMap::from_iter([( "did:web:labeler.test".parse().expect("invalid did"), vec![interpret_label_value_definition( - &LabelValueDefinition { + &LabelValueDefinitionData { identifier: String::from("!hide"), default_setting: Some(String::from("warn")), severity: String::from("inform"), blurs: String::from("none"), adult_only: None, locales: Vec::new(), - }, + } + .into(), Some("did:web:labeler.test".parse().expect("invalid did")), ) .expect("invalid label value definition")], @@ -423,26 +429,28 @@ fn ignore_invalid_label_value_names() { "did:web:labeler.test".parse().expect("invalid did"), vec![ interpret_label_value_definition( - &LabelValueDefinition { + &LabelValueDefinitionData { identifier: String::from("BadLabel"), default_setting: Some(String::from("warn")), severity: String::from("inform"), blurs: String::from("content"), adult_only: None, locales: Vec::new(), - }, + } + .into(), Some("did:web:labeler.test".parse().expect("invalid did")), ) .expect("invalid label value definition"), interpret_label_value_definition( - &LabelValueDefinition { + &LabelValueDefinitionData { identifier: String::from("bad/label"), default_setting: Some(String::from("warn")), severity: String::from("inform"), blurs: String::from("content"), adult_only: None, locales: Vec::new(), - }, + } + .into(), Some("did:web:labeler.test".parse().expect("invalid did")), ) .expect("invalid label value definition"), @@ -488,38 +496,41 @@ fn custom_labels_with_default_settings() { "did:web:labeler.test".parse().expect("invalid did"), vec![ interpret_label_value_definition( - &LabelValueDefinition { + &LabelValueDefinitionData { identifier: String::from("default-hide"), default_setting: Some(String::from("hide")), severity: String::from("inform"), blurs: String::from("content"), adult_only: None, locales: Vec::new(), - }, + } + .into(), Some("did:web:labeler.test".parse().expect("invalid did")), ) .expect("invalid label value definition"), interpret_label_value_definition( - &LabelValueDefinition { + &LabelValueDefinitionData { identifier: String::from("default-warn"), default_setting: Some(String::from("warn")), severity: String::from("inform"), blurs: String::from("content"), adult_only: None, locales: Vec::new(), - }, + } + .into(), Some("did:web:labeler.test".parse().expect("invalid did")), ) .expect("invalid label value definition"), interpret_label_value_definition( - &LabelValueDefinition { + &LabelValueDefinitionData { identifier: String::from("default-ignore"), default_setting: Some(String::from("ignore")), severity: String::from("inform"), blurs: String::from("content"), adult_only: None, locales: Vec::new(), - }, + } + .into(), Some("did:web:labeler.test".parse().expect("invalid did")), ) .expect("invalid label value definition"), @@ -598,14 +609,15 @@ fn custom_labels_require_adult_content_enabled() { HashMap::from_iter([( "did:web:labeler.test".parse().expect("invalid did"), vec![interpret_label_value_definition( - &LabelValueDefinition { + &LabelValueDefinitionData { identifier: String::from("adult"), default_setting: Some(String::from("hide")), severity: String::from("inform"), blurs: String::from("content"), adult_only: Some(true), locales: Vec::new(), - }, + } + .into(), Some("did:web:labeler.test".parse().expect("invalid did")), ) .expect("invalid label value definition")], diff --git a/bsky-sdk/src/moderation/tests/behaviors.rs b/bsky-sdk/src/moderation/tests/behaviors.rs index 5f3468bb..fefd85e5 100644 --- a/bsky-sdk/src/moderation/tests/behaviors.rs +++ b/bsky-sdk/src/moderation/tests/behaviors.rs @@ -3,13 +3,13 @@ use super::{ExpectedBehaviors, ResultFlag, FAKE_CID}; use crate::moderation::decision::DecisionContext; use crate::moderation::types::*; use crate::moderation::Moderator; -use atrium_api::app::bsky::actor::defs::{ProfileViewBasic, ViewerState}; -use atrium_api::app::bsky::graph::defs::{ListPurpose, ListViewBasic}; +use atrium_api::app::bsky::actor::defs::{ProfileViewBasic, ViewerState, ViewerStateData}; +use atrium_api::app::bsky::graph::defs::{ListPurpose, ListViewBasic, ListViewBasicData}; use atrium_api::types::string::Datetime; use std::collections::HashMap; fn list_view_basic(name: &str) -> ListViewBasic { - ListViewBasic { + ListViewBasicData { avatar: None, cid: FAKE_CID.parse().expect("invalid cid"), indexed_at: Some(Datetime::now()), @@ -19,6 +19,7 @@ fn list_view_basic(name: &str) -> ListViewBasic { uri: String::from("at://did:plc:fake/app.bsky.graph.list/fake"), viewer: None, } + .into() } #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -100,7 +101,7 @@ impl TestUser { }, _ => Definition::default(), }; - ViewerState { + ViewerStateData { blocked_by: if def.blocked_by { Some(true) } else { None }, blocking: if def.blocking || def.blocking_by_list { Some(String::from( @@ -128,6 +129,7 @@ impl TestUser { None }, } + .into() } } diff --git a/bsky-sdk/src/moderation/tests/custom_labels.rs b/bsky-sdk/src/moderation/tests/custom_labels.rs index eea49a32..71aea285 100644 --- a/bsky-sdk/src/moderation/tests/custom_labels.rs +++ b/bsky-sdk/src/moderation/tests/custom_labels.rs @@ -5,7 +5,7 @@ use crate::moderation::error::Result; use crate::moderation::types::*; use crate::moderation::util::interpret_label_value_definition; use crate::moderation::Moderator; -use atrium_api::com::atproto::label::defs::LabelValueDefinition; +use atrium_api::com::atproto::label::defs::LabelValueDefinitionData; use std::collections::HashMap; #[derive(Debug)] @@ -89,14 +89,15 @@ impl Scenario { HashMap::from_iter([( "did:web:labeler.test".parse().expect("invalid did"), vec![interpret_label_value_definition( - &LabelValueDefinition { + &LabelValueDefinitionData { adult_only: None, blurs: self.blurs.as_ref().to_string(), default_setting: Some(LabelPreference::Warn.as_ref().to_string()), identifier: String::from("custom"), locales: Vec::new(), severity: self.severity.as_ref().to_string(), - }, + } + .into(), Some("did:web:labeler.test".parse().expect("invalid did")), )?], )]), diff --git a/bsky-sdk/src/moderation/tests/mutewords.rs b/bsky-sdk/src/moderation/tests/mutewords.rs index fda662c8..6121d02c 100644 --- a/bsky-sdk/src/moderation/tests/mutewords.rs +++ b/bsky-sdk/src/moderation/tests/mutewords.rs @@ -1,8 +1,20 @@ use super::{post_view, profile_view_basic}; use crate::moderation::decision::DecisionContext; +use crate::moderation::mutewords::has_muted_word; use crate::moderation::{ModerationPrefs, Moderator}; -use atrium_api::app::bsky::actor::defs::MutedWord; -use std::collections::HashMap; +use atrium_api::app::bsky::actor::defs::{MutedWord, MutedWordData}; +use atrium_api::app::bsky::richtext::facet::{ByteSliceData, MainData, MainFeaturesItem, TagData}; +use atrium_api::types::{Union, UnknownData}; +use ipld_core::ipld::Ipld; +use std::collections::{BTreeMap, HashMap}; + +fn muted_word(target: &str, value: &str) -> MutedWord { + MutedWordData { + targets: vec![String::from(target)], + value: String::from(value), + } + .into() +} #[cfg(feature = "rich-text")] #[tokio::test] @@ -14,10 +26,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("This is a post #inlineTag").await?; assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("tag")], - value: String::from("outlineTag"), - }], + &[muted_word("tag", "outlineTag")], &rt.text, &rt.facets, &Some(vec![String::from("outlineTag")]), @@ -28,10 +37,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("This is a post #inlineTag").await?; assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("tag")], - value: String::from("inlineTag"), - }], + &[muted_word("tag", "inlineTag")], &rt.text, &rt.facets, &Some(vec![String::from("outlineTag")]), @@ -42,10 +48,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("This is a post #inlineTag").await?; assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("inlineTag"), - }], + &[muted_word("content", "inlineTag")], &rt.text, &rt.facets, &Some(vec![String::from("outlineTag")]), @@ -56,10 +59,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("This is a post").await?; assert!(!has_muted_word( - &[MutedWord { - targets: vec![String::from("tag")], - value: String::from("post"), - }], + &[muted_word("tag", "post")], &rt.text, &rt.facets, &Some(vec![]), @@ -70,10 +70,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("改善希望です").await?; assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("希"), - }], + &[muted_word("content", "希")], &rt.text, &rt.facets, &Some(vec![]), @@ -84,10 +81,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("Idk why ☠︎ but maybe").await?; assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("☠︎"), - }], + &[muted_word("content", "☠︎")], &rt.text, &rt.facets, &Some(vec![]), @@ -98,10 +92,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("hey").await?; assert!(!has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("politics"), - }], + &[muted_word("content", "politics")], &rt.text, &rt.facets, &Some(vec![]), @@ -112,10 +103,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("javascript").await?; assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("javascript"), - }], + &[muted_word("content", "javascript")], &rt.text, &rt.facets, &Some(vec![]), @@ -126,10 +114,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("This is a post about javascript").await?; assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("javascript"), - }], + &[muted_word("content", "javascript")], &rt.text, &rt.facets, &Some(vec![]), @@ -140,10 +125,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("Use your brain, Eric").await?; assert!(!has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("ai"), - }], + &[muted_word("content", "ai")], &rt.text, &rt.facets, &Some(vec![]), @@ -154,10 +136,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("Use your\n\tbrain, Eric").await?; assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("brain"), - }], + &[muted_word("content", "brain")], &rt.text, &rt.facets, &Some(vec![]), @@ -168,10 +147,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { { let rt = rich_text_with_detect_facets("So happy :)").await?; assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from(":)"), - }], + &[muted_word("content", ":)")], &rt.text, &rt.facets, &Some(vec![]), @@ -183,10 +159,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("We're federating, yay!").await?; // match: yay! assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("yay!"), - }], + &[muted_word("content", "yay!")], &rt.text, &rt.facets, &Some(vec![]), @@ -194,10 +167,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: yay assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("yay"), - }], + &[muted_word("content", "yay")], &rt.text, &rt.facets, &Some(vec![]), @@ -209,10 +179,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("We're federating, y!ppee!!").await?; // match: y!ppee assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("y!ppee"), - }], + &[muted_word("content", "y!ppee")], &rt.text, &rt.facets, &Some(vec![]), @@ -220,10 +187,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: y!ppee! assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("y!ppee!"), - }], + &[muted_word("content", "y!ppee!")], &rt.text, &rt.facets, &Some(vec![]), @@ -235,10 +199,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("Yay, Bluesky's mutewords work").await?; // match: Bluesky's assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("Bluesky's"), - }], + &[muted_word("content", "Bluesky's")], &rt.text, &rt.facets, &Some(vec![]), @@ -246,10 +207,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: Bluesky assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("Bluesky"), - }], + &[muted_word("content", "Bluesky")], &rt.text, &rt.facets, &Some(vec![]), @@ -257,10 +215,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: bluesky assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("bluesky"), - }], + &[muted_word("content", "bluesky")], &rt.text, &rt.facets, &Some(vec![]), @@ -268,10 +223,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: blueskys assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("blueskys"), - }], + &[muted_word("content", "blueskys")], &rt.text, &rt.facets, &Some(vec![]), @@ -283,10 +235,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("Why so S@assy?").await?; // match: S@assy assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("S@assy"), - }], + &[muted_word("content", "S@assy")], &rt.text, &rt.facets, &Some(vec![]), @@ -294,10 +243,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: s@assy assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("s@assy"), - }], + &[muted_word("content", "s@assy")], &rt.text, &rt.facets, &Some(vec![]), @@ -309,10 +255,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("New York Times").await?; // match: new york times assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("new york times"), - }], + &[muted_word("content", "new york times")], &rt.text, &rt.facets, &Some(vec![]), @@ -324,10 +267,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("Idk maybe a bot !command").await?; // match: !command assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("!command"), - }], + &[muted_word("content", "!command")], &rt.text, &rt.facets, &Some(vec![]), @@ -335,10 +275,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: command assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("command"), - }], + &[muted_word("content", "command")], &rt.text, &rt.facets, &Some(vec![]), @@ -347,10 +284,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { // no match: !command let rt = rich_text_with_detect_facets("Idk maybe a bot command").await?; assert!(!has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("!command"), - }], + &[muted_word("content", "!command")], &rt.text, &rt.facets, &Some(vec![]), @@ -362,10 +296,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("I'm e/acc pilled").await?; // match: e/acc assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("e/acc"), - }], + &[muted_word("content", "e/acc")], &rt.text, &rt.facets, &Some(vec![]), @@ -373,10 +304,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: acc assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("acc"), - }], + &[muted_word("content", "acc")], &rt.text, &rt.facets, &Some(vec![]), @@ -388,10 +316,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("I'm super-bad").await?; // match: super-bad assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("super-bad"), - }], + &[muted_word("content", "super-bad")], &rt.text, &rt.facets, &Some(vec![]), @@ -399,10 +324,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: super assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("super"), - }], + &[muted_word("content", "super")], &rt.text, &rt.facets, &Some(vec![]), @@ -410,10 +332,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: bad assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("bad"), - }], + &[muted_word("content", "bad")], &rt.text, &rt.facets, &Some(vec![]), @@ -421,10 +340,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: super bad assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("super bad"), - }], + &[muted_word("content", "super bad")], &rt.text, &rt.facets, &Some(vec![]), @@ -432,10 +348,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: superbad assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("superbad"), - }], + &[muted_word("content", "superbad")], &rt.text, &rt.facets, &Some(vec![]), @@ -447,10 +360,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("Weird post with idk_what_this_would_be").await?; // match: idk what this would be assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("idk what this would be"), - }], + &[muted_word("content", "idk what this would be")], &rt.text, &rt.facets, &Some(vec![]), @@ -458,10 +368,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // no match: idk what this would be for assert!(!has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("idk what this would be for"), - }], + &[muted_word("content", "idk what this would be for")], &rt.text, &rt.facets, &Some(vec![]), @@ -469,10 +376,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: idk assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("idk"), - }], + &[muted_word("content", "idk")], &rt.text, &rt.facets, &Some(vec![]), @@ -480,10 +384,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: idkwhatthiswouldbe assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("idkwhatthiswouldbe"), - }], + &[muted_word("content", "idkwhatthiswouldbe")], &rt.text, &rt.facets, &Some(vec![]), @@ -495,10 +396,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("Post with context(iykyk)").await?; // match: context(iykyk) assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("context(iykyk)"), - }], + &[muted_word("content", "context(iykyk)")], &rt.text, &rt.facets, &Some(vec![]), @@ -506,10 +404,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: context assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("context"), - }], + &[muted_word("content", "context")], &rt.text, &rt.facets, &Some(vec![]), @@ -517,10 +412,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: iykyk assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("iykyk"), - }], + &[muted_word("content", "iykyk")], &rt.text, &rt.facets, &Some(vec![]), @@ -528,10 +420,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: (iykyk) assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("(iykyk)"), - }], + &[muted_word("content", "(iykyk)")], &rt.text, &rt.facets, &Some(vec![]), @@ -543,10 +432,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("Post with 🦋").await?; // match: 🦋 assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("🦋"), - }], + &[muted_word("content", "🦋")], &rt.text, &rt.facets, &Some(vec![]), @@ -561,10 +447,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { .await?; // match: stop worrying assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("stop worrying"), - }], + &[muted_word("content", "stop worrying")], &rt.text, &rt.facets, &Some(vec![]), @@ -572,10 +455,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { )); // match: turtles, or how assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("turtles, or how"), - }], + &[muted_word("content", "turtles, or how")], &rt.text, &rt.facets, &Some(vec![]), @@ -587,10 +467,7 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { let rt = rich_text_with_detect_facets("私はカメが好きです、またはどのようにして心配するのをやめてインターネットを愛するようになったのか").await?; // match: インターネット assert!(has_muted_word( - &[MutedWord { - targets: vec![String::from("content")], - value: String::from("インターネット"), - }], + &[muted_word("content", "インターネット")], &rt.text, &rt.facets, &Some(vec![]), @@ -600,16 +477,80 @@ async fn has_muted_word_from_rich_text() -> crate::error::Result<()> { Ok(()) } +#[test] +fn facet_with_multiple_features() { + // multiple tags + { + assert!(has_muted_word( + &[muted_word("content", "bad")], + "tags", + &Some(vec![MainData { + features: vec![ + Union::Refs(MainFeaturesItem::Tag(Box::new( + TagData { + tag: String::from("good") + } + .into() + ))), + Union::Refs(MainFeaturesItem::Tag(Box::new( + TagData { + tag: String::from("bad") + } + .into() + ))) + ], + index: ByteSliceData { + byte_end: 4, + byte_start: 0, + } + .into() + } + .into()]), + &Some(vec![]), + &None, + )) + } + // other features + { + assert!(has_muted_word( + &[muted_word("content", "bad")], + "test", + &Some(vec![MainData { + features: vec![ + Union::Unknown(UnknownData { + r#type: String::from("com.example.richtext.facet#other"), + data: Ipld::Map(BTreeMap::from_iter([( + String::from("foo"), + Ipld::String(String::from("bar")) + ),])) + }), + Union::Refs(MainFeaturesItem::Tag(Box::new( + TagData { + tag: String::from("bad") + } + .into() + ))) + ], + index: ByteSliceData { + byte_end: 4, + byte_start: 0, + } + .into() + } + .into()]), + &Some(vec![]), + &None, + )) + } +} + #[test] fn does_not_mute_own_post() { let prefs = &ModerationPrefs { adult_content_enabled: false, labels: HashMap::new(), labelers: Vec::new(), - muted_words: vec![MutedWord { - targets: vec![String::from("content")], - value: String::from("words"), - }], + muted_words: vec![muted_word("content", "words")], hidden_posts: Vec::new(), }; let post = &post_view( @@ -651,10 +592,7 @@ async fn does_not_mute_own_tags() -> crate::error::Result<()> { adult_content_enabled: false, labels: HashMap::new(), labelers: Vec::new(), - muted_words: vec![MutedWord { - targets: vec![String::from("tag")], - value: String::from("words"), - }], + muted_words: vec![muted_word("tag", "words")], hidden_posts: Vec::new(), }; let rt = rich_text_with_detect_facets("Mute #words!").await?; diff --git a/bsky-sdk/src/moderation/tests/quoteposts.rs b/bsky-sdk/src/moderation/tests/quoteposts.rs index 0e5f49c5..fcd2551e 100644 --- a/bsky-sdk/src/moderation/tests/quoteposts.rs +++ b/bsky-sdk/src/moderation/tests/quoteposts.rs @@ -6,9 +6,9 @@ use crate::moderation::types::*; use crate::moderation::util::interpret_label_value_definition; use crate::moderation::Moderator; use atrium_api::app::bsky::actor::defs::ProfileViewBasic; -use atrium_api::app::bsky::embed::record::{View, ViewRecord, ViewRecordRefs}; +use atrium_api::app::bsky::embed::record::{ViewData, ViewRecordData, ViewRecordRefs}; use atrium_api::app::bsky::feed::defs::{PostView, PostViewEmbedRefs}; -use atrium_api::com::atproto::label::defs::{Label, LabelValueDefinition}; +use atrium_api::com::atproto::label::defs::{Label, LabelValueDefinitionData}; use atrium_api::records::{KnownRecord, Record}; use atrium_api::types::string::Datetime; use atrium_api::types::Union; @@ -19,20 +19,26 @@ fn embed_record_view( record: &atrium_api::app::bsky::feed::post::Record, labels: Option>, ) -> Union { - Union::Refs(PostViewEmbedRefs::AppBskyEmbedRecordView(Box::new(View { - record: Union::Refs(ViewRecordRefs::ViewRecord(Box::new(ViewRecord { - author: author.clone(), - cid: FAKE_CID.parse().expect("invalid cid"), - embeds: None, - indexed_at: Datetime::now(), - labels, - like_count: None, - reply_count: None, - repost_count: None, - uri: format!("at://{}/app.bsky.feed.post/fake", author.did.as_ref()), - value: Record::Known(KnownRecord::AppBskyFeedPost(Box::new(record.clone()))), - }))), - }))) + Union::Refs(PostViewEmbedRefs::AppBskyEmbedRecordView(Box::new( + ViewData { + record: Union::Refs(ViewRecordRefs::ViewRecord(Box::new( + ViewRecordData { + author: author.clone(), + cid: FAKE_CID.parse().expect("invalid cid"), + embeds: None, + indexed_at: Datetime::now(), + labels, + like_count: None, + reply_count: None, + repost_count: None, + uri: format!("at://{}/app.bsky.feed.post/fake", author.did.as_ref()), + value: Record::Known(KnownRecord::AppBskyFeedPost(Box::new(record.clone()))), + } + .into(), + ))), + } + .into(), + ))) } fn quoted_post(profile_labels: Option>, post_labels: Option>) -> PostView { @@ -43,7 +49,7 @@ fn quoted_post(profile_labels: Option>, post_labels: Option>, post_labels: Option), + ProfileView(Box), + ProfileViewDetailed(Box), } impl SubjectProfile { @@ -517,24 +516,50 @@ impl SubjectProfile { impl From for SubjectProfile { fn from(p: ProfileViewBasic) -> Self { - Self::ProfileViewBasic(p) + Self::ProfileViewBasic(Box::new(p)) } } impl From for SubjectProfile { fn from(p: ProfileView) -> Self { - Self::ProfileView(p) + Self::ProfileView(Box::new(p)) } } impl From for SubjectProfile { fn from(p: ProfileViewDetailed) -> Self { - Self::ProfileViewDetailed(p) + Self::ProfileViewDetailed(Box::new(p)) } } /// A subject post. -pub type SubjectPost = PostView; +pub type SubjectPost = atrium_api::app::bsky::feed::defs::PostView; + +/// A subject notification. +pub type SubjectNotification = + atrium_api::app::bsky::notification::list_notifications::Notification; + +/// A subject feed generator. +pub type SubjectFeedGenerator = atrium_api::app::bsky::feed::defs::GeneratorView; + +/// A subject user list. +#[derive(Debug)] +pub enum SubjectUserList { + ListView(Box), + ListViewBasic(Box), +} + +impl From for SubjectUserList { + fn from(list_view: ListView) -> Self { + Self::ListView(Box::new(list_view)) + } +} + +impl From for SubjectUserList { + fn from(list_view_basic: ListViewBasic) -> Self { + Self::ListViewBasic(Box::new(list_view_basic)) + } +} /// A cause for moderation decisions. #[derive(Debug, Clone)] @@ -603,11 +628,11 @@ pub struct ModerationCauseOther { // moderation preferences /// The labeler preferences for moderation. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct ModerationPrefsLabeler { pub did: Did, pub labels: HashMap, - #[serde(skip_serializing)] + #[serde(skip_serializing, skip_deserializing)] pub is_default_labeler: bool, } @@ -622,16 +647,30 @@ impl Default for ModerationPrefsLabeler { } /// The moderation preferences. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ModerationPrefs { pub adult_content_enabled: bool, pub labels: HashMap, + #[serde(deserialize_with = "deserialize_labelers")] pub labelers: Vec, pub muted_words: Vec, pub hidden_posts: Vec, } +fn deserialize_labelers<'de, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + let mut labelers: Vec = Deserialize::deserialize(deserializer)?; + for labeler in labelers.iter_mut() { + if labeler.did.as_str() == BSKY_LABELER_DID { + labeler.is_default_labeler = true; + } + } + Ok(labelers) +} + impl Default for ModerationPrefs { fn default() -> Self { Self { diff --git a/bsky-sdk/src/preference.rs b/bsky-sdk/src/preference.rs index 251bdaee..3d11e9d0 100644 --- a/bsky-sdk/src/preference.rs +++ b/bsky-sdk/src/preference.rs @@ -1,10 +1,157 @@ //! Preferences for Bluesky application. use crate::moderation::ModerationPrefs; +use atrium_api::app::bsky::actor::defs::SavedFeed; +use atrium_api::types::Object; use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + +/// A preference for a feed view. +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "camelCase")] +pub struct FeedViewPreferenceData { + pub hide_replies: bool, + pub hide_replies_by_unfollowed: bool, + pub hide_replies_by_like_count: i64, + pub hide_reposts: bool, + pub hide_quote_posts: bool, +} + +impl Default for FeedViewPreferenceData { + fn default() -> Self { + Self { + hide_replies: false, + hide_replies_by_unfollowed: true, + hide_replies_by_like_count: 0, + hide_reposts: false, + hide_quote_posts: false, + } + } +} + +pub type FeedViewPreference = Object; + +/// A preference for a thread view. +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "camelCase")] +pub struct ThreadViewPreferenceData { + pub sort: String, + pub prioritize_followed_users: bool, +} + +impl ThreadViewPreferenceData { + pub const SORT_OLDEST: &str = "oldest"; + pub const SORT_NEWEST: &str = "newest"; + pub const SORT_MOST_LIKES: &str = "most-likes"; + pub const SORT_RANDOM: &str = "random"; +} + +impl Default for ThreadViewPreferenceData { + fn default() -> Self { + Self { + sort: Self::SORT_OLDEST.to_string(), + prioritize_followed_users: true, + } + } +} + +pub type ThreadViewPreference = Object; /// Preferences for Bluesky application. -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Preferences { + pub saved_feeds: Vec, + pub feed_view_prefs: HashMap, + pub thread_view_prefs: ThreadViewPreference, pub moderation_prefs: ModerationPrefs, } + +impl Default for Preferences { + fn default() -> Self { + Self { + saved_feeds: Default::default(), + feed_view_prefs: Default::default(), + thread_view_prefs: ThreadViewPreferenceData::default().into(), + moderation_prefs: Default::default(), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::moderation::ModerationPrefsLabeler; + use atrium_api::app::bsky::actor::get_preferences::Output; + use serde_json::{from_str, to_string, Value}; + + const XRPC_PREFERENCES_JSON: &str = r#"{ + "preferences": [ + { + "$type": "app.bsky.actor.defs#savedFeedsPrefV2", + "items": [ + { + "id": "3kt2b4tp6gs2a", + "pinned": true, + "type": "timeline", + "value": "following" + } + ] + }, + { + "$type": "app.bsky.actor.defs#threadViewPref", + "sort": "oldest", + "lab_treeViewEnabled": false + }, + { + "$type": "app.bsky.actor.defs#feedViewPref", + "feed": "home", + "hideRepliesByUnfollowed": false, + "lab_mergeFeedEnabled": true + } + ] +}"#; + + #[test] + fn xrpc_preferences_json() { + let deserialized1 = from_str::(XRPC_PREFERENCES_JSON) + .expect("deserializing preferences should succeed"); + assert_eq!(deserialized1.preferences.len(), 3); + let serialized = to_string(&deserialized1).expect("serializing preferences should succeed"); + assert_eq!( + serialized.replace(char::is_whitespace, ""), + XRPC_PREFERENCES_JSON.replace(char::is_whitespace, "") + ); + let deserialized2 = + from_str::(&serialized).expect("deserializing preferences should succeed"); + assert_eq!(deserialized1, deserialized2); + } + + #[test] + fn sdk_preferences_json() { + let preferences = Preferences { + saved_feeds: Vec::new(), + feed_view_prefs: HashMap::new(), + thread_view_prefs: ThreadViewPreferenceData::default().into(), + moderation_prefs: ModerationPrefs { + labelers: vec![ + ModerationPrefsLabeler::default(), + ModerationPrefsLabeler { + did: "did:fake:labeler.test".parse().expect("invalid did"), + labels: HashMap::new(), + is_default_labeler: false, + }, + ], + ..Default::default() + }, + }; + let serialized1 = to_string(&preferences).expect("serializing preferences should succeed"); + let deserialized = from_str::(&serialized1) + .expect("deserializing preferences should succeed"); + assert_eq!(preferences, deserialized); + let serialized2 = to_string(&deserialized).expect("serializing preferences should succeed"); + assert_eq!( + from_str::(&serialized1).expect("deserializing to value should succeed"), + from_str::(&serialized2).expect("deserializing to value should succeed"), + ); + } +} diff --git a/bsky-sdk/src/rich_text.rs b/bsky-sdk/src/rich_text.rs index 0ee15586..e3a98548 100644 --- a/bsky-sdk/src/rich_text.rs +++ b/bsky-sdk/src/rich_text.rs @@ -4,7 +4,9 @@ mod detection; use crate::agent::config::Config; use crate::agent::BskyAgentBuilder; use crate::error::Result; -use atrium_api::app::bsky::richtext::facet::{ByteSlice, Link, MainFeaturesItem, Mention, Tag}; +use atrium_api::app::bsky::richtext::facet::{ + ByteSliceData, Link, MainFeaturesItem, Mention, MentionData, Tag, +}; use atrium_api::types::Union; use atrium_api::xrpc::XrpcClient; use detection::{detect_facets, FacetFeaturesItem}; @@ -68,7 +70,7 @@ pub struct RichText { } impl RichText { - const BYTE_SLICE_ZERO: ByteSlice = ByteSlice { + const BYTE_SLICE_ZERO: ByteSliceData = ByteSliceData { byte_start: 0, byte_end: 0, }; @@ -179,7 +181,7 @@ impl RichText { // scenario A (entirely outer) if start_index <= facet.index.byte_start && end_index >= facet.index.byte_end { // delete slice (will get removed in final pass) - facet.index = Self::BYTE_SLICE_ZERO; + facet.index = Self::BYTE_SLICE_ZERO.into(); } // scenario B (entirely after) else if start_index > facet.index.byte_end { @@ -235,12 +237,12 @@ impl RichText { match feature { FacetFeaturesItem::Mention(mention) => { let did = agent.api.com.atproto.identity.resolve_handle( - atrium_api::com::atproto::identity::resolve_handle::Parameters { + atrium_api::com::atproto::identity::resolve_handle::ParametersData { handle: mention.handle.parse().expect("invalid handle"), - } - ).await?.did; + }.into() + ).await?.data.did; features.push(Union::Refs(MainFeaturesItem::Mention(Box::new( - Mention { did }, + MentionData { did }.into(), )))); } FacetFeaturesItem::Link(link) => { @@ -251,10 +253,13 @@ impl RichText { } } } - facets.push(atrium_api::app::bsky::richtext::facet::Main { - features, - index: facet_without_resolution.index, - }); + facets.push( + atrium_api::app::bsky::richtext::facet::MainData { + features, + index: facet_without_resolution.index, + } + .into(), + ); } Some(facets) }; diff --git a/bsky-sdk/src/rich_text/detection.rs b/bsky-sdk/src/rich_text/detection.rs index 479d7603..adbc0e2a 100644 --- a/bsky-sdk/src/rich_text/detection.rs +++ b/bsky-sdk/src/rich_text/detection.rs @@ -1,4 +1,6 @@ -use atrium_api::app::bsky::richtext::facet::{ByteSlice, Link, Tag}; +use atrium_api::app::bsky::richtext::facet::{ + ByteSlice, ByteSliceData, Link, LinkData, Tag, TagData, +}; use psl; use regex::Regex; use std::sync::OnceLock; @@ -43,10 +45,11 @@ pub fn detect_facets(text: &str) -> Vec { handle: m.as_str().into(), }, ))], - index: ByteSlice { + index: ByteSliceData { byte_end: m.end(), byte_start: m.start() - 1, - }, + } + .into(), }); } } @@ -70,7 +73,7 @@ pub fn detect_facets(text: &str) -> Vec { } else { m.as_str().into() }; - let mut index = ByteSlice { + let mut index = ByteSliceData { byte_end: m.end(), byte_start: m.start(), }; @@ -84,8 +87,8 @@ pub fn detect_facets(text: &str) -> Vec { index.byte_end -= 1; } facets.push(FacetWithoutResolution { - features: vec![FacetFeaturesItem::Link(Box::new(Link { uri }))], - index, + features: vec![FacetFeaturesItem::Link(Box::new(LinkData { uri }.into()))], + index: index.into(), }); } } @@ -111,12 +114,15 @@ pub fn detect_facets(text: &str) -> Vec { continue; } let leading = capture.get(1).expect("invalid capture"); - let index = ByteSlice { + let index = ByteSliceData { byte_end: leading.end() + tag.len(), byte_start: leading.start(), - }; + } + .into(); facets.push(FacetWithoutResolution { - features: vec![FacetFeaturesItem::Tag(Box::new(Tag { tag: tag.into() }))], + features: vec![FacetFeaturesItem::Tag(Box::new( + TagData { tag: tag.into() }.into(), + ))], index, }); } diff --git a/bsky-sdk/src/rich_text/tests.rs b/bsky-sdk/src/rich_text/tests.rs index eb410d28..c1ad05a2 100644 --- a/bsky-sdk/src/rich_text/tests.rs +++ b/bsky-sdk/src/rich_text/tests.rs @@ -3,7 +3,9 @@ mod detection; use crate::error::Result; use crate::rich_text::{RichText, RichTextSegment}; use crate::tests::MockClient; -use atrium_api::app::bsky::richtext::facet::{ByteSlice, Link, Main, MainFeaturesItem, Mention}; +use atrium_api::app::bsky::richtext::facet::{ + ByteSliceData, LinkData, Main, MainData, MainFeaturesItem, MentionData, +}; use atrium_api::types::{Union, UnknownData}; use ipld_core::ipld::Ipld; @@ -21,16 +23,18 @@ pub async fn rich_text_with_detect_facets(text: &str) -> Result { } fn facet(byte_start: usize, byte_end: usize) -> Main { - Main { + MainData { features: vec![Union::Unknown(UnknownData { r#type: String::new(), data: Ipld::Null, })], - index: ByteSlice { + index: ByteSliceData { byte_end, byte_start, - }, + } + .into(), } + .into() } #[test] @@ -429,24 +433,34 @@ fn segments() { let input = RichText::new( "one two three", Some(vec![ - Main { - features: vec![Union::Refs(MainFeaturesItem::Mention(Box::new(Mention { - did: "did:plc:123".parse().expect("invalid did"), - })))], - index: ByteSlice { + MainData { + features: vec![Union::Refs(MainFeaturesItem::Mention(Box::new( + MentionData { + did: "did:plc:123".parse().expect("invalid did"), + } + .into(), + )))], + index: ByteSliceData { byte_end: 3, byte_start: 0, - }, - }, - Main { - features: vec![Union::Refs(MainFeaturesItem::Link(Box::new(Link { - uri: String::from("https://example.com"), - })))], - index: ByteSlice { + } + .into(), + } + .into(), + MainData { + features: vec![Union::Refs(MainFeaturesItem::Link(Box::new( + LinkData { + uri: String::from("https://example.com"), + } + .into(), + )))], + index: ByteSliceData { byte_end: 7, byte_start: 4, - }, - }, + } + .into(), + } + .into(), facet(8, 13), ]), ); diff --git a/lexicon/atrium-codegen/src/token_stream.rs b/lexicon/atrium-codegen/src/token_stream.rs index 358bd0d4..12a1f547 100644 --- a/lexicon/atrium-codegen/src/token_stream.rs +++ b/lexicon/atrium-codegen/src/token_stream.rs @@ -263,7 +263,8 @@ fn lex_token(token: &LexToken, name: &str, schema_id: &str) -> Result Result { let description = description(&object.description); let derives = derives()?; - let struct_name = format_ident!("{}", name.to_pascal_case()); + let struct_name = format_ident!("{}Data", name.to_pascal_case()); + let object_name = format_ident!("{}", name.to_pascal_case()); let mut required = if let Some(required) = &object.required { HashSet::from_iter(required) } else { @@ -290,6 +291,8 @@ fn lex_object(object: &LexObject, name: &str) -> Result { pub struct #struct_name { #(#fields)* } + + pub type #object_name = crate::types::Object<#struct_name>; }) }