|
|
@ -19,6 +19,7 @@ use reqwest::multipart; |
|
|
|
use entities::prelude::*; |
|
|
|
use entities::prelude::*; |
|
|
|
pub use errors::{Error, Result}; |
|
|
|
pub use errors::{Error, Result}; |
|
|
|
use helpers::deserialise_response; |
|
|
|
use helpers::deserialise_response; |
|
|
|
|
|
|
|
use serde::{Serialize,Deserialize}; |
|
|
|
use requests::{ |
|
|
|
use requests::{ |
|
|
|
AddFilterRequest, |
|
|
|
AddFilterRequest, |
|
|
|
AddPushRequest, |
|
|
|
AddPushRequest, |
|
|
@ -87,6 +88,14 @@ impl From<AppData> for FediClient { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Serialize,Deserialize,Clone,Copy,PartialEq)] |
|
|
|
|
|
|
|
#[serde(rename_all="snake_case")] |
|
|
|
|
|
|
|
pub enum SearchType { |
|
|
|
|
|
|
|
Accounts, |
|
|
|
|
|
|
|
Hashtags, |
|
|
|
|
|
|
|
Statuses |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl FediClient { |
|
|
|
impl FediClient { |
|
|
|
methods![get, put, post, delete,]; |
|
|
|
methods![get, put, post, delete,]; |
|
|
|
|
|
|
|
|
|
|
@ -154,7 +163,15 @@ impl FediClient { |
|
|
|
route_v1!((get) get_filters: "filters" => Vec<Filter>); |
|
|
|
route_v1!((get) get_filters: "filters" => Vec<Filter>); |
|
|
|
route_v1!((get) get_follow_suggestions: "suggestions" => Vec<Account>); |
|
|
|
route_v1!((get) get_follow_suggestions: "suggestions" => Vec<Account>); |
|
|
|
|
|
|
|
|
|
|
|
route_v2!((get (q: &'a str, resolve: bool,)) search_v2: "search" => SearchResultV2); |
|
|
|
route_v2!((get ( |
|
|
|
|
|
|
|
q: &'a str, |
|
|
|
|
|
|
|
resolve: bool, |
|
|
|
|
|
|
|
#[serde(skip_serializing_if = "Option::is_none")] |
|
|
|
|
|
|
|
#[serde(rename = "type")] |
|
|
|
|
|
|
|
type_: Option<SearchType>, |
|
|
|
|
|
|
|
limit: Option<i32>, |
|
|
|
|
|
|
|
following: bool, |
|
|
|
|
|
|
|
)) search_v2: "search" => SearchResultV2); |
|
|
|
|
|
|
|
|
|
|
|
route_v1_id!((get) get_account: "accounts/{}" => Account); |
|
|
|
route_v1_id!((get) get_account: "accounts/{}" => Account); |
|
|
|
route_v1_id!((post) follow: "accounts/{}/follow" => Relationship); |
|
|
|
route_v1_id!((post) follow: "accounts/{}/follow" => Relationship); |
|
|
|