1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! [Infos API](https://developers.deezer.com/api/infos)
#[warn(missing_docs)]
use serde::{Deserialize, Serialize};

/// Contains all the information about the API in the current country.
///
/// # Examples
///
/// ```rust
/// # use deezer::models::*;
/// # use deezer::{DeezerClient, DeezerError};
/// # #[tokio::main]
/// # async fn main() -> Result<(), DeezerError> {
/// let deezer = DeezerClient::new();
/// let info = deezer.api_info().await?;
/// # println!("{:?}", info);
/// # Ok(())
/// # }
///
/// ```
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Infos {
    /// The current country ISO code
    pub country_iso: String,

    /// The current country name
    pub country: String,

    /// Indicates if Deezer is open in the current country or not
    pub open: bool,

    /// An array of available offers in the current country
    pub offers: Vec<Offer>,
}

/// Contains all the information provided for an Offer.
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Offer {
    pub id: u64,
    pub name: String,
    pub amount: String,
    pub currency: String,
    pub displayed_amount: String,
    pub tc: String,
    pub tc_html: String,
    pub tc_txt: String,
    pub try_and_buy: u64,
}