Skip to content

Commit

Permalink
SeatBid object
Browse files Browse the repository at this point in the history
  • Loading branch information
k-bx committed Jun 11, 2020
1 parent 42259f3 commit f3e8621
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
58 changes: 58 additions & 0 deletions src/v2_5/bid.rs
Original file line number Diff line number Diff line change
@@ -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<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub burl: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub lurl: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub adm: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub adid: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub adomain: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bundle: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub iurl: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<String>,
#[serde(rename = "crid", skip_serializing_if = "Option::is_none")]
pub cr_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tactic: Option<String>,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub cat: Vec<Category>,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub attr: Vec<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub api: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub qagmediarating: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub language: Option<String>,
#[serde(rename = "dealid", skip_serializing_if = "Option::is_none")]
pub deal_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub w: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub h: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub wratio: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hratio: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub exp: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ext: Option<serde_utils::Ext>,
}
2 changes: 2 additions & 0 deletions src/v2_5/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mod app;
mod audio;
mod banner;
mod banner_ad_type;
mod bid;
mod bid_request;
mod bid_response;
mod category;
Expand All @@ -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::*;
Expand Down
10 changes: 10 additions & 0 deletions src/v2_5/seat_bid.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
use serde_utils;
use super::bid::Bid;

#[derive(Serialize, Deserialize, Debug)]
pub struct SeatBid {
pub bid: Vec<Bid>, // todo: require 1+ bid somehow
#[serde(skip_serializing_if = "Option::is_none")]
pub seat: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub group: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ext: Option<serde_utils::Ext>,
}

0 comments on commit f3e8621

Please sign in to comment.