use client::Client;
use error;
use utils;
#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct Feeds {
pub timeline_url: String,
pub user_url: String,
pub current_user_public_ur: Option<String>,
pub current_user_url: Option<String>,
pub current_user_actor_url: Option<String>,
pub current_user_organization_url: Option<String>,
pub current_user_organization_urls: Option<Vec<String>>,
#[serde(rename = "_links")]
pub links: Links
}
#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct Links {
pub timeline: FeedsElem,
pub user: FeedsElem,
pub current_user_public: Option<FeedsElem>,
pub current_user: Option<FeedsElem>,
pub current_user_actor: Option<FeedsElem>,
pub current_user_organization: Option<FeedsElem>,
pub current_user_organizations: Option<FeedsElem>,
}
#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct FeedsElem {
pub href: String,
#[serde(rename = "type")]
pub mime_type: String
}
pub trait FeedsExt {
fn get_feeds(&mut self) -> Result<Feeds, error::Error>;
}
impl FeedsExt for Client {
fn get_feeds(&mut self) -> Result<Feeds, error::Error> {
utils::request_endpoint(self, "/feeds".into())
}
}