#![doc = r#"An ATP "Client". Implements all HTTP APIs of XRPC."#]
pub struct AtpServiceClient<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub app: app::Service<T>,
pub com: com::Service<T>,
}
pub mod app {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub bsky: bsky::Service<T>,
}
pub mod bsky {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub actor: actor::Service<T>,
pub feed: feed::Service<T>,
pub graph: graph::Service<T>,
pub notification: notification::Service<T>,
pub unspecced: unspecced::Service<T>,
}
pub mod actor {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
pub mod feed {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
pub mod graph {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
pub mod notification {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
pub mod unspecced {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
}
}
pub mod com {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub atproto: atproto::Service<T>,
}
pub mod atproto {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub admin: admin::Service<T>,
pub identity: identity::Service<T>,
pub label: label::Service<T>,
pub moderation: moderation::Service<T>,
pub repo: repo::Service<T>,
pub server: server::Service<T>,
pub sync: sync::Service<T>,
}
pub mod admin {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
pub mod identity {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
pub mod label {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
pub mod moderation {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
pub mod repo {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
pub mod server {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
pub mod sync {
pub struct Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub xrpc: std::sync::Arc<T>,
}
}
}
}
impl<T> AtpServiceClient<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self {
app: app::Service::new(std::sync::Arc::clone(&xrpc)),
com: com::Service::new(std::sync::Arc::clone(&xrpc)),
}
}
}
impl<T> app::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self {
bsky: app::bsky::Service::new(std::sync::Arc::clone(&xrpc)),
}
}
}
impl<T> app::bsky::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self {
actor: app::bsky::actor::Service::new(std::sync::Arc::clone(&xrpc)),
feed: app::bsky::feed::Service::new(std::sync::Arc::clone(&xrpc)),
graph: app::bsky::graph::Service::new(std::sync::Arc::clone(&xrpc)),
notification: app::bsky::notification::Service::new(std::sync::Arc::clone(&xrpc)),
unspecced: app::bsky::unspecced::Service::new(std::sync::Arc::clone(&xrpc)),
}
}
}
impl<T> app::bsky::actor::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "Get private preferences attached to the account."]
pub async fn get_preferences(
&self,
params: crate::app::bsky::actor::get_preferences::Parameters,
) -> Result<
crate::app::bsky::actor::get_preferences::Output,
atrium_xrpc::error::Error<crate::app::bsky::actor::get_preferences::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.actor.getPreferences",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
pub async fn get_profile(
&self,
params: crate::app::bsky::actor::get_profile::Parameters,
) -> Result<
crate::app::bsky::actor::get_profile::Output,
atrium_xrpc::error::Error<crate::app::bsky::actor::get_profile::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.actor.getProfile",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
pub async fn get_profiles(
&self,
params: crate::app::bsky::actor::get_profiles::Parameters,
) -> Result<
crate::app::bsky::actor::get_profiles::Output,
atrium_xrpc::error::Error<crate::app::bsky::actor::get_profiles::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.actor.getProfiles",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Get a list of actors suggested for following. Used in discovery UIs."]
pub async fn get_suggestions(
&self,
params: crate::app::bsky::actor::get_suggestions::Parameters,
) -> Result<
crate::app::bsky::actor::get_suggestions::Output,
atrium_xrpc::error::Error<crate::app::bsky::actor::get_suggestions::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.actor.getSuggestions",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Sets the private preferences attached to the account."]
pub async fn put_preferences(
&self,
input: crate::app::bsky::actor::put_preferences::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::app::bsky::actor::put_preferences::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"app.bsky.actor.putPreferences",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Find actors matching search criteria."]
pub async fn search_actors(
&self,
params: crate::app::bsky::actor::search_actors::Parameters,
) -> Result<
crate::app::bsky::actor::search_actors::Output,
atrium_xrpc::error::Error<crate::app::bsky::actor::search_actors::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.actor.searchActors",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Find actor suggestions for a search term."]
pub async fn search_actors_typeahead(
&self,
params: crate::app::bsky::actor::search_actors_typeahead::Parameters,
) -> Result<
crate::app::bsky::actor::search_actors_typeahead::Output,
atrium_xrpc::error::Error<crate::app::bsky::actor::search_actors_typeahead::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.actor.searchActorsTypeahead",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> app::bsky::feed::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "Returns information about a given feed generator including TOS & offered feed URIs"]
pub async fn describe_feed_generator(
&self,
) -> Result<
crate::app::bsky::feed::describe_feed_generator::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::describe_feed_generator::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.describeFeedGenerator",
None,
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Retrieve a list of feeds created by a given actor"]
pub async fn get_actor_feeds(
&self,
params: crate::app::bsky::feed::get_actor_feeds::Parameters,
) -> Result<
crate::app::bsky::feed::get_actor_feeds::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_actor_feeds::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getActorFeeds",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "A view of an actor's feed."]
pub async fn get_author_feed(
&self,
params: crate::app::bsky::feed::get_author_feed::Parameters,
) -> Result<
crate::app::bsky::feed::get_author_feed::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_author_feed::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getAuthorFeed",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Compose and hydrate a feed from a user's selected feed generator"]
pub async fn get_feed(
&self,
params: crate::app::bsky::feed::get_feed::Parameters,
) -> Result<
crate::app::bsky::feed::get_feed::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_feed::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getFeed",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Get information about a specific feed offered by a feed generator, such as its online status"]
pub async fn get_feed_generator(
&self,
params: crate::app::bsky::feed::get_feed_generator::Parameters,
) -> Result<
crate::app::bsky::feed::get_feed_generator::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_feed_generator::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getFeedGenerator",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Get information about a list of feed generators"]
pub async fn get_feed_generators(
&self,
params: crate::app::bsky::feed::get_feed_generators::Parameters,
) -> Result<
crate::app::bsky::feed::get_feed_generators::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_feed_generators::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getFeedGenerators",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "A skeleton of a feed provided by a feed generator"]
pub async fn get_feed_skeleton(
&self,
params: crate::app::bsky::feed::get_feed_skeleton::Parameters,
) -> Result<
crate::app::bsky::feed::get_feed_skeleton::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_feed_skeleton::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getFeedSkeleton",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
pub async fn get_likes(
&self,
params: crate::app::bsky::feed::get_likes::Parameters,
) -> Result<
crate::app::bsky::feed::get_likes::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_likes::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getLikes",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
pub async fn get_post_thread(
&self,
params: crate::app::bsky::feed::get_post_thread::Parameters,
) -> Result<
crate::app::bsky::feed::get_post_thread::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_post_thread::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getPostThread",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "A view of an actor's feed."]
pub async fn get_posts(
&self,
params: crate::app::bsky::feed::get_posts::Parameters,
) -> Result<
crate::app::bsky::feed::get_posts::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_posts::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getPosts",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
pub async fn get_reposted_by(
&self,
params: crate::app::bsky::feed::get_reposted_by::Parameters,
) -> Result<
crate::app::bsky::feed::get_reposted_by::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_reposted_by::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getRepostedBy",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "A view of the user's home timeline."]
pub async fn get_timeline(
&self,
params: crate::app::bsky::feed::get_timeline::Parameters,
) -> Result<
crate::app::bsky::feed::get_timeline::Output,
atrium_xrpc::error::Error<crate::app::bsky::feed::get_timeline::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.feed.getTimeline",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> app::bsky::graph::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "Who is the requester's account blocking?"]
pub async fn get_blocks(
&self,
params: crate::app::bsky::graph::get_blocks::Parameters,
) -> Result<
crate::app::bsky::graph::get_blocks::Output,
atrium_xrpc::error::Error<crate::app::bsky::graph::get_blocks::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.graph.getBlocks",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Who is following an actor?"]
pub async fn get_followers(
&self,
params: crate::app::bsky::graph::get_followers::Parameters,
) -> Result<
crate::app::bsky::graph::get_followers::Output,
atrium_xrpc::error::Error<crate::app::bsky::graph::get_followers::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.graph.getFollowers",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Who is an actor following?"]
pub async fn get_follows(
&self,
params: crate::app::bsky::graph::get_follows::Parameters,
) -> Result<
crate::app::bsky::graph::get_follows::Output,
atrium_xrpc::error::Error<crate::app::bsky::graph::get_follows::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.graph.getFollows",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Fetch a list of actors"]
pub async fn get_list(
&self,
params: crate::app::bsky::graph::get_list::Parameters,
) -> Result<
crate::app::bsky::graph::get_list::Output,
atrium_xrpc::error::Error<crate::app::bsky::graph::get_list::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.graph.getList",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Which lists is the requester's account muting?"]
pub async fn get_list_mutes(
&self,
params: crate::app::bsky::graph::get_list_mutes::Parameters,
) -> Result<
crate::app::bsky::graph::get_list_mutes::Output,
atrium_xrpc::error::Error<crate::app::bsky::graph::get_list_mutes::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.graph.getListMutes",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Fetch a list of lists that belong to an actor"]
pub async fn get_lists(
&self,
params: crate::app::bsky::graph::get_lists::Parameters,
) -> Result<
crate::app::bsky::graph::get_lists::Output,
atrium_xrpc::error::Error<crate::app::bsky::graph::get_lists::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.graph.getLists",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Who does the viewer mute?"]
pub async fn get_mutes(
&self,
params: crate::app::bsky::graph::get_mutes::Parameters,
) -> Result<
crate::app::bsky::graph::get_mutes::Output,
atrium_xrpc::error::Error<crate::app::bsky::graph::get_mutes::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.graph.getMutes",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Mute an actor by did or handle."]
pub async fn mute_actor(
&self,
input: crate::app::bsky::graph::mute_actor::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::app::bsky::graph::mute_actor::Error>> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"app.bsky.graph.muteActor",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Mute a list of actors."]
pub async fn mute_actor_list(
&self,
input: crate::app::bsky::graph::mute_actor_list::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::app::bsky::graph::mute_actor_list::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"app.bsky.graph.muteActorList",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Unmute an actor by did or handle."]
pub async fn unmute_actor(
&self,
input: crate::app::bsky::graph::unmute_actor::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::app::bsky::graph::unmute_actor::Error>> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"app.bsky.graph.unmuteActor",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Unmute a list of actors."]
pub async fn unmute_actor_list(
&self,
input: crate::app::bsky::graph::unmute_actor_list::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::app::bsky::graph::unmute_actor_list::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"app.bsky.graph.unmuteActorList",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> app::bsky::notification::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
pub async fn get_unread_count(
&self,
params: crate::app::bsky::notification::get_unread_count::Parameters,
) -> Result<
crate::app::bsky::notification::get_unread_count::Output,
atrium_xrpc::error::Error<crate::app::bsky::notification::get_unread_count::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.notification.getUnreadCount",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
pub async fn list_notifications(
&self,
params: crate::app::bsky::notification::list_notifications::Parameters,
) -> Result<
crate::app::bsky::notification::list_notifications::Output,
atrium_xrpc::error::Error<crate::app::bsky::notification::list_notifications::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.notification.listNotifications",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Notify server that the user has seen notifications."]
pub async fn update_seen(
&self,
input: crate::app::bsky::notification::update_seen::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::app::bsky::notification::update_seen::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"app.bsky.notification.updateSeen",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> app::bsky::unspecced::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "An unspecced view of globally popular items"]
pub async fn get_popular(
&self,
params: crate::app::bsky::unspecced::get_popular::Parameters,
) -> Result<
crate::app::bsky::unspecced::get_popular::Output,
atrium_xrpc::error::Error<crate::app::bsky::unspecced::get_popular::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.unspecced.getPopular",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "An unspecced view of globally popular feed generators"]
pub async fn get_popular_feed_generators(
&self,
) -> Result<
crate::app::bsky::unspecced::get_popular_feed_generators::Output,
atrium_xrpc::error::Error<crate::app::bsky::unspecced::get_popular_feed_generators::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"app.bsky.unspecced.getPopularFeedGenerators",
None,
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> com::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self {
atproto: com::atproto::Service::new(std::sync::Arc::clone(&xrpc)),
}
}
}
impl<T> com::atproto::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self {
admin: com::atproto::admin::Service::new(std::sync::Arc::clone(&xrpc)),
identity: com::atproto::identity::Service::new(std::sync::Arc::clone(&xrpc)),
label: com::atproto::label::Service::new(std::sync::Arc::clone(&xrpc)),
moderation: com::atproto::moderation::Service::new(std::sync::Arc::clone(&xrpc)),
repo: com::atproto::repo::Service::new(std::sync::Arc::clone(&xrpc)),
server: com::atproto::server::Service::new(std::sync::Arc::clone(&xrpc)),
sync: com::atproto::sync::Service::new(std::sync::Arc::clone(&xrpc)),
}
}
}
impl<T> com::atproto::admin::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "Disable an account from receiving new invite codes, but does not invalidate existing codes"]
pub async fn disable_account_invites(
&self,
input: crate::com::atproto::admin::disable_account_invites::Input,
) -> Result<
(),
atrium_xrpc::error::Error<crate::com::atproto::admin::disable_account_invites::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.admin.disableAccountInvites",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Disable some set of codes and/or all codes associated with a set of users"]
pub async fn disable_invite_codes(
&self,
input: crate::com::atproto::admin::disable_invite_codes::Input,
) -> Result<
(),
atrium_xrpc::error::Error<crate::com::atproto::admin::disable_invite_codes::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.admin.disableInviteCodes",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Re-enable an accounts ability to receive invite codes"]
pub async fn enable_account_invites(
&self,
input: crate::com::atproto::admin::enable_account_invites::Input,
) -> Result<
(),
atrium_xrpc::error::Error<crate::com::atproto::admin::enable_account_invites::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.admin.enableAccountInvites",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Admin view of invite codes"]
pub async fn get_invite_codes(
&self,
params: crate::com::atproto::admin::get_invite_codes::Parameters,
) -> Result<
crate::com::atproto::admin::get_invite_codes::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::get_invite_codes::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.admin.getInviteCodes",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "View details about a moderation action."]
pub async fn get_moderation_action(
&self,
params: crate::com::atproto::admin::get_moderation_action::Parameters,
) -> Result<
crate::com::atproto::admin::get_moderation_action::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::get_moderation_action::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.admin.getModerationAction",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "List moderation actions related to a subject."]
pub async fn get_moderation_actions(
&self,
params: crate::com::atproto::admin::get_moderation_actions::Parameters,
) -> Result<
crate::com::atproto::admin::get_moderation_actions::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::get_moderation_actions::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.admin.getModerationActions",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "View details about a moderation report."]
pub async fn get_moderation_report(
&self,
params: crate::com::atproto::admin::get_moderation_report::Parameters,
) -> Result<
crate::com::atproto::admin::get_moderation_report::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::get_moderation_report::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.admin.getModerationReport",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "List moderation reports related to a subject."]
pub async fn get_moderation_reports(
&self,
params: crate::com::atproto::admin::get_moderation_reports::Parameters,
) -> Result<
crate::com::atproto::admin::get_moderation_reports::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::get_moderation_reports::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.admin.getModerationReports",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "View details about a record."]
pub async fn get_record(
&self,
params: crate::com::atproto::admin::get_record::Parameters,
) -> Result<
crate::com::atproto::admin::get_record::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::get_record::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.admin.getRecord",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "View details about a repository."]
pub async fn get_repo(
&self,
params: crate::com::atproto::admin::get_repo::Parameters,
) -> Result<
crate::com::atproto::admin::get_repo::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::get_repo::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.admin.getRepo",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Administrative action to rebase an account's repo"]
pub async fn rebase_repo(
&self,
input: crate::com::atproto::admin::rebase_repo::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::com::atproto::admin::rebase_repo::Error>> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.admin.rebaseRepo",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Resolve moderation reports by an action."]
pub async fn resolve_moderation_reports(
&self,
input: crate::com::atproto::admin::resolve_moderation_reports::Input,
) -> Result<
crate::com::atproto::admin::resolve_moderation_reports::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::resolve_moderation_reports::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.admin.resolveModerationReports",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Reverse a moderation action."]
pub async fn reverse_moderation_action(
&self,
input: crate::com::atproto::admin::reverse_moderation_action::Input,
) -> Result<
crate::com::atproto::admin::reverse_moderation_action::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::reverse_moderation_action::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.admin.reverseModerationAction",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Find repositories based on a search term."]
pub async fn search_repos(
&self,
params: crate::com::atproto::admin::search_repos::Parameters,
) -> Result<
crate::com::atproto::admin::search_repos::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::search_repos::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.admin.searchRepos",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Take a moderation action on a repo."]
pub async fn take_moderation_action(
&self,
input: crate::com::atproto::admin::take_moderation_action::Input,
) -> Result<
crate::com::atproto::admin::take_moderation_action::Output,
atrium_xrpc::error::Error<crate::com::atproto::admin::take_moderation_action::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.admin.takeModerationAction",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Administrative action to update an account's email"]
pub async fn update_account_email(
&self,
input: crate::com::atproto::admin::update_account_email::Input,
) -> Result<
(),
atrium_xrpc::error::Error<crate::com::atproto::admin::update_account_email::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.admin.updateAccountEmail",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Administrative action to update an account's handle"]
pub async fn update_account_handle(
&self,
input: crate::com::atproto::admin::update_account_handle::Input,
) -> Result<
(),
atrium_xrpc::error::Error<crate::com::atproto::admin::update_account_handle::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.admin.updateAccountHandle",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> com::atproto::identity::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "Provides the DID of a repo."]
pub async fn resolve_handle(
&self,
params: crate::com::atproto::identity::resolve_handle::Parameters,
) -> Result<
crate::com::atproto::identity::resolve_handle::Output,
atrium_xrpc::error::Error<crate::com::atproto::identity::resolve_handle::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.identity.resolveHandle",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Updates the handle of the account"]
pub async fn update_handle(
&self,
input: crate::com::atproto::identity::update_handle::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::com::atproto::identity::update_handle::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.identity.updateHandle",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> com::atproto::label::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "Find labels relevant to the provided URI patterns."]
pub async fn query_labels(
&self,
params: crate::com::atproto::label::query_labels::Parameters,
) -> Result<
crate::com::atproto::label::query_labels::Output,
atrium_xrpc::error::Error<crate::com::atproto::label::query_labels::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.label.queryLabels",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> com::atproto::moderation::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "Report a repo or a record."]
pub async fn create_report(
&self,
input: crate::com::atproto::moderation::create_report::Input,
) -> Result<
crate::com::atproto::moderation::create_report::Output,
atrium_xrpc::error::Error<crate::com::atproto::moderation::create_report::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.moderation.createReport",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> com::atproto::repo::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "Apply a batch transaction of creates, updates, and deletes."]
pub async fn apply_writes(
&self,
input: crate::com::atproto::repo::apply_writes::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::com::atproto::repo::apply_writes::Error>> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.repo.applyWrites",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Create a new record."]
pub async fn create_record(
&self,
input: crate::com::atproto::repo::create_record::Input,
) -> Result<
crate::com::atproto::repo::create_record::Output,
atrium_xrpc::error::Error<crate::com::atproto::repo::create_record::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.repo.createRecord",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Delete a record, or ensure it doesn't exist."]
pub async fn delete_record(
&self,
input: crate::com::atproto::repo::delete_record::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::com::atproto::repo::delete_record::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.repo.deleteRecord",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Get information about the repo, including the list of collections."]
pub async fn describe_repo(
&self,
params: crate::com::atproto::repo::describe_repo::Parameters,
) -> Result<
crate::com::atproto::repo::describe_repo::Output,
atrium_xrpc::error::Error<crate::com::atproto::repo::describe_repo::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.repo.describeRepo",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Get a record."]
pub async fn get_record(
&self,
params: crate::com::atproto::repo::get_record::Parameters,
) -> Result<
crate::com::atproto::repo::get_record::Output,
atrium_xrpc::error::Error<crate::com::atproto::repo::get_record::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.repo.getRecord",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "List a range of records in a collection."]
pub async fn list_records(
&self,
params: crate::com::atproto::repo::list_records::Parameters,
) -> Result<
crate::com::atproto::repo::list_records::Output,
atrium_xrpc::error::Error<crate::com::atproto::repo::list_records::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.repo.listRecords",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Write a record, creating or updating it as needed."]
pub async fn put_record(
&self,
input: crate::com::atproto::repo::put_record::Input,
) -> Result<
crate::com::atproto::repo::put_record::Output,
atrium_xrpc::error::Error<crate::com::atproto::repo::put_record::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.repo.putRecord",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Simple rebase of repo that deletes history"]
pub async fn rebase_repo(
&self,
input: crate::com::atproto::repo::rebase_repo::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::com::atproto::repo::rebase_repo::Error>> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.repo.rebaseRepo",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Upload a new blob to be added to repo in a later request."]
pub async fn upload_blob(
&self,
input: Vec<u8>,
) -> Result<
crate::com::atproto::repo::upload_blob::Output,
atrium_xrpc::error::Error<crate::com::atproto::repo::upload_blob::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), Vec<u8>, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.repo.uploadBlob",
None,
Some(atrium_xrpc::InputDataOrBytes::Bytes(input)),
Some(String::from("*/*")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> com::atproto::server::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "Create an account."]
pub async fn create_account(
&self,
input: crate::com::atproto::server::create_account::Input,
) -> Result<
crate::com::atproto::server::create_account::Output,
atrium_xrpc::error::Error<crate::com::atproto::server::create_account::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.createAccount",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Create an app-specific password."]
pub async fn create_app_password(
&self,
input: crate::com::atproto::server::create_app_password::Input,
) -> Result<
crate::com::atproto::server::create_app_password::Output,
atrium_xrpc::error::Error<crate::com::atproto::server::create_app_password::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.createAppPassword",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Create an invite code."]
pub async fn create_invite_code(
&self,
input: crate::com::atproto::server::create_invite_code::Input,
) -> Result<
crate::com::atproto::server::create_invite_code::Output,
atrium_xrpc::error::Error<crate::com::atproto::server::create_invite_code::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.createInviteCode",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Create an invite code."]
pub async fn create_invite_codes(
&self,
input: crate::com::atproto::server::create_invite_codes::Input,
) -> Result<
crate::com::atproto::server::create_invite_codes::Output,
atrium_xrpc::error::Error<crate::com::atproto::server::create_invite_codes::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.createInviteCodes",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Create an authentication session."]
pub async fn create_session(
&self,
input: crate::com::atproto::server::create_session::Input,
) -> Result<
crate::com::atproto::server::create_session::Output,
atrium_xrpc::error::Error<crate::com::atproto::server::create_session::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.createSession",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Delete a user account with a token and password."]
pub async fn delete_account(
&self,
input: crate::com::atproto::server::delete_account::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::com::atproto::server::delete_account::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.deleteAccount",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Delete the current session."]
pub async fn delete_session(
&self,
) -> Result<(), atrium_xrpc::error::Error<crate::com::atproto::server::delete_session::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), (), (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.deleteSession",
None,
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Get a document describing the service's accounts configuration."]
pub async fn describe_server(
&self,
) -> Result<
crate::com::atproto::server::describe_server::Output,
atrium_xrpc::error::Error<crate::com::atproto::server::describe_server::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.server.describeServer",
None,
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Get all invite codes for a given account"]
pub async fn get_account_invite_codes(
&self,
params: crate::com::atproto::server::get_account_invite_codes::Parameters,
) -> Result<
crate::com::atproto::server::get_account_invite_codes::Output,
atrium_xrpc::error::Error<crate::com::atproto::server::get_account_invite_codes::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.server.getAccountInviteCodes",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Get information about the current session."]
pub async fn get_session(
&self,
) -> Result<
crate::com::atproto::server::get_session::Output,
atrium_xrpc::error::Error<crate::com::atproto::server::get_session::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.server.getSession",
None,
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "List all app-specific passwords."]
pub async fn list_app_passwords(
&self,
) -> Result<
crate::com::atproto::server::list_app_passwords::Output,
atrium_xrpc::error::Error<crate::com::atproto::server::list_app_passwords::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.server.listAppPasswords",
None,
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Refresh an authentication session."]
pub async fn refresh_session(
&self,
) -> Result<
crate::com::atproto::server::refresh_session::Output,
atrium_xrpc::error::Error<crate::com::atproto::server::refresh_session::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), (), _, _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.refreshSession",
None,
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Initiate a user account deletion via email."]
pub async fn request_account_delete(
&self,
) -> Result<
(),
atrium_xrpc::error::Error<crate::com::atproto::server::request_account_delete::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), (), (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.requestAccountDelete",
None,
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Initiate a user account password reset via email."]
pub async fn request_password_reset(
&self,
input: crate::com::atproto::server::request_password_reset::Input,
) -> Result<
(),
atrium_xrpc::error::Error<crate::com::atproto::server::request_password_reset::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.requestPasswordReset",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Reset a user account password using a token."]
pub async fn reset_password(
&self,
input: crate::com::atproto::server::reset_password::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::com::atproto::server::reset_password::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.resetPassword",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Revoke an app-specific password by name."]
pub async fn revoke_app_password(
&self,
input: crate::com::atproto::server::revoke_app_password::Input,
) -> Result<
(),
atrium_xrpc::error::Error<crate::com::atproto::server::revoke_app_password::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.server.revokeAppPassword",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}
impl<T> com::atproto::sync::Service<T>
where
T: atrium_xrpc::XrpcClient + Send + Sync,
{
pub fn new(xrpc: std::sync::Arc<T>) -> Self {
Self { xrpc }
}
#[doc = "Get a blob associated with a given repo."]
pub async fn get_blob(
&self,
params: crate::com::atproto::sync::get_blob::Parameters,
) -> Result<Vec<u8>, atrium_xrpc::error::Error<crate::com::atproto::sync::get_blob::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<_, (), (), _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.sync.getBlob",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(bytes) => Ok(bytes),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Gets blocks from a given repo."]
pub async fn get_blocks(
&self,
params: crate::com::atproto::sync::get_blocks::Parameters,
) -> Result<Vec<u8>, atrium_xrpc::error::Error<crate::com::atproto::sync::get_blocks::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<_, (), (), _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.sync.getBlocks",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(bytes) => Ok(bytes),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Gets the repo state."]
pub async fn get_checkout(
&self,
params: crate::com::atproto::sync::get_checkout::Parameters,
) -> Result<Vec<u8>, atrium_xrpc::error::Error<crate::com::atproto::sync::get_checkout::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<_, (), (), _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.sync.getCheckout",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(bytes) => Ok(bytes),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Gets the path of repo commits"]
pub async fn get_commit_path(
&self,
params: crate::com::atproto::sync::get_commit_path::Parameters,
) -> Result<
crate::com::atproto::sync::get_commit_path::Output,
atrium_xrpc::error::Error<crate::com::atproto::sync::get_commit_path::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.sync.getCommitPath",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Gets the current HEAD CID of a repo."]
pub async fn get_head(
&self,
params: crate::com::atproto::sync::get_head::Parameters,
) -> Result<
crate::com::atproto::sync::get_head::Output,
atrium_xrpc::error::Error<crate::com::atproto::sync::get_head::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.sync.getHead",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Gets blocks needed for existence or non-existence of record."]
pub async fn get_record(
&self,
params: crate::com::atproto::sync::get_record::Parameters,
) -> Result<Vec<u8>, atrium_xrpc::error::Error<crate::com::atproto::sync::get_record::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<_, (), (), _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.sync.getRecord",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(bytes) => Ok(bytes),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Gets the repo state."]
pub async fn get_repo(
&self,
params: crate::com::atproto::sync::get_repo::Parameters,
) -> Result<Vec<u8>, atrium_xrpc::error::Error<crate::com::atproto::sync::get_repo::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<_, (), (), _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.sync.getRepo",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(bytes) => Ok(bytes),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "List blob cids for some range of commits"]
pub async fn list_blobs(
&self,
params: crate::com::atproto::sync::list_blobs::Parameters,
) -> Result<
crate::com::atproto::sync::list_blobs::Output,
atrium_xrpc::error::Error<crate::com::atproto::sync::list_blobs::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.sync.listBlobs",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "List dids and root cids of hosted repos"]
pub async fn list_repos(
&self,
params: crate::com::atproto::sync::list_repos::Parameters,
) -> Result<
crate::com::atproto::sync::list_repos::Output,
atrium_xrpc::error::Error<crate::com::atproto::sync::list_repos::Error>,
> {
let response = atrium_xrpc::XrpcClient::send::<_, (), _, _>(
self.xrpc.as_ref(),
http::Method::GET,
"com.atproto.sync.listRepos",
Some(params),
None,
None,
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Data(data) => Ok(data),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Notify a crawling service of a recent update. Often when a long break between updates causes the connection with the crawling service to break."]
pub async fn notify_of_update(
&self,
input: crate::com::atproto::sync::notify_of_update::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::com::atproto::sync::notify_of_update::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.sync.notifyOfUpdate",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
#[doc = "Request a service to persistently crawl hosted repos."]
pub async fn request_crawl(
&self,
input: crate::com::atproto::sync::request_crawl::Input,
) -> Result<(), atrium_xrpc::error::Error<crate::com::atproto::sync::request_crawl::Error>>
{
let response = atrium_xrpc::XrpcClient::send::<(), _, (), _>(
self.xrpc.as_ref(),
http::Method::POST,
"com.atproto.sync.requestCrawl",
None,
Some(atrium_xrpc::InputDataOrBytes::Data(input)),
Some(String::from("application/json")),
)
.await?;
match response {
atrium_xrpc::OutputDataOrBytes::Bytes(_) => Ok(()),
_ => Err(atrium_xrpc::error::Error::UnexpectedResponseType),
}
}
}