|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
use crate::error::ApiResult;
|
|
|
|
|
use crate::models::{Anime, Artist, Image, Resource, SearchResponse, ThemeEntry};
|
|
|
|
|
use crate::models::{Anime, Artist, Image, Resource, SearchResponse, Series, ThemeEntry};
|
|
|
|
|
use reqwest::Response;
|
|
|
|
|
use serde::de::DeserializeOwned;
|
|
|
|
|
use serde::Serialize;
|
|
|
|
@ -95,6 +95,11 @@ impl AnimeThemesClient {
|
|
|
|
|
self.entry_by_id_with_include("resource", id, include).await
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Returns a series by slug
|
|
|
|
|
pub async fn series(&self, slug: &str, include: &[&str]) -> ApiResult<Series> {
|
|
|
|
|
self.entry_by_id_with_include("series", slug, include).await
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Generic endpoint with the format /<endpoint>/<id> returning the type on the json field <endpoint>
|
|
|
|
|
async fn entry_by_id_with_include<T: DeserializeOwned, I: Display>(
|
|
|
|
|
&self,
|
|
|
|
|