-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from sugyan/feature/update-codegen
Update API
- Loading branch information
Showing
25 changed files
with
504 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
pub mod defs; | ||
pub mod get_preferences; | ||
pub mod get_profile; | ||
pub mod get_profiles; | ||
pub mod get_suggestions; | ||
pub mod profile; | ||
pub mod put_preferences; | ||
pub mod search_actors; | ||
pub mod search_actors_typeahead; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
#![doc = "Definitions for the `app.bsky.actor.getPreferences` namespace."] | ||
#[doc = "`app.bsky.actor.getPreferences`"] | ||
#[doc = "Get private preferences attached to the account."] | ||
#[async_trait::async_trait] | ||
pub trait GetPreferences: crate::xrpc::XrpcClient { | ||
async fn get_preferences( | ||
&self, | ||
params: Parameters, | ||
) -> Result<Output, Box<dyn std::error::Error>> { | ||
let body = crate::xrpc::XrpcClient::send::<Error>( | ||
self, | ||
http::Method::GET, | ||
"app.bsky.actor.getPreferences", | ||
Some(serde_urlencoded::to_string(¶ms)?), | ||
None, | ||
None, | ||
) | ||
.await?; | ||
serde_json::from_slice(&body).map_err(|e| e.into()) | ||
} | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Parameters {} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Output { | ||
pub preferences: crate::app::bsky::actor::defs::Preferences, | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(tag = "error", content = "message")] | ||
pub enum Error {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
#![doc = "Definitions for the `app.bsky.actor.putPreferences` namespace."] | ||
#[doc = "`app.bsky.actor.putPreferences`"] | ||
#[doc = "Sets the private preferences attached to the account."] | ||
#[async_trait::async_trait] | ||
pub trait PutPreferences: crate::xrpc::XrpcClient { | ||
async fn put_preferences(&self, input: Input) -> Result<(), Box<dyn std::error::Error>> { | ||
let _ = crate::xrpc::XrpcClient::send::<Error>( | ||
self, | ||
http::Method::POST, | ||
"app.bsky.actor.putPreferences", | ||
None, | ||
Some(serde_json::to_vec(&input)?), | ||
Some(String::from("application/json")), | ||
) | ||
.await?; | ||
Ok(()) | ||
} | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Input { | ||
pub preferences: crate::app::bsky::actor::defs::Preferences, | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(tag = "error", content = "message")] | ||
pub enum Error {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
pub mod block; | ||
pub mod defs; | ||
pub mod follow; | ||
pub mod get_blocks; | ||
pub mod get_followers; | ||
pub mod get_follows; | ||
pub mod get_list; | ||
pub mod get_list_mutes; | ||
pub mod get_lists; | ||
pub mod get_mutes; | ||
pub mod list; | ||
pub mod listitem; | ||
pub mod mute_actor; | ||
pub mod mute_actor_list; | ||
pub mod unmute_actor; | ||
pub mod unmute_actor_list; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
#![doc = "Definitions for the `app.bsky.graph.defs` namespace."] | ||
#[doc = "`app.bsky.graph.defs#listItemView`"] | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ListItemView { | ||
pub subject: crate::app::bsky::actor::defs::ProfileView, | ||
} | ||
#[doc = "`app.bsky.graph.defs#listPurpose`"] | ||
pub type ListPurpose = String; | ||
#[doc = "`app.bsky.graph.defs#listView`"] | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ListView { | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub avatar: Option<String>, | ||
pub creator: crate::app::bsky::actor::defs::ProfileView, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub description: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub description_facets: Option<Vec<crate::app::bsky::richtext::facet::Main>>, | ||
pub indexed_at: String, | ||
pub name: String, | ||
pub purpose: ListPurpose, | ||
pub uri: String, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub viewer: Option<ListViewerState>, | ||
} | ||
#[doc = "`app.bsky.graph.defs#listViewBasic`"] | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ListViewBasic { | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub avatar: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub indexed_at: Option<String>, | ||
pub name: String, | ||
pub purpose: ListPurpose, | ||
pub uri: String, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub viewer: Option<ListViewerState>, | ||
} | ||
#[doc = "`app.bsky.graph.defs#listViewerState`"] | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ListViewerState { | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub muted: Option<bool>, | ||
} | ||
#[doc = "`app.bsky.graph.defs#modlist`"] | ||
#[doc = "A list of actors to apply an aggregate moderation action (mute/block) on"] | ||
pub struct Modlist; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
#![doc = "Definitions for the `app.bsky.graph.getList` namespace."] | ||
#[doc = "`app.bsky.graph.getList`"] | ||
#[doc = "Fetch a list of actors"] | ||
#[async_trait::async_trait] | ||
pub trait GetList: crate::xrpc::XrpcClient { | ||
async fn get_list(&self, params: Parameters) -> Result<Output, Box<dyn std::error::Error>> { | ||
let body = crate::xrpc::XrpcClient::send::<Error>( | ||
self, | ||
http::Method::GET, | ||
"app.bsky.graph.getList", | ||
Some(serde_urlencoded::to_string(¶ms)?), | ||
None, | ||
None, | ||
) | ||
.await?; | ||
serde_json::from_slice(&body).map_err(|e| e.into()) | ||
} | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Parameters { | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub cursor: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub limit: Option<i32>, | ||
pub list: String, | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Output { | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub cursor: Option<String>, | ||
pub items: Vec<crate::app::bsky::graph::defs::ListItemView>, | ||
pub list: crate::app::bsky::graph::defs::ListView, | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(tag = "error", content = "message")] | ||
pub enum Error {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
#![doc = "Definitions for the `app.bsky.graph.getListMutes` namespace."] | ||
#[doc = "`app.bsky.graph.getListMutes`"] | ||
#[doc = "Which lists is the requester's account muting?"] | ||
#[async_trait::async_trait] | ||
pub trait GetListMutes: crate::xrpc::XrpcClient { | ||
async fn get_list_mutes( | ||
&self, | ||
params: Parameters, | ||
) -> Result<Output, Box<dyn std::error::Error>> { | ||
let body = crate::xrpc::XrpcClient::send::<Error>( | ||
self, | ||
http::Method::GET, | ||
"app.bsky.graph.getListMutes", | ||
Some(serde_urlencoded::to_string(¶ms)?), | ||
None, | ||
None, | ||
) | ||
.await?; | ||
serde_json::from_slice(&body).map_err(|e| e.into()) | ||
} | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Parameters { | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub cursor: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub limit: Option<i32>, | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Output { | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub cursor: Option<String>, | ||
pub lists: Vec<crate::app::bsky::graph::defs::ListView>, | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(tag = "error", content = "message")] | ||
pub enum Error {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
#![doc = "Definitions for the `app.bsky.graph.getLists` namespace."] | ||
#[doc = "`app.bsky.graph.getLists`"] | ||
#[doc = "Fetch a list of lists that belong to an actor"] | ||
#[async_trait::async_trait] | ||
pub trait GetLists: crate::xrpc::XrpcClient { | ||
async fn get_lists(&self, params: Parameters) -> Result<Output, Box<dyn std::error::Error>> { | ||
let body = crate::xrpc::XrpcClient::send::<Error>( | ||
self, | ||
http::Method::GET, | ||
"app.bsky.graph.getLists", | ||
Some(serde_urlencoded::to_string(¶ms)?), | ||
None, | ||
None, | ||
) | ||
.await?; | ||
serde_json::from_slice(&body).map_err(|e| e.into()) | ||
} | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Parameters { | ||
pub actor: String, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub cursor: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub limit: Option<i32>, | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Output { | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub cursor: Option<String>, | ||
pub lists: Vec<crate::app::bsky::graph::defs::ListView>, | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(tag = "error", content = "message")] | ||
pub enum Error {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
#![doc = "Definitions for the `app.bsky.graph.list` namespace."] | ||
#[doc = "`app.bsky.graph.list`"] | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Record { | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub avatar: Option<crate::blob::BlobRef>, | ||
pub created_at: String, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub description: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub description_facets: Option<Vec<crate::app::bsky::richtext::facet::Main>>, | ||
pub name: String, | ||
pub purpose: crate::app::bsky::graph::defs::ListPurpose, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
#![doc = "Definitions for the `app.bsky.graph.listitem` namespace."] | ||
#[doc = "`app.bsky.graph.listitem`"] | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Record { | ||
pub created_at: String, | ||
pub list: String, | ||
pub subject: String, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
#![doc = "Definitions for the `app.bsky.graph.muteActorList` namespace."] | ||
#[doc = "`app.bsky.graph.muteActorList`"] | ||
#[doc = "Mute a list of actors."] | ||
#[async_trait::async_trait] | ||
pub trait MuteActorList: crate::xrpc::XrpcClient { | ||
async fn mute_actor_list(&self, input: Input) -> Result<(), Box<dyn std::error::Error>> { | ||
let _ = crate::xrpc::XrpcClient::send::<Error>( | ||
self, | ||
http::Method::POST, | ||
"app.bsky.graph.muteActorList", | ||
None, | ||
Some(serde_json::to_vec(&input)?), | ||
Some(String::from("application/json")), | ||
) | ||
.await?; | ||
Ok(()) | ||
} | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Input { | ||
pub list: String, | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(tag = "error", content = "message")] | ||
pub enum Error {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This file is generated by atrium-codegen. DO NOT EDIT. | ||
#![doc = "Definitions for the `app.bsky.graph.unmuteActorList` namespace."] | ||
#[doc = "`app.bsky.graph.unmuteActorList`"] | ||
#[doc = "Unmute a list of actors."] | ||
#[async_trait::async_trait] | ||
pub trait UnmuteActorList: crate::xrpc::XrpcClient { | ||
async fn unmute_actor_list(&self, input: Input) -> Result<(), Box<dyn std::error::Error>> { | ||
let _ = crate::xrpc::XrpcClient::send::<Error>( | ||
self, | ||
http::Method::POST, | ||
"app.bsky.graph.unmuteActorList", | ||
None, | ||
Some(serde_json::to_vec(&input)?), | ||
Some(String::from("application/json")), | ||
) | ||
.await?; | ||
Ok(()) | ||
} | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Input { | ||
pub list: String, | ||
} | ||
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)] | ||
#[serde(tag = "error", content = "message")] | ||
pub enum Error {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.