Struct miniflux_api::MinifluxApi
source · pub struct MinifluxApi { /* private fields */ }
Implementations§
source§impl MinifluxApi
impl MinifluxApi
sourcepub fn new(url: &Url, username: String, password: String) -> Self
pub fn new(url: &Url, username: String, password: String) -> Self
Create a new instance of the MinifluxApi.
url
: url of the hosted Miniflux instance (e.g.https://reader.miniflux.app/
)username
: user existing on said Miniflux instancepassword
: password of said user
sourcepub fn new_from_token(url: &Url, token: String) -> Self
pub fn new_from_token(url: &Url, token: String) -> Self
Create a new instance of the MinifluxApi using Token Auth.
url
: url of the hosted Miniflux instance (e.g.https://reader.miniflux.app/
)token
: token generated by Miniflux instance
sourcepub async fn discover_subscription(
&self,
url: Url,
client: &Client
) -> Result<Vec<Feed>, ApiError>
pub async fn discover_subscription( &self, url: Url, client: &Client ) -> Result<Vec<Feed>, ApiError>
Try to find all available feeds (RSS/Atom) for a given website url.
url
: url of a website with possible feeds (e.g.http://example.org
)
sourcepub async fn get_feeds(&self, client: &Client) -> Result<Vec<Feed>, ApiError>
pub async fn get_feeds(&self, client: &Client) -> Result<Vec<Feed>, ApiError>
Get all subscribed feeds.
sourcepub async fn get_feed(&self, id: i64, client: &Client) -> Result<Feed, ApiError>
pub async fn get_feed(&self, id: i64, client: &Client) -> Result<Feed, ApiError>
Get a specific feed by id.
sourcepub async fn get_feed_icon(
&self,
id: i64,
client: &Client
) -> Result<FavIcon, ApiError>
pub async fn get_feed_icon( &self, id: i64, client: &Client ) -> Result<FavIcon, ApiError>
Get the FavIcon for a specific feed.
sourcepub async fn create_feed(
&self,
feed_url: &Url,
category_id: i64,
client: &Client
) -> Result<i64, ApiError>
pub async fn create_feed( &self, feed_url: &Url, category_id: i64, client: &Client ) -> Result<i64, ApiError>
Subscribe to a feed.
feed_url
: url to a RSS or Atom feed (e.g.http://example.org/feed.atom
)category_id
: Miniflux internal id of a category the feed should be created in
sourcepub async fn update_feed(
&self,
id: i64,
title: Option<&str>,
category_id: Option<i64>,
feed_url: Option<&str>,
site_url: Option<&str>,
username: Option<&str>,
password: Option<&str>,
user_agent: Option<&str>,
client: &Client
) -> Result<Feed, ApiError>
pub async fn update_feed( &self, id: i64, title: Option<&str>, category_id: Option<i64>, feed_url: Option<&str>, site_url: Option<&str>, username: Option<&str>, password: Option<&str>, user_agent: Option<&str>, client: &Client ) -> Result<Feed, ApiError>
Update title and/or move feed to a different category.
id
: Miniflux internal id of the feed to altertitle
: new title of the feedcategory_id
: new parent category id
sourcepub async fn refresh_feed_synchronous(
&self,
id: i64,
client: &Client
) -> Result<(), ApiError>
pub async fn refresh_feed_synchronous( &self, id: i64, client: &Client ) -> Result<(), ApiError>
Refresh the contents of a feed synchronous on Miniflux. This operation can block the Miniflux instance for hundrets of milliseconds.
sourcepub async fn delete_feed(
&self,
id: i64,
client: &Client
) -> Result<(), ApiError>
pub async fn delete_feed( &self, id: i64, client: &Client ) -> Result<(), ApiError>
Unsubscribe from a feed.
sourcepub async fn get_feed_entry(
&self,
feed_id: i64,
entry_id: i64,
client: &Client
) -> Result<Entry, ApiError>
pub async fn get_feed_entry( &self, feed_id: i64, entry_id: i64, client: &Client ) -> Result<Entry, ApiError>
Get a single specific entry (= article) from a feed.
sourcepub async fn get_entry(
&self,
id: i64,
client: &Client
) -> Result<Entry, ApiError>
pub async fn get_entry( &self, id: i64, client: &Client ) -> Result<Entry, ApiError>
Get a single specific entry (= article).
sourcepub async fn get_entries(
&self,
status: Option<EntryStatus>,
offset: Option<i64>,
limit: Option<i64>,
order: Option<OrderBy>,
direction: Option<OrderDirection>,
before: Option<i64>,
after: Option<i64>,
before_entry_id: Option<i64>,
after_entry_id: Option<i64>,
starred: Option<bool>,
client: &Client
) -> Result<Vec<Entry>, ApiError>
pub async fn get_entries( &self, status: Option<EntryStatus>, offset: Option<i64>, limit: Option<i64>, order: Option<OrderBy>, direction: Option<OrderDirection>, before: Option<i64>, after: Option<i64>, before_entry_id: Option<i64>, after_entry_id: Option<i64>, starred: Option<bool>, client: &Client ) -> Result<Vec<Entry>, ApiError>
Get a batch of entries (= articles).
sourcepub async fn get_feed_entries(
&self,
id: i64,
status: Option<EntryStatus>,
offset: Option<i64>,
limit: Option<i64>,
order: Option<OrderBy>,
direction: Option<OrderDirection>,
before: Option<i64>,
after: Option<i64>,
before_entry_id: Option<i64>,
after_entry_id: Option<i64>,
starred: Option<bool>,
client: &Client
) -> Result<Vec<Entry>, ApiError>
pub async fn get_feed_entries( &self, id: i64, status: Option<EntryStatus>, offset: Option<i64>, limit: Option<i64>, order: Option<OrderBy>, direction: Option<OrderDirection>, before: Option<i64>, after: Option<i64>, before_entry_id: Option<i64>, after_entry_id: Option<i64>, starred: Option<bool>, client: &Client ) -> Result<Vec<Entry>, ApiError>
Get a batch of entries (= articles) from a specific feed. The field comments_url is available since Miniflux v2.0.5.
sourcepub async fn update_entries_status(
&self,
ids: Vec<i64>,
status: EntryStatus,
client: &Client
) -> Result<(), ApiError>
pub async fn update_entries_status( &self, ids: Vec<i64>, status: EntryStatus, client: &Client ) -> Result<(), ApiError>
Update the read status of a batch of entries (= articles).
sourcepub async fn toggle_bookmark(
&self,
id: i64,
client: &Client
) -> Result<(), ApiError>
pub async fn toggle_bookmark( &self, id: i64, client: &Client ) -> Result<(), ApiError>
Toggle the starred status of an entry (= article)
sourcepub async fn get_categories(
&self,
client: &Client
) -> Result<Vec<Category>, ApiError>
pub async fn get_categories( &self, client: &Client ) -> Result<Vec<Category>, ApiError>
Get all categories
sourcepub async fn create_category(
&self,
title: &str,
client: &Client
) -> Result<Category, ApiError>
pub async fn create_category( &self, title: &str, client: &Client ) -> Result<Category, ApiError>
Create a new empty category
sourcepub async fn update_category(
&self,
id: i64,
title: &str,
client: &Client
) -> Result<Category, ApiError>
pub async fn update_category( &self, id: i64, title: &str, client: &Client ) -> Result<Category, ApiError>
Rename a existing cagegory
sourcepub async fn delete_category(
&self,
id: i64,
client: &Client
) -> Result<(), ApiError>
pub async fn delete_category( &self, id: i64, client: &Client ) -> Result<(), ApiError>
Delete a existing category
sourcepub async fn export_opml(&self, client: &Client) -> Result<String, ApiError>
pub async fn export_opml(&self, client: &Client) -> Result<String, ApiError>
Serialize all categories and subscribed feeds into a OPML string. This API call is available since Miniflux v2.0.1.
sourcepub async fn import_opml(
&self,
opml: &str,
client: &Client
) -> Result<(), ApiError>
pub async fn import_opml( &self, opml: &str, client: &Client ) -> Result<(), ApiError>
Parse OPML string, create all contained categories and subscribe to all contained feeds. This API call is available since Miniflux v2.0.7.
sourcepub async fn create_user(
&self,
username: &str,
password: &str,
is_admin: bool,
client: &Client
) -> Result<User, ApiError>
pub async fn create_user( &self, username: &str, password: &str, is_admin: bool, client: &Client ) -> Result<User, ApiError>
Create a new user on the Miniflux instance. You must be an administrator to create users.
sourcepub async fn update_user(
&self,
id: i64,
username: Option<String>,
password: Option<String>,
is_admin: Option<bool>,
theme: Option<String>,
language: Option<String>,
timezone: Option<String>,
entry_sorting_direction: Option<String>,
client: &Client
) -> Result<User, ApiError>
pub async fn update_user( &self, id: i64, username: Option<String>, password: Option<String>, is_admin: Option<bool>, theme: Option<String>, language: Option<String>, timezone: Option<String>, entry_sorting_direction: Option<String>, client: &Client ) -> Result<User, ApiError>
Update details and/or credentials of a user. You must be an administrator to update users.
sourcepub async fn get_current_user(&self, client: &Client) -> Result<User, ApiError>
pub async fn get_current_user(&self, client: &Client) -> Result<User, ApiError>
Get the user specified when this struct was created. This API endpoint is available since Miniflux v2.0.8.
sourcepub async fn get_user_by_id(
&self,
id: i64,
client: &Client
) -> Result<User, ApiError>
pub async fn get_user_by_id( &self, id: i64, client: &Client ) -> Result<User, ApiError>
Get a specific user of the Miniflux instance. You must be an administrator to fetch users.
sourcepub async fn get_user_by_name(
&self,
username: &str,
client: &Client
) -> Result<User, ApiError>
pub async fn get_user_by_name( &self, username: &str, client: &Client ) -> Result<User, ApiError>
Try to get a user by its username
.
You must be an administrator to fetch users.