Skip to main content

tmdb_rs/endpoints/
network.rs

1use serde::Deserialize;
2
3use crate::common::{AlternativeName, Images};
4use crate::Logo;
5
6#[derive(Debug, Clone, Deserialize)]
7pub struct NetworkDetails {
8    pub id: u64,
9    pub name: String,
10    pub headquarters: Option<String>,
11    #[serde(rename = "homepage")]
12    pub website: String,
13    #[serde(rename = "logo_path")]
14    pub logo: Option<Logo>,
15    pub origin_country: Option<String>,
16}
17
18endpoint! {
19    /// a network's details
20    network(id: u64): GET "/network/{id}" => NetworkDetails
21}
22
23endpoint! {
24    /// a network's alternative names
25    network_alternative_names(id: u64): GET "/network/{id}/alternative_names" => Vec<AlternativeName> [results]
26}
27
28endpoint! {
29    /// a network's logos
30    network_images(id: u64): GET "/network/{id}/images" => Images
31}