diff --git a/src/v2_5/bid.rs b/src/v2_5/bid.rs new file mode 100644 index 0000000..44e7866 --- /dev/null +++ b/src/v2_5/bid.rs @@ -0,0 +1,58 @@ +use super::category::Category; +use serde_utils; + +#[derive(Serialize, Deserialize, Debug)] +pub struct Bid { + pub id: String, + #[serde(rename = "impid")] + pub imp_id: String, + pub price: f64, + #[serde(skip_serializing_if = "Option::is_none")] + pub nurl: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub burl: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub lurl: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub adm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub adid: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub adomain: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bundle: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iurl: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cid: Option, + #[serde(rename = "crid", skip_serializing_if = "Option::is_none")] + pub cr_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tactic: Option, + #[serde(skip_serializing_if = "Vec::is_empty")] + pub cat: Vec, + #[serde(skip_serializing_if = "Vec::is_empty")] + pub attr: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub api: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub protocol: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub qagmediarating: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub language: Option, + #[serde(rename = "dealid", skip_serializing_if = "Option::is_none")] + pub deal_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub w: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub h: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wratio: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub hratio: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ext: Option, +} diff --git a/src/v2_5/mod.rs b/src/v2_5/mod.rs index 360f4eb..b6ad66a 100644 --- a/src/v2_5/mod.rs +++ b/src/v2_5/mod.rs @@ -11,6 +11,7 @@ mod app; mod audio; mod banner; mod banner_ad_type; +mod bid; mod bid_request; mod bid_response; mod category; @@ -34,6 +35,7 @@ pub use self::app::*; pub use self::audio::*; pub use self::banner::*; pub use self::banner_ad_type::*; +pub use self::bid::*; pub use self::bid_request::*; pub use self::bid_response::*; pub use self::category::*; diff --git a/src/v2_5/seat_bid.rs b/src/v2_5/seat_bid.rs index 0b6f1c6..4f63450 100644 --- a/src/v2_5/seat_bid.rs +++ b/src/v2_5/seat_bid.rs @@ -1,3 +1,13 @@ +use serde_utils; +use super::bid::Bid; + #[derive(Serialize, Deserialize, Debug)] pub struct SeatBid { + pub bid: Vec, // todo: require 1+ bid somehow + #[serde(skip_serializing_if = "Option::is_none")] + pub seat: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub group: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ext: Option, }