From 4e08b9845ed6860290368ff0668038db9d7ec646 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Fri, 17 Nov 2023 13:32:48 -0500 Subject: [PATCH 1/6] OpenRTB v2.6-202309 --- openrtb2/audio.go | 9 +++++++ openrtb2/bid_request.go | 19 ++++++++++++--- openrtb2/deal.go | 37 ++++++++++++++++++++++++++++- openrtb2/durfloors.go | 52 +++++++++++++++++++++++++++++++++++++++++ openrtb2/imp.go | 3 ++- openrtb2/site.go | 2 +- openrtb2/video.go | 9 +++++++ 7 files changed, 125 insertions(+), 6 deletions(-) create mode 100644 openrtb2/durfloors.go diff --git a/openrtb2/audio.go b/openrtb2/audio.go index c1ff9a5..720b329 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -256,6 +256,15 @@ type Audio struct { // Normalization Modes in AdCOM 1.0. NVol *adcom1.VolumeNormalizationMode `json:"nvol,omitempty"` + // Attribute: + // durfloors + // Type: + // object array + // Description: + // An array of DurFloors objects (Section 3.2.35) indicating the floor + // prices for video creatives of various durations that the buyer may bid with. + DurFloors []DurFloors `json:"durfloors,omitempty"` + // Attribute: // ext // Type: diff --git a/openrtb2/bid_request.go b/openrtb2/bid_request.go index 28c9988..adaf126 100644 --- a/openrtb2/bid_request.go +++ b/openrtb2/bid_request.go @@ -8,7 +8,7 @@ import ( // 3.2.1 Object: BidRequest // -// The top-level bid request object contains a globally unique bid request or auction ID. +// The top-level bid request object contains an exchange unique bid request or auction ID. // This id attribute is required as is at least one impression object (Section 3.2.4). // Other attributes in this top-level object establish rules and restrictions that apply to all impressions being offered. // @@ -22,7 +22,9 @@ type BidRequest struct { // Type: // string; required // Description: - // Unique ID of the bid request, provided by the exchange. + // ID of the bid request, assigned by the exchange, and unique for the + // exchange’s subsequent tracking of the responses. The exchange may use + // different values for different recipients. ID string `json:"id"` // Attribute: @@ -182,6 +184,17 @@ type BidRequest struct { // should be present. WLangB []string `json:"wlangb,omitempty"` + // Attribute: + // acat + // Type: + // string array + // Description: + // Allowed advertiser categories using the specified category taxonomy. + // The taxonomy to be used is defined by the cattax field. If no cattax + // field is supplied IAB Content Taxonomy 1.0 is assumed. Only one of + // acat or bcat should be present. + ACat []string `json:"acat,omitempty"` + // Attribute: // bcat // Type: @@ -191,7 +204,7 @@ type BidRequest struct { // category taxonomy. // The taxonomy to be used is defined by the cattax field. If no // cattax field is supplied IAB Content Category Taxonomy 1.0 is - // assumed. + // assumed. Only one of acat or bcat should be present. BCat []string `json:"bcat,omitempty"` // Attribute: diff --git a/openrtb2/deal.go b/openrtb2/deal.go index 9919f84..24a335a 100644 --- a/openrtb2/deal.go +++ b/openrtb2/deal.go @@ -32,7 +32,9 @@ type Deal struct { // Description: // Currency specified using ISO-4217 alpha codes. This may be // different from bid currency returned by bidder if this is - // allowed by the exchange. + // allowed by the exchange. This field does not inherit from + // imp.bidfloorcur; it is either explicitly specified or + // defaults to USD. BidFloorCur string `json:"bidfloorcur,omitempty"` // Attribute: @@ -66,6 +68,39 @@ type Deal struct { // bid on this deal. Omission implies no advertiser restrictions. WADomain []string `json:"wadomain,omitempty"` + // Attribute: + // guar + // Type: + // integer, default 0 + // Description: + // Indicates that the deal is of type guaranteed and the bidder must + // bid on the deal, where 0 = not a guaranteed deal, 1 = guaranteed deal. + Guar int8 `json:"guar,omitempty"` // convert to an enum? + + // Attribute: + // mincpmpersec + // Type: + // float + // Definition: + // Minimum CPM per second. This is a price floor for video or audio + // impression opportunities, relative to the duration of bids an + // advertiser may submit. + MinCPMPerSec float64 `json:"mincpmpersec,omitempty"` + + // Attribute: + // durfloors + // Type: + // object array + // Description: + // An array of DurFloors objects (Section 3.2.35) indicating the floor + // prices for video creatives of various durations that the buyer may bid with. + DurFloors [] `json:"durfloors,omitempty"` + + // Attribute: + // wadomain + // Type: + // string array + // Description: // Attribute: // ext // Type: diff --git a/openrtb2/durfloors.go b/openrtb2/durfloors.go new file mode 100644 index 0000000..dc4cbd2 --- /dev/null +++ b/openrtb2/durfloors.go @@ -0,0 +1,52 @@ +package openrtb2 + +import ( + "encoding/json" +) + +// Object: DurFloors +// +// This object allows sellers to specify price floors for video and audio creatives, whose price varies based on time. +// For example: 1-15 seconds at a floor of $5; 16-30 seconds at a floor of $10, > 31 seconds at a floor of $20. +// There are no explicit constraints on the defined ranges, nor guarantees that they don't overlap. +// In cases where multiple ranges may apply, it is up to the buyer and seller to coordinate on which floor is applicable. +type DurFloors struct { + // Attribute: + // mindur + // Type: + // integer + // Description: + // An integer indicating the low end of a duration range. If this + // value is missing, the low end is unbounded. Either mindur or maxdur + // is required, but not both. + MinDur int64 `json:"mindur,omitempty"` + + // Attribute: + // maxdur + // Type: + // integer + // Description: + // An integer indicating the high end of a duration range. If this + // value is missing, the high end is unbounded. Either mindur or maxdur + // is required, but not both. + MaxDur int64 `json:"maxdur,omitempty"` + + // Attribute: + // bidfloor + // Type: + // float; default 0 + // Description: + // Minimum bid for a given impression opportunity, if bidding with a + // creative in this duration range, expressed in CPM. For any creatives + // whose durations are outside of the defined min/max, the bidfloor at + // the Imp level will serve as the default floor. + BidFloor float64 `json:"bidfloor,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Placeholder for vendor specific extensions to this object. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/openrtb2/imp.go b/openrtb2/imp.go index 1b1ec1f..5e8e864 100644 --- a/openrtb2/imp.go +++ b/openrtb2/imp.go @@ -130,7 +130,8 @@ type Imp struct { // Description: // Currency specified using ISO-4217 alpha codes. This may be // different from bid currency returned by bidder if this is - // allowed by the exchange. + // allowed by the exchange. This currency sets the default for + // all floors specified in the Imp object. BidFloorCur string `json:"bidfloorcur,omitempty"` // Attribute: diff --git a/openrtb2/site.go b/openrtb2/site.go index 876bddb..b9045c4 100644 --- a/openrtb2/site.go +++ b/openrtb2/site.go @@ -40,7 +40,7 @@ type Site struct { // Attribute: // cattax // Type: - // integer + // integer; default 1 // Description: // The taxonomy in use. Refer to the AdCOM list List: Category // Taxonomies for values. If no cattax field is supplied IAB Content diff --git a/openrtb2/video.go b/openrtb2/video.go index 21bb5df..e1a8c2e 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -374,6 +374,15 @@ type Video struct { // attribute with the particular banner (Section 3.2.6). CompanionType []adcom1.CompanionType `json:"companiontype,omitempty"` + // Attribute: + // durfloors + // Type: + // object array + // Description: + // An array of DurFloors objects (Section 3.2.35) indicating the floor + // prices for video creatives of various durations that the buyer may bid with. + DurFloors []DurFloors `json:"durfloors,omitempty"` + // Attribute: // ext // Type: From 13f45b69041a16be574a2e4b281bd85d17b8248f Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Fri, 17 Nov 2023 13:47:25 -0500 Subject: [PATCH 2/6] Guar Type --- openrtb2/deal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/deal.go b/openrtb2/deal.go index 24a335a..acfe8fa 100644 --- a/openrtb2/deal.go +++ b/openrtb2/deal.go @@ -75,7 +75,7 @@ type Deal struct { // Description: // Indicates that the deal is of type guaranteed and the bidder must // bid on the deal, where 0 = not a guaranteed deal, 1 = guaranteed deal. - Guar int8 `json:"guar,omitempty"` // convert to an enum? + Guar *int8 `json:"guar,omitempty"` // Attribute: // mincpmpersec From 0c131e30d90b241d709a42e91c3a43a2c5263fea Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Fri, 17 Nov 2023 13:47:55 -0500 Subject: [PATCH 3/6] Fix Deal DurFloors --- openrtb2/deal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/deal.go b/openrtb2/deal.go index acfe8fa..b9e90ae 100644 --- a/openrtb2/deal.go +++ b/openrtb2/deal.go @@ -94,7 +94,7 @@ type Deal struct { // Description: // An array of DurFloors objects (Section 3.2.35) indicating the floor // prices for video creatives of various durations that the buyer may bid with. - DurFloors [] `json:"durfloors,omitempty"` + DurFloors []DurFloors `json:"durfloors,omitempty"` // Attribute: // wadomain From 5cf6415780d65557d96de14e6c760e98a91366bf Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Fri, 17 Nov 2023 13:50:19 -0500 Subject: [PATCH 4/6] Follow Rules For Guar Type --- openrtb2/deal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/deal.go b/openrtb2/deal.go index b9e90ae..7d730bc 100644 --- a/openrtb2/deal.go +++ b/openrtb2/deal.go @@ -75,7 +75,7 @@ type Deal struct { // Description: // Indicates that the deal is of type guaranteed and the bidder must // bid on the deal, where 0 = not a guaranteed deal, 1 = guaranteed deal. - Guar *int8 `json:"guar,omitempty"` + Guar int8 `json:"guar,omitempty"` // Attribute: // mincpmpersec From bea3d61ae68811ecbf1e96b65138ead718da6274 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Fri, 17 Nov 2023 13:52:32 -0500 Subject: [PATCH 5/6] Whitespace Consistency --- openrtb2/durfloors.go | 1 + openrtb2/refresh.go | 1 + openrtb2/refsettings.go | 1 + 3 files changed, 3 insertions(+) diff --git a/openrtb2/durfloors.go b/openrtb2/durfloors.go index dc4cbd2..c203eff 100644 --- a/openrtb2/durfloors.go +++ b/openrtb2/durfloors.go @@ -11,6 +11,7 @@ import ( // There are no explicit constraints on the defined ranges, nor guarantees that they don't overlap. // In cases where multiple ranges may apply, it is up to the buyer and seller to coordinate on which floor is applicable. type DurFloors struct { + // Attribute: // mindur // Type: diff --git a/openrtb2/refresh.go b/openrtb2/refresh.go index dae1349..87f3912 100644 --- a/openrtb2/refresh.go +++ b/openrtb2/refresh.go @@ -4,6 +4,7 @@ import "encoding/json" // Object: Refresh type Refresh struct { + // Attribute: // refsettings // Type: diff --git a/openrtb2/refsettings.go b/openrtb2/refsettings.go index 45b0007..9c7c08f 100644 --- a/openrtb2/refsettings.go +++ b/openrtb2/refsettings.go @@ -10,6 +10,7 @@ import ( // // Information on how often and what triggers an ad slot being refreshed. type RefSettings struct { + // Attribute: // reftype // Type: From fcaa4c665836093d7e1883e610e24c08e02b9df2 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Wed, 22 Nov 2023 13:04:10 -0500 Subject: [PATCH 6/6] Fix Deal DurFloors Description --- openrtb2/deal.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openrtb2/deal.go b/openrtb2/deal.go index 7d730bc..1cdccaa 100644 --- a/openrtb2/deal.go +++ b/openrtb2/deal.go @@ -92,8 +92,9 @@ type Deal struct { // Type: // object array // Description: - // An array of DurFloors objects (Section 3.2.35) indicating the floor - // prices for video creatives of various durations that the buyer may bid with. + // Container for floor price by duration information, to be used if a + // given deal is eligible for video or audio demand. An array of DurFloors + // objects (see Section 3.2.35). DurFloors []DurFloors `json:"durfloors,omitempty"` // Attribute: