Skip to main content

tmdb_rs/endpoints/
watch_provider.rs

1use serde::Deserialize;
2
3use crate::common::WatchProvider;
4use crate::{CountryCode, Language};
5
6#[derive(Debug, Clone, Deserialize)]
7pub struct ProviderRegion {
8    #[serde(rename = "iso_3166_1")]
9    pub country: CountryCode,
10    pub english_name: String,
11    pub native_name: String,
12}
13
14endpoint! {
15    /// the regions watch provider data covers
16    watch_provider_regions(): GET "/watch/providers/regions" => Vec<ProviderRegion> [results] {
17        params { language: Language }
18    }
19}
20
21endpoint! {
22    /// the movie watch providers available in a region
23    movie_watch_provider_list(): GET "/watch/providers/movie" => Vec<WatchProvider> [results] {
24        params { language: Language, watch_region: CountryCode }
25    }
26}
27
28endpoint! {
29    /// the series watch providers available in a region
30    tv_watch_provider_list(): GET "/watch/providers/tv" => Vec<WatchProvider> [results] {
31        params { language: Language, watch_region: CountryCode }
32    }
33}