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
49
50
51
52
53
54
/// 3.2.10 Object: Format
///
/// This object represents an allowed size (i.e., height and width combination) or Flex Ad
/// parameters for a banner impression. These are typically used in an array where multiple sizes
/// are permitted. It is recommended that either the w/h pair or the wratio/hratio/wmin set (i.e.,
/// for Flex Ads) be specified.
#[derive(serde::Serialize, serde::Deserialize, Default, Debug, PartialEq, Clone)]
pub struct Format<'a> {
    /// integer
    /// Width in device independent pixels (DIPS).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub w: Option<i32>,
    /// integer
    /// Height in device independent pixels (DIPS).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub h: Option<i32>,
    /// integer
    /// Relative width when expressing size as a ratio.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub wratio: Option<i32>,
    /// integer
    /// Relative height when expressing size as a ratio.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hratio: Option<i32>,
    /// integer
    /// The minimum width in device independent pixels (DIPS) at which the ad will be displayed the
    /// size is expressed as a ratio.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub wmin: Option<i32>,
    /// object
    /// Placeholder for exchange-specific extensions to OpenRTB.
    #[serde(borrow, default, skip_serializing_if = "Option::is_none")]
    pub ext: Option<json_ext::Object<'a>>,
}
#[cfg(test)]
mod test {
    use super::*;
    #[test]
    fn json() -> serde_json::Result<()> {
        let json = "{}";
        let o1 = Format::default();
        assert_eq!(serde_json::to_string(&o1)?, json);
        assert_eq!(o1, serde_json::from_str::<Format>(json)?);
        Ok(())
    }
}