From a8fef21c3bf309315e3000050c633dcae8369eea Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Wed, 11 May 2022 17:08:34 -0400 Subject: [PATCH 01/62] Increment Version --- README.md | 18 +++++++++--------- adcom1/README.md | 2 +- adcom1/adcom1_test.go | 2 +- go.mod | 2 +- native1/README.md | 2 +- native1/request/README.md | 2 +- native1/request/data.go | 2 +- native1/request/event_tracker.go | 2 +- native1/request/image.go | 2 +- native1/request/request.go | 2 +- native1/request/request_test.go | 2 +- native1/request/video.go | 2 +- native1/response/README.md | 2 +- native1/response/data.go | 2 +- native1/response/event_tracker.go | 2 +- native1/response/image.go | 2 +- native1/response/response_test.go | 2 +- openrtb2/README.md | 2 +- openrtb2/bid_request_test.go | 2 +- openrtb2/bid_response_test.go | 2 +- openrtb3/README.md | 2 +- openrtb3/openrtb3_test.go | 2 +- 22 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index da4980d..ac4f845 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# openrtb [![Go Reference](https://pkg.go.dev/badge/github.com/mxmCherry/openrtb/v15.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15) [![Test](https://github.com/mxmCherry/openrtb/actions/workflows/test.yml/badge.svg)](https://github.com/mxmCherry/openrtb/actions/workflows/test.yml) +# openrtb [![Go Reference](https://pkg.go.dev/badge/github.com/mxmCherry/openrtb/v16.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16) [![Test](https://github.com/mxmCherry/openrtb/actions/workflows/test.yml/badge.svg)](https://github.com/mxmCherry/openrtb/actions/workflows/test.yml) [OpenRTB](https://iabtechlab.com/standards/openrtb/), [AdCOM](https://iabtechlab.com/standards/openmedia) and [OpenRTB Dynamic Native Ads](https://iabtechlab.com/standards/openrtb-native/) types for [Go programming language](https://golang.org/) @@ -16,19 +16,19 @@ Also, [test/matcher library](https://github.com/onsi/gomega) relies on newer Go # Using ```bash -go get -u "github.com/mxmCherry/openrtb/v15/..." +go get -u "github.com/mxmCherry/openrtb/v16/..." ``` ```go import ( - openrtb2 "github.com/mxmCherry/openrtb/v15/openrtb2" + openrtb2 "github.com/mxmCherry/openrtb/v16/openrtb2" - openrtb3 "github.com/mxmCherry/openrtb/v15/openrtb3" - adcom1 "github.com/mxmCherry/openrtb/v15/adcom1" + openrtb3 "github.com/mxmCherry/openrtb/v16/openrtb3" + adcom1 "github.com/mxmCherry/openrtb/v16/adcom1" - native1 "github.com/mxmCherry/openrtb/v15/native1" - nreq "github.com/mxmCherry/openrtb/v15/native1/request" - nres "github.com/mxmCherry/openrtb/v15/native1/response" + native1 "github.com/mxmCherry/openrtb/v16/native1" + nreq "github.com/mxmCherry/openrtb/v16/native1/request" + nres "github.com/mxmCherry/openrtb/v16/native1/response" ) ``` @@ -64,7 +64,7 @@ Pointer | Omitempty | When to use Using both pointer and `omitempty` is mostly just to save traffic / generate more "canonical" (strict) JSON. -## Documentation ([pkg.go.dev](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15)) +## Documentation ([pkg.go.dev](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16)) - [Godoc: documenting Go code](http://blog.golang.org/godoc-documenting-go-code) - Each entity (type, struct key or constant) should be documented - Comments for entities should be copy-pasted "as-is" from OpenRTB specification (except section 5 - replace "table" with "list" there; ideally, each sentence must be on a new line) diff --git a/adcom1/README.md b/adcom1/README.md index 2ab0f13..d45ad77 100644 --- a/adcom1/README.md +++ b/adcom1/README.md @@ -1,3 +1,3 @@ -# adcom1 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/adcom1?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/adcom1) +# adcom1 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/adcom1?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/adcom1) [AdCOM](https://iabtechlab.com/standards/openmedia/) [1.0](https://github.com/InteractiveAdvertisingBureau/AdCOM) types for [Go programming language](https://golang.org/) diff --git a/adcom1/adcom1_test.go b/adcom1/adcom1_test.go index 110c564..0896bb6 100644 --- a/adcom1/adcom1_test.go +++ b/adcom1/adcom1_test.go @@ -8,7 +8,7 @@ import ( . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/gomega" - . "github.com/mxmCherry/openrtb/v15/adcom1" + . "github.com/mxmCherry/openrtb/v16/adcom1" ) var _ = DescribeTable( diff --git a/go.mod b/go.mod index 402af62..0d7135e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/mxmCherry/openrtb/v15 +module github.com/mxmCherry/openrtb/v16 go 1.16 diff --git a/native1/README.md b/native1/README.md index 3e4a2fb..c75dcc7 100644 --- a/native1/README.md +++ b/native1/README.md @@ -1,4 +1,4 @@ -# native1 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/native1?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/native1) +# native1 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/native1?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/native1) [OpenRTB Dynamic Native Ads API](https://iabtechlab.com/standards/openrtb-native/) [1.2](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) section "7 Reference Lists/Enumerations" types for [Go programming language](https://golang.org/) diff --git a/native1/request/README.md b/native1/request/README.md index f560845..3baef77 100644 --- a/native1/request/README.md +++ b/native1/request/README.md @@ -1,3 +1,3 @@ -# native1/request [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/native1/request?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/native1/request) +# native1/request [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/native1/request?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/6/native1/request) [OpenRTB Dynamic Native Ads API](https://iabtechlab.com/standards/openrtb-native/) [1.2](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) section "4 Native Ad Request Markup Details" types for [Go programming language](https://golang.org/) diff --git a/native1/request/data.go b/native1/request/data.go index d37b57f..fc8ece2 100644 --- a/native1/request/data.go +++ b/native1/request/data.go @@ -3,7 +3,7 @@ package request import ( "encoding/json" - "github.com/mxmCherry/openrtb/v15/native1" + "github.com/mxmCherry/openrtb/v16/native1" ) // 4.6 Data Object diff --git a/native1/request/event_tracker.go b/native1/request/event_tracker.go index 1af6c20..7b774be 100644 --- a/native1/request/event_tracker.go +++ b/native1/request/event_tracker.go @@ -3,7 +3,7 @@ package request import ( "encoding/json" - "github.com/mxmCherry/openrtb/v15/native1" + "github.com/mxmCherry/openrtb/v16/native1" ) // 4.7 Event Trackers Request Object diff --git a/native1/request/image.go b/native1/request/image.go index ace9ea6..6b5bea8 100644 --- a/native1/request/image.go +++ b/native1/request/image.go @@ -3,7 +3,7 @@ package request import ( "encoding/json" - "github.com/mxmCherry/openrtb/v15/native1" + "github.com/mxmCherry/openrtb/v16/native1" ) // 4.4 Image Object diff --git a/native1/request/request.go b/native1/request/request.go index f9bd9f5..c0aac62 100644 --- a/native1/request/request.go +++ b/native1/request/request.go @@ -8,7 +8,7 @@ package request import ( "encoding/json" - "github.com/mxmCherry/openrtb/v15/native1" + "github.com/mxmCherry/openrtb/v16/native1" ) // 4.1 Native Markup Request Object diff --git a/native1/request/request_test.go b/native1/request/request_test.go index ab45772..32a2f39 100644 --- a/native1/request/request_test.go +++ b/native1/request/request_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "path/filepath" - . "github.com/mxmCherry/openrtb/v15/native1/request" + . "github.com/mxmCherry/openrtb/v16/native1/request" . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" diff --git a/native1/request/video.go b/native1/request/video.go index ef67280..05fee3e 100644 --- a/native1/request/video.go +++ b/native1/request/video.go @@ -3,7 +3,7 @@ package request import ( "encoding/json" - "github.com/mxmCherry/openrtb/v15/native1" + "github.com/mxmCherry/openrtb/v16/native1" ) // 4.5 Video Object diff --git a/native1/response/README.md b/native1/response/README.md index cc03b16..9cbf221 100644 --- a/native1/response/README.md +++ b/native1/response/README.md @@ -1,3 +1,3 @@ -# native1/response [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/native1/response?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/native1/response) +# native1/response [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/native1/response?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/native1/response) [OpenRTB Dynamic Native Ads API](https://iabtechlab.com/standards/openrtb-native/) [1.2](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) section "5 Native Ad Response Markup Details" types for [Go programming language](https://golang.org/) diff --git a/native1/response/data.go b/native1/response/data.go index e2de89c..f20842b 100644 --- a/native1/response/data.go +++ b/native1/response/data.go @@ -3,7 +3,7 @@ package response import ( "encoding/json" - "github.com/mxmCherry/openrtb/v15/native1" + "github.com/mxmCherry/openrtb/v16/native1" ) // 5.5 Object: Data diff --git a/native1/response/event_tracker.go b/native1/response/event_tracker.go index 4b593e0..b58930a 100644 --- a/native1/response/event_tracker.go +++ b/native1/response/event_tracker.go @@ -3,7 +3,7 @@ package response import ( "encoding/json" - "github.com/mxmCherry/openrtb/v15/native1" + "github.com/mxmCherry/openrtb/v16/native1" ) // 5.8 Event Tracker Response Object diff --git a/native1/response/image.go b/native1/response/image.go index 728cf8f..2c25cb1 100644 --- a/native1/response/image.go +++ b/native1/response/image.go @@ -3,7 +3,7 @@ package response import ( "encoding/json" - "github.com/mxmCherry/openrtb/v15/native1" + "github.com/mxmCherry/openrtb/v16/native1" ) // 5.4 Object: Image diff --git a/native1/response/response_test.go b/native1/response/response_test.go index 50dac08..1341c57 100644 --- a/native1/response/response_test.go +++ b/native1/response/response_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "path/filepath" - . "github.com/mxmCherry/openrtb/v15/native1/response" + . "github.com/mxmCherry/openrtb/v16/native1/response" . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" diff --git a/openrtb2/README.md b/openrtb2/README.md index 01b662f..2bc54d1 100644 --- a/openrtb2/README.md +++ b/openrtb2/README.md @@ -1,3 +1,3 @@ -# openrtb2 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/openrtb2?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/openrtb2) +# openrtb2 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/openrtb2?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/openrtb2) [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.5](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) types for [Go programming language](https://golang.org/) diff --git a/openrtb2/bid_request_test.go b/openrtb2/bid_request_test.go index 1ba280c..89df631 100644 --- a/openrtb2/bid_request_test.go +++ b/openrtb2/bid_request_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "path/filepath" - . "github.com/mxmCherry/openrtb/v15/openrtb2" + . "github.com/mxmCherry/openrtb/v16/openrtb2" . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" diff --git a/openrtb2/bid_response_test.go b/openrtb2/bid_response_test.go index 0c5ca1b..1c4b2e8 100644 --- a/openrtb2/bid_response_test.go +++ b/openrtb2/bid_response_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "path/filepath" - . "github.com/mxmCherry/openrtb/v15/openrtb2" + . "github.com/mxmCherry/openrtb/v16/openrtb2" . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" diff --git a/openrtb3/README.md b/openrtb3/README.md index 359d54b..9f8a0a4 100644 --- a/openrtb3/README.md +++ b/openrtb3/README.md @@ -1,3 +1,3 @@ -# openrtb3 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/openrtb3?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v15/openrtb3) +# openrtb3 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/openrtb3?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/openrtb3) [OpenRTB](https://iabtechlab.com/standards/openrtb/) [3.0](https://github.com/InteractiveAdvertisingBureau/openrtb) types for [Go programming language](https://golang.org/) diff --git a/openrtb3/openrtb3_test.go b/openrtb3/openrtb3_test.go index 0b417f4..987c93b 100644 --- a/openrtb3/openrtb3_test.go +++ b/openrtb3/openrtb3_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "path/filepath" - . "github.com/mxmCherry/openrtb/v15/openrtb3" + . "github.com/mxmCherry/openrtb/v16/openrtb3" . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/gomega" From 4b4474f897192e8fdca8f6d89370abed6713f003 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Thu, 12 May 2022 21:59:35 -0400 Subject: [PATCH 02/62] Main OpenRTB 2.6 Changes --- README.md | 2 +- native1/protocol.go | 6 +- openrtb2/README.md | 2 +- openrtb2/ad_position.go | 33 ----- openrtb2/api_framework.go | 15 -- openrtb2/app.go | 38 ++++- openrtb2/audio.go | 118 +++++++++++++--- openrtb2/banner.go | 71 +++------- openrtb2/banner_ad_type.go | 13 -- openrtb2/bid.go | 93 ++++++++++-- openrtb2/bid_request.go | 57 ++++++-- openrtb2/bid_response.go | 7 +- openrtb2/brand_version.go | 37 +++++ openrtb2/channel.go | 49 +++++++ openrtb2/companion_type.go | 14 -- openrtb2/connection_type.go | 29 ---- openrtb2/content.go | 75 +++++++--- openrtb2/content_context.go | 18 --- openrtb2/content_delivery_method.go | 12 -- openrtb2/creative_attribute.go | 26 ---- openrtb2/device.go | 85 ++++++++--- openrtb2/device_type.go | 22 --- openrtb2/eid.go | 37 +++++ openrtb2/expandable_direction.go | 14 -- openrtb2/feed_type.go | 12 -- openrtb2/geo.go | 9 +- openrtb2/imp.go | 27 +++- openrtb2/ip_location_service.go | 13 -- openrtb2/iqg_media_rating.go | 13 -- openrtb2/location_type.go | 12 -- openrtb2/loss_reason_code.go | 41 ------ openrtb2/metric.go | 2 +- openrtb2/native.go | 22 ++- openrtb2/network.go | 49 +++++++ openrtb2/no_bid_reason_code.go | 33 ----- openrtb2/openrtb2.go | 4 +- openrtb2/playback_cessation_mode.go | 12 -- openrtb2/playback_method.go | 15 -- openrtb2/producer.go | 14 +- openrtb2/production_quality.go | 27 ---- openrtb2/protocol.go | 19 --- openrtb2/publisher.go | 13 +- openrtb2/regs.go | 24 +++- openrtb2/seat_bid.go | 2 +- openrtb2/site.go | 32 ++++- openrtb2/source.go | 11 ++ openrtb2/start_delay.go | 28 ---- openrtb2/supply_chain.go | 52 +++++++ openrtb2/supply_chain_node.go | 92 ++++++++++++ openrtb2/testdata/README.md | 2 +- openrtb2/uid.go | 36 +++++ openrtb2/user.go | 35 ++++- openrtb2/user_agent.go | 86 +++++++++++ openrtb2/video.go | 196 ++++++++++++++++++-------- openrtb2/video_linearity.go | 16 --- openrtb2/video_placement_type.go | 14 -- openrtb2/volume_normalization_mode.go | 27 ---- 57 files changed, 1147 insertions(+), 716 deletions(-) delete mode 100644 openrtb2/ad_position.go delete mode 100644 openrtb2/api_framework.go delete mode 100644 openrtb2/banner_ad_type.go create mode 100644 openrtb2/brand_version.go create mode 100644 openrtb2/channel.go delete mode 100644 openrtb2/companion_type.go delete mode 100644 openrtb2/connection_type.go delete mode 100644 openrtb2/content_context.go delete mode 100644 openrtb2/content_delivery_method.go delete mode 100644 openrtb2/creative_attribute.go delete mode 100644 openrtb2/device_type.go create mode 100644 openrtb2/eid.go delete mode 100644 openrtb2/expandable_direction.go delete mode 100644 openrtb2/feed_type.go delete mode 100644 openrtb2/ip_location_service.go delete mode 100644 openrtb2/iqg_media_rating.go delete mode 100644 openrtb2/location_type.go delete mode 100644 openrtb2/loss_reason_code.go create mode 100644 openrtb2/network.go delete mode 100644 openrtb2/no_bid_reason_code.go delete mode 100644 openrtb2/playback_cessation_mode.go delete mode 100644 openrtb2/playback_method.go delete mode 100644 openrtb2/production_quality.go delete mode 100644 openrtb2/protocol.go delete mode 100644 openrtb2/start_delay.go create mode 100644 openrtb2/supply_chain.go create mode 100644 openrtb2/supply_chain_node.go create mode 100644 openrtb2/uid.go create mode 100644 openrtb2/user_agent.go delete mode 100644 openrtb2/video_linearity.go delete mode 100644 openrtb2/video_placement_type.go delete mode 100644 openrtb2/volume_normalization_mode.go diff --git a/README.md b/README.md index ac4f845..ec0c27f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [OpenRTB](https://iabtechlab.com/standards/openrtb/), [AdCOM](https://iabtechlab.com/standards/openmedia) and [OpenRTB Dynamic Native Ads](https://iabtechlab.com/standards/openrtb-native/) types for [Go programming language](https://golang.org/) -- [openrtb2](openrtb2/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.5](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) +- [openrtb2](openrtb2/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.6](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) - [openrtb3](openrtb3/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [3.0](https://github.com/InteractiveAdvertisingBureau/openrtb) - [adcom1](adcom1/) - [AdCOM](https://iabtechlab.com/standards/openmedia/) [1.0](https://github.com/InteractiveAdvertisingBureau/AdCOM) - [native1](native1/) - [OpenRTB Dynamic Native Ads API](https://iabtechlab.com/standards/openrtb-native/) [1.2](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) diff --git a/native1/protocol.go b/native1/protocol.go index 23ab7ba..d23d54e 100644 --- a/native1/protocol.go +++ b/native1/protocol.go @@ -1,6 +1,6 @@ package native1 -// 5.8 Protocols (from OpenRTB spec 2.5) +// 5.8 Protocols (from AdCOM spec 1.0) // // Options for the various bid response protocols that could be supported by an exchange. // @@ -18,4 +18,8 @@ const ( ProtocolVAST40Wrapper Protocol = 8 // VAST 4.0 Wrapper ProtocolDAAST10 Protocol = 9 // DAAST 1.0 ProtocolDAAST10Wrapper Protocol = 10 // DAAST 1.0 Wrapper + ProtocolVAST41 Protocol = 11 // VAST 4.1 + ProtocolVAST41Wrapper Protocol = 11 // VAST 4.1 Wrapper + ProtocolVAST42 Protocol = 11 // VAST 4.2 + ProtocolVAST42Wrapper Protocol = 11 // VAST 4.2 Wrapper ) diff --git a/openrtb2/README.md b/openrtb2/README.md index 2bc54d1..78bec08 100644 --- a/openrtb2/README.md +++ b/openrtb2/README.md @@ -1,3 +1,3 @@ # openrtb2 [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/openrtb2?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/openrtb2) -[OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.5](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) types for [Go programming language](https://golang.org/) +[OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.6](https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf) types for [Go programming language](https://golang.org/) diff --git a/openrtb2/ad_position.go b/openrtb2/ad_position.go deleted file mode 100644 index 2f76994..0000000 --- a/openrtb2/ad_position.go +++ /dev/null @@ -1,33 +0,0 @@ -package openrtb2 - -// 5.4 Ad Position -// -// Position of the ad as a relative measure of visibility or prominence. -// This OpenRTB list has values derived from the Inventory Quality Guidelines (IQG). -// Practitioners should keep in sync with updates to the IQG values as published on IAB.com. -// Values “4” - “7” apply to apps per the mobile addendum to IQG version 2.1. -type AdPosition int8 - -const ( - AdPositionUnknown AdPosition = 0 // Unknown - AdPositionAboveTheFold AdPosition = 1 // Above the Fold - AdPositionMayOrMayNotBeInitiallyVisible AdPosition = 2 // DEPRECATED - May or may not be initially visible depending on screen size/resolution. - AdPositionBelowTheFold AdPosition = 3 // Below the Fold - AdPositionHeader AdPosition = 4 // Header - AdPositionFooter AdPosition = 5 // Footer - AdPositionSidebar AdPosition = 6 // Sidebar - AdPositionFullScreen AdPosition = 7 // Full Screen -) - -// Ptr returns pointer to own value. -func (p AdPosition) Ptr() *AdPosition { - return &p -} - -// Val safely dereferences pointer, returning default value (AdPositionUnknown) for nil. -func (p *AdPosition) Val() AdPosition { - if p == nil { - return AdPositionUnknown - } - return *p -} diff --git a/openrtb2/api_framework.go b/openrtb2/api_framework.go deleted file mode 100644 index f5403bd..0000000 --- a/openrtb2/api_framework.go +++ /dev/null @@ -1,15 +0,0 @@ -package openrtb2 - -// 5.6 API Frameworks -// -// List of API frameworks supported by the publisher. -type APIFramework int8 - -const ( - APIFrameworkVPAID10 APIFramework = 1 // VPAID 1.0 - APIFrameworkVPAID20 APIFramework = 2 // VPAID 2.0 - APIFrameworkMRAID1 APIFramework = 3 // MRAID-1 - APIFrameworkORMMA APIFramework = 4 // ORMMA - APIFrameworkMRAID2 APIFramework = 5 // MRAID-2 - APIFrameworkMRAID3 APIFramework = 6 // MRAID-3 -) diff --git a/openrtb2/app.go b/openrtb2/app.go index ce08d67..502d608 100644 --- a/openrtb2/app.go +++ b/openrtb2/app.go @@ -30,10 +30,12 @@ type App struct { // Type: // string // Description: - // A platform-specific application identifier intended to be - // unique to the app and independent of the exchange. On - // Android, this should be a bundle or package name (e.g., - // com.foo.mygame). On iOS, it is typically a numeric ID. + // The store ID of the app in an app store. See OTT/CTV Store + // Assigned App Identification Guidelines for more details about + // expected strings for CTV app stores. For mobile apps in + // Google Play Store, these should be bundle or package names + // (e.g. com.foo.mygame). For apps in Apple App Store, these + // should be a numeric ID. Bundle string `json:"bundle,omitempty"` // Attribute: @@ -52,12 +54,23 @@ type App struct { // App store URL for an installed app; for IQG 2.1 compliance. StoreURL string `json:"storeurl,omitempty"` + // Attribute: + // cattax + // Type: + // integer; default 1 + // Description: + // The taxonomy in use. Refer to the AdCOM list List: Category + // Taxonomies for values. + CatTax int64 `json:"cattax,omitempty"` + // Attribute: // cat // Type: // string array // Description: - // Array of IAB content categories of the app. Refer to List 5.1 + // Array of IAB content categories of the app. 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. Cat []string `json:"cat,omitempty"` // Attribute: @@ -66,7 +79,8 @@ type App struct { // string array // Description: // Array of IAB content categories that describe the current - // section of the app. Refer to List 5.1. + // section of the app. + // The taxonomy to be used is defined by the cattax field. SectionCat []string `json:"sectioncat,omitempty"` // Attribute: @@ -75,7 +89,8 @@ type App struct { // string array // Description: // Array of IAB content categories that describe the current page - // or view of the app. Refer to List 5.1. + // or view of the app. + // The taxonomy to be used is defined by the cattax field. PageCat []string `json:"pagecat,omitempty"` // Attribute: @@ -126,6 +141,15 @@ type App struct { // Comma separated list of keywords about the app. Keywords string `json:"keywords,omitempty"` + // Attribute: + // kwarray + // Type: + // string + // Description: + // Array of keywords about the site. Only one of ‘keywords’ or + // ‘kwarray’ may be present. + KwArray []string `json:"kwarray,omitempty"` + // Attribute: // ext // Type: diff --git a/openrtb2/audio.go b/openrtb2/audio.go index 9b2ac5a..ca607a6 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -25,7 +25,7 @@ type Audio struct { // Attribute: // minduration // Type: - // integer; recommended + // integer; default 0; recommended // Description: // Minimum audio ad duration in seconds. MinDuration int64 `json:"minduration,omitempty"` @@ -38,13 +38,27 @@ type Audio struct { // Maximum audio ad duration in seconds. MaxDuration int64 `json:"maxduration,omitempty"` + // Attribute: + // poddur + // Type: + // integer; recommended + // Description: + // Indicates the total amount of time that advertisers may fill for a + // "dynamic" audio ad pod, or the dynamic portion of a "hybrid" + // ad pod. This field is required only for the dynamic portion(s) of + // audio ad pods. This field refers to the length of the entire ad + // break, whereas minduration/maxduration/rqddurs are + // constraints relating to the slots that make up the pod. + PodDur int64 `json:"poddur,omitempty"` + // Attribute: // protocols // Type: // integer array; recommended // Description: - // Array of supported audio protocols. Refer to List 5.8. - Protocols []Protocol `json:"protocols,omitempty"` + // Array of supported audio protocols. Refer to List: Creative + // Subtypes - Audio/Video in AdCOM 1.0. + Protocols []int8 `json:"protocols,omitempty"` // Attribute: // startdelay @@ -52,26 +66,84 @@ type Audio struct { // integer; recommended // Description: // Indicates the start delay in seconds for pre-roll, mid-roll, or - // post-roll ad placements. Refer to List 5.12. - StartDelay *StartDelay `json:"startdelay,omitempty"` + // post-roll ad placements. Refer to List: Start Delay Modes in + // AdCOM 1.0. + StartDelay *int8 `json:"startdelay,omitempty"` // Attribute: - // sequence + // rqddurs + // Type: + // integer array + // Description: + // Precise acceptable durations for audio creatives in seconds. This + // field specifically targets the live audio/radio use case where + // non-exact ad durations would result in undesirable ‘dead air’. + // This field is mutually exclusive with minduration and + // maxduration; if rqddurs is specified, minduration and + // maxduration must not be specified and vice versa. + RqdDurs []int64 `json:"rqddurs,omitempty"` + + // Attribute: + // podid // Type: // integer // Description: + // Unique identifier indicating that an impression opportunity + // belongs to an audioad pod. If multiple impression opportunities + // within a bid request share the same podid, this indicates that + // those impression opportunities belong to the same audio ad + // pod. + PodID int64 `json:"podid,omitempty"` + + // Attribute: + // podid + // Type: + // integer; default 0 + // Description: + // The sequence (position) of the audio ad pod within a + // content stream. Refer to List: Pod Sequence in AdCOM 1.0 + // for guidance on the use of this field. + PodSeq int8 `json:"podseq,omitempty"` + + // Attribute: + // sequence + // Type: + // integer; default 0; DEPRECATED + // Description: // If multiple ad impressions are offered in the same bid request, // the sequence number will allow for the coordinated delivery // of multiple creatives. Sequence int64 `json:"sequence,omitempty"` + // Attribute: + // slotinpod + // Type: + // integer; default 0 + // Description: + // For audio ad pods, this value indicates that the seller can + // guarantee delivery against the indicated sequence. Refer to + // List: Slot Position in Pod in AdCOM 1.0 for guidance on the + // use of this field. + SlotInPod *int8 `json:"slotinpod,omitempty"` + + // Attribute: + // mincpmpersec + // Type: + // float + // Description: + // Minimum CPM per second. This is a price floor for the + // "dynamic" portion of an audio ad pod, relative to the duration + // of bids an advertiser may submit. + MinCPMPerSec float64 `json:"mincpmpersec,omitempty"` + // Attribute: // battr // Type: // integer array // Description: - // Blocked creative attributes. Refer to List 5.3. - BAttr []CreativeAttribute `json:"battr,omitempty"` + // Blocked creative attributes. Refer to List: Creative Attributes in + // AdCOM 1.0. + BAttr []int64 `json:"battr,omitempty"` // Attribute: // maxextended @@ -107,8 +179,9 @@ type Audio struct { // integer array // Description: // Supported delivery methods (e.g., streaming, progressive). If - // none specified, assume all are supported. Refer to List 5.15. - Delivery []ContentDeliveryMethod `json:"delivery,omitempty"` + // none specified, assume all are supported. Refer to List: Delivery + // Methods in AdCOM 1.0. + Delivery []int8 `json:"delivery,omitempty"` // Attribute: // companionad @@ -125,19 +198,19 @@ type Audio struct { // integer array // Description: // List of supported API frameworks for this impression. Refer to - // List 5.6. If an API is not explicitly listed, it is assumed not to be - // supported. - API []APIFramework `json:"api,omitempty"` + // List: API Frameworks in AdCOM 1.0. If an API is not explicitly + // listed, it is assumed not to be supported. + API []int64 `json:"api,omitempty"` // Attribute: // companiontype // Type: // integer array // Description: - // Supported DAAST companion ad types. Refer to List 5.14. - // Recommended if companion Banner objects are included via - // the companionad array. - CompanionType []CompanionType `json:"companiontype,omitempty"` + // Supported companion ad types. Refer to List: Companion + // Types in AdCOM 1.0. Recommended if companion Banner + // objects are included via the companionad array. + CompanionType []int8 `json:"companiontype,omitempty"` // Attribute: // maxseq @@ -145,8 +218,6 @@ type Audio struct { // integer // Description: // The maximum number of ads that can be played in an ad pod. - // OpenRTB API Specification Version 2.5 IAB Technology Lab - // www.iab.com/openrtb Page 18 MaxSeq int64 `json:"maxseq,omitempty"` // Attribute: @@ -154,8 +225,8 @@ type Audio struct { // Type: // integer // Description: - // Type of audio feed. Refer to List 5.16. - Feed FeedType `json:"feed,omitempty"` + // Type of audio feed. Refer to List: Feed Types in AdCOM 1.0. + Feed int8 `json:"feed,omitempty"` // Attribute: // stitched @@ -171,8 +242,9 @@ type Audio struct { // Type: // integer // Description: - // Volume normalization mode. Refer to List 5.17. - NVol *VolumeNormalizationMode `json:"nvol,omitempty"` + // Volume normalization mode. Refer to List: Volume + // Normalization Modes in AdCOM 1.0. + NVol int8 `json:"nvol,omitempty"` // Attribute: // ext diff --git a/openrtb2/banner.go b/openrtb2/banner.go index 23fc078..bfbf7de 100644 --- a/openrtb2/banner.go +++ b/openrtb2/banner.go @@ -41,74 +41,42 @@ type Banner struct { // recommended if no format objects are specified. H *int64 `json:"h,omitempty"` - // Attribute: - // wmax - // Type: - // integer; DEPRECATED - // Description: - // NOTE: Deprecated in favor of the format array. - // Maximum width in device independent pixels (DIPS). - WMax int64 `json:"wmax,omitempty"` - - // Attribute: - // hmax - // Type: - // integer; DEPRECATED - // Description: - // NOTE: Deprecated in favor of the format array. - // Maximum height in device independent pixels (DIPS). - HMax int64 `json:"hmax,omitempty"` - - // Attribute: - // wmin - // Type: - // integer; DEPRECATED - // Description: - // NOTE: Deprecated in favor of the format array. - // Minimum width in device independent pixels (DIPS). - WMin int64 `json:"wmin,omitempty"` - - // Attribute: - // hmin - // Type: - // integer; DEPRECATED - // Description: - // NOTE: Deprecated in favor of the format array. - // Minimum height in device independent pixels (DIPS). - HMin int64 `json:"hmin,omitempty"` - // Attribute: // btype // Type: // integer array // Description: - // Blocked banner ad types. Refer to List 5.2. - BType []BannerAdType `json:"btype,omitempty"` + // Blocked banner ad types. + // Values: + // 1 = XHTML Text Ad, + // 2 = XHTML Banner Ad, + // 3 = JavaScript Ad, + // 4 = iframe. + BType []int8 `json:"btype,omitempty"` // Attribute: // battr // Type: // integer array // Description: - // Blocked creative attributes. Refer to List 5.3. - BAttr []CreativeAttribute `json:"battr,omitempty"` + // Blocked creative attributes. Refer to List: Creative Attributes in AdCOM 1.0. + BAttr []int64 `json:"battr,omitempty"` // Attribute: // pos // Type: // integer // Description: - // Ad position on screen. Refer to List 5.4. - Pos *AdPosition `json:"pos,omitempty"` + // Ad position on screen. Refer to List: Placement Positions in AdCOM 1.0. + Pos *int8 `json:"pos,omitempty"` // Attribute: // mimes // Type: // string array // Description: - // Content MIME types supported. Popular MIME types may - // include “application/x-shockwave-flash”, - // “image/jpg”, and “image/gif”. + // Content MIME types supported. Popular MIME types may include, + // "image/jpeg" and "image/gif". MIMEs []string `json:"mimes,omitempty"` // Attribute: @@ -125,18 +93,19 @@ type Banner struct { // Type: // integer array // Description: - // Directions in which the banner may expand. Refer to List 5.5. - ExpDir []ExpandableDirection `json:"expdir,omitempty"` + // Directions in which the banner may expand. Refer to List: Expandable + // Directions in AdCOM 1.0. + ExpDir []int8 `json:"expdir,omitempty"` // Attribute: // api // Type: // integer array // Description: - // List of supported API frameworks for this impression. Refer to - // List 5.6. If an API is not explicitly listed, it is assumed not to be - // supported. - API []APIFramework `json:"api,omitempty"` + // List of supported API frameworks for this impression. Refer to List: API + // Frameworks in AdCOM 1.0. If an API is not explicitly listed, it is assumed + // not to be supported. + API []int64 `json:"api,omitempty"` // Attribute: // id diff --git a/openrtb2/banner_ad_type.go b/openrtb2/banner_ad_type.go deleted file mode 100644 index f597250..0000000 --- a/openrtb2/banner_ad_type.go +++ /dev/null @@ -1,13 +0,0 @@ -package openrtb2 - -// 5.2 Banner Ad Types -// -// Types of ads that can be accepted by the exchange unless restricted by publisher site settings. -type BannerAdType int8 - -const ( - BannerAdTypeXHTMLTextAd BannerAdType = 1 // XHTML Text Ad (usually mobile) - BannerAdTypeXHTMLBannerAd BannerAdType = 2 // XHTML Banner Ad. (usually mobile) - BannerAdTypeJavaScriptAd BannerAdType = 3 // JavaScript Ad; must be valid XHTML (i.e., Script Tags Included) - BannerAdTypeIframe BannerAdType = 4 // iframe -) diff --git a/openrtb2/bid.go b/openrtb2/bid.go index d4e7b5c..5bf9c2a 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -2,7 +2,7 @@ package openrtb2 import "encoding/json" -// 4.2.3 Object: Bid +// 4.3.19 Object: Bid // // A SeatBid object contains one or more Bid objects, each of which relates to a specific impression in the bid request via the impid attribute and constitutes an offer to buy that impression for a given price. // @@ -166,12 +166,23 @@ type Bid struct { // communicated between buyer and exchanges a priori. Tactic string `json:"tactic,omitempty"` + // Attribute: + // cattax + // Type: + // integer + // Description: + // The taxonomy in use. Refer to the AdCOM 1.0 list List: Category + // Taxonomies for values. + CatTax int64 `json:"cattax,omitempty"` + // Attribute: // cat // Type: // string array // Description: - // IAB content categories of the creative. Refer to List 5.1. + // IAB content categories of the creative. 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. Cat []string `json:"cat,omitempty"` // Attribute: @@ -179,16 +190,29 @@ type Bid struct { // Type: // integer array // Description: - // Set of attributes describing the creative. Refer to List 5.3. - Attr []CreativeAttribute `json:"attr,omitempty"` + // Set of attributes describing the creative. Refer to List: Creative + // Attributes in AdCOM 1.0. + Attr []int64 `json:"attr,omitempty"` + + // Attribute: + // apis + // Type: + // integer array + // Description: + // List of supported APIs for the markup. If an API is not explicitly + // listed, it is assumed to be unsupported. Refer to List: API + // Frameworks in AdCOM 1.0. + APIs int64 `json:"apis,omitempty"` // Attribute: // api // Type: - // integer + // integer; DEPRECATED // Description: - // API required by the markup if applicable. Refer to List 5.6. - API APIFramework `json:"api,omitempty"` + // NOTE: Deprecated in favor of the apis integer array. + // API required by the markup if applicable. Refer to List: API + // Frameworks in AdCOM 1.0. + API int64 `json:"api,omitempty"` // Attribute: // protocol @@ -196,27 +220,37 @@ type Bid struct { // integer // Description: // Video response protocol of the markup if applicable. Refer to - // List 5.8. - Protocol Protocol `json:"protocol,omitempty"` + // List: Creative Subtypes - Audio/Video in AdCOM 1.0. + Protocol int8 `json:"protocol,omitempty"` // Attribute: // qagmediarating // Type: // integer // Description: - // Creative media rating per IQG guidelines. Refer to List 5.19. - QAGMediaRating IQGMediaRating `json:"qagmediarating,omitempty"` + // Media rating per IQG guidelines. Refer to List: Media Ratings in + // AdCOM 1.0. + QAGMediaRating int8 `json:"qagmediarating,omitempty"` // Attribute: // language // Type: // string // Description: - // Language of the creative using ISO-639-1-alpha-2. The nonstandard - // code “xx” may also be used if the creative has no + // Language of the creative using ISO-639-1-alpha-2. The nonstandard code “xx” may also be used if the creative has no // linguistic content (e.g., a banner with just a company logo). + // Only one of language or langb should be present. Language string `json:"language,omitempty"` + // Attribute: + // langb + // Type: + // string + // Description: + // Language of the creative using IETF BCP 47. Only one of + // language or langb should be present + LangB string `json:"langb,omitempty"` + // Attribute: // dealid // Type: @@ -269,6 +303,39 @@ type Bid struct { // wait between the auction and the actual impression. Exp int64 `json:"exp,omitempty"` + // Attribute: + // dur + // Type: + // integer + // Description: + // Duration of the video or audio creative in seconds. + Dur int64 `json:"dur,omitempty"` + + // Attribute: + // mtype + // Type: + // integer + // Description: + // Type of the creative markup so that it can properly be + // associated with the right sub-object of the BidRequest.Imp. + // Values: + // 1 = Banner + // 2 = Video + // 3 = Audio + // 4 = Native + MType int8 `json:"mtype,omitempty"` + + // Attribute: + // slotinpod + // Type: + // integer + // Description: + // Indicates that the bid response is only eligible for a specific + // position within a video or audio ad pod (e.g. first position, + // last position, or any). Refer to List: Slot Position in Pod in + // AdCOM 1.0 for guidance on the use of this field. + SlotInPod *int8 `json:"slotinpod,omitempty"` + // Attribute: // ext // Type: diff --git a/openrtb2/bid_request.go b/openrtb2/bid_request.go index 07ad36d..a318f40 100644 --- a/openrtb2/bid_request.go +++ b/openrtb2/bid_request.go @@ -83,7 +83,7 @@ type BidRequest struct { // Description: // Auction type, where 1 = First Price, 2 = Second Price Plus. // Exchange-specific auction types can be defined using values - // greater than 500. + // 500 and greater. AT int64 `json:"at,omitempty"` // Attribute: @@ -101,12 +101,12 @@ type BidRequest struct { // Type: // string array // Description: - // White list of buyer seats (e.g., advertisers, agencies) allowed - // to bid on this impression. IDs of seats and knowledge of the - // buyer’s customers to which they refer must be coordinated - // between bidders and the exchange a priori. At most, only one - // of wseat and bseat should be used in the same request. - // Omission of both implies no seat restrictions. + // Allowed list of buyer seats (e.g., advertisers, agencies) + // allowed to bid on this impression. IDs of seats and knowledge + // of the buyer’s customers to which they refer must be + // coordinated between bidders and the exchange a priori. At + // most, only one of wseat and bseat should be used in the + // same request. Omission of both implies no seat restrictions. WSeat []string `json:"wseat,omitempty"` // Attribute: @@ -149,21 +149,46 @@ type BidRequest struct { // Type: // string array // Description: - // White list of languages for creatives using ISO-639-1-alpha-2. + // Allowed list of languages for creatives using ISO-639-1-alpha-2. // Omission implies no specific restrictions, but buyers would be // advised to consider language attribute in the Device and/or - // Content objects if available. + // Content objects if available. Only one of wlang or wlangb + // should be present. WLang []string `json:"wlang,omitempty"` + // Attribute: + // wlangb + // Type: + // string array + // Description: + // Allowed list of languages for creatives using IETF BCP 47I. + // Omission implies no specific restrictions, but buyers would be + // advised to consider language attribute in the Device and/or + // Content objects if available. Only one of wlang or wlangb + // should be present. + WLangB []string `json:"wlangb,omitempty"` + // Attribute: // bcat // Type: // string array // Description: - // Blocked advertiser categories using the IAB content - // categories. Refer to List 5.1. + // Blocked 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 Category Taxonomy 1.0 is + // assumed. BCat []string `json:"bcat,omitempty"` + // Attribute: + // cattax + // Type: + // integer; default 1 + // Description: + // The taxonomy in use for bcat. Refer to the AdCOM + // 1.0 list List: Category Taxonomies for values + CatTax int64 `json:"cattax,omitempty"` + // Attribute: // badv // Type: @@ -177,10 +202,12 @@ type BidRequest struct { // Type: // string array // Description: - // Block list of applications by their platform-specific exchangeindependent - // application identifiers. On Android, these should - // be bundle or package names (e.g., com.foo.mygame). On iOS, - // these are numeric IDs. + // Block list of applications by their app store IDs. See OTT/CTV + // Store Assigned App Identification Guidelines for more details + // about expected strings for CTV app stores. For mobile apps in + // Google Play Store, these should be bundle or package names + // (e.g. com.foo.mygame). For apps in Apple App Store, these + // should be a numeric ID. BApp []string `json:"bapp,omitempty"` // Attribute: diff --git a/openrtb2/bid_response.go b/openrtb2/bid_response.go index acc2c9a..bf33d2f 100644 --- a/openrtb2/bid_response.go +++ b/openrtb2/bid_response.go @@ -2,7 +2,7 @@ package openrtb2 import "encoding/json" -// 4.2.1 Object: BidResponse +// 4.3.17 Object: BidResponse // // This object is the top-level bid response object (i.e., the unnamed outer JSON object). // The id attribute is a reflection of the bid request ID for logging purposes. @@ -63,8 +63,9 @@ type BidResponse struct { // Type: // integer // Description: - // Reason for not bidding. Refer to List 5.24. - NBR *NoBidReasonCode `json:"nbr,omitempty"` + // Reason for not bidding. Refer to List: No-Bid Reason Codes in + // OpenRTB 3.0. + NBR *int64 `json:"nbr,omitempty"` // Attribute: // ext diff --git a/openrtb2/brand_version.go b/openrtb2/brand_version.go new file mode 100644 index 0000000..8e6e939 --- /dev/null +++ b/openrtb2/brand_version.go @@ -0,0 +1,37 @@ +package openrtb2 + +import "encoding/json" + +// 3.2.30 Object: BrandVersion +// +// Further identification based on User-Agent Client Hints, the BrandVersion object is used to identify a device’s browser or similar software component, and the user agent’s execution platform or operating system. +type BrandVersion struct { + + // Attribute: + // brand + // Type: + // string; required + // Description: + // A brand identifier, for example, "Chrome" or "Windows". The value may be + // sourced from the User-Agent Client Hints headers, representing either the + // user agent brand (from the Sec-CH-UA-Full-Version header) or the platform + // brand (from the Sec-CH-UA-Platform header). + Brand string `json:"brand"` + + // Attribute: + // version + // Type: + // string array + // Description: + // A sequence of version components, in descending hierarchical order (major, + // minor, micro, …) + Version []string `json:"version,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for advertising-system specific extensions to this object. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/openrtb2/channel.go b/openrtb2/channel.go new file mode 100644 index 0000000..6a884ab --- /dev/null +++ b/openrtb2/channel.go @@ -0,0 +1,49 @@ +package openrtb2 + +import "encoding/json" + +// 3.2.24 Object: Channel +// +// This object describes the channel an ad will be displayed on. +// A Channel is defined as the entity that curates a content library, or stream within a brand name for viewers. +// Examples are specific view selectable ‘channels’ within linear and streaming television (MTV, HGTV, CNN, BBC One, etc) or a specific stream of audio content commonly called ‘stations.’ +// Name is a human-readable field while domain and id can be used for reporting and targeting purposes. +// See 7.6 for further examples. +type Channel struct { + + // Attribute: + // id + // Type: + // string + // Description: + // A unique identifier assigned by the publisher. This may not be + // a unique identifier across all supply sources. + ID string `json:"id,omitempty"` + + // Attribute: + // name + // Type: + // string + // Description: + // Channel the content is on (e.g., a local channel like “WABC-TV"). + Name string `json:"name,omitempty"` + + // Attribute: + // domain + // Type: + // string + // Description: + // The primary domain of the channel (e.g. "abc7ny.com" in the + // case of the local channel WABC-TV). It is recommended to + // include the top private domain (PSL+1) for DSP targeting + // normalization purposes. + Domain string `json:"domain,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for exchange-specific extensions to OpenRTB. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/openrtb2/companion_type.go b/openrtb2/companion_type.go deleted file mode 100644 index 2c538db..0000000 --- a/openrtb2/companion_type.go +++ /dev/null @@ -1,14 +0,0 @@ -package openrtb2 - -// 5.14 Companion Types -// -// Options to indicate markup types allowed for companion ads that apply to video and audio ads. -// This table is derived from VAST 2.0+ and DAAST 1.0 specifications. -// Refer to www.iab.com/guidelines/digital-video-suite for more information. -type CompanionType int8 - -const ( - CompanionTypeStatic CompanionType = 1 // Static Resource - CompanionTypeHTML CompanionType = 2 // HTML Resource - CompanionTypeIframe CompanionType = 3 // iframe Resource -) diff --git a/openrtb2/connection_type.go b/openrtb2/connection_type.go deleted file mode 100644 index 215121b..0000000 --- a/openrtb2/connection_type.go +++ /dev/null @@ -1,29 +0,0 @@ -package openrtb2 - -// 5.22 Connection Type -// -// Various options for the type of device connectivity. -type ConnectionType int8 - -const ( - ConnectionTypeUnknown ConnectionType = 0 // Unknown - ConnectionTypeEthernet ConnectionType = 1 // Ethernet - ConnectionTypeWIFI ConnectionType = 2 // WIFI - ConnectionTypeCellularNetworkUnknownGeneration ConnectionType = 3 // Cellular Network – Unknown Generation - ConnectionTypeCellularNetwork2G ConnectionType = 4 // Cellular Network – 2G - ConnectionTypeCellularNetwork3G ConnectionType = 5 // Cellular Network – 3G - ConnectionTypeCellularNetwork4G ConnectionType = 6 // Cellular Network – 4G -) - -// Ptr returns pointer to own value. -func (t ConnectionType) Ptr() *ConnectionType { - return &t -} - -// Val safely dereferences pointer, returning default value (ConnectionTypeUnknown) for nil. -func (t *ConnectionType) Val() ConnectionType { - if t == nil { - return ConnectionTypeUnknown - } - return *t -} diff --git a/openrtb2/content.go b/openrtb2/content.go index 7e59c71..e07c9e0 100644 --- a/openrtb2/content.go +++ b/openrtb2/content.go @@ -106,13 +106,24 @@ type Content struct { // URL of the content, for buy-side contextualization or review. URL string `json:"url,omitempty"` + // Attribute: + // cattax + // Type: + // integer + // Description: + // The taxonomy in use. Refer to the AdCOM list List: Category + // Taxonomies for values. + CatTax int64 `json:"cattax,omitempty"` + // Attribute: // cat // Type: // string array // Description: - // Array of IAB content categories that describe the content - // producer. Refer to List 5.1. + // Array of IAB content categories that describe the content. + // 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. Cat []string `json:"cat,omitempty"` // Attribute: @@ -120,25 +131,17 @@ type Content struct { // Type: // integer // Description: - // Production quality. Refer to List 5.13 - ProdQ *ProductionQuality `json:"prodq,omitempty"` - - // Attribute: - // videoquality - // Type: - // integer; DEPRECATED - // Description: - // Note: Deprecated in favor of prodq. - // Video quality. Refer to List 5.13. - VideoQuality *ProductionQuality `json:"videoquality,omitempty"` + // Production quality. Refer to List: Production Qualities in AdCOM 1.0. + ProdQ int8 `json:"prodq,omitempty"` // Attribute: // context // Type: // integer // Description: - // Type of content (game, video, text, etc.). Refer to List 5.18. - Context ContentContext `json:"context,omitempty"` + // Type of content (game, video, text, etc.). Refer to List: Content + // Contexts in AdCOM 1.0. + Context int8 `json:"context,omitempty"` // Attribute: // contentrating @@ -161,8 +164,9 @@ type Content struct { // Type: // integer // Description: - // Media rating per IQG guidelines. Refer to List 5.19. - QAGMediaRating IQGMediaRating `json:"qagmediarating,omitempty"` + // Media rating per IQG guidelines. Refer to List: Media Ratings in + // AdCOM 1.0. + QAGMediaRating int8 `json:"qagmediarating,omitempty"` // Attribute: // keywords @@ -172,6 +176,15 @@ type Content struct { // Comma separated list of keywords describing the content. Keywords string `json:"keywords,omitempty"` + // Attribute: + // kwarray + // Type: + // string + // Description: + // Array of keywords about the site. Only one of ‘keywords’ or + // ‘kwarray’ may be present. + KwArray []string `json:"kwarray,omitempty"` + // Attribute: // livestream // Type: @@ -201,9 +214,19 @@ type Content struct { // Type: // string // Description: - // Content language using ISO-639-1-alpha-2. + // Content language using ISO-639-1-alpha-2. Only one of + // language or langb should be present. Language string `json:"language,omitempty"` + // Attribute: + // langb + // Type: + // string + // Description: + // Content language using IETF BCP 47. Only one of language or + // langb should be present. + LangB string `json:"langb,omitempty"` + // Attribute: // embeddable // Type: @@ -222,6 +245,22 @@ type Content struct { // represents a different data source. Data []Data `json:"data,omitempty"` + // Attribute: + // network + // Type: + // object + // Description: + // Details about the network (Section 3.2.23) the content is on. + Network *Network `json:"network,omitempty"` + + // Attribute: + // channel + // Type: + // object + // Description: + // Details about the channel (Section 3.2.24) the content is on. + Channel *Channel `json:"channel,omitempty"` + // Attribute: // ext // Type: diff --git a/openrtb2/content_context.go b/openrtb2/content_context.go deleted file mode 100644 index d3e89a1..0000000 --- a/openrtb2/content_context.go +++ /dev/null @@ -1,18 +0,0 @@ -package openrtb2 - -// 5.18 Content Context -// -// Various options for indicating the type of content being used or consumed by the user in which the impression will appear. -// This OpenRTB list has values derived from the Inventory Quality Guidelines (IQG). -// Practitioners should keep in sync with updates to the IQG values. -type ContentContext int8 - -const ( - ContentContextVideo ContentContext = 1 // Video (i.e., video file or stream such as Internet TV broadcasts) - ContentContextGame ContentContext = 2 // Game (i.e., an interactive software game) - ContentContextMusic ContentContext = 3 // Music (i.e., audio file or stream such as Internet radio broadcasts) - ContentContextApplication ContentContext = 4 // Application (i.e., an interactive software application) - ContentContextText ContentContext = 5 // Text (i.e., primarily textual document such as a web page, eBook, or news article) - ContentContextOther ContentContext = 6 // Other (i.e., none of the other categories applies) - ContentContextUnknown ContentContext = 7 // Unknown -) diff --git a/openrtb2/content_delivery_method.go b/openrtb2/content_delivery_method.go deleted file mode 100644 index d84b4bc..0000000 --- a/openrtb2/content_delivery_method.go +++ /dev/null @@ -1,12 +0,0 @@ -package openrtb2 - -// 5.15 Content Delivery Methods -// -// Various options for the delivery of video or audio content. -type ContentDeliveryMethod int8 - -const ( - ContentDeliveryMethodStreaming ContentDeliveryMethod = 1 // Streaming - ContentDeliveryMethodProgressive ContentDeliveryMethod = 2 // Progressive - ContentDeliveryMethodDownload ContentDeliveryMethod = 3 // Download -) diff --git a/openrtb2/creative_attribute.go b/openrtb2/creative_attribute.go deleted file mode 100644 index 326340d..0000000 --- a/openrtb2/creative_attribute.go +++ /dev/null @@ -1,26 +0,0 @@ -package openrtb2 - -// 5.3 Creative Attributes -// -// Standard list of creative attributes that can describe an ad being served or serve as restrictions of thereof. -type CreativeAttribute int8 - -const ( - CreativeAttributeAudioAdAutoPlay CreativeAttribute = 1 // Audio Ad (Auto-Play) - CreativeAttributeAudioAdUserInitiated CreativeAttribute = 2 // Audio Ad (User Initiated) - CreativeAttributeExpandableAutomatic CreativeAttribute = 3 // Expandable (Automatic) - CreativeAttributeExpandableUserInitiatedClick CreativeAttribute = 4 // Expandable (User Initiated - Click) - CreativeAttributeExpandableUserInitiatedRollover CreativeAttribute = 5 // Expandable (User Initiated - Rollover) - CreativeAttributeInBannerVideoAdAutoPlay CreativeAttribute = 6 // In-Banner Video Ad (Auto-Play) - CreativeAttributeInBannerVideoAdUserInitiated CreativeAttribute = 7 // In-Banner Video Ad (User Initiated) - CreativeAttributePop CreativeAttribute = 8 // Pop (e.g., Over, Under, or Upon Exit) - CreativeAttributeProvocativeOrSuggestiveImagery CreativeAttribute = 9 // Provocative or Suggestive Imagery - CreativeAttributeShakyFlashingFlickeringExtremeAnimationSmileys CreativeAttribute = 10 // Shaky, Flashing, Flickering, Extreme Animation, Smileys - CreativeAttributeSurveys CreativeAttribute = 11 // Surveys - CreativeAttributeTextOnly CreativeAttribute = 12 // Text Only - CreativeAttributeUserInteractive CreativeAttribute = 13 // User Interactive (e.g., Embedded Games) - CreativeAttributeWindowsDialogOrAlertStyle CreativeAttribute = 14 // Windows Dialog or Alert Style - CreativeAttributeHasAudioOnOffButton CreativeAttribute = 15 // Has Audio On/Off Button - CreativeAttributeAdProvidesSkipButton CreativeAttribute = 16 // Ad Provides Skip Button (e.g. VPAID-rendered skip button on pre-roll video) - CreativeAttributeAdobeFlash CreativeAttribute = 17 // Adobe Flash -) diff --git a/openrtb2/device.go b/openrtb2/device.go index a356976..0631fe0 100644 --- a/openrtb2/device.go +++ b/openrtb2/device.go @@ -17,14 +17,6 @@ import "encoding/json" // Exchanges are urged to research and implement this feature carefully when presenting device IP values to bidders. type Device struct { - // Attribute: - // ua - // Type: - // string; recommended - // Description: - // Browser user agent string. - UA string `json:"ua,omitempty"` - // Attribute: // geo // Type: @@ -53,6 +45,38 @@ type Device struct { // be limited per commercial guidelines. Lmt *int8 `json:"lmt,omitempty"` + // Attribute: + // ua + // Type: + // string + // Description: + // Browser user agent string. This field represents a raw user + // agent string from the browser. For backwards compatibility, + // exchanges are recommended to always populate ‘ua’ with the + // User-Agent string, when available from the end user’s device, + // even if an alternative representation, such as the User-Agent + // Client-Hints, is available and is used to populate ‘sua’. No + // inferred or approximated user agents are expected in this field. + // If a client supports User-Agent Client Hints, and ‘sua’ field is + // present, bidders are recommended to rely on ‘sua’ for + // detecting device type, browser type and version and other + // purposes that rely on the user agent information, and ignore + // ‘ua’ field. This is because the ‘ua’ may contain a frozen or + // reduced user agent string. + UA string `json:"ua,omitempty"` + + // Attribute: + // sua + // Type: + // object + // Description: + // Structured user agent information defined by a UserAgent + // object (see Section 3.2.29). If both ‘ua’ and ‘sua’ are present in + // the bid request, ‘sua’ should be considered the more accurate + // representation of the device attributes. This is because the ‘ua’ + // may contain a frozen or reduced user agent string. + SUA struct `json:"ua,omitempty"` + // Attribute: // ip // Type: @@ -74,8 +98,9 @@ type Device struct { // Type: // integer // Description: - // The general type of device. Refer to List 5.21. - DeviceType DeviceType `json:"devicetype,omitempty"` + // The general type of device. Refer to List: Device Types in + // AdCOM 1.0. + DeviceType int8 `json:"devicetype,omitempty"` // Attribute: // make @@ -179,9 +204,19 @@ type Device struct { // Type: // string // Description: - // Browser language using ISO-639-1-alpha-2. + // Browser language using ISO-639-1-alpha-2. Only one of + // language or langb should be present. Language string `json:"language,omitempty"` + // Attribute: + // langb + // Type: + // string + // Description: + // Content language using IETF BCP 47. Only one of language or + // langb should be present. + LangB string `json:"langb,omitempty"` + // Attribute: // carrier // Type: @@ -196,11 +231,16 @@ type Device struct { // Type: // string // Description: - // Mobile carrier as the concatenated MCC-MNC code (e.g., - // “310-005” identifies Verizon Wireless CDMA in the USA). + // Mobile carrier as the concatenated MCC-MNC code + // (e.g., "310-005" identifies Verizon Wireless CDMA in the + // USA). // Refer to https://en.wikipedia.org/wiki/Mobile_country_code // for further examples. Note that the dash between the MCC - // and MNC parts is required to remove parsing ambiguity. + // and MNC parts is required to remove parsing ambiguity. The + // MCC-MNC values represent the SIM installed on the device + // and do not change when a device is roaming. Roaming may + // be inferred by a combination of the MCC-MNC, geo, IP and + // other data signals. MCCMNC string `json:"mccmnc,omitempty"` // Attribute: @@ -208,8 +248,9 @@ type Device struct { // Type: // integer // Description: - // Network connection type. Refer to List 5.22. - ConnectionType *ConnectionType `json:"connectiontype,omitempty"` + // Network connection type. Refer to List: Connection Types in + // AdCOM 1.0. + ConnectionType int8 `json:"connectiontype,omitempty"` // Attribute: // ifa @@ -222,7 +263,7 @@ type Device struct { // Attribute: // didsha1 // Type: - // string + // string; ; DEPRECATED // Description: // Hardware device ID (e.g., IMEI); hashed via SHA1. DIDSHA1 string `json:"didsha1,omitempty"` @@ -230,7 +271,7 @@ type Device struct { // Attribute: // didmd5 // Type: - // string + // string; DEPRECATED // Description: // Hardware device ID (e.g., IMEI); hashed via MD5. DIDMD5 string `json:"didmd5,omitempty"` @@ -238,7 +279,7 @@ type Device struct { // Attribute: // dpidsha1 // Type: - // string + // string; DEPRECATED // Description: // Platform device ID (e.g., Android ID); hashed via SHA1. DPIDSHA1 string `json:"dpidsha1,omitempty"` @@ -246,7 +287,7 @@ type Device struct { // Attribute: // dpidmd5 // Type: - // string + // string; DEPRECATED // Description: // Platform device ID (e.g., Android ID); hashed via MD5. DPIDMD5 string `json:"dpidmd5,omitempty"` @@ -254,7 +295,7 @@ type Device struct { // Attribute: // macsha1 // Type: - // string + // string; DEPRECATED // Description: // MAC address of the device; hashed via SHA1. MACSHA1 string `json:"macsha1,omitempty"` @@ -262,7 +303,7 @@ type Device struct { // Attribute: // macmd5 // Type: - // string + // string; DEPRECATED // Description: // MAC address of the device; hashed via MD5. MACMD5 string `json:"macmd5,omitempty"` diff --git a/openrtb2/device_type.go b/openrtb2/device_type.go deleted file mode 100644 index 33dfa5a..0000000 --- a/openrtb2/device_type.go +++ /dev/null @@ -1,22 +0,0 @@ -package openrtb2 - -// 5.21 Device Type -// -// Type of device from which the impression originated. -// -// OpenRTB version 2.2 of the specification added distinct values for Mobile and Tablet. -// It is recommended that any bidder adding support for 2.2 treat a value of 1 as an acceptable alias of 4 & 5. -// -// This OpenRTB list has values derived from the Inventory Quality Guidelines (IQG). -// Practitioners should keep in sync with updates to the IQG values. -type DeviceType int8 - -const ( - DeviceTypeMobileTablet DeviceType = 1 // Mobile/Tablet (Version 2.0) - DeviceTypePersonalComputer DeviceType = 2 // Personal Computer (Version 2.0) - DeviceTypeConnectedTV DeviceType = 3 // Connected TV (Version 2.0) - DeviceTypePhone DeviceType = 4 // Phone (New for Version 2.2) - DeviceTypeTablet DeviceType = 5 // Tablet (New for Version 2.2) - DeviceTypeConnectedDevice DeviceType = 6 // Connected Device (New for Version 2.2) - DeviceTypeSetTopBox DeviceType = 7 // Set Top Box (New for Version 2.2) -) diff --git a/openrtb2/eid.go b/openrtb2/eid.go new file mode 100644 index 0000000..b05945e --- /dev/null +++ b/openrtb2/eid.go @@ -0,0 +1,37 @@ +package openrtb2 + +import "encoding/json" + +// 3.2.27 Object: EID +// +// Extended identifiers support in the OpenRTB specification allows buyers to use audience data in real-time bidding. +// This object can contain one or more UIDs from a single source or a technology provider. +// The exchange should ensure that business agreements allow for the sending of this data. +type EID struct { + + // Attribute: + // source + // Type: + // string + // Description: + // Source or technology provider responsible for the set of + // included IDs. Expressed as a top-level domain. + Source string `json:"source,omitempty"` + + // Attribute: + // uids + // Type: + // object array + // Description: + // Array of extended ID UID objects from the given source. Refer + // to 3.2.28 Extended Identifier UIDs. + UIDs []UID `json:"uids,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for advertising-system specific extensions to this object. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/openrtb2/expandable_direction.go b/openrtb2/expandable_direction.go deleted file mode 100644 index 3f90291..0000000 --- a/openrtb2/expandable_direction.go +++ /dev/null @@ -1,14 +0,0 @@ -package openrtb2 - -// 5.5 Expandable Direction -// -// Directions in which an expandable ad may expand, given the positioning of the ad unit on the page and constraints imposed by the content. -type ExpandableDirection int8 - -const ( - ExpandableDirectionLeft ExpandableDirection = 1 // Left - ExpandableDirectionRight ExpandableDirection = 2 // Right - ExpandableDirectionUp ExpandableDirection = 3 // Up - ExpandableDirectionDown ExpandableDirection = 4 // Down - ExpandableDirectionFullScreen ExpandableDirection = 5 // Full Screen -) diff --git a/openrtb2/feed_type.go b/openrtb2/feed_type.go deleted file mode 100644 index 5f62578..0000000 --- a/openrtb2/feed_type.go +++ /dev/null @@ -1,12 +0,0 @@ -package openrtb2 - -// 5.16 Feed Types -// -// Types of feeds, typically for audio. -type FeedType int8 - -const ( - FeedTypeMusicService FeedType = 1 // Music Service - FeedTypeFMAMBroadcast FeedType = 2 // FM/AM Broadcast - FeedTypePodcast FeedType = 3 // Podcast -) diff --git a/openrtb2/geo.go b/openrtb2/geo.go index 0417f9d..7b141d6 100644 --- a/openrtb2/geo.go +++ b/openrtb2/geo.go @@ -35,8 +35,8 @@ type Geo struct { // integer // Description: // Source of location data; recommended when passing - // lat/lon. Refer to List 5.20. - Type LocationType `json:"type,omitempty"` + // lat/lon. Refer to List: Location Types in AdCOM 1.0. + Type int8 `json:"type,omitempty"` // Attribute: // accuracy @@ -67,8 +67,9 @@ type Geo struct { // integer // Description: // Service or provider used to determine geolocation from IP - // address if applicable (i.e., type = 2). Refer to List 5.23. - IPService IPLocationService `json:"ipservice,omitempty"` + // address if applicable (i.e., type = 2). Refer to List: IP + // Location Services in AdCOM 1.0. + IPService int8 `json:"ipservice,omitempty"` // Attribute: // country diff --git a/openrtb2/imp.go b/openrtb2/imp.go index d46411e..03872fe 100644 --- a/openrtb2/imp.go +++ b/openrtb2/imp.go @@ -100,7 +100,7 @@ type Imp struct { // Attribute: // instl // Type: - // int; default 0 + // integer; default 0 // Description: // 1 = the ad is interstitial or full screen, 0 = not interstitial. Instl int8 `json:"instl,omitempty"` @@ -163,6 +163,31 @@ type Imp struct { // Array of exchange-specific names of supported iframe busters. IframeBuster []string `json:"iframebuster,omitempty"` + // Attribute: + // rwdd + // Type: + // integer; default 0 + // Description: + // Indicates whether the user receives a reward for viewing the + // ad, where 0 = no, 1 = yes. Typically video ad implementations + // allow users to read an additional news article for free, receive + // an extra life in a game, or get a sponsored ad-free music + // session. The reward is typically distributed after the video ad is + // completed. + Rwdd int8 `json:"secure,omitempty"` + + // Attribute: + // ssai + // Type: + // integer; default 0 + // Description: + // Indicates if server-side ad insertion (e.g., stitching an ad into an + // audio or video stream) is in use and the impact of this on asset + // and tracker retrieval, where 0 = status unknown, 1 = all client- + // side (i.e., not server-side), 2 = assets stitched server-side but + // tracking pixels fired client-side, 3 = all server-side. + SSAI int8 `json:"ssai,omitempty"` + // Attribute: // exp // Type: diff --git a/openrtb2/ip_location_service.go b/openrtb2/ip_location_service.go deleted file mode 100644 index 012ccf8..0000000 --- a/openrtb2/ip_location_service.go +++ /dev/null @@ -1,13 +0,0 @@ -package openrtb2 - -// 5.23 IP Location Services -// -// Services and/or vendors used for resolving IP addresses to geolocations. -type IPLocationService int8 - -const ( - IPLocationServiceIP2location IPLocationService = 1 // ip2location - IPLocationServiceNeustar IPLocationService = 2 // Neustar (Quova) - IPLocationServiceMaxMind IPLocationService = 3 // MaxMind - IPLocationServiceNetAcuity IPLocationService = 4 // NetAcuity (Digital Element) -) diff --git a/openrtb2/iqg_media_rating.go b/openrtb2/iqg_media_rating.go deleted file mode 100644 index 5130d5f..0000000 --- a/openrtb2/iqg_media_rating.go +++ /dev/null @@ -1,13 +0,0 @@ -package openrtb2 - -// 5.19 IQG Media Ratings -// -// Media ratings used in describing content based on the IQG 2.1 categorization. -// Refer to www.iab.com/guidelines/digital-video-suite for more information. -type IQGMediaRating int8 - -const ( - IQGMediaRatingAll IQGMediaRating = 1 // All Audiences - IQGMediaRatingOver12 IQGMediaRating = 2 // Everyone Over 12 - IQGMediaRatingMature IQGMediaRating = 3 // Mature Audiences -) diff --git a/openrtb2/location_type.go b/openrtb2/location_type.go deleted file mode 100644 index 6799687..0000000 --- a/openrtb2/location_type.go +++ /dev/null @@ -1,12 +0,0 @@ -package openrtb2 - -// 5.20 Location Type -// -// Options to indicate how the geographic information was determined. -type LocationType int8 - -const ( - LocationTypeGPSLocationServices LocationType = 1 // GPS/Location Services - LocationTypeIPAddress LocationType = 2 // IP Address - LocationTypeUserProvided LocationType = 3 // User provided (e.g., registration data) -) diff --git a/openrtb2/loss_reason_code.go b/openrtb2/loss_reason_code.go deleted file mode 100644 index c22ce12..0000000 --- a/openrtb2/loss_reason_code.go +++ /dev/null @@ -1,41 +0,0 @@ -package openrtb2 - -// 5.25 Loss Reason Codes -// -// Options for an exchange to inform a bidder as to the reason why they did not win an impression. -type LossReasonCode int64 - -const ( - LossReasonCodeBidWon LossReasonCode = 0 // Bid Won - LossReasonCodeInternalError LossReasonCode = 1 // Internal Error - LossReasonCodeImpressionOpportunityExpired LossReasonCode = 2 // Impression Opportunity Expired - LossReasonCodeInvalidBidResponse LossReasonCode = 3 // Invalid Bid Response - LossReasonCodeInvalidDealID LossReasonCode = 4 // Invalid Deal ID - LossReasonCodeInvalidAuctionID LossReasonCode = 5 // Invalid Auction ID - LossReasonCodeInvalidAdvertiserDomain LossReasonCode = 6 // Invalid (i.e., malformed) Advertiser Domain - LossReasonCodeMissingMarkup LossReasonCode = 7 // Missing Markup - LossReasonCodeMissingCreativeID LossReasonCode = 8 // Missing Creative ID - LossReasonCodeMissingBidPrice LossReasonCode = 9 // Missing Bid Price - LossReasonCodeMissingMinimumCreativeApprovalData LossReasonCode = 10 // Missing Minimum Creative Approval Data - LossReasonCodeBidBelowAuctionFloor LossReasonCode = 100 // Bid was Below Auction Floor - LossReasonCodeBidBelowDealFloor LossReasonCode = 101 // Bid was Below Deal Floor - LossReasonCodeLostToHigherBid LossReasonCode = 102 // Lost to Higher Bid - LossReasonCodeLostToBidForPMPDeal LossReasonCode = 103 // Lost to a Bid for a PMP Deal - LossReasonCodeBuyerSeatBlocked LossReasonCode = 104 // Buyer Seat Blocked - LossReasonCodeCreativeFilteredGeneral LossReasonCode = 200 // Creative Filtered – General; reason unknown. - LossReasonCodeCreativeFilteredPendingProcessingByExchange LossReasonCode = 201 // Creative Filtered – Pending processing by Exchange (e.g., approval, transcoding, etc.) - LossReasonCodeCreativeFilteredDisapprovedByExchange LossReasonCode = 202 // Creative Filtered – Disapproved by Exchange - LossReasonCodeCreativeFilteredSizeNotAllowed LossReasonCode = 203 // Creative Filtered – Size Not Allowed - LossReasonCodeCreativeFilteredIncorrectCreativeFormat LossReasonCode = 204 // Creative Filtered – Incorrect Creative Format - LossReasonCodeCreativeFilteredAdvertiserExclusions LossReasonCode = 205 // Creative Filtered – Advertiser Exclusions - LossReasonCodeCreativeFilteredAppBundleExclusions LossReasonCode = 206 // Creative Filtered – App Bundle Exclusions - LossReasonCodeCreativeFilteredNotSecure LossReasonCode = 207 // Creative Filtered – Not Secure - LossReasonCodeCreativeFilteredLanguageExclusions LossReasonCode = 208 // Creative Filtered – Language Exclusions - LossReasonCodeCreativeFilteredCategoryExclusions LossReasonCode = 209 // Creative Filtered – Category Exclusions - LossReasonCodeCreativeFilteredCreativeAttributeExclusions LossReasonCode = 210 // Creative Filtered – Creative Attribute Exclusions - LossReasonCodeCreativeFilteredAdTypeExclusions LossReasonCode = 211 // Creative Filtered – Ad Type Exclusions - LossReasonCodeCreativeFilteredAnimationTooLong LossReasonCode = 212 // Creative Filtered – Animation Too Long - LossReasonCodeCreativeFilteredNotAllowedInPMPDeal LossReasonCode = 213 // Creative Filtered – Not Allowed in PMP Deal - - // ≥ 1000 Exchange specific (should be communicated to bidders a priori) -) diff --git a/openrtb2/metric.go b/openrtb2/metric.go index 2d6f98b..444fcbd 100644 --- a/openrtb2/metric.go +++ b/openrtb2/metric.go @@ -15,7 +15,7 @@ type Metric struct { // string; required // Description: // Type of metric being presented using exchange curated string - // names which should be published to bidders a priori.\ + // names which should be published to bidders a priori. Type string `json:"type"` // Attribute: diff --git a/openrtb2/native.go b/openrtb2/native.go index 0888e09..50e917f 100644 --- a/openrtb2/native.go +++ b/openrtb2/native.go @@ -24,6 +24,17 @@ type Native struct { // string; required // Description: // Request payload complying with the Native Ad Specification. + // The root node of the payload, “native”, was dropped in the + // Native Ad Specification 1.1. + // + // For Native 1.0, this is a JSON-encoded string consisting of a + // unnamed root object with a single subordinate object named + // 'native', which is the Native Markup Request object, section 4.1 + // of OpenRTB Native 1.0 specification. + // + // For Native 1.1 and higher, this is a JSON-encoded string + // consisting of an unnamed root object which is itself the Native + // Markup Request Object, section 4.1 of OpenRTB Native 1.1+. Request string `json:"request"` // Attribute: @@ -41,17 +52,18 @@ type Native struct { // integer array // Description: // List of supported API frameworks for this impression. Refer to - // List 5.6. If an API is not explicitly listed, it is assumed not to be - // supported. - API []APIFramework `json:"api,omitempty"` + // List: API Frameworks in AdCOM. If an API is not explicitly listed, + // it is assumed not to be supported. + API []int64 `json:"api,omitempty"` // Attribute: // sequence // Type: // integer array // Description: - // Blocked creative attributes. Refer to List 5.3. - BAttr []CreativeAttribute `json:"battr,omitempty"` + // Blocked creative attributes. Refer to List: Creative Attributes in + // AdCOM. + BAttr []int64 `json:"battr,omitempty"` // Attribute: // ext diff --git a/openrtb2/network.go b/openrtb2/network.go new file mode 100644 index 0000000..30e4959 --- /dev/null +++ b/openrtb2/network.go @@ -0,0 +1,49 @@ +package openrtb2 + +import "encoding/json" + +// 3.2.23 Object: Network +// +// This object describes the network an ad will be displayed on. +// A Network is defined as the parent entity of the Channel object’s entity for the purposes of organizing Channels. +// Examples are companies that own and/or license a collection of content channels (Viacom, Discovery, CBS, WarnerMedia, Turner and others), or studio that creates such content and self-distributes content. +// Name is a human-readable field while domain and id can be used for reporting and targeting purposes. +// See 7.6 for further examples. +type Network struct { + + // Attribute: + // id + // Type: + // string + // Description: + // A unique identifier assigned by the publisher. This may not be + // a unique identifier across all supply sources. + ID string `json:"id,omitempty"` + + // Attribute: + // name + // Type: + // string + // Description: + // Network the content is on (e.g., a TV network like “ABC"). + Name string `json:"name,omitempty"` + + // Attribute: + // domain + // Type: + // string + // Description: + // The primary domain of the network (e.g. "abc.com" in the + // case of the network ABC). It is recommended to include the + // top private domain (PSL+1) for DSP targeting normalization + // purposes. + Domain string `json:"domain,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for exchange-specific extensions to OpenRTB. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/openrtb2/no_bid_reason_code.go b/openrtb2/no_bid_reason_code.go deleted file mode 100644 index 785cfad..0000000 --- a/openrtb2/no_bid_reason_code.go +++ /dev/null @@ -1,33 +0,0 @@ -package openrtb2 - -// 5.24 No-Bid Reason Codes -// -// Options for a bidder to signal the exchange as to why it did not offer a bid for the impression. -type NoBidReasonCode int8 - -const ( - NoBidReasonCodeUnknownError NoBidReasonCode = 0 // Unknown Error - NoBidReasonCodeTechnicalError NoBidReasonCode = 1 // Technical Error - NoBidReasonCodeInvalidRequest NoBidReasonCode = 2 // Invalid Request - NoBidReasonCodeKnownWebSpider NoBidReasonCode = 3 // Known Web Spider - NoBidReasonCodeSuspectedNonHumanTraffic NoBidReasonCode = 4 // Suspected Non-Human Traffic - NoBidReasonCodeCloudDataCenterProxyIP NoBidReasonCode = 5 // Cloud, Data center, or Proxy IP - NoBidReasonCodeUnsupportedDevice NoBidReasonCode = 6 // Unsupported Device - NoBidReasonCodeBlockedPublisherOrSite NoBidReasonCode = 7 // Blocked Publisher or Site - NoBidReasonCodeUnmatchedUser NoBidReasonCode = 8 // Unmatched User - NoBidReasonCodeDailyReaderCapMet NoBidReasonCode = 9 // Daily Reader Cap Met - NoBidReasonCodeDailyDomainCapMet NoBidReasonCode = 10 // Daily Domain Cap Met -) - -// Ptr returns pointer to own value. -func (c NoBidReasonCode) Ptr() *NoBidReasonCode { - return &c -} - -// Val safely dereferences pointer, returning default value (NoBidReasonCodeUnknownError) for nil. -func (c *NoBidReasonCode) Val() NoBidReasonCode { - if c == nil { - return NoBidReasonCodeUnknownError - } - return *c -} diff --git a/openrtb2/openrtb2.go b/openrtb2/openrtb2.go index f15cba5..ed8365e 100644 --- a/openrtb2/openrtb2.go +++ b/openrtb2/openrtb2.go @@ -1,5 +1,5 @@ -// Package openrtb2 provides OpenRTB 2.5 types +// Package openrtb2 provides OpenRTB 2.6 types // // https://iabtechlab.com/standards/openrtb/ -// https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf +// https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf package openrtb2 diff --git a/openrtb2/playback_cessation_mode.go b/openrtb2/playback_cessation_mode.go deleted file mode 100644 index 0d28218..0000000 --- a/openrtb2/playback_cessation_mode.go +++ /dev/null @@ -1,12 +0,0 @@ -package openrtb2 - -// 5.11 Playback Cessation Modes -// -// Various modes for when playback terminates. -type PlaybackCessationMode int8 - -const ( - PlaybackCessationModeVideoCompletionOrTerminatedByUser PlaybackCessationMode = 1 // On Video Completion or when Terminated by User - PlaybackCessationModeLeavingViewportOrTerminatedByUser PlaybackCessationMode = 2 // On Leaving Viewport or when Terminated by User - PlaybackCessationModeLeavingViewportUntilVideoCompletionOrTerminatedByUser PlaybackCessationMode = 3 // On Leaving Viewport Continues as a Floating/Slider Unit until Video Completion or when Terminated by User -) diff --git a/openrtb2/playback_method.go b/openrtb2/playback_method.go deleted file mode 100644 index 4f01e6a..0000000 --- a/openrtb2/playback_method.go +++ /dev/null @@ -1,15 +0,0 @@ -package openrtb2 - -// 5.10 Playback Methods -// -// Various playback methods. -type PlaybackMethod int8 - -const ( - PlaybackMethodPageLoadSoundOn PlaybackMethod = 1 // Initiates on Page Load with Sound On - PlaybackMethodPageLoadSoundOff PlaybackMethod = 2 // Initiates on Page Load with Sound Off by Default - PlaybackMethodClickSoundOn PlaybackMethod = 3 // Initiates on Click with Sound On - PlaybackMethodMouseOverSoundOn PlaybackMethod = 4 // Initiates on Mouse-Over with Sound On - PlaybackMethodEnteringViewportSoundOn PlaybackMethod = 5 // Initiates on Entering Viewport with Sound On - PlaybackMethodEnteringViewportSoundOff PlaybackMethod = 6 // Initiates on Entering Viewport with Sound Off by Default -) diff --git a/openrtb2/producer.go b/openrtb2/producer.go index 2acd6ee..56b8590 100644 --- a/openrtb2/producer.go +++ b/openrtb2/producer.go @@ -25,13 +25,25 @@ type Producer struct { // Content producer or originator name (e.g., “Warner Bros”). Name string `json:"name,omitempty"` + // Attribute: + // cattax + // Type: + // integer + // Description: + // The taxonomy in use. Refer to the AdCOM 1.0 list List: Category + // Taxonomies for values. + CatTax int64 `json:"cattax,omitempty"` + // Attribute: // cat // Type: // string array // Description: // Array of IAB content categories that describe the content - // producer. Refer to List 5.1. + // producer. + // 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. Cat []string `json:"cat,omitempty"` // Attribute: diff --git a/openrtb2/production_quality.go b/openrtb2/production_quality.go deleted file mode 100644 index 2403240..0000000 --- a/openrtb2/production_quality.go +++ /dev/null @@ -1,27 +0,0 @@ -package openrtb2 - -// 5.13 Production Quality -// -// Options for content quality. -// These values are defined by the IAB; refer to www.iab.com/wp-content/uploads/2015/03/long-form-video-final.pdf for more information. -type ProductionQuality int8 - -const ( - ProductionQualityUnknown ProductionQuality = 0 // Unknown - ProductionQualityProfessionallyProduced ProductionQuality = 1 // Professionally Produced - ProductionQualityProsumer ProductionQuality = 2 // Prosumer - ProductionQualityUserGenerated ProductionQuality = 3 // User Generated (UGC) -) - -// Ptr returns pointer to own value. -func (q ProductionQuality) Ptr() *ProductionQuality { - return &q -} - -// Val safely dereferences pointer, returning default value (ProductionQualityUnknown) for nil. -func (q *ProductionQuality) Val() ProductionQuality { - if q == nil { - return ProductionQualityUnknown - } - return *q -} diff --git a/openrtb2/protocol.go b/openrtb2/protocol.go deleted file mode 100644 index 2e12345..0000000 --- a/openrtb2/protocol.go +++ /dev/null @@ -1,19 +0,0 @@ -package openrtb2 - -// 5.8 Protocols -// -// Options for the various bid response protocols that could be supported by an exchange. -type Protocol int8 - -const ( - ProtocolVAST10 Protocol = 1 // VAST 1.0 - ProtocolVAST20 Protocol = 2 // VAST 2.0 - ProtocolVAST30 Protocol = 3 // VAST 3.0 - ProtocolVAST10Wrapper Protocol = 4 // VAST 1.0 Wrapper - ProtocolVAST20Wrapper Protocol = 5 // VAST 2.0 Wrapper - ProtocolVAST30Wrapper Protocol = 6 // VAST 3.0 Wrapper - ProtocolVAST40 Protocol = 7 // VAST 4.0 - ProtocolVAST40Wrapper Protocol = 8 // VAST 4.0 Wrapper - ProtocolDAAST10 Protocol = 9 // DAAST 1.0 - ProtocolDAAST10Wrapper Protocol = 10 // DAAST 1.0 Wrapper -) diff --git a/openrtb2/publisher.go b/openrtb2/publisher.go index fdeeff1..b454db0 100644 --- a/openrtb2/publisher.go +++ b/openrtb2/publisher.go @@ -24,13 +24,24 @@ type Publisher struct { // Publisher name (may be aliased at the publisher’s request). Name string `json:"name,omitempty"` + // Attribute: + // cattax + // Type: + // integer; default 1 + // Description: + // The taxonomy in use. Refer to the AdCOM list List: Category + // Taxonomies for values. + CatTax int64 `json:"cattax,omitempty"` + // Attribute: // cat // Type: // string array // Description: // Array of IAB content categories that describe the publisher. - // Refer to List 5.1. + // 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. Cat []string `json:"cat,omitempty"` // Attribute: diff --git a/openrtb2/regs.go b/openrtb2/regs.go index 84a9231..54c05d5 100644 --- a/openrtb2/regs.go +++ b/openrtb2/regs.go @@ -4,8 +4,8 @@ import "encoding/json" // 3.2.3 Object: Regs // -// This object contains any legal, governmental, or industry regulations that apply to the request. -// The coppa flag signals whether or not the request falls under the United States Federal Trade Commission’s regulations for the United States Children’s Online Privacy Protection Act (“COPPA”). +// This object contains any legal, governmental, or industry regulations that the sender deems applicable to the request. +// See Section 7.5 for more details on the flags supporting Coppa, GDPR and CCPA. type Regs struct { // Attribute: @@ -18,6 +18,26 @@ type Regs struct { // Refer to Section 7.5 for more information. COPPA int8 `json:"coppa,omitempty"` + // Attribute: + // gdpr + // Type: + // integer + // Description: + // Flag that indicates whether or not the request is subject to + // GDPR regulations 0 = No, 1 = Yes, omission indicates + // Unknown. Refer to Section 7.5 for more information. + GDPR *int8 `json:"gdpr,omitempty"` + + // Attribute: + // us_privacy + // Type: + // string + // Description: + // Communicates signals regarding consumer privacy under US + // privacy regulation. See US Privacy String specifications. Refer + // to Section 7.5 for more information. + USPrivacy string `json:"us_privacy,omitempty"` + // Attribute: // ext // Type: diff --git a/openrtb2/seat_bid.go b/openrtb2/seat_bid.go index 6ab7956..4bf422c 100644 --- a/openrtb2/seat_bid.go +++ b/openrtb2/seat_bid.go @@ -2,7 +2,7 @@ package openrtb2 import "encoding/json" -// 4.2.2 Object: SeatBid +// 4.3.18 Object: SeatBid // // A bid response can contain multiple SeatBid objects, each on behalf of a different bidder seat and each containing one or more individual bids. // If multiple impressions are presented in the request, the group attribute can be used to specify if a seat is willing to accept any impressions that it can win (default) or if it is only interested in winning any if it can win them all as a group. diff --git a/openrtb2/site.go b/openrtb2/site.go index e07a47b..cd178ed 100644 --- a/openrtb2/site.go +++ b/openrtb2/site.go @@ -33,12 +33,23 @@ type Site struct { // Domain of the site (e.g., “mysite.foo.com”). Domain string `json:"domain,omitempty"` + // Attribute: + // cattax + // Type: + // integer + // Description: + // The taxonomy in use. Refer to the AdCOM list List: Category + // Taxonomies for values. If no cattax field is supplied IAB Content + // Category Taxonomy 1.0 is assumed. + CatTax int64 `json:"cattax,omitempty"` + // Attribute: // cat // Type: // string array // Description: - // Array of IAB content categories of the site. Refer to List 5.1. + // Array of IABTL content categories of the site. + // The taxonomy to be used is defined by the cattax field. Cat []string `json:"cat,omitempty"` // Attribute: @@ -46,8 +57,9 @@ type Site struct { // Type: // string array // Description: - // Array of IAB content categories that describe the current - // section of the site. Refer to List 5.1. + // Array of IABTL content categories that describe the current + // section of the site. The taxonomy to be used is defined by + // the cattax field. SectionCat []string `json:"sectioncat,omitempty"` // Attribute: @@ -55,8 +67,9 @@ type Site struct { // Type: // string array // Description: - // Array of IAB content categories that describe the current page - // or view of the site. Refer to List 5.1. + // Array of IABTL content categories that describe the current + // page or view of the site. + // The taxonomy to be used is defined by the cattax field. PageCat []string `json:"pagecat,omitempty"` // Attribute: @@ -124,6 +137,15 @@ type Site struct { // Comma separated list of keywords about the site. Keywords string `json:"keywords,omitempty"` + // Attribute: + // kwarray + // Type: + // string + // Description: + // Array of keywords about the site. Only one of ‘keywords’ or + // ‘kwarray’ may be present. + KwArray []string `json:"kwarray,omitempty"` + // Attribute: // ext // Type: diff --git a/openrtb2/source.go b/openrtb2/source.go index d622121..7da01d4 100644 --- a/openrtb2/source.go +++ b/openrtb2/source.go @@ -36,6 +36,17 @@ type Source struct { // described in the TAG Payment ID Protocol v1.0. PChain string `json:"pchain,omitempty"` + // Attribute: + // schain + // Type: + // object; recommended + // Description: + // This object represents both the links in the supply chain as + // well as an indicator whether or not the supply chain is + // complete. Details via the SupplyChain object (section + // 3.2.25) + SChain struct `json:"schain,omitempty"` + // Attribute: // ext // Type: diff --git a/openrtb2/start_delay.go b/openrtb2/start_delay.go deleted file mode 100644 index dcde3e2..0000000 --- a/openrtb2/start_delay.go +++ /dev/null @@ -1,28 +0,0 @@ -package openrtb2 - -// 5.12 Start Delay -// -// Various options for the video or audio start delay. -// If the start delay value is greater than 0, then the position is mid-roll and the value indicates the start delay. -type StartDelay int64 - -const ( - // > 0 Mid-Roll (value indicates start delay in second) - - StartDelayPreRoll StartDelay = 0 // Pre-Roll - StartDelayGenericMidRoll StartDelay = -1 // Generic Mid-Roll - StartDelayGenericPostRoll StartDelay = -2 // Generic Post-Roll -) - -// Ptr returns pointer to own value. -func (d StartDelay) Ptr() *StartDelay { - return &d -} - -// Val safely dereferences pointer, returning default value (StartDelayPreRoll) for nil. -func (d *StartDelay) Val() StartDelay { - if d == nil { - return StartDelayPreRoll - } - return *d -} diff --git a/openrtb2/supply_chain.go b/openrtb2/supply_chain.go new file mode 100644 index 0000000..fc64013 --- /dev/null +++ b/openrtb2/supply_chain.go @@ -0,0 +1,52 @@ +package openrtb2 + +import "encoding/json" + +// 3.2.25 Object: SupplyChain +// +// This object is composed of a set of nodes where each node represents a specific entity that participates in the transacting of inventory. +// The entire chain of nodes from beginning to end represents all entities who are involved in the direct flow of payment for inventory. +// Detailed implementation examples can be found here: https://github.com/InteractiveAdvertisingBureau/openrtb/blob/master/supplychainobject.md. +type SupplyChain struct { + + // Attribute: + // complete + // Type: + // integer; required + // Description: + // Flag indicating whether the chain contains all nodes involved + // in the transaction leading back to the owner of the site, app + // or other medium of the inventory, where 0 = no, 1 = yes. + Complete int8 `json:"complete"` + + // Attribute: + // nodes + // Type: + // object array; required + // Description: + // Array of SupplyChainNode objects in the order of the chain. In a + // complete supply chain, the first node represents the initial + // advertising system and seller ID involved in the transaction, i.e. + // the owner of the site, app, or other medium. In an incomplete + // supply chain, it represents the first known node. The last node + // epresents the entity sending this bid request. + Nodes SupplyChainNode `json:"nodes"` + + // Attribute: + // ver + // Type: + // string; required + // Description: + // Version of the supply chain specification in use, in the format + // of "major.minor". For example, for version 1.0 of the spec, + // use the string “1.0”. + Ver string `json:"ver"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for advertising-system specific extensions to this object. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/openrtb2/supply_chain_node.go b/openrtb2/supply_chain_node.go new file mode 100644 index 0000000..aa5aef8 --- /dev/null +++ b/openrtb2/supply_chain_node.go @@ -0,0 +1,92 @@ +package openrtb2 + +import "encoding/json" + +// 3.2.26 Object: SupplyChainNode +// +// This object is associated with a SupplyChain object as an array of nodes. +// These nodes define the identity of an entity participating in the supply chain of a bid request. +// Detailed implementation examples can be found here: https://github.com/InteractiveAdvertisingBureau/openrtb/blob/master/supplychainobject.md. +type SupplyChainNode struct { + + // Attribute: + // asi + // Type: + // string; required + // Description: + // The canonical domain name of the SSP, Exchange, Header + // Wrapper, etc system that bidders connect to. This may be + // the operational domain of the system, if that is different than + // the parent corporate domain, to facilitate WHOIS and + // reverse IP lookups to establish clear ownership of the + // delegate system. This should be the same value as used to + // identify sellers in an ads.txt file if one exists + ASI string `json:"asi"` + + // Attribute: + // sid + // Type: + // string; required + // Description: + // The identifier associated with the seller or reseller account + // within the advertising system. This must contain the same value + // used in transactions (i.e. OpenRTB bid requests) in the field + // specified by the SSP/exchange. Typically, in OpenRTB, this is + // publisher.id. For OpenDirect it is typically the publisher’s + // organization ID.Should be limited to 64 characters in length. + SID string `json:"sid"` + + // Attribute: + // rid + // Type: + // string + // Description: + // The OpenRTB RequestId of the request as issued by this seller. + RID string `json:"rid,omitempty"` + + // Attribute: + // name + // Type: + // string + // Description: + // The name of the company (the legal entity) that is paid for + // inventory transacted under the given seller_ID. This value is + // optional and should NOT be included if it exists in the + // advertising system’s sellers.json file. + Name string `json:"name,omitempty"` + + // Attribute: + // domain + // Type: + // string + // Description: + // The business domain name of the entity represented by this + // node. This value is optional and should NOT be included if it + // exists in the advertising system’s sellers.json file. + Domain string `json:"domain,omitempty"` + + // Attribute: + // hp + // Type: + // integer; required + // Description: + // Indicates whether this node will be involved in the flow of + // payment for the inventory. When set to 1, the advertising + // system in the asi field pays the seller in the sid field, who is + // responsible for paying the previous node in the chain. When + // set to 0, this node is not involved in the flow of payment for + // the inventory. For version 1.0 of SupplyChain, this property + // should always be 1. Implementers should ensure that they + // propagate this field onwards when constructing SupplyChain + // objects in bid requests sent to a downstream advertising + // system. + HP int8 `json:"hp"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for advertising-system specific extensions to this object. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/openrtb2/testdata/README.md b/openrtb2/testdata/README.md index 85b1e8e..0857681 100644 --- a/openrtb2/testdata/README.md +++ b/openrtb2/testdata/README.md @@ -1,5 +1,5 @@ # testdata -JSON examples copied from [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.5](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) spec - section 6. Bid Request/Response Samples. +JSON examples copied from [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.6](https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf) spec - section 6. Bid Request/Response Samples. Some empty/zero attributes were omited (not copied) because of [encoding/json](https://golang.org/pkg/encoding/json/) `omitempty` and [gomega.MatchJSON(...)](http://onsi.github.io/gomega/#matchjsonjson-interface). diff --git a/openrtb2/uid.go b/openrtb2/uid.go new file mode 100644 index 0000000..7d70891 --- /dev/null +++ b/openrtb2/uid.go @@ -0,0 +1,36 @@ +package openrtb2 + +import "encoding/json" + +// 3.2.28 Object: UID +// +// This object contains a single user identifier provided as part of extended identifiers. +// The exchange should ensure that business agreements allow for the sending of this data. +type UID struct { + + // Attribute: + // source + // Type: + // string + // Description: + // The identifier for the user. + ID string `json:"source,omitempty"` + + // Attribute: + // atype + // Type: + // object array + // Description: + // Type of user agent the ID is from. It is highly recommended to set this, as + // many DSPs separate app-native IDs from browser-based IDs and require a type + // value for ID resolution. Refer to List: Agent Types in AdCOM 1.0 + AType int64 `json:"uids,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for advertising-system specific extensions to this object. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/openrtb2/user.go b/openrtb2/user.go index 271c3a8..21273f7 100644 --- a/openrtb2/user.go +++ b/openrtb2/user.go @@ -30,7 +30,7 @@ type User struct { // Attribute: // yob // Type: - // integer + // integer; DEPRECATED // Description: // Year of birth as a 4-digit integer. Yob int64 `json:"yob,omitempty"` @@ -38,7 +38,7 @@ type User struct { // Attribute: // gender // Type: - // string + // string; DEPRECATED // Description: // Gender, where “M” = male, “F” = female, “O” = known to be // other (i.e., omitted is unknown). @@ -49,9 +49,19 @@ type User struct { // Type: // string // Description: - // Comma separated list of keywords, interests, or intent. + // Comma separated list of keywords, interests, or intent. Only + // one of ‘keywords’ or ‘kwarray’ may be present. Keywords string `json:"keywords,omitempty"` + // Attribute: + // kwarray + // Type: + // string + // Description: + // Array of keywords about the site. Only one of ‘keywords’ or + // ‘kwarray’ may be present. + KwArray []string `json:"kwarray,omitempty"` + // Attribute: // customdata // Type: @@ -81,6 +91,25 @@ type User struct { // represents a different data source. Data []Data `json:"data,omitempty"` + // Attribute: + // consent + // Type: + // string + // Description: + // When GDPR regulations are in effect this attribute contains + // the Transparency and Consent Framework’s Consent String + // data structure. + Consent string `json:"consent,omitempty"` + + // Attribute: + // eids + // Type: + // object array + // Description: + // Details for support of a standard protocol for multiple third + // party identity providers (Section 3.2.27) + EIDs []struct `json:"eids,omitempty"` + // Attribute: // ext // Type: diff --git a/openrtb2/user_agent.go b/openrtb2/user_agent.go new file mode 100644 index 0000000..8646049 --- /dev/null +++ b/openrtb2/user_agent.go @@ -0,0 +1,86 @@ +package openrtb2 + +import "encoding/json" + +// 3.2.29 Object: UserAgent +// +// This object contains a single user identifier provided as part of extended identifiers. +// The exchange should ensure that business agreements allow for the sending of this data. +type UserAgent struct { + + // Attribute: + // browsers + // Type: + // object array; recommended + // Description: + // Each BrandVersion object (see Section 3.2.30) identifies a browser or similar + // software component. Implementers should send brands and versions + // derived from the Sec-CH-UA-Full-Version-List header. + Browsers []BrandVersion `json:"browsers,omitempty"` + + // Attribute: + // platform + // Type: + // object; recommended + // Description: + // A BrandVersion object (see Section 3.2.30) that identifies the user agent’s + // execution platform / OS. Implementers should send a brand derived from the + // Sec-CH-UA-Platform header, and version derived from the Sec-CH-UA- + // Platform-Version header. + Platform *BrandVersion `json:"platform,omitempty"` + + // Attribute: + // mobile + // Type: + // integer + // Description: + // 1 if the agent prefers a “mobile” version of the content, if available, i.e. + // optimized for small screens or touch input. 0 if the agent prefers the “desktop” + // or “full” content. Implementers should derive this value from the Sec-CH-UA- + // Mobile header. + Mobile *int8 `json:"mobile,omitempty"` + + // Attribute: + // architecture + // Type: + // string + // Description: + // Device’s major binary architecture, e.g. “x86” or “arm”. Implementers should + // retrieve this value from the Sec-CH-UA-Arch header. + Architecture string `json:"architecture,omitempty"` + + // Attribute: + // bitness + // Type: + // string + // Description: + // Device’s bitness, e.g. “64” for 64-bit architecture. Implementers should + // retrieve this value from the Sec-CH-UA-Bitness header. + Bitness string `json:"bitness,omitempty"` + + // Attribute: + // model + // Type: + // string + // Description: + // Device model. Implementers should retrieve this value from the Sec-CH-UA- + // Model header. + Model string `json:"model,omitempty"` + + // Attribute: + // source + // Type: + // integer; default 0 + // Description: + // The source of data used to create this object, List: User-Agent Source in + // AdCOM 1.0. + Source int8 `json:"source,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for advertising-system specific extensions to this object. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/openrtb2/video.go b/openrtb2/video.go index 19702e0..9854836 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -26,39 +26,66 @@ type Video struct { // Attribute: // minduration // Type: - // integer; recommended - // Description: - // Minimum video ad duration in seconds. - MinDuration int64 `json:"minduration,omitempty"` + // integer; default 0; recommended + // Definition: + // Minimum video ad duration in seconds. This field is mutually + // exclusive with rqddurs; only one of minduration and rqddurs + // may be in a bid request. + MinDuration *int64 `json:"minduration,omitempty"` // Attribute: // maxduration // Type: // integer; recommended - // Description: - // Maximum video ad duration in seconds. - MaxDuration int64 `json:"maxduration,omitempty"` + // Definition: + // Maximum video ad duration in seconds. This field is mutually + // exclusive with rqddurs; only one of maxduration and rqddurs + // may be in a bid request. + MaxDuration *int64 `json:"maxduration,omitempty"` // Attribute: - // protocols + // startdelay // Type: - // integer array; recommended - // Description: - // Array of supported video protocols. Refer to List 5.8. At least - // one supported protocol must be specified in either the - // protocol or protocols attribute. - Protocols []Protocol `json:"protocols,omitempty"` + // integer; recommended + // Definition: + // Indicates the start delay in seconds for pre-roll, mid-roll, or + // post-roll ad placements. Refer to List: Start Delay Modes + // in AdCOM 1.0. + StartDelay *int8 `json:"startdelay,omitempty"` // Attribute: - // protocol + // maxseq // Type: - // integer; DEPRECATED - // Description: - // NOTE: Deprecated in favor of protocols. - // Supported video protocol. Refer to List 5.8. At least one - // supported protocol must be specified in either the protocol - // or protocols attribute. - Protocol Protocol `json:"protocol,omitempty"` + // integer; recommended + // Definition: + // Indicates the maximum number of ads that may be served into + // a “dynamic” video ad pod (where the precise number of ads is + // not predetermined by the seller). See Section 7.6 for more + // details. + MaxSeq int64 `json:"maxseq,omitempty"` + + // Attribute: + // poddur + // Type: + // integer; recommended + // Definition: + // Indicates the total amount of time in seconds that advertisers + // may fill for a “dynamic” video ad pod (See Section 7.6 for more + // details), or the dynamic portion of a “hybrid” ad pod. This field + // is required only for the dynamic portion(s) of video ad pods. + // This field refers to the length of the entire ad break, whereas + // minduration/maxduration/rqddurs are constraints relating to + // the slots that make up the pod. + PodDur int64 `json:"poddur,omitempty"` + + // Attribute: + // protocols + // Type: + // integer array; recommended + // Definition: + // Array of supported video protocols. Refer to List: Creative + // Subtypes - Audio/Video in AdCOM 1.0. + Protocols []int8 `json:"protocols,omitempty"` // Attribute: // w @@ -77,22 +104,48 @@ type Video struct { H int64 `json:"h,omitempty"` // Attribute: - // startdelay + // podid // Type: - // integer; recommended - // Description: - // Indicates the start delay in seconds for pre-roll, mid-roll, or - // post-roll ad placements. Refer to List 5.12 for additional - // generic values. - StartDelay *StartDelay `json:"startdelay,omitempty"` + // integer + // Definition: + // Unique identifier indicating that an impression opportunity + // belongs to a video ad pod. If multiple impression opportunities + // within a bid request share the same podid, this indicates that + // those impression opportunities belong to the same video ad + // pod. + PodID int64 `json:"podid,omitempty"` + + // Attribute: + // podseq + // Type: + // integer; default 0 + // Definition: + // The sequence (position) of the video ad pod within a + // content stream. Refer to List: Pod Sequence in AdCOM 1.0 + // for guidance on the use of this field. + PodSeq int8 `json:"podseq,omitempty"` + + // Attribute: + // rqddurs + // Type: + // integer array + // Definition: + // Precise acceptable durations for video creatives in + // seconds. This field specifically targets the Live TV use case + // where non-exact ad durations would result in undesirable + // ‘dead air’. This field is mutually exclusive with minduration + // and maxduration; if rqddurs is specified, minduration and + // maxduration must not be specified and vice versa. + RqdDurs []int64 `json:"rqddurs,omitempty"` // Attribute: // placement // Type: // integer // Description: - // Placement type for the impression. Refer to List 5.9. - Placement VideoPlacementType `json:"placement,omitempty"` + // Video placement type for the impression. Refer to List: + // Placement Subtypes - Video in AdCOM 1.0. + Placement int8 `json:"placement,omitempty"` // Attribute: // linearity @@ -100,8 +153,11 @@ type Video struct { // integer // Description: // Indicates if the impression must be linear, nonlinear, etc. If - // none specified, assume all are allowed. Refer to List 5.7. - Linearity VideoLinearity `json:"linearity,omitempty"` + // none specified, assume all are allowed. Refer to List: Linearity + // Modes in AdCOM 1.0. Note that this field describes the + // expected VAST response and not whether a placement is in- + // stream, out-stream, etc. For that, see placement. + Linearity int8 `json:"linearity,omitempty"` // Attribute: // skip @@ -112,7 +168,8 @@ type Video struct { // where 0 = no, 1 = yes. // If a bidder sends markup/creative that is itself skippable, the // Bid object should include the attr array with an element of - // 16 indicating skippable video. Refer to List 5.3. + // 16 indicating skippable video. Refer to List: Creative + // Attributes in AdCOM 1.0. Skip *int8 `json:"skip,omitempty"` // Attribute: @@ -136,20 +193,42 @@ type Video struct { // Attribute: // sequence // Type: - // integer + // integer; default 0; DEPRECATED // Description: // If multiple ad impressions are offered in the same bid request, // the sequence number will allow for the coordinated delivery // of multiple creatives. Sequence int8 `json:"sequence,omitempty"` + // Attribute: + // slotinpod + // Type: + // integer; default 0 + // Description: + // For video ad pods, this value indicates that the seller can + // guarantee delivery against the indicated slot position in the + // pod. Refer to List: Slot Position in Pod in AdCOM 1.0 guidance + // on the use of this field. + SlotInPod *int8 `json:"slotinpod,omitempty"` + + // Attribute: + // mincpmpersec + // Type: + // float + // Description: + // Minimum CPM per second. This is a price floor for the + // "dynamic" portion of a video ad pod, relative to the duration + // of bids an advertiser may submit. + MinCPMPerSec float64 `json:"mincpmpersec,omitempty"` + // Attribute: // battr // Type: // integer array // Description: - // Blocked creative attributes. Refer to List 5.3. - BAttr []CreativeAttribute `json:"battr,omitempty"` + // Blocked creative attributes. Refer to List: Creative Attributes in + // AdCOM 1.0 + BAttr []int64 `json:"battr,omitempty"` // Attribute: // maxextended @@ -194,20 +273,22 @@ type Video struct { // integer array // Description: // Playback methods that may be in use. If none are specified, - // any method may be used. Refer to List 5.10. Only one - // method is typically used in practice. As a result, this array may - // be converted to an integer in a future version of the - // specification. It is strongly advised to use only the first - // element of this array in preparation for this change. - PlaybackMethod []PlaybackMethod `json:"playbackmethod,omitempty"` + // any method may be used. Refer to List: Playback Methods + // in AdCOM 1.0. Only one method is typically used in practice. + // As a result, this array may be converted to an integer in a + // future version of the specification. It is strongly advised to use + // only the first element of this array in preparation for this + // change. + PlaybackMethod []int8 `json:"playbackmethod,omitempty"` // Attribute: // playbackend // Type: // integer // Description: - // The event that causes playback to end. Refer to List 5.11. - PlaybackEnd PlaybackCessationMode `json:"playbackend,omitempty"` + // The event that causes playback to end. Refer to List: Playback + // Cessation Modes in AdCOM 1.0. + PlaybackEnd int8 `json:"playbackend,omitempty"` // Attribute: // delivery @@ -215,16 +296,18 @@ type Video struct { // integer array // Description: // Supported delivery methods (e.g., streaming, progressive). If - // none specified, assume all are supported. Refer to List 5.15. - Delivery []ContentDeliveryMethod `json:"delivery,omitempty"` + // none specified, assume all are supported. Refer to List: + // Delivery Methods in AdCOM 1.0. + Delivery []int8 `json:"delivery,omitempty"` // Attribute: // pos // Type: // integer // Description: - // Ad position on screen. Refer to List 5.4. - Pos *AdPosition `json:"pos,omitempty"` + // Ad position on screen. Refer to List: Placement Positions in + // AdCOM 1.0. + Pos int8 `json:"pos,omitempty"` // Attribute: // companionad @@ -241,21 +324,22 @@ type Video struct { // integer array // Description: // List of supported API frameworks for this impression. Refer to - // List 5.6. If an API is not explicitly listed, it is assumed not to be - // supported. - API []APIFramework `json:"api,omitempty"` + // List: API Frameworks in AdCOM 1.0. If an API is not explicitly + // listed, it is assumed not to be supported. + API []int64 `json:"api,omitempty"` // Attribute: // companiontype // Type: // integer array // Description: - // Supported VAST companion ad types. Refer to List 5.14. - // Recommended if companion Banner objects are included via - // the companionad array. If one of these banners will be + // Supported VAST companion ad types. Refer to List: + // Companion Types in AdCOM 1.0. Recommended if + // companion Banner objects are included via the + // companionad array. If one of these banners will be // rendered as an end-card, this can be specified using the vcm // attribute with the particular banner (Section 3.2.6). - CompanionType []CompanionType `json:"companiontype,omitempty"` + CompanionType []int8 `json:"companiontype,omitempty"` // Attribute: // ext diff --git a/openrtb2/video_linearity.go b/openrtb2/video_linearity.go deleted file mode 100644 index 07fc9bb..0000000 --- a/openrtb2/video_linearity.go +++ /dev/null @@ -1,16 +0,0 @@ -package openrtb2 - -// 5.7 Video Linearity -// -// Options for video linearity. -// “In-stream” or “linear” video refers to preroll, post-roll, or mid-roll video ads where the user is forced to watch ad in order to see the video content. -// “Overlay” or “non-linear” refer to ads that are shown on top of the video content. -// -// This OpenRTB list has values derived from the Inventory Quality Guidelines (IQG). -// Practitioners should keep in sync with updates to the IQG values. -type VideoLinearity int8 - -const ( - VideoLinearityLinearInStream VideoLinearity = 1 // Linear / In-Stream - VideoLinearityNonLinearOverlay VideoLinearity = 2 // Non-Linear / Overlay -) diff --git a/openrtb2/video_placement_type.go b/openrtb2/video_placement_type.go deleted file mode 100644 index 41b6042..0000000 --- a/openrtb2/video_placement_type.go +++ /dev/null @@ -1,14 +0,0 @@ -package openrtb2 - -// 5.9 Video Placement Types -// -// Various types of video placements derived largely from the IAB Digital Video Guidelines. -type VideoPlacementType int8 - -const ( - VideoPlacementTypeInStream VideoPlacementType = 1 // In-Stream. Played before, during or after the streaming video content that the consumer has requested (e.g., Pre-roll, Mid-roll, Post-roll). - VideoPlacementTypeInBanner VideoPlacementType = 2 // In-Banner. Exists within a web banner that leverages the banner space to deliver a video experience asopposed to another static or rich media format. The format relies on the existence of displayad inventory on the page for its delivery. - VideoPlacementTypeInArticle VideoPlacementType = 3 // In-Article. Loads and plays dynamically between paragraphs of editorial content; existing as a standalonebranded message. - VideoPlacementTypeInFeed VideoPlacementType = 4 // In-Feed. Found in content, social, or product feeds. - VideoPlacementTypeInterstitialSliderFloating VideoPlacementType = 5 // Interstitial/Slider/Floating. Covers the entire or a portion of screen area, but is always on screen while displayed (i.e.cannot be scrolled out of view). Note that a full-screen interstitial (e.g., in mobile) can bedistinguished from a floating/slider unit by the imp.instl field. -) diff --git a/openrtb2/volume_normalization_mode.go b/openrtb2/volume_normalization_mode.go deleted file mode 100644 index 44e6475..0000000 --- a/openrtb2/volume_normalization_mode.go +++ /dev/null @@ -1,27 +0,0 @@ -package openrtb2 - -// 5.17 Volume Normalization Modes -// -// Types of volume normalization modes, typically for audio. -type VolumeNormalizationMode int8 - -const ( - VolumeNormalizationModeNone VolumeNormalizationMode = 0 // None - VolumeNormalizationModeAdVolumeAverageNormalizedToContent VolumeNormalizationMode = 1 // Ad Volume Average Normalized to Content - VolumeNormalizationModeAdVolumePeakNormalizedToContent VolumeNormalizationMode = 2 // Ad Volume Peak Normalized to Content - VolumeNormalizationModeAdLoudnessNormalizedToContent VolumeNormalizationMode = 3 // Ad Loudness Normalized to Content - VolumeNormalizationModeCustomVolumeNormalizationMode VolumeNormalizationMode = 4 // Custom Volume Normalization -) - -// Ptr returns pointer to own value. -func (m VolumeNormalizationMode) Ptr() *VolumeNormalizationMode { - return &m -} - -// Val safely dereferences pointer, returning default value (VolumeNormalizationModeNone) for nil. -func (m *VolumeNormalizationMode) Val() VolumeNormalizationMode { - if m == nil { - return VolumeNormalizationModeNone - } - return *m -} From b3b9d6615804a958a1fde2c0bfeb9778eda300ed Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Thu, 12 May 2022 23:33:01 -0400 Subject: [PATCH 03/62] AdCOM Fields Added For OpenRTB 2.6 Parity --- adcom1/agent_type.go | 13 +++++ adcom1/api_framework.go | 16 +++--- adcom1/app.go | 8 +++ adcom1/audio_placement.go | 72 +++++++++++++++++++++++++++ adcom1/brand_version.go | 32 ++++++++++++ adcom1/category_taxonomy.go | 9 ++-- adcom1/channel.go | 43 ++++++++++++++++ adcom1/content.go | 26 ++++++++++ adcom1/device.go | 19 ++++++++ adcom1/device_type.go | 1 + adcom1/expandable_direction.go | 1 + adcom1/extended_identifier.go | 33 +++++++++++++ adcom1/extended_identifier_uid.go | 31 ++++++++++++ adcom1/media_creative_subtype.go | 2 + adcom1/network.go | 43 ++++++++++++++++ adcom1/playback_method.go | 1 + adcom1/pod_sequence.go | 11 +++++ adcom1/site.go | 8 +++ adcom1/slot_position_in_pod.go | 12 +++++ adcom1/user.go | 20 +++++++- adcom1/user_agent.go | 81 +++++++++++++++++++++++++++++++ adcom1/user_agent_source.go | 12 +++++ adcom1/video_placement.go | 81 +++++++++++++++++++++++++++++++ openrtb2/video.go | 4 +- 24 files changed, 565 insertions(+), 14 deletions(-) create mode 100644 adcom1/agent_type.go create mode 100644 adcom1/brand_version.go create mode 100644 adcom1/channel.go create mode 100644 adcom1/extended_identifier.go create mode 100644 adcom1/extended_identifier_uid.go create mode 100644 adcom1/network.go create mode 100644 adcom1/pod_sequence.go create mode 100644 adcom1/slot_position_in_pod.go create mode 100644 adcom1/user_agent.go create mode 100644 adcom1/user_agent_source.go diff --git a/adcom1/agent_type.go b/adcom1/agent_type.go new file mode 100644 index 0000000..8482230 --- /dev/null +++ b/adcom1/agent_type.go @@ -0,0 +1,13 @@ +package adcom1 + +// AgentType identifies the user agent types a user identifier is from. +type AgentType int + +// Agent types dewscribing where the user agent is from. +// +// Values of 500+ hold vendor-specific codes. +const ( + ATypeWeb AgentType = 1 // An ID which is tied to a specific web browser or device (cookie-based, probabilistic, or other). + ATypeApp AgentType = 2 // In-app impressions, which will typically contain a type of device ID (or rather, the privacy-compliant versions of device IDs). + ATypePerson AgentType = 3 // A person-based ID, i.e., that is the same across devices. +) diff --git a/adcom1/api_framework.go b/adcom1/api_framework.go index 1ed2caa..f9f074c 100644 --- a/adcom1/api_framework.go +++ b/adcom1/api_framework.go @@ -7,11 +7,13 @@ type APIFramework int // // Values of 500+ hold vendor-specific codes. const ( - APIVPAID1 APIFramework = 1 // VPAID 1.0 - APIVPAID2 APIFramework = 2 // VPAID 2.0 - APIMRAID1 APIFramework = 3 // MRAID 1.0 - APIORMMA APIFramework = 4 // ORMMA - APIMRAID2 APIFramework = 5 // MRAID 2.0 - APIMRAID3 APIFramework = 6 // MRAID 3.0 - APIOMID1 APIFramework = 7 // OMID 1.0 + APIVPAID1 APIFramework = 1 // VPAID 1.0 + APIVPAID2 APIFramework = 2 // VPAID 2.0 + APIMRAID1 APIFramework = 3 // MRAID 1.0 + APIORMMA APIFramework = 4 // ORMMA + APIMRAID2 APIFramework = 5 // MRAID 2.0 + APIMRAID3 APIFramework = 6 // MRAID 3.0 + APIOMID1 APIFramework = 7 // OMID 1.0 + APISIMID10 APIFramework = 8 // SIMID 1.0 + APISIMID11 APIFramework = 9 // SIMID 1.1 ) diff --git a/adcom1/app.go b/adcom1/app.go index 90409a0..e49f001 100644 --- a/adcom1/app.go +++ b/adcom1/app.go @@ -64,6 +64,14 @@ type App struct { // Comma separated list of keywords about the app. Keywords string `json:"keywords,omitempty"` + // Attribute: + // kwarray + // Type: + // string array + // Definition: + // Array of keywords about the site. Only one of 'keywords' or 'kwarray' may be present. + KwArray []string `json:"kwarray,omitempty"` + // Attribute: // bundle // Type: diff --git a/adcom1/audio_placement.go b/adcom1/audio_placement.go index e8ec4bc..ebfcbf5 100644 --- a/adcom1/audio_placement.go +++ b/adcom1/audio_placement.go @@ -117,6 +117,17 @@ type AudioPlacement struct { // Maximum creative duration in seconds. MaxDur int64 `json:"maxdur,omitempty"` + // Attribute: + // rqddurs + // Type: + // integer array + // Definition: + // Precise acceptable durations for video creatives in seconds. This field specifically + // targets the Live TV use case where non-exact ad durations would result in undesirable + // 'dead air'. This field is mutually exclusive with mindur and maxdur; if rqddurs is + // specified, mindur and maxdur must not be specified and vice versa. + RqdDurs []in64 `json:"rqddurs,omitempty"` + // Attribute: // maxext // Type: @@ -162,6 +173,57 @@ type AudioPlacement struct { // The maximum number of ads that can be played in an ad pod. MaxSeq int64 `json:"maxseq,omitempty"` + // Attribute: + // poddur + // Type: + // integer + // Definition: + // Indicates the total amount of time in seconds that advertisers may fill + // for a “dynamic” video ad pod, or the dynamic portion of a “hybrid” ad pod. + // This field is required only for the dynamic portion(s) of video ad pods. + // This field refers to the length of the entire ad break, whereas + // mindur/maxdur/rqddurs are constraints relating to the slots that make up the pod. + PodDur int64 `json:"poddur,omitempty"` + + // Attribute: + // podid + // Type: + // integer + // Definition: + // Unique identifier indicating that an impression opportunity belongs to a + // video ad pod. If multiple impression opportunities within a bid request + // share the same podid, this indicates that those impression opportunities + // belong to the same video ad pod. + PodID int64 `json:"podid,omitempty"` + + // Attribute: + // podseq + // Type: + // integer; default 0 + // Definition: + // The sequence (position) of the video ad pod within a content stream. + // Refer to List: List: Pod Sequence for guidance on the use of this field. + PodSeq PodSequence `json:"podseq,omitempty"` + + // Attribute: + // slotinpod + // Type: + // integer; default 0 + // Definition: + // For video ad pods, this value indicates that the seller can guarantee delivery + // against the indicated slot position in the pod. + // Refer to List: List: Slot Position in Pod for guidance on the use of this field. + SlotInPod SlotPositionInPod `json:"slotinpod,omitempty"` + + // Attribute: + // mincpmpersec + // Type: + // float + // Definition: + // Minimum CPM per second. This is a price floor for the “dynamic” portion of a + // video ad pod, relative to the duration of bids an advertiser may submit. + MinCPMPerSec float64 `json:"mincpmpersec,omitempty"` + // Attribute: // comp // Type: @@ -180,6 +242,16 @@ type AudioPlacement struct { // Refer to List: Companion Types. CompType []CompanionType `json:"comptype,omitempty"` + // Attribute: + // overlayexpdir + // Type: + // integer array + // Definition: + // Directions in which the creative (video overlay) is permitted to expand. + // This is primarily used for non-linear videos. + // Refer to List: Expandable Directions. + OverlayExpDir []ExpandableDirection `json:"overlayexpdir,omitempty"` + // Attribute: // ext // Type: diff --git a/adcom1/brand_version.go b/adcom1/brand_version.go new file mode 100644 index 0000000..021e1db --- /dev/null +++ b/adcom1/brand_version.go @@ -0,0 +1,32 @@ +package adcom1 + +import "encoding/json" + +// BrandVersion provides further identification based on User-Agent Client Hints. +// The BrandVersion object is used to identify a device’s browser or similar software component, and the user agent’s execution platform or operating system. +type BrandVersion struct { + // Attribute: + // brand + // Type: + // string; recommended + // Definition: + // A brand identifier, for example, “Chrome” or “Windows”. + // The value may be sourced from the User-Agent Client Hints headers, representing either the user agent brand (from the Sec-CH-UA-Full-Version header) or the platform brand (from the Sec-CH-UA-Platform header). + Brand string `json:"brand,omitempty"` + + // Attribute: + // version + // Type: + // string array + // Definition: + // A sequence of version components, in descending hierarchical order (major, minor, micro, …). + Version []string `json:"name,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/category_taxonomy.go b/adcom1/category_taxonomy.go index a7a9f6d..3fb1224 100644 --- a/adcom1/category_taxonomy.go +++ b/adcom1/category_taxonomy.go @@ -7,7 +7,10 @@ type CategoryTaxonomy int // // Values of 500+ hold vendor-specific codes. const ( - CatTaxIABContent1 CategoryTaxonomy = 1 // 1 IAB Content Category Taxonomy 1.0. - CatTaxIABContent2 CategoryTaxonomy = 2 // 2 IAB Content Category Taxonomy 2.0: www.iab.com/guidelines/taxonomy - CatTaxIABProduct1 CategoryTaxonomy = 3 // 3 IAB Ad Product Taxonomy 1.0. + CatTaxIABContent1 CategoryTaxonomy = 1 // 1 IAB Content Category Taxonomy 1.0. + CatTaxIABContent20 CategoryTaxonomy = 2 // 2 IAB Content Category Taxonomy 2.0: www.iab.com/guidelines/taxonomy + CatTaxIABProduct1 CategoryTaxonomy = 3 // 3 IAB Ad Product Taxonomy 1.0. + CatTaxIABAudience11 CategoryTaxonomy = 4 // 4 IAB Audience Taxonomy 1.1. + CatTaxIABContent21 CategoryTaxonomy = 5 // 5 IAB Content Category Taxonomy 2.1. + CatTaxIABContent22 CategoryTaxonomy = 6 // 6 IAB Content Category Taxonomy 2.2 ) diff --git a/adcom1/channel.go b/adcom1/channel.go new file mode 100644 index 0000000..05ac1b4 --- /dev/null +++ b/adcom1/channel.go @@ -0,0 +1,43 @@ +package adcom1 + +import "encoding/json" + +// Channel describes the channel an ad will be displayed on. +// A Channel is defined as the entity that curates a content library, or stream within a brand name for viewers. +// Examples are specific view selectable ‘channels’ within linear and streaming television (MTV, HGTV, CNN, BBC One, etc) or a specific stream of audio content commonly called ‘stations.’ +// Name is human-readable field while domain and id can be used for reporting and targeting purposes. +type Channel struct { + // Attribute: + // id + // Type: + // string + // Definition: + // A unique identifier assigned by the publisher. + // This may not be a unique identifier across all supply sources. + ID string `json:"id,omitempty"` + + // Attribute: + // name + // Type: + // string + // Definition: + // Channel the content is on (e.g., a local channel like "WABC-TV"). + Name string `json:"name,omitempty"` + + // Attribute: + // domain + // Type: + // string + // Definition: + // The primary domain of the channel (e.g., “abc7ny.com” in the case of the local channel WABC-TV). + // It is recommended to include the top private domain (PSL+1) for DSP targeting normalization purposes. + Domain string `json:"domain,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/content.go b/adcom1/content.go index 701363b..fc06ef7 100644 --- a/adcom1/content.go +++ b/adcom1/content.go @@ -158,6 +158,14 @@ type Content struct { // Comma separated list of keywords describing the content. Keywords string `json:"keywords,omitempty"` + // Attribute: + // kwarray + // Type: + // string array + // Definition: + // Array of keywords about the site. Only one of 'keywords' or 'kwarray' may be present. + KwArray []string `json:"kwarray,omitempty"` + // Attribute: // live // Type: @@ -207,6 +215,24 @@ type Content struct { // Refer to Object: Producer. Producer *Producer `json:"producer,omitempty"` + // Attribute: + // network + // Type: + // object + // Definition: + // Details about the network. + // Refer to Object: Network. + Network *Network `json:"network,omitempty"` + + // Attribute: + // channel + // Type: + // object + // Definition: + // Details about the channel. + // Refer to Object: Channel. + Channel *Channel `json:"channel,omitempty"` + // Attribute: // data // Type: diff --git a/adcom1/device.go b/adcom1/device.go index 58e09d3..8471973 100644 --- a/adcom1/device.go +++ b/adcom1/device.go @@ -23,6 +23,16 @@ type Device struct { // Browser user agent string. UA string `json:"ua,omitempty"` + // Attribute: + // aua + // Type: + // string + // Definition: + // Structured user agent information defined by a Object: UserAgent. + // If both `ua` and `sua` are present in the bid request, `sua` should be considered the more accurate representation of the device attributes. + // This is because the `ua` may contain a frozen or reduced UserAgent string. + SUA *UserAgent `json:"sua,omitempty"` + // Attribute: // ifa // Type: @@ -137,6 +147,15 @@ type Device struct { // Browser language using ISO-639-1-alpha-2. Lang string `json:"lang,omitempty"` + // Attribute: + // langb + // Type: + // string + // Definition: + // Browser language using IETF BCP 47. + // Only one of lang or langb should be present. + LangB string `json:"langb,omitempty"` + // Attribute: // ip // Type: diff --git a/adcom1/device_type.go b/adcom1/device_type.go index bca0e80..3402799 100644 --- a/adcom1/device_type.go +++ b/adcom1/device_type.go @@ -13,4 +13,5 @@ const ( DeviceTablet DeviceType = 5 // Tablet DeviceConnected DeviceType = 6 // Connected Device DeviceSetTopBox DeviceType = 7 // Set Top Box + DeviceOOH DeviceType = 8 // OOH Device ) diff --git a/adcom1/expandable_direction.go b/adcom1/expandable_direction.go index 1d8519c..135800c 100644 --- a/adcom1/expandable_direction.go +++ b/adcom1/expandable_direction.go @@ -10,4 +10,5 @@ const ( ExpandableUp ExpandableDirection = 3 // Up ExpandableDown ExpandableDirection = 4 // Down ExpandableFullScreen ExpandableDirection = 5 // Full Screen + ExpandableSmaller ExpandableDirection = 6 // Resize/Minimize (make smaller) ) diff --git a/adcom1/extended_identifier.go b/adcom1/extended_identifier.go new file mode 100644 index 0000000..717e90e --- /dev/null +++ b/adcom1/extended_identifier.go @@ -0,0 +1,33 @@ +package adcom1 + +import "encoding/json" + +// ExtendedIdentifier support in the OpenRTB specification allows buyers to use audience data in real-time bidding. +// The exchange should ensure that business agreements allow for the sending of this data. +// Note, it is assumed that exchanges and DSPs will collaborate with the appropriate regulatory agencies and ID vendor(s) to ensure compliance. +type ExtendedIdentifier struct { + // Attribute: + // source + // Type: + // string + // Definition: + // Source or technology provider responsible for the set of included IDs. + // Expressed as a top-level domain. + Source string `json:"source,omitempty"` + + // Attribute: + // uids + // Type: + // object array + // Definition: + // Array of extended ID UID objects from the given source. Refer to Object: Extended Identifier UIDs. + UIDs []ExtendedIdentifierUID `json:"uids,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/extended_identifier_uid.go b/adcom1/extended_identifier_uid.go new file mode 100644 index 0000000..3cf16a2 --- /dev/null +++ b/adcom1/extended_identifier_uid.go @@ -0,0 +1,31 @@ +package adcom1 + +import "encoding/json" + +type ExtendedIdentifierUID struct { + // Attribute: + // id + // Type: + // string + // Definition: + // Cookie or platform-native identifier. + ID string `json:"id,omitempty"` + + // Attribute: + // uids + // Type: + // object array + // Definition: + // Type of user agent the match is from. + // It is highly recommended to set this, as many DSPs separate app-native IDs from browser-based IDs and require a type value for ID resolution. + // Refer to List: Agent Types. + AType AgentType `json:"uids,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/media_creative_subtype.go b/adcom1/media_creative_subtype.go index 5601462..e3b5d20 100644 --- a/adcom1/media_creative_subtype.go +++ b/adcom1/media_creative_subtype.go @@ -17,4 +17,6 @@ const ( CreativeDAAST10Wrapper MediaCreativeSubtype = 10 // DAAST 1.0 Wrapper CreativeVAST41 MediaCreativeSubtype = 11 // VAST 4.1 CreativeVAST41Wrapper MediaCreativeSubtype = 12 // VAST 4.1 Wrapper + CreativeVAST42 MediaCreativeSubtype = 13 // VAST 4.2 + CreativeVAST42Wrapper MediaCreativeSubtype = 14 // VAST 4.2 Wrapper ) diff --git a/adcom1/network.go b/adcom1/network.go new file mode 100644 index 0000000..a437d02 --- /dev/null +++ b/adcom1/network.go @@ -0,0 +1,43 @@ +package adcom1 + +import "encoding/json" + +// Network describes the network an ad will be displayed on. +// A Network is defined as the parent entity of the Channel object’s entity for the purposes of organizing Channels. +// Examples are companies that own and/or license a collection of content channels (Viacom, Discovery, CBS, WarnerMedia, Turner and others), or studio that creates such content and self-distributes content. +// Name is human-readable field while domain and id can be used for reporting and targeting purposes. +type Network struct { + // Attribute: + // id + // Type: + // string + // Definition: + // A unique identifier assigned by the publisher. + // This may not be a unique identifier across all supply sources. + ID string `json:"id,omitempty"` + + // Attribute: + // name + // Type: + // string + // Definition: + // Network the content is on (e.g., a TV network like "ABC"). + Name string `json:"name,omitempty"` + + // Attribute: + // domain + // Type: + // string + // Definition: + // The primary domain of the network (e.g., “abc.com” in the case of the network ABC). + // It is recommended to include the top private domain (PSL+1) for DSP targeting normalization purposes. + Domain string `json:"domain,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/playback_method.go b/adcom1/playback_method.go index 76f4928..ffbed69 100644 --- a/adcom1/playback_method.go +++ b/adcom1/playback_method.go @@ -11,4 +11,5 @@ const ( PlaybackMouseOverSoundOn PlaybackMethod = 4 // Initiates on Mouse-Over with Sound On PlaybackViewportSoundOn PlaybackMethod = 5 // Initiates on Entering Viewport with Sound On PlaybackViewportSoundOff PlaybackMethod = 6 // Initiates on Entering Viewport with Sound Off by Default + PlaybackContinuous PlaybackMethod = 7 // Continuous Playback - Media playback is set to play additional media automatically without user interaction. The media player will keep playing additional media (playlist or generated) for the user until the user actively stops this from happening. ) diff --git a/adcom1/pod_sequence.go b/adcom1/pod_sequence.go new file mode 100644 index 0000000..77580a6 --- /dev/null +++ b/adcom1/pod_sequence.go @@ -0,0 +1,11 @@ +package adcom1 + +// PodSequence identifies the pod sequence field, for use in audio and video content streams with one or more ad pods. +type PodSequence int8 + +// PodSequence options. +const ( + PodSeqLast PodSequence = -1 // -1 Last pod in the content stream. + PodSeqAny PodSequence = 0 // 0 Any pod in the content stream. + PodSeqFirst PodSequence = 1 // 1 First pod in the content stream. +) diff --git a/adcom1/site.go b/adcom1/site.go index c690391..e7f0eba 100644 --- a/adcom1/site.go +++ b/adcom1/site.go @@ -64,6 +64,14 @@ type Site struct { // Comma separated list of keywords about the site. Keywords string `json:"keywords,omitempty"` + // Attribute: + // kwarray + // Type: + // string array + // Definition: + // Array of keywords about the site. Only one of 'keywords' or 'kwarray' may be present. + KwArray []string `json:"kwarray,omitempty"` + // Attribute: // page // Type: diff --git a/adcom1/slot_position_in_pod.go b/adcom1/slot_position_in_pod.go new file mode 100644 index 0000000..679c7ba --- /dev/null +++ b/adcom1/slot_position_in_pod.go @@ -0,0 +1,12 @@ +package adcom1 + +// PodSequence identifies the slot position in pod field, for use in audio and video ad pods. +type SlotPositionInPod int8 + +// PodSequence options. +const ( + SlotPosLast SlotPositionInPod = -1 // -1 Last ad in the pod. + SlotPosAny SlotPositionInPod = 0 // 0 Any ad in the pod. + SlotPosFirst SlotPositionInPod = 1 // 1 First ad in the pod. + SlotPosFirstOrLast SlotPositionInPod = 2 // 1 First or Last ad in the pod. +) diff --git a/adcom1/user.go b/adcom1/user.go index a12b096..ece0b2f 100644 --- a/adcom1/user.go +++ b/adcom1/user.go @@ -27,7 +27,7 @@ type User struct { // Attribute: // yob // Type: - // integer + // integer; DEPRECATED // Definition: // Year of birth as a 4-digit integer. YOB int64 `json:"yob,omitempty"` @@ -35,7 +35,7 @@ type User struct { // Attribute: // gender // Type: - // string + // string; DEPRECATED // Definition: // Gender, where “M” = male, “F” = female, “O” = known to be other (i.e., omitted is unknown). Gender string `json:"gender,omitempty"` @@ -48,6 +48,14 @@ type User struct { // Comma separated list of keywords, interests, or intent. Keywords string `json:"keywords,omitempty"` + // Attribute: + // kwarray + // Type: + // string array + // Definition: + // Array of keywords about the site. Only one of 'keywords' or 'kwarray' may be present. + KwArray []string `json:"kwarray,omitempty"` + // Attribute: // consent // Type: @@ -75,6 +83,14 @@ type User struct { // Refer to Object: Data. Data []Data `json:"data,omitempty"` + // Attribute: + // eids + // Type: + // object array + // Definition: + // Extended (third-party) identifiers for this user. Refer to Object: Extended Identifiers. + EIDs []EID `json:"eids,omitempty"` + // Attribute: // ext // Type: diff --git a/adcom1/user_agent.go b/adcom1/user_agent.go new file mode 100644 index 0000000..6fc743e --- /dev/null +++ b/adcom1/user_agent.go @@ -0,0 +1,81 @@ +package adcom1 + +import "encoding/json" + +// UserAgent represents Structured user agent information provided when client supports User-Agent Client Hints. +// If both device.ua and device.sua are present in the bid request, device.sua should be considered the more accurate representation of the device attributes. +// This is because the device.ua may contain a frozen or reduced UserAgent string. +type UserAgent struct { + // Attribute: + // browsers + // Type: + // object array; recommended + // Definition: + // Each BrandVersion object identifies a browser or similar software component. + // Refer to Object: BrandVersion. + // Implementers should send brands and versions derived from the Sec-CH-UA-Full-Version-List header. + Browsers []BrandVersion `json:"browsers,omitempty"` + + // Attribute: + // platform + // Type: + // object; recommended + // Definition: + // Refer to Object: BrandVersion that identifies the user agent’s execution platform / OS. + // Implementers should send a brand derived from the Sec-CH-UA-Platform header, and version derived from the Sec-CH-UA-Platform-Version header. + Platform []BrandVersion `json:"platform,omitempty"` + + // Attribute: + // mobile + // Type: + // integer + // Definition: + // 1 if the agent prefers a “mobile” version of the content, if available, i.e. optimized for small screens or touch input. + // 0 if the agent prefers the “desktop” or “full” content. + // Implementers should derive this value from the Sec-CH-UA-Mobile header. + Mobile int8 `json:"mobile,omitempty"` + + // Attribute: + // architecture + // Type: + // string + // Definition: + // Device’s major binary architecture, e.g. “x86” or “arm”. + // Implementers should retrieve this value from the Sec-CH-UA-Arch header. + Architecture string `json:"architecture,omitempty"` + + // Attribute: + // bitness + // Type: + // string + // Definition: + // Device’s bitness, e.g. “64” for 64-bit architecture. + // Implementers should retrieve this value from the Sec-CH-UA-Bitness header. + Bitness string `json:"bitness,omitempty"` + + // Attribute: + // model + // Type: + // string + // Definition: + // Device model. + // Implementers should retrieve this value from the Sec-CH-UA-Model header. + Model string `json:"model,omitempty"` + + // Attribute: + // source + // Type: + // integer + // Definition: + // The source of data used to create this object. + // Refer to List: User-Agent Source + Source UserAgentSource `json:"source,omitempty"` + + // Attribute: + // ext + // Type: + // object + // Definition: + // Optional vendor-specific extensions. + Ext json.RawMessage `json:"ext,omitempty"` +} diff --git a/adcom1/user_agent_source.go b/adcom1/user_agent_source.go new file mode 100644 index 0000000..8ab6617 --- /dev/null +++ b/adcom1/user_agent_source.go @@ -0,0 +1,12 @@ +package adcom1 + +// UserAgentSource represents the source of a user agent. +type UserAgentSource int8 + +// Options for the user agent source. +const ( + UASourceUnknown UserAgentSource = 0 // Unspecified/unknown + UASourceLowEntropy UserAgentSource = 1 // User-Agent Client Hints (only low-entropy headers were available) + UASourceHighEntropy UserAgentSource = 2 // User-Agent Client Hints (with high-entropy headers available) + UASourceParsed UserAgentSource = 3 // Parsed from User-Agent header (the same string carried by the ua field) +) diff --git a/adcom1/video_placement.go b/adcom1/video_placement.go index c3c1200..da63b51 100644 --- a/adcom1/video_placement.go +++ b/adcom1/video_placement.go @@ -151,6 +151,17 @@ type VideoPlacement struct { // Maximum creative duration in seconds. MaxDur int64 `json:"maxdur,omitempty"` + // Attribute: + // rqddurs + // Type: + // integer array + // Definition: + // Precise acceptable durations for video creatives in seconds. This field specifically + // targets the Live TV use case where non-exact ad durations would result in undesirable + // 'dead air'. This field is mutually exclusive with mindur and maxdur; if rqddurs is + // specified, mindur and maxdur must not be specified and vice versa. + RqdDurs []int64 `json:"rqddurs,omitempty"` + // Attribute: // maxext // Type: @@ -196,6 +207,57 @@ type VideoPlacement struct { // The maximum number of ads that can be played in an ad pod. MaxSeq int64 `json:"maxseq,omitempty"` + // Attribute: + // poddur + // Type: + // integer + // Definition: + // Indicates the total amount of time in seconds that advertisers may fill + // for a “dynamic” video ad pod, or the dynamic portion of a “hybrid” ad pod. + // This field is required only for the dynamic portion(s) of video ad pods. + // This field refers to the length of the entire ad break, whereas + // mindur/maxdur/rqddurs are constraints relating to the slots that make up the pod. + PodDur int64 `json:"poddur,omitempty"` + + // Attribute: + // podid + // Type: + // integer + // Definition: + // Unique identifier indicating that an impression opportunity belongs to a + // video ad pod. If multiple impression opportunities within a bid request + // share the same podid, this indicates that those impression opportunities + // belong to the same video ad pod. + PodID int64 `json:"podid,omitempty"` + + // Attribute: + // podseq + // Type: + // integer; default 0 + // Definition: + // The sequence (position) of the video ad pod within a content stream. + // Refer to List: List: Pod Sequence for guidance on the use of this field. + PodSeq PodSequence `json:"podseq,omitempty"` + + // Attribute: + // slotinpod + // Type: + // integer; default 0 + // Definition: + // For video ad pods, this value indicates that the seller can guarantee delivery + // against the indicated slot position in the pod. + // Refer to List: List: Slot Position in Pod for guidance on the use of this field. + SlotInPod SlotPositionInPod `json:"slotinpod,omitempty"` + + // Attribute: + // mincpmpersec + // Type: + // float + // Definition: + // Minimum CPM per second. This is a price floor for the “dynamic” portion of a + // video ad pod, relative to the duration of bids an advertiser may submit. + MinCPMPerSec float64 `json:"mincpmpersec,omitempty"` + // Attribute: // linear // Type: @@ -232,6 +294,25 @@ type VideoPlacement struct { // Refer to List: Companion Types. CompType []CompanionType `json:"comptype,omitempty"` + // Attribute: + // expdir + // Type: + // integer array + // Definition: + // Directions in which the creative (video placement) is permitted to expand. + // Refer to List: Expandable Directions. + ExpDir []ExpandableDirection `json:"expdir,omitempty"` + + // Attribute: + // overlayexpdir + // Type: + // integer array + // Definition: + // Directions in which the creative (video overlay) is permitted to expand. + // This is primarily used for non-linear videos. + // Refer to List: Expandable Directions. + OverlayExpDir []ExpandableDirection `json:"overlayexpdir,omitempty"` + // Attribute: // ext // Type: diff --git a/openrtb2/video.go b/openrtb2/video.go index 9854836..26510b1 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -31,7 +31,7 @@ type Video struct { // Minimum video ad duration in seconds. This field is mutually // exclusive with rqddurs; only one of minduration and rqddurs // may be in a bid request. - MinDuration *int64 `json:"minduration,omitempty"` + MinDuration int64 `json:"minduration,omitempty"` // Attribute: // maxduration @@ -41,7 +41,7 @@ type Video struct { // Maximum video ad duration in seconds. This field is mutually // exclusive with rqddurs; only one of maxduration and rqddurs // may be in a bid request. - MaxDuration *int64 `json:"maxduration,omitempty"` + MaxDuration int64 `json:"maxduration,omitempty"` // Attribute: // startdelay From fc839da51d6f60380551898d18c35454cde31401 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Thu, 12 May 2022 23:49:01 -0400 Subject: [PATCH 04/62] Self Review Pass --- adcom1/agent_type.go | 2 +- adcom1/api_framework.go | 2 +- adcom1/audio_placement.go | 2 +- adcom1/category_taxonomy.go | 2 +- adcom1/creative_attribute.go | 2 +- adcom1/user.go | 2 +- openrtb2/channel.go | 4 ++-- openrtb2/device.go | 16 ++++++++-------- openrtb2/imp.go | 8 +++++--- openrtb2/source.go | 2 +- openrtb2/supply_chain.go | 2 +- openrtb2/supply_chain_node.go | 4 ++-- openrtb2/user.go | 4 ++-- openrtb3/auction_type.go | 2 +- openrtb3/request.go | 2 +- 15 files changed, 29 insertions(+), 27 deletions(-) diff --git a/adcom1/agent_type.go b/adcom1/agent_type.go index 8482230..74ee866 100644 --- a/adcom1/agent_type.go +++ b/adcom1/agent_type.go @@ -1,7 +1,7 @@ package adcom1 // AgentType identifies the user agent types a user identifier is from. -type AgentType int +type AgentType int64 // Agent types dewscribing where the user agent is from. // diff --git a/adcom1/api_framework.go b/adcom1/api_framework.go index f9f074c..743c7d8 100644 --- a/adcom1/api_framework.go +++ b/adcom1/api_framework.go @@ -1,7 +1,7 @@ package adcom1 // APIFramework represents API frameworks either supported by a placement or required by an ad. -type APIFramework int +type APIFramework int64 // API frameworks either supported by a placement or required by an ad. // diff --git a/adcom1/audio_placement.go b/adcom1/audio_placement.go index ebfcbf5..98f2ba9 100644 --- a/adcom1/audio_placement.go +++ b/adcom1/audio_placement.go @@ -126,7 +126,7 @@ type AudioPlacement struct { // targets the Live TV use case where non-exact ad durations would result in undesirable // 'dead air'. This field is mutually exclusive with mindur and maxdur; if rqddurs is // specified, mindur and maxdur must not be specified and vice versa. - RqdDurs []in64 `json:"rqddurs,omitempty"` + RqdDurs []int64 `json:"rqddurs,omitempty"` // Attribute: // maxext diff --git a/adcom1/category_taxonomy.go b/adcom1/category_taxonomy.go index 3fb1224..fbd9d49 100644 --- a/adcom1/category_taxonomy.go +++ b/adcom1/category_taxonomy.go @@ -1,7 +1,7 @@ package adcom1 // CategoryTaxonomy identifies the taxonomy in effect when content categories are listed. -type CategoryTaxonomy int +type CategoryTaxonomy int64 // CategoryTaxonomy options. // diff --git a/adcom1/creative_attribute.go b/adcom1/creative_attribute.go index e19bfa1..ca8237f 100644 --- a/adcom1/creative_attribute.go +++ b/adcom1/creative_attribute.go @@ -1,7 +1,7 @@ package adcom1 // CreativeAttribute specifies a standard list of creative attributes that can describe an actual ad or restrictions relative to a given placement. -type CreativeAttribute int +type CreativeAttribute int64 // Standard list of creative attributes that can describe an actual ad or restrictions relative to a given placement. // diff --git a/adcom1/user.go b/adcom1/user.go index ece0b2f..197605a 100644 --- a/adcom1/user.go +++ b/adcom1/user.go @@ -89,7 +89,7 @@ type User struct { // object array // Definition: // Extended (third-party) identifiers for this user. Refer to Object: Extended Identifiers. - EIDs []EID `json:"eids,omitempty"` + EIDs []ExtendedIdentifier `json:"eids,omitempty"` // Attribute: // ext diff --git a/openrtb2/channel.go b/openrtb2/channel.go index 6a884ab..df299d1 100644 --- a/openrtb2/channel.go +++ b/openrtb2/channel.go @@ -17,7 +17,7 @@ type Channel struct { // string // Description: // A unique identifier assigned by the publisher. This may not be - // a unique identifier across all supply sources. + // a unique identifier across all supply sources. ID string `json:"id,omitempty"` // Attribute: @@ -25,7 +25,7 @@ type Channel struct { // Type: // string // Description: - // Channel the content is on (e.g., a local channel like “WABC-TV"). + // Channel the content is on (e.g., a local channel like “WABC-TV"). Name string `json:"name,omitempty"` // Attribute: diff --git a/openrtb2/device.go b/openrtb2/device.go index 0631fe0..a3c8322 100644 --- a/openrtb2/device.go +++ b/openrtb2/device.go @@ -71,11 +71,11 @@ type Device struct { // object // Description: // Structured user agent information defined by a UserAgent - // object (see Section 3.2.29). If both ‘ua’ and ‘sua’ are present in - // the bid request, ‘sua’ should be considered the more accurate - // representation of the device attributes. This is because the ‘ua’ - // may contain a frozen or reduced user agent string. - SUA struct `json:"ua,omitempty"` + // object (see Section 3.2.29). If both ‘ua’ and ‘sua’ are present in + // the bid request, ‘sua’ should be considered the more accurate + // representation of the device attributes. This is because the ‘ua’ + // may contain a frozen or reduced user agent string. + SUA UserAgent `json:"ua,omitempty"` // Attribute: // ip @@ -99,7 +99,7 @@ type Device struct { // integer // Description: // The general type of device. Refer to List: Device Types in - // AdCOM 1.0. + // AdCOM 1.0. DeviceType int8 `json:"devicetype,omitempty"` // Attribute: @@ -249,7 +249,7 @@ type Device struct { // integer // Description: // Network connection type. Refer to List: Connection Types in - // AdCOM 1.0. + // AdCOM 1.0. ConnectionType int8 `json:"connectiontype,omitempty"` // Attribute: @@ -263,7 +263,7 @@ type Device struct { // Attribute: // didsha1 // Type: - // string; ; DEPRECATED + // string; DEPRECATED // Description: // Hardware device ID (e.g., IMEI); hashed via SHA1. DIDSHA1 string `json:"didsha1,omitempty"` diff --git a/openrtb2/imp.go b/openrtb2/imp.go index 03872fe..f4e7bca 100644 --- a/openrtb2/imp.go +++ b/openrtb2/imp.go @@ -183,9 +183,11 @@ type Imp struct { // Description: // Indicates if server-side ad insertion (e.g., stitching an ad into an // audio or video stream) is in use and the impact of this on asset - // and tracker retrieval, where 0 = status unknown, 1 = all client- - // side (i.e., not server-side), 2 = assets stitched server-side but - // tracking pixels fired client-side, 3 = all server-side. + // and tracker retrieval, where + // 0 = status unknown, + // 1 = all client-side (i.e., not server-side), + // 2 = assets stitched server-side but tracking pixels fired client-side, + // 3 = all server-side. SSAI int8 `json:"ssai,omitempty"` // Attribute: diff --git a/openrtb2/source.go b/openrtb2/source.go index 7da01d4..32d8777 100644 --- a/openrtb2/source.go +++ b/openrtb2/source.go @@ -45,7 +45,7 @@ type Source struct { // well as an indicator whether or not the supply chain is // complete. Details via the SupplyChain object (section // 3.2.25) - SChain struct `json:"schain,omitempty"` + SChain SupplyChain `json:"schain,omitempty"` // Attribute: // ext diff --git a/openrtb2/supply_chain.go b/openrtb2/supply_chain.go index fc64013..7baaddd 100644 --- a/openrtb2/supply_chain.go +++ b/openrtb2/supply_chain.go @@ -30,7 +30,7 @@ type SupplyChain struct { // the owner of the site, app, or other medium. In an incomplete // supply chain, it represents the first known node. The last node // epresents the entity sending this bid request. - Nodes SupplyChainNode `json:"nodes"` + Nodes []SupplyChainNode `json:"nodes"` // Attribute: // ver diff --git a/openrtb2/supply_chain_node.go b/openrtb2/supply_chain_node.go index aa5aef8..cbe1397 100644 --- a/openrtb2/supply_chain_node.go +++ b/openrtb2/supply_chain_node.go @@ -68,7 +68,7 @@ type SupplyChainNode struct { // Attribute: // hp // Type: - // integer; required + // integer; default 1 // Description: // Indicates whether this node will be involved in the flow of // payment for the inventory. When set to 1, the advertising @@ -80,7 +80,7 @@ type SupplyChainNode struct { // propagate this field onwards when constructing SupplyChain // objects in bid requests sent to a downstream advertising // system. - HP int8 `json:"hp"` + HP *int8 `json:"hp"` // Attribute: // ext diff --git a/openrtb2/user.go b/openrtb2/user.go index 21273f7..a96702d 100644 --- a/openrtb2/user.go +++ b/openrtb2/user.go @@ -107,8 +107,8 @@ type User struct { // object array // Description: // Details for support of a standard protocol for multiple third - // party identity providers (Section 3.2.27) - EIDs []struct `json:"eids,omitempty"` + // party identity providers (Section 3.2.27) + EIDs []EID `json:"eids,omitempty"` // Attribute: // ext diff --git a/openrtb3/auction_type.go b/openrtb3/auction_type.go index bcaf51a..4f9d607 100644 --- a/openrtb3/auction_type.go +++ b/openrtb3/auction_type.go @@ -9,5 +9,5 @@ const ( SecondPricePlus = 2 DealPrice = 3 // the value passed in flr is the agreed upon deal price - // Values greater than 500 can be used for exchange-specific auction types. + // Values 500 and greater can be used for exchange-specific auction types. ) diff --git a/openrtb3/request.go b/openrtb3/request.go index dffd22f..c24014e 100644 --- a/openrtb3/request.go +++ b/openrtb3/request.go @@ -39,7 +39,7 @@ type Request struct { // integer; default 2 // Definition: // Auction type, where 1 = First Price, 2 = Second Price Plus. - // Values greater than 500 can be used for exchange-specific auction types. + // Values 500 and greater can be used for exchange-specific auction types. AT AuctionType `json:"at,omitempty"` // Attribute: From 09cdad966848995cf0f6de82f4cc364a3c73be18 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Fri, 13 May 2022 00:13:02 -0400 Subject: [PATCH 05/62] Self Review --- README.md | 2 +- adcom1/brand_version.go | 2 +- adcom1/device.go | 2 +- adcom1/pod_sequence.go | 6 +++--- adcom1/slot_position_in_pod.go | 8 ++++---- adcom1/user_agent.go | 2 +- openrtb2/device.go | 2 +- openrtb2/imp.go | 2 +- openrtb2/supply_chain_node.go | 2 +- openrtb2/uid.go | 6 +++--- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index ec0c27f..2a97a91 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [OpenRTB](https://iabtechlab.com/standards/openrtb/), [AdCOM](https://iabtechlab.com/standards/openmedia) and [OpenRTB Dynamic Native Ads](https://iabtechlab.com/standards/openrtb-native/) types for [Go programming language](https://golang.org/) -- [openrtb2](openrtb2/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.6](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) +- [openrtb2](openrtb2/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.6](https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf) - [openrtb3](openrtb3/) - [OpenRTB](https://iabtechlab.com/standards/openrtb/) [3.0](https://github.com/InteractiveAdvertisingBureau/openrtb) - [adcom1](adcom1/) - [AdCOM](https://iabtechlab.com/standards/openmedia/) [1.0](https://github.com/InteractiveAdvertisingBureau/AdCOM) - [native1](native1/) - [OpenRTB Dynamic Native Ads API](https://iabtechlab.com/standards/openrtb-native/) [1.2](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) diff --git a/adcom1/brand_version.go b/adcom1/brand_version.go index 021e1db..c88beef 100644 --- a/adcom1/brand_version.go +++ b/adcom1/brand_version.go @@ -20,7 +20,7 @@ type BrandVersion struct { // string array // Definition: // A sequence of version components, in descending hierarchical order (major, minor, micro, …). - Version []string `json:"name,omitempty"` + Version []string `json:"version,omitempty"` // Attribute: // ext diff --git a/adcom1/device.go b/adcom1/device.go index 8471973..9e84cc1 100644 --- a/adcom1/device.go +++ b/adcom1/device.go @@ -24,7 +24,7 @@ type Device struct { UA string `json:"ua,omitempty"` // Attribute: - // aua + // sua // Type: // string // Definition: diff --git a/adcom1/pod_sequence.go b/adcom1/pod_sequence.go index 77580a6..f1e9400 100644 --- a/adcom1/pod_sequence.go +++ b/adcom1/pod_sequence.go @@ -5,7 +5,7 @@ type PodSequence int8 // PodSequence options. const ( - PodSeqLast PodSequence = -1 // -1 Last pod in the content stream. - PodSeqAny PodSequence = 0 // 0 Any pod in the content stream. - PodSeqFirst PodSequence = 1 // 1 First pod in the content stream. + PodSeqLast PodSequence = -1 // Last pod in the content stream. + PodSeqAny PodSequence = 0 // Any pod in the content stream. + PodSeqFirst PodSequence = 1 // First pod in the content stream. ) diff --git a/adcom1/slot_position_in_pod.go b/adcom1/slot_position_in_pod.go index 679c7ba..76726e0 100644 --- a/adcom1/slot_position_in_pod.go +++ b/adcom1/slot_position_in_pod.go @@ -5,8 +5,8 @@ type SlotPositionInPod int8 // PodSequence options. const ( - SlotPosLast SlotPositionInPod = -1 // -1 Last ad in the pod. - SlotPosAny SlotPositionInPod = 0 // 0 Any ad in the pod. - SlotPosFirst SlotPositionInPod = 1 // 1 First ad in the pod. - SlotPosFirstOrLast SlotPositionInPod = 2 // 1 First or Last ad in the pod. + SlotPosLast SlotPositionInPod = -1 // Last ad in the pod. + SlotPosAny SlotPositionInPod = 0 // Any ad in the pod. + SlotPosFirst SlotPositionInPod = 1 // First ad in the pod. + SlotPosFirstOrLast SlotPositionInPod = 2 // First or Last ad in the pod. ) diff --git a/adcom1/user_agent.go b/adcom1/user_agent.go index 6fc743e..5a59949 100644 --- a/adcom1/user_agent.go +++ b/adcom1/user_agent.go @@ -23,7 +23,7 @@ type UserAgent struct { // Definition: // Refer to Object: BrandVersion that identifies the user agent’s execution platform / OS. // Implementers should send a brand derived from the Sec-CH-UA-Platform header, and version derived from the Sec-CH-UA-Platform-Version header. - Platform []BrandVersion `json:"platform,omitempty"` + Platform BrandVersion `json:"platform,omitempty"` // Attribute: // mobile diff --git a/openrtb2/device.go b/openrtb2/device.go index a3c8322..b3beb7e 100644 --- a/openrtb2/device.go +++ b/openrtb2/device.go @@ -75,7 +75,7 @@ type Device struct { // the bid request, ‘sua’ should be considered the more accurate // representation of the device attributes. This is because the ‘ua’ // may contain a frozen or reduced user agent string. - SUA UserAgent `json:"ua,omitempty"` + SUA UserAgent `json:"sua,omitempty"` // Attribute: // ip diff --git a/openrtb2/imp.go b/openrtb2/imp.go index f4e7bca..3b5976b 100644 --- a/openrtb2/imp.go +++ b/openrtb2/imp.go @@ -174,7 +174,7 @@ type Imp struct { // an extra life in a game, or get a sponsored ad-free music // session. The reward is typically distributed after the video ad is // completed. - Rwdd int8 `json:"secure,omitempty"` + Rwdd int8 `json:"rwdd,omitempty"` // Attribute: // ssai diff --git a/openrtb2/supply_chain_node.go b/openrtb2/supply_chain_node.go index cbe1397..c643e74 100644 --- a/openrtb2/supply_chain_node.go +++ b/openrtb2/supply_chain_node.go @@ -80,7 +80,7 @@ type SupplyChainNode struct { // propagate this field onwards when constructing SupplyChain // objects in bid requests sent to a downstream advertising // system. - HP *int8 `json:"hp"` + HP *int8 `json:"hp,omitempty"` // Attribute: // ext diff --git a/openrtb2/uid.go b/openrtb2/uid.go index 7d70891..c66c7c9 100644 --- a/openrtb2/uid.go +++ b/openrtb2/uid.go @@ -9,12 +9,12 @@ import "encoding/json" type UID struct { // Attribute: - // source + // id // Type: // string // Description: // The identifier for the user. - ID string `json:"source,omitempty"` + ID string `json:"id,omitempty"` // Attribute: // atype @@ -24,7 +24,7 @@ type UID struct { // Type of user agent the ID is from. It is highly recommended to set this, as // many DSPs separate app-native IDs from browser-based IDs and require a type // value for ID resolution. Refer to List: Agent Types in AdCOM 1.0 - AType int64 `json:"uids,omitempty"` + AType int64 `json:"atype,omitempty"` // Attribute: // ext From c2e87c88f8776059f5399fc6ea6fffe74d5caabc Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Fri, 13 May 2022 00:21:13 -0400 Subject: [PATCH 06/62] Check Keyword Descriptions --- adcom1/app.go | 6 ++++-- adcom1/content.go | 6 ++++-- adcom1/site.go | 6 ++++-- adcom1/user.go | 6 ++++-- openrtb2/app.go | 3 ++- openrtb2/content.go | 3 ++- openrtb2/site.go | 3 ++- 7 files changed, 22 insertions(+), 11 deletions(-) diff --git a/adcom1/app.go b/adcom1/app.go index e49f001..57d2ac3 100644 --- a/adcom1/app.go +++ b/adcom1/app.go @@ -59,9 +59,11 @@ type App struct { // Attribute: // keywords // Type: - // string + // string; DEPRECATED // Definition: - // Comma separated list of keywords about the app. + // Comma-separated list of keywords about the app. + // Only one of 'keywords' or 'kwarray' may be present. + // NOTE: this field is deprecated, use 'kwarray' instead. Keywords string `json:"keywords,omitempty"` // Attribute: diff --git a/adcom1/content.go b/adcom1/content.go index fc06ef7..a7ef9b3 100644 --- a/adcom1/content.go +++ b/adcom1/content.go @@ -153,9 +153,11 @@ type Content struct { // Attribute: // keywords // Type: - // string + // string; DEPRECATED // Definition: - // Comma separated list of keywords describing the content. + // Comma-separated list of keywords describing the content. + // Only one of 'keywords' or 'kwarray' may be present. + // NOTE: this field is deprecated, use 'kwarray' instead. Keywords string `json:"keywords,omitempty"` // Attribute: diff --git a/adcom1/site.go b/adcom1/site.go index e7f0eba..f7e5f62 100644 --- a/adcom1/site.go +++ b/adcom1/site.go @@ -59,9 +59,11 @@ type Site struct { // Attribute: // keywords // Type: - // string + // string; DEPRECATED // Definition: - // Comma separated list of keywords about the site. + // Comma-separated list of keywords about the app. + // Only one of 'keywords' or 'kwarray' may be present. + // NOTE: this field is deprecated, use 'kwarray' instead. Keywords string `json:"keywords,omitempty"` // Attribute: diff --git a/adcom1/user.go b/adcom1/user.go index 197605a..38ab2ec 100644 --- a/adcom1/user.go +++ b/adcom1/user.go @@ -43,9 +43,11 @@ type User struct { // Attribute: // keywords // Type: - // string + // string; DEPRECATED // Definition: - // Comma separated list of keywords, interests, or intent. + // Comma-separated list of keywords, interests, or intent. + // Only one of 'keywords' or 'kwarray' may be present. + // NOTE: this field is deprecated, use 'kwarray' instead. Keywords string `json:"keywords,omitempty"` // Attribute: diff --git a/openrtb2/app.go b/openrtb2/app.go index 502d608..dc6f9a4 100644 --- a/openrtb2/app.go +++ b/openrtb2/app.go @@ -138,7 +138,8 @@ type App struct { // Type: // string // Description: - // Comma separated list of keywords about the app. + // Comma separated list of keywords about the app. Only one of + // ‘keywords’ or ‘kwarray’ may be present. Keywords string `json:"keywords,omitempty"` // Attribute: diff --git a/openrtb2/content.go b/openrtb2/content.go index e07c9e0..42b68b8 100644 --- a/openrtb2/content.go +++ b/openrtb2/content.go @@ -173,7 +173,8 @@ type Content struct { // Type: // string // Description: - // Comma separated list of keywords describing the content. + // Comma separated list of keywords describing the content. Only + // one of ‘keywords’ or ‘kwarray’ may be present. Keywords string `json:"keywords,omitempty"` // Attribute: diff --git a/openrtb2/site.go b/openrtb2/site.go index cd178ed..1beb89d 100644 --- a/openrtb2/site.go +++ b/openrtb2/site.go @@ -134,7 +134,8 @@ type Site struct { // Type: // string // Description: - // Comma separated list of keywords about the site. + // Comma separated list of keywords about the site. Only one of + // ‘keywords’ or ‘kwarray’ may be present. Keywords string `json:"keywords,omitempty"` // Attribute: From 6ed3abe7402e0ff7d85ac3e7fe749750d35d7880 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Fri, 13 May 2022 00:24:39 -0400 Subject: [PATCH 07/62] Fix Tests - Object Pointer Mistake --- openrtb2/device.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/device.go b/openrtb2/device.go index b3beb7e..32b68d8 100644 --- a/openrtb2/device.go +++ b/openrtb2/device.go @@ -75,7 +75,7 @@ type Device struct { // the bid request, ‘sua’ should be considered the more accurate // representation of the device attributes. This is because the ‘ua’ // may contain a frozen or reduced user agent string. - SUA UserAgent `json:"sua,omitempty"` + SUA *UserAgent `json:"sua,omitempty"` // Attribute: // ip From 53b2d0defdcf17f6254798e57c9916fd371549c8 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Fri, 13 May 2022 00:34:05 -0400 Subject: [PATCH 08/62] Fix More Object Pointers --- adcom1/audio_placement.go | 4 ++-- adcom1/user_agent.go | 2 +- adcom1/video_placement.go | 4 ++-- openrtb2/source.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/adcom1/audio_placement.go b/adcom1/audio_placement.go index 98f2ba9..ab0dd8d 100644 --- a/adcom1/audio_placement.go +++ b/adcom1/audio_placement.go @@ -202,7 +202,7 @@ type AudioPlacement struct { // integer; default 0 // Definition: // The sequence (position) of the video ad pod within a content stream. - // Refer to List: List: Pod Sequence for guidance on the use of this field. + // Refer to List: Pod Sequence for guidance on the use of this field. PodSeq PodSequence `json:"podseq,omitempty"` // Attribute: @@ -212,7 +212,7 @@ type AudioPlacement struct { // Definition: // For video ad pods, this value indicates that the seller can guarantee delivery // against the indicated slot position in the pod. - // Refer to List: List: Slot Position in Pod for guidance on the use of this field. + // Refer to List: Slot Position in Pod for guidance on the use of this field. SlotInPod SlotPositionInPod `json:"slotinpod,omitempty"` // Attribute: diff --git a/adcom1/user_agent.go b/adcom1/user_agent.go index 5a59949..dd8e62b 100644 --- a/adcom1/user_agent.go +++ b/adcom1/user_agent.go @@ -23,7 +23,7 @@ type UserAgent struct { // Definition: // Refer to Object: BrandVersion that identifies the user agent’s execution platform / OS. // Implementers should send a brand derived from the Sec-CH-UA-Platform header, and version derived from the Sec-CH-UA-Platform-Version header. - Platform BrandVersion `json:"platform,omitempty"` + Platform *BrandVersion `json:"platform,omitempty"` // Attribute: // mobile diff --git a/adcom1/video_placement.go b/adcom1/video_placement.go index da63b51..896854e 100644 --- a/adcom1/video_placement.go +++ b/adcom1/video_placement.go @@ -236,7 +236,7 @@ type VideoPlacement struct { // integer; default 0 // Definition: // The sequence (position) of the video ad pod within a content stream. - // Refer to List: List: Pod Sequence for guidance on the use of this field. + // Refer to List: Pod Sequence for guidance on the use of this field. PodSeq PodSequence `json:"podseq,omitempty"` // Attribute: @@ -246,7 +246,7 @@ type VideoPlacement struct { // Definition: // For video ad pods, this value indicates that the seller can guarantee delivery // against the indicated slot position in the pod. - // Refer to List: List: Slot Position in Pod for guidance on the use of this field. + // Refer to List: Slot Position in Pod for guidance on the use of this field. SlotInPod SlotPositionInPod `json:"slotinpod,omitempty"` // Attribute: diff --git a/openrtb2/source.go b/openrtb2/source.go index 32d8777..9df3e6d 100644 --- a/openrtb2/source.go +++ b/openrtb2/source.go @@ -45,7 +45,7 @@ type Source struct { // well as an indicator whether or not the supply chain is // complete. Details via the SupplyChain object (section // 3.2.25) - SChain SupplyChain `json:"schain,omitempty"` + SChain *SupplyChain `json:"schain,omitempty"` // Attribute: // ext From ca9bdd67aeb9a8d9bf4d21186690a808a56ab8b7 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 18:54:59 +0300 Subject: [PATCH 09/62] native1: constant naming: "Xxx 1.0" -> "Xxx10" --- adcom1/category_taxonomy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adcom1/category_taxonomy.go b/adcom1/category_taxonomy.go index fbd9d49..02cac18 100644 --- a/adcom1/category_taxonomy.go +++ b/adcom1/category_taxonomy.go @@ -7,9 +7,9 @@ type CategoryTaxonomy int64 // // Values of 500+ hold vendor-specific codes. const ( - CatTaxIABContent1 CategoryTaxonomy = 1 // 1 IAB Content Category Taxonomy 1.0. + CatTaxIABContent10 CategoryTaxonomy = 1 // 1 IAB Content Category Taxonomy 1.0. CatTaxIABContent20 CategoryTaxonomy = 2 // 2 IAB Content Category Taxonomy 2.0: www.iab.com/guidelines/taxonomy - CatTaxIABProduct1 CategoryTaxonomy = 3 // 3 IAB Ad Product Taxonomy 1.0. + CatTaxIABProduct10 CategoryTaxonomy = 3 // 3 IAB Ad Product Taxonomy 1.0. CatTaxIABAudience11 CategoryTaxonomy = 4 // 4 IAB Audience Taxonomy 1.1. CatTaxIABContent21 CategoryTaxonomy = 5 // 5 IAB Content Category Taxonomy 2.1. CatTaxIABContent22 CategoryTaxonomy = 6 // 6 IAB Content Category Taxonomy 2.2 From c07ff34d9c52bcc03957204dfa08fd4880f9cdb6 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 19:02:06 +0300 Subject: [PATCH 10/62] readme: document Foo 1.0 -> Foo10 naming approach --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2a97a91..aac01ef 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Master always contains latest code, so better use some package manager to vendor - [UpperCamelCase](http://en.wikipedia.org/wiki/CamelCase) - Capitalized abbreviations (e.g., `AT`, `COPPA`, `PMP` etc.) - Capitalized `ID` keys +- Enum items with versions should include minor/patch zeros, i.e. "Foo 1.0" -> `Foo10` (and not just `Foo1`), "Foo 1.1" -> `Foo11` etc ## Types - Key types should be chosen according to OpenRTB specification (attribute types) From 8b4c1f48f1dbf7042f08aedfb87f0ecfecdbc33a Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 19:03:26 +0300 Subject: [PATCH 11/62] adcom1: fix mistype --- adcom1/agent_type.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adcom1/agent_type.go b/adcom1/agent_type.go index 74ee866..95b2504 100644 --- a/adcom1/agent_type.go +++ b/adcom1/agent_type.go @@ -3,7 +3,7 @@ package adcom1 // AgentType identifies the user agent types a user identifier is from. type AgentType int64 -// Agent types dewscribing where the user agent is from. +// Agent types describing where the user agent is from. // // Values of 500+ hold vendor-specific codes. const ( From 651b9938be1def46ca7ead97a1dc4fcba7c0d51d Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 19:20:00 +0300 Subject: [PATCH 12/62] adcom1: api framework - follow Xxx10 convention --- adcom1/api_framework.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/adcom1/api_framework.go b/adcom1/api_framework.go index 743c7d8..eebf295 100644 --- a/adcom1/api_framework.go +++ b/adcom1/api_framework.go @@ -7,13 +7,13 @@ type APIFramework int64 // // Values of 500+ hold vendor-specific codes. const ( - APIVPAID1 APIFramework = 1 // VPAID 1.0 - APIVPAID2 APIFramework = 2 // VPAID 2.0 - APIMRAID1 APIFramework = 3 // MRAID 1.0 + APIVPAID10 APIFramework = 1 // VPAID 1.0 + APIVPAID20 APIFramework = 2 // VPAID 2.0 + APIMRAID10 APIFramework = 3 // MRAID 1.0 APIORMMA APIFramework = 4 // ORMMA - APIMRAID2 APIFramework = 5 // MRAID 2.0 - APIMRAID3 APIFramework = 6 // MRAID 3.0 - APIOMID1 APIFramework = 7 // OMID 1.0 + APIMRAID20 APIFramework = 5 // MRAID 2.0 + APIMRAID30 APIFramework = 6 // MRAID 3.0 + APIOMID10 APIFramework = 7 // OMID 1.0 APISIMID10 APIFramework = 8 // SIMID 1.0 APISIMID11 APIFramework = 9 // SIMID 1.1 ) From 77b6c0a773d71f3408cd48a6cf2b1b3c96a3b3c4 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 19:55:14 +0300 Subject: [PATCH 13/62] adcom1: fix ExtendedIdentifierUID name/desc/json --- adcom1/extended_identifier_uid.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adcom1/extended_identifier_uid.go b/adcom1/extended_identifier_uid.go index 3cf16a2..6bd165a 100644 --- a/adcom1/extended_identifier_uid.go +++ b/adcom1/extended_identifier_uid.go @@ -12,14 +12,14 @@ type ExtendedIdentifierUID struct { ID string `json:"id,omitempty"` // Attribute: - // uids + // atype // Type: - // object array + // integer // Definition: // Type of user agent the match is from. // It is highly recommended to set this, as many DSPs separate app-native IDs from browser-based IDs and require a type value for ID resolution. // Refer to List: Agent Types. - AType AgentType `json:"uids,omitempty"` + AType AgentType `json:"atype,omitempty"` // Attribute: // ext From 649ff719e44110804ea8f54737e918e091753404 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 19:58:27 +0300 Subject: [PATCH 14/62] adcom1: fix godoc comment --- adcom1/slot_position_in_pod.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adcom1/slot_position_in_pod.go b/adcom1/slot_position_in_pod.go index 76726e0..a1c0f4f 100644 --- a/adcom1/slot_position_in_pod.go +++ b/adcom1/slot_position_in_pod.go @@ -1,9 +1,9 @@ package adcom1 -// PodSequence identifies the slot position in pod field, for use in audio and video ad pods. +// SlotPositionInPod identifies the slot position in pod field, for use in audio and video ad pods. type SlotPositionInPod int8 -// PodSequence options. +// SlotPositionInPod options. const ( SlotPosLast SlotPositionInPod = -1 // Last ad in the pod. SlotPosAny SlotPositionInPod = 0 // Any ad in the pod. From 127985565b158dcfb6c7ee300b4c511a7df77326 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 20:05:30 +0300 Subject: [PATCH 15/62] native1: fix doc link in readme --- native1/request/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native1/request/README.md b/native1/request/README.md index 3baef77..dde317e 100644 --- a/native1/request/README.md +++ b/native1/request/README.md @@ -1,3 +1,3 @@ -# native1/request [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/native1/request?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/6/native1/request) +# native1/request [![GoDoc](https://godoc.org/github.com/mxmCherry/openrtb/native1/request?status.svg)](https://pkg.go.dev/github.com/mxmCherry/openrtb/v16/native1/request) [OpenRTB Dynamic Native Ads API](https://iabtechlab.com/standards/openrtb-native/) [1.2](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) section "4 Native Ad Request Markup Details" types for [Go programming language](https://golang.org/) From 1d20ff2e69071c11d6dc1343070c4e1811bbc6db Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 20:54:05 +0300 Subject: [PATCH 16/62] adcom1: change const prefix ATypeXXX -> AgentTypeXXX --- adcom1/agent_type.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adcom1/agent_type.go b/adcom1/agent_type.go index 95b2504..284d48a 100644 --- a/adcom1/agent_type.go +++ b/adcom1/agent_type.go @@ -7,7 +7,7 @@ type AgentType int64 // // Values of 500+ hold vendor-specific codes. const ( - ATypeWeb AgentType = 1 // An ID which is tied to a specific web browser or device (cookie-based, probabilistic, or other). - ATypeApp AgentType = 2 // In-app impressions, which will typically contain a type of device ID (or rather, the privacy-compliant versions of device IDs). - ATypePerson AgentType = 3 // A person-based ID, i.e., that is the same across devices. + AgentTypeWeb AgentType = 1 // An ID which is tied to a specific web browser or device (cookie-based, probabilistic, or other). + AgentTypeApp AgentType = 2 // In-app impressions, which will typically contain a type of device ID (or rather, the privacy-compliant versions of device IDs). + AgentTypePerson AgentType = 3 // A person-based ID, i.e., that is the same across devices. ) From d63e0e1cf60fb191970c8a7188c372ecb9623e6d Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 21:44:55 +0300 Subject: [PATCH 17/62] openrtb2: bring back rm-ed Banner fields openrtb2 should be usable with all the versions 2.0 .. 2.6 - only deprecate, do not remove fields --- openrtb2/banner.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/openrtb2/banner.go b/openrtb2/banner.go index bfbf7de..c8b7eb5 100644 --- a/openrtb2/banner.go +++ b/openrtb2/banner.go @@ -40,7 +40,43 @@ type Banner struct { // Exact height in device independent pixels (DIPS); // recommended if no format objects are specified. H *int64 `json:"h,omitempty"` + + // Attribute: + // wmax + // Type: + // integer; DEPRECATED; REMOVED in OpenRTB 2.6 + // Description: + // NOTE: Deprecated in favor of the format array. + // Maximum width in device independent pixels (DIPS). + WMax int64 `json:"wmax,omitempty"` + + // Attribute: + // hmax + // Type: + // integer; DEPRECATED; REMOVED in OpenRTB 2.6 + // Description: + // NOTE: Deprecated in favor of the format array. + // Maximum height in device independent pixels (DIPS). + HMax int64 `json:"hmax,omitempty"` + // Attribute: + // wmin + // Type: + // integer; DEPRECATED; REMOVED in OpenRTB 2.6 + // Description: + // NOTE: Deprecated in favor of the format array. + // Minimum width in device independent pixels (DIPS). + WMin int64 `json:"wmin,omitempty"` + + // Attribute: + // hmin + // Type: + // integer; DEPRECATED; REMOVED in OpenRTB 2.6 + // Description: + // NOTE: Deprecated in favor of the format array. + // Minimum height in device independent pixels (DIPS). + HMin int64 `json:"hmin,omitempty"` + // Attribute: // btype // Type: From 2d835abf5f3548dc4d5164cab1b5e5e8683bf708 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 21:46:41 +0300 Subject: [PATCH 18/62] openrtb2: rm extra whitespace (tab) --- openrtb2/banner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/banner.go b/openrtb2/banner.go index c8b7eb5..7c6b76c 100644 --- a/openrtb2/banner.go +++ b/openrtb2/banner.go @@ -40,7 +40,7 @@ type Banner struct { // Exact height in device independent pixels (DIPS); // recommended if no format objects are specified. H *int64 `json:"h,omitempty"` - + // Attribute: // wmax // Type: From 516ccc6485682fd7cb52eedc18a2869c763936f0 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 22:06:06 +0300 Subject: [PATCH 19/62] openrtb2: resolve Banner TODOs - bring back removed fields - only deprecate, do not remove - reuse adcom1 enums --- adcom1/expandable_direction.go | 2 +- adcom1/placement_position.go | 14 ++++++++++++++ openrtb2/banner.go | 30 ++++++++++++++++++------------ openrtb2/banner_ad_type.go | 13 +++++++++++++ 4 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 openrtb2/banner_ad_type.go diff --git a/adcom1/expandable_direction.go b/adcom1/expandable_direction.go index 135800c..48fc30b 100644 --- a/adcom1/expandable_direction.go +++ b/adcom1/expandable_direction.go @@ -10,5 +10,5 @@ const ( ExpandableUp ExpandableDirection = 3 // Up ExpandableDown ExpandableDirection = 4 // Down ExpandableFullScreen ExpandableDirection = 5 // Full Screen - ExpandableSmaller ExpandableDirection = 6 // Resize/Minimize (make smaller) + ExpandableResize ExpandableDirection = 6 // Resize/Minimize (make smaller) ) diff --git a/adcom1/placement_position.go b/adcom1/placement_position.go index 5cc6fc0..2939d43 100644 --- a/adcom1/placement_position.go +++ b/adcom1/placement_position.go @@ -6,6 +6,7 @@ type PlacementPosition int8 // Placement positions. const ( + PositionUnknown PlacementPosition = 0 // Unknown PositionAboveFold PlacementPosition = 1 // Above The Fold PositionLocked PlacementPosition = 2 // Locked (i.e., fixed position) PositionBelowFold PlacementPosition = 3 // Below The Fold @@ -14,3 +15,16 @@ const ( PositionSideBar PlacementPosition = 6 // Sidebar PositionFullScreen PlacementPosition = 7 // Fullscreen ) + +// Ptr returns pointer to own value. +func (p PlacementPosition) Ptr() *PlacementPosition { + return &p +} + +// Val safely dereferences pointer, returning default value (AdPositionUnknown) for nil. +func (p *PlacementPosition) Val() PlacementPosition { + if p == nil { + return PositionUnknown + } + return *p +} diff --git a/openrtb2/banner.go b/openrtb2/banner.go index 7c6b76c..7277cfd 100644 --- a/openrtb2/banner.go +++ b/openrtb2/banner.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.6 Object: Banner // @@ -76,19 +80,15 @@ type Banner struct { // NOTE: Deprecated in favor of the format array. // Minimum height in device independent pixels (DIPS). HMin int64 `json:"hmin,omitempty"` - + // Attribute: // btype // Type: // integer array // Description: // Blocked banner ad types. - // Values: - // 1 = XHTML Text Ad, - // 2 = XHTML Banner Ad, - // 3 = JavaScript Ad, - // 4 = iframe. - BType []int8 `json:"btype,omitempty"` + // Refer to BannerAdType constants. + BType []BannerAdType `json:"btype,omitempty"` // Attribute: // battr @@ -96,7 +96,9 @@ type Banner struct { // integer array // Description: // Blocked creative attributes. Refer to List: Creative Attributes in AdCOM 1.0. - BAttr []int64 `json:"battr,omitempty"` + // Note: + // OpenRTB <=2.5 defined only attributes with IDs 1..17. + BAttr []adcom1.CreativeAttribute `json:"battr,omitempty"` // Attribute: // pos @@ -104,7 +106,7 @@ type Banner struct { // integer // Description: // Ad position on screen. Refer to List: Placement Positions in AdCOM 1.0. - Pos *int8 `json:"pos,omitempty"` + Pos *adcom1.PlacementPosition `json:"pos,omitempty"` // Attribute: // mimes @@ -131,7 +133,9 @@ type Banner struct { // Description: // Directions in which the banner may expand. Refer to List: Expandable // Directions in AdCOM 1.0. - ExpDir []int8 `json:"expdir,omitempty"` + // Note: + // OpenRTB <=2.5 defined only directions 1..5. + ExpDir []adcom1.ExpandableDirection `json:"expdir,omitempty"` // Attribute: // api @@ -141,7 +145,9 @@ type Banner struct { // List of supported API frameworks for this impression. Refer to List: API // Frameworks in AdCOM 1.0. If an API is not explicitly listed, it is assumed // not to be supported. - API []int64 `json:"api,omitempty"` + // Note: + // OpenRTB <=2.5 defined only frameworks 1..6. + API []adcom1.APIFramework `json:"api,omitempty"` // Attribute: // id diff --git a/openrtb2/banner_ad_type.go b/openrtb2/banner_ad_type.go new file mode 100644 index 0000000..35bef24 --- /dev/null +++ b/openrtb2/banner_ad_type.go @@ -0,0 +1,13 @@ +package openrtb2 + +// BannerAdType +// +// Types of ads that can be accepted by the exchange unless restricted by publisher site settings. +type BannerAdType int8 + +const ( + BannerAdTypeXHTMLTextAd BannerAdType = 1 // XHTML Text Ad (usually mobile) + BannerAdTypeXHTMLBannerAd BannerAdType = 2 // XHTML Banner Ad. (usually mobile) + BannerAdTypeJavaScriptAd BannerAdType = 3 // JavaScript Ad; must be valid XHTML (i.e., Script Tags Included) + BannerAdTypeIframe BannerAdType = 4 // iframe +) From a27c40aabf4ddbd3d1e0e1ed3646181f8ba81a8b Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 22:14:24 +0300 Subject: [PATCH 20/62] openrtb2: impl TODOs for App --- openrtb2/app.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openrtb2/app.go b/openrtb2/app.go index dc6f9a4..d2764d2 100644 --- a/openrtb2/app.go +++ b/openrtb2/app.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.14 Object: App // @@ -61,7 +65,7 @@ type App struct { // Description: // The taxonomy in use. Refer to the AdCOM list List: Category // Taxonomies for values. - CatTax int64 `json:"cattax,omitempty"` + CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"` // Attribute: // cat From 917bf91516d74782db89b03aedc52598d2bbb35b Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 23:03:02 +0300 Subject: [PATCH 21/62] openrtb2: use 2.6 test examples --- openrtb2/bid_request_test.go | 47 +++++-- openrtb2/bid_response_test.go | 35 +++-- openrtb2/testdata/README.md | 11 +- .../{ => 2.5}/expandable-creative.json | 0 .../bid-request/{ => 2.5}/mobile.json | 0 .../bid-request/{ => 2.5}/native-ad.json | 0 .../{ => 2.5}/pmp-with-direct-deal.json | 0 .../bid-request/{ => 2.5}/simple-banner.json | 0 .../testdata/bid-request/{ => 2.5}/video.json | 0 .../bid-request/2.6/expandable-creative.json | 68 +++++++++ openrtb2/testdata/bid-request/2.6/mobile.json | 70 ++++++++++ .../bid-request/2.6/pmp-with-direct-deal.json | 61 ++++++++ .../bid-request/2.6/simple-banner.json | 37 +++++ openrtb2/testdata/bid-request/2.6/video.json | 130 ++++++++++++++++++ .../{ => 2.5}/ad-served-on-win-notice.json | 0 .../direct-deal-ad-served-on-win-notice.json | 0 .../native-markup-returned-inline.json | 0 .../vast-xml-document-returned-inline.json | 0 .../2.6/ad-served-on-win-notice.json | 34 +++++ .../direct-deal-ad-served-on-win-notice.json | 32 +++++ .../2.6/native-markup-returned-inline.json | 16 +++ .../vast-xml-document-returned-inline.json | 16 +++ 22 files changed, 536 insertions(+), 21 deletions(-) rename openrtb2/testdata/bid-request/{ => 2.5}/expandable-creative.json (100%) rename openrtb2/testdata/bid-request/{ => 2.5}/mobile.json (100%) rename openrtb2/testdata/bid-request/{ => 2.5}/native-ad.json (100%) rename openrtb2/testdata/bid-request/{ => 2.5}/pmp-with-direct-deal.json (100%) rename openrtb2/testdata/bid-request/{ => 2.5}/simple-banner.json (100%) rename openrtb2/testdata/bid-request/{ => 2.5}/video.json (100%) create mode 100644 openrtb2/testdata/bid-request/2.6/expandable-creative.json create mode 100644 openrtb2/testdata/bid-request/2.6/mobile.json create mode 100644 openrtb2/testdata/bid-request/2.6/pmp-with-direct-deal.json create mode 100644 openrtb2/testdata/bid-request/2.6/simple-banner.json create mode 100644 openrtb2/testdata/bid-request/2.6/video.json rename openrtb2/testdata/bid-response/{ => 2.5}/ad-served-on-win-notice.json (100%) rename openrtb2/testdata/bid-response/{ => 2.5}/direct-deal-ad-served-on-win-notice.json (100%) rename openrtb2/testdata/bid-response/{ => 2.5}/native-markup-returned-inline.json (100%) rename openrtb2/testdata/bid-response/{ => 2.5}/vast-xml-document-returned-inline.json (100%) create mode 100644 openrtb2/testdata/bid-response/2.6/ad-served-on-win-notice.json create mode 100644 openrtb2/testdata/bid-response/2.6/direct-deal-ad-served-on-win-notice.json create mode 100644 openrtb2/testdata/bid-response/2.6/native-markup-returned-inline.json create mode 100644 openrtb2/testdata/bid-response/2.6/vast-xml-document-returned-inline.json diff --git a/openrtb2/bid_request_test.go b/openrtb2/bid_request_test.go index 89df631..ca06f93 100644 --- a/openrtb2/bid_request_test.go +++ b/openrtb2/bid_request_test.go @@ -28,29 +28,52 @@ var _ = Describe("BidRequest", func() { Expect(actual).To(MatchJSON(expected)) }, + // 2.5 Entry( - "Simple Banner", - "bid-request/simple-banner.json", + "2.5 Simple Banner", + "bid-request/2.5/simple-banner.json", new(BidRequest)), Entry( - "Expandable Creative", - "bid-request/expandable-creative.json", + "2.5 Expandable Creative", + "bid-request/2.5/expandable-creative.json", new(BidRequest)), Entry( - "Mobile", - "bid-request/mobile.json", + "2.5 Mobile", + "bid-request/2.5/mobile.json", new(BidRequest)), Entry( - "Video", - "bid-request/video.json", + "2.5 Video", + "bid-request/2.5/video.json", new(BidRequest)), Entry( - "PMP with Direct Deal", - "bid-request/pmp-with-direct-deal.json", + "2.5 PMP with Direct Deal", + "bid-request/2.5/pmp-with-direct-deal.json", new(BidRequest)), Entry( - "Native Ad", - "bid-request/native-ad.json", + "2.5 Native Ad", + "bid-request/2.5/native-ad.json", + new(BidRequest)), + + // 2.6 + Entry( + "2.6 Simple Banner", + "bid-request/2.6/simple-banner.json", + new(BidRequest)), + Entry( + "2.6 Expandable Creative", + "bid-request/2.6/expandable-creative.json", + new(BidRequest)), + Entry( + "2.6 Mobile", + "bid-request/2.6/mobile.json", + new(BidRequest)), + Entry( + "2.6 Video", + "bid-request/2.6/video.json", + new(BidRequest)), + Entry( + "2.6 PMP with Direct Deal", + "bid-request/2.6/pmp-with-direct-deal.json", new(BidRequest)), ) }) diff --git a/openrtb2/bid_response_test.go b/openrtb2/bid_response_test.go index 1c4b2e8..98eba9d 100644 --- a/openrtb2/bid_response_test.go +++ b/openrtb2/bid_response_test.go @@ -28,21 +28,40 @@ var _ = Describe("BidResponse", func() { Expect(actual).To(MatchJSON(expected)) }, + // 2.5 Entry( - "Ad Served on Win Notice", - "bid-response/ad-served-on-win-notice.json", + "2.5 Ad Served on Win Notice", + "bid-response/2.5/ad-served-on-win-notice.json", new(BidResponse)), Entry( - "VAST XML Document Returned Inline", - "bid-response/vast-xml-document-returned-inline.json", + "2.5 VAST XML Document Returned Inline", + "bid-response/2.5/vast-xml-document-returned-inline.json", new(BidResponse)), Entry( - "Direct Deal Ad Served on Win Notice", - "bid-response/direct-deal-ad-served-on-win-notice.json", + "2.5 Direct Deal Ad Served on Win Notice", + "bid-response/2.5/direct-deal-ad-served-on-win-notice.json", new(BidResponse)), Entry( - "Native Markup Returned Inline", - "bid-response/native-markup-returned-inline.json", + "2.5 Native Markup Returned Inline", + "bid-response/2.5/native-markup-returned-inline.json", + new(BidResponse)), + + // 2.6 + Entry( + "2.6 Ad Served on Win Notice", + "bid-response/2.6/ad-served-on-win-notice.json", + new(BidResponse)), + Entry( + "2.6 VAST XML Document Returned Inline", + "bid-response/2.6/vast-xml-document-returned-inline.json", + new(BidResponse)), + Entry( + "2.6 Direct Deal Ad Served on Win Notice", + "bid-response/2.6/direct-deal-ad-served-on-win-notice.json", + new(BidResponse)), + Entry( + "2.6 Native Markup Returned Inline", + "bid-response/2.6/native-markup-returned-inline.json", new(BidResponse)), ) }) diff --git a/openrtb2/testdata/README.md b/openrtb2/testdata/README.md index 0857681..7db181f 100644 --- a/openrtb2/testdata/README.md +++ b/openrtb2/testdata/README.md @@ -1,5 +1,14 @@ # testdata -JSON examples copied from [OpenRTB](https://iabtechlab.com/standards/openrtb/) [2.6](https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf) spec - section 6. Bid Request/Response Samples. +JSON examples copied from [OpenRTB](https://iabtechlab.com/standards/openrtb/) spec documents: +- [2.5](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) spec - section 6. Bid Request/Response Samples +- [2.6](https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf) spec - section 6. Bid Request/Response Samples Some empty/zero attributes were omited (not copied) because of [encoding/json](https://golang.org/pkg/encoding/json/) `omitempty` and [gomega.MatchJSON(...)](http://onsi.github.io/gomega/#matchjsonjson-interface). + +Sloppy examples (and types) is not something new for OpenRTB spec, so the following adjustments were made: + +- [bid-request/2.6/simple-banner.json](bid-request/2.6/simple-banner.json) - spec example embedded `user` into `site`, moved `user` to top level +- [bid-request/2.6/expandable-creative.json](bid-request/2.6/expandable-creative.json) - `data[2].value` added, moved to `data[2].segment[0].value` +- [bid-request/2.6/mobile.json](bid-request/2.6/mobile.json) - `imp[0].instl = 0` removed (because of JSON/omitempty) +- [bid-request/2.6/VIDEO.json](bid-request/2.6/VIDEO.json) - `imp[0].video.apis` renamed to `api` (it is singular in spec, but plural in example) diff --git a/openrtb2/testdata/bid-request/expandable-creative.json b/openrtb2/testdata/bid-request/2.5/expandable-creative.json similarity index 100% rename from openrtb2/testdata/bid-request/expandable-creative.json rename to openrtb2/testdata/bid-request/2.5/expandable-creative.json diff --git a/openrtb2/testdata/bid-request/mobile.json b/openrtb2/testdata/bid-request/2.5/mobile.json similarity index 100% rename from openrtb2/testdata/bid-request/mobile.json rename to openrtb2/testdata/bid-request/2.5/mobile.json diff --git a/openrtb2/testdata/bid-request/native-ad.json b/openrtb2/testdata/bid-request/2.5/native-ad.json similarity index 100% rename from openrtb2/testdata/bid-request/native-ad.json rename to openrtb2/testdata/bid-request/2.5/native-ad.json diff --git a/openrtb2/testdata/bid-request/pmp-with-direct-deal.json b/openrtb2/testdata/bid-request/2.5/pmp-with-direct-deal.json similarity index 100% rename from openrtb2/testdata/bid-request/pmp-with-direct-deal.json rename to openrtb2/testdata/bid-request/2.5/pmp-with-direct-deal.json diff --git a/openrtb2/testdata/bid-request/simple-banner.json b/openrtb2/testdata/bid-request/2.5/simple-banner.json similarity index 100% rename from openrtb2/testdata/bid-request/simple-banner.json rename to openrtb2/testdata/bid-request/2.5/simple-banner.json diff --git a/openrtb2/testdata/bid-request/video.json b/openrtb2/testdata/bid-request/2.5/video.json similarity index 100% rename from openrtb2/testdata/bid-request/video.json rename to openrtb2/testdata/bid-request/2.5/video.json diff --git a/openrtb2/testdata/bid-request/2.6/expandable-creative.json b/openrtb2/testdata/bid-request/2.6/expandable-creative.json new file mode 100644 index 0000000..87ed8ef --- /dev/null +++ b/openrtb2/testdata/bid-request/2.6/expandable-creative.json @@ -0,0 +1,68 @@ +{ + "id": "123456789316e6ede735f123ef6e32361bfc7b22", + "at": 2, + "cur": [ + "USD" + ], + "imp": [ + { + "id": "1", + "bidfloor": 0.03, + "iframebuster": [ + "vendor1.com", + "vendor2.com" + ], + "banner": { + "h": 250, + "w": 300, + "pos": 0, + "battr": [ + 13 + ], + "expdir": [ + 2, + 4 + ] + } + } + ], + "site": { + "id": "102855", + "cat": [ + "IAB3-1" + ], + "domain": "www.foobar.com", + "page": "http://www.foobar.com/1234.html", + "publisher": { + "id": "8953", + "name": "foobar.com", + "cat": [ + "IAB3-1" + ], + "domain": "foobar.com" + } + }, + "user": { + "id": "55816b39711f9b5acf3b90e313ed29e51665623f", + "buyeruid": "545678765467876567898765678987654", + "data": [ + { + "id": "12341318394918", + "name": "auto intenders" + }, + { + "id": "1234131839491234", + "name": "auto enthusiasts" + }, + { + "id": "23423424", + "name": "data-provider1-age", + "segment": [ + { + "value": "30-40" + } + ] + } + ] + } +} diff --git a/openrtb2/testdata/bid-request/2.6/mobile.json b/openrtb2/testdata/bid-request/2.6/mobile.json new file mode 100644 index 0000000..c69572e --- /dev/null +++ b/openrtb2/testdata/bid-request/2.6/mobile.json @@ -0,0 +1,70 @@ +{ + "id": "IxexyLDIIk", + "at": 2, + "bcat": [ + "IAB25", + "IAB7-39", + "IAB8-18", + "IAB8-5", + "IAB9-9" + ], + "badv": [ + "apple.com", + "go-text.me", + "heywire.com" + ], + "imp": [ + { + "id": "1", + "bidfloor": 0.5, + "tagid": "agltb3B1Yi1pbmNyDQsSBFNpdGUY7fD0FAw", + "banner": { + "w": 728, + "h": 90, + "pos": 1, + "btype": [ + 4 + ], + "battr": [ + 14 + ], + "api": [ + 3 + ] + } + } + ], + "app": { + "id": "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfIUDA", + "name": "Yahoo Weather", + "cat": [ + "IAB15", + "IAB15-10" + ], + "ver": "1.0.2", + "bundle": "12345", + "storeurl": "https://itunes.apple.com/id628677149", + "publisher": { + "id": "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfTUCV", + "name": "yahoo", + "domain": "www.yahoo.com" + } + }, + "device": { + "dnt": 0, + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3", + "ifa": "AA000DFE74168477C70D291f574D344790E0BB11", + "carrier": "VERIZON", + "language": "en", + "make": "Apple", + "model": "iPhone", + "os": "iOS", + "osv": "6.1", + "js": 1, + "connectiontype": 3, + "devicetype": 1 + }, + "user": { + "id": "ffffffd5135596709273b3a1a07e466ea2bf4fff" + } +} diff --git a/openrtb2/testdata/bid-request/2.6/pmp-with-direct-deal.json b/openrtb2/testdata/bid-request/2.6/pmp-with-direct-deal.json new file mode 100644 index 0000000..805bf9b --- /dev/null +++ b/openrtb2/testdata/bid-request/2.6/pmp-with-direct-deal.json @@ -0,0 +1,61 @@ +{ + "id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22", + "at": 1, + "cur": [ + "USD" + ], + "imp": [ + { + "id": "1", + "bidfloor": 0.03, + "banner": { + "h": 250, + "w": 300, + "pos": 0 + }, + "pmp": { + "private_auction": 1, + "deals": [ + { + "id": "AB-Agency1-0001", + "at": 1, + "bidfloor": 2.5, + "wseat": [ + "Agency1" + ] + }, + { + "id": "XY-Agency2-0001", + "at": 2, + "bidfloor": 2, + "wseat": [ + "Agency2" + ] + } + ] + } + } + ], + "site": { + "id": "102855", + "domain": "www.foobar.com", + "cat": [ + "IAB3-1" + ], + "page": "http://www.foobar.com/1234.html", + "publisher": { + "id": "8953", + "name": "foobar.com", + "cat": [ + "IAB3-1" + ], + "domain": "foobar.com" + } + }, + "device": { + "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2" + }, + "user": { + "id": "55816b39711f9b5acf3b90e313ed29e51665623f" + } +} diff --git a/openrtb2/testdata/bid-request/2.6/simple-banner.json b/openrtb2/testdata/bid-request/2.6/simple-banner.json new file mode 100644 index 0000000..88f7508 --- /dev/null +++ b/openrtb2/testdata/bid-request/2.6/simple-banner.json @@ -0,0 +1,37 @@ +{ + "id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22", + "at": 1, + "cur": [ + "USD" + ], + "imp": [ + { + "id": "1", + "bidfloor": 0.03, + "banner": { + "h": 250, + "w": 300, + "pos": 0 + } + } + ], + "site": { + "id": "102855", + "cat": [ + "IAB3-1" + ], + "domain": "www.foobar.com", + "page": "http://www.foobar.com/1234.html ", + "publisher": { + "id": "8953", + "name": "foobar.com", + "cat": [ + "IAB3-1" + ], + "domain": "foobar.com" + } + }, + "user": { + "id": "55816b39711f9b5acf3b90e313ed29e51665623f" + } +} diff --git a/openrtb2/testdata/bid-request/2.6/video.json b/openrtb2/testdata/bid-request/2.6/video.json new file mode 100644 index 0000000..ba999c2 --- /dev/null +++ b/openrtb2/testdata/bid-request/2.6/video.json @@ -0,0 +1,130 @@ +{ + "id": "1234567893", + "at": 2, + "tmax": 120, + "imp": [ + { + "id": "1", + "bidfloor": 0.03, + "video": { + "w": 640, + "h": 480, + "pos": 1, + "startdelay": 0, + "minduration": 5, + "maxduration": 30, + "maxextended": 30, + "minbitrate": 300, + "maxbitrate": 1500, + "api": [ + 1, + 2 + ], + "protocols": [ + 2, + 3 + ], + "mimes": [ + "video/x-flv", + "video/mp4", + "application/javascript" + ], + "linearity": 1, + "boxingallowed": 1, + "playbackmethod": [ + 1, + 3 + ], + "delivery": [ + 2 + ], + "battr": [ + 13, + 14 + ], + "companionad": [ + { + "id": "1234567893-1", + "w": 300, + "h": 250, + "pos": 1, + "battr": [ + 13, + 14 + ], + "expdir": [ + 2, + 4 + ] + }, + { + "id": "1234567893-2", + "w": 728, + "h": 90, + "pos": 1, + "battr": [ + 13, + 14 + ] + } + ], + "companiontype": [ + 1, + 2 + ] + } + } + ], + "site": { + "id": "1345135123", + "name": "Site ABCD", + "domain": "siteabcd.com", + "cat": [ + "IAB2-1", + "IAB2-2" + ], + "page": "http://siteabcd.com/page.htm", + "ref": "http://referringsite.com/referringpage.htm", + "privacypolicy": 1, + "publisher": { + "id": "pub12345", + "name": "Publisher A" + }, + "content": { + "id": "1234567", + "series": "All About Cars", + "season": "2", + "episode": 23, + "title": "Car Show", + "cat": [ + "IAB2-2" + ], + "keywords": "keyword-a,keyword-b,keyword-c" + } + }, + "device": { + "ua": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16", + "os": "OS X", + "js": 1 + }, + "user": { + "id": "456789876567897654678987656789", + "buyeruid": "545678765467876567898765678987654", + "data": [ + { + "id": "6", + "name": "Data Provider 1", + "segment": [ + { + "id": "12341318394918", + "name": "auto intenders" + }, + { + "id": "1234131839491234", + "name": "auto enthusiasts" + } + ] + } + ] + } +} diff --git a/openrtb2/testdata/bid-response/ad-served-on-win-notice.json b/openrtb2/testdata/bid-response/2.5/ad-served-on-win-notice.json similarity index 100% rename from openrtb2/testdata/bid-response/ad-served-on-win-notice.json rename to openrtb2/testdata/bid-response/2.5/ad-served-on-win-notice.json diff --git a/openrtb2/testdata/bid-response/direct-deal-ad-served-on-win-notice.json b/openrtb2/testdata/bid-response/2.5/direct-deal-ad-served-on-win-notice.json similarity index 100% rename from openrtb2/testdata/bid-response/direct-deal-ad-served-on-win-notice.json rename to openrtb2/testdata/bid-response/2.5/direct-deal-ad-served-on-win-notice.json diff --git a/openrtb2/testdata/bid-response/native-markup-returned-inline.json b/openrtb2/testdata/bid-response/2.5/native-markup-returned-inline.json similarity index 100% rename from openrtb2/testdata/bid-response/native-markup-returned-inline.json rename to openrtb2/testdata/bid-response/2.5/native-markup-returned-inline.json diff --git a/openrtb2/testdata/bid-response/vast-xml-document-returned-inline.json b/openrtb2/testdata/bid-response/2.5/vast-xml-document-returned-inline.json similarity index 100% rename from openrtb2/testdata/bid-response/vast-xml-document-returned-inline.json rename to openrtb2/testdata/bid-response/2.5/vast-xml-document-returned-inline.json diff --git a/openrtb2/testdata/bid-response/2.6/ad-served-on-win-notice.json b/openrtb2/testdata/bid-response/2.6/ad-served-on-win-notice.json new file mode 100644 index 0000000..621b4cb --- /dev/null +++ b/openrtb2/testdata/bid-response/2.6/ad-served-on-win-notice.json @@ -0,0 +1,34 @@ +{ + "id": "1234567890", + "bidid": "abc1123", + "cur": "USD", + "seatbid": [ + { + "seat": "512", + "bid": [ + { + "id": "1", + "impid": "102", + "price": 9.43, + "nurl": "http://adserver.com/winnotice?impid=102", + "iurl": "http://adserver.com/pathtosampleimage", + "adomain": [ + "advertiserdomain.com" + ], + "cid": "campaign111", + "crid": "creative112", + "attr": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 12 + ] + } + ] + } + ] +} diff --git a/openrtb2/testdata/bid-response/2.6/direct-deal-ad-served-on-win-notice.json b/openrtb2/testdata/bid-response/2.6/direct-deal-ad-served-on-win-notice.json new file mode 100644 index 0000000..0aabb0d --- /dev/null +++ b/openrtb2/testdata/bid-response/2.6/direct-deal-ad-served-on-win-notice.json @@ -0,0 +1,32 @@ +{ + "id": "1234567890", + "bidid": "abc1123", + "cur": "USD", + "seatbid": [ + { + "seat": "512", + "bid": [ + { + "id": "1", + "impid": "102", + "price": 5, + "dealid": "ABC-1234-6789", + "nurl": "http: //adserver.com/winnotice?impid=102", + "adomain": [ + "advertiserdomain.com" + ], + "iurl": "http: //adserver.com/pathtosampleimage", + "cid": "campaign111", + "crid": "creative112", + "adid": "314", + "attr": [ + 1, + 2, + 3, + 4 + ] + } + ] + } + ] +} diff --git a/openrtb2/testdata/bid-response/2.6/native-markup-returned-inline.json b/openrtb2/testdata/bid-response/2.6/native-markup-returned-inline.json new file mode 100644 index 0000000..6ad0341 --- /dev/null +++ b/openrtb2/testdata/bid-response/2.6/native-markup-returned-inline.json @@ -0,0 +1,16 @@ +{ + "id": "123", + "seatbid": [ + { + "bid": [ + { + "id": "12345", + "impid": "2", + "price": 3, + "nurl": "http://example.com/winnoticeurl", + "adm": "{\"native\":{\"ver\":\"1.0\",\"link\":{ ... },\"imptrackers\":[ ... ],\"assets\":[ ... ]}}" + } + ] + } + ] +} diff --git a/openrtb2/testdata/bid-response/2.6/vast-xml-document-returned-inline.json b/openrtb2/testdata/bid-response/2.6/vast-xml-document-returned-inline.json new file mode 100644 index 0000000..b2f09f0 --- /dev/null +++ b/openrtb2/testdata/bid-response/2.6/vast-xml-document-returned-inline.json @@ -0,0 +1,16 @@ +{ + "id": "123", + "seatbid": [ + { + "bid": [ + { + "id": "12345", + "impid": "2", + "price": 3, + "nurl": "http://example.com/winnoticeurl", + "adm": "\n\n\n\nSpotXchange\n\n\n\nhttp://sample.com\n\n\n\n \n\n\n00:00:30\n < /TrackingEvents>\n\n\n\n\n\n< MediaFiles >\n < MediaFile delivery =\"progressive\" bitrate=\"256\" width=\"640\" height=\"480\" type=\"video/mp4\">\n\n< /MediaFile>\n\n < /Linear>\n< /Creative>\n\n < /InLine>\n\n < /VAST>" + } + ] + } + ] +} From 74f4d14f34b035e05ea7c5f2ae18a612575f32bf Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Mon, 16 May 2022 23:11:38 +0300 Subject: [PATCH 22/62] openrtb2: testdata - just reformat JSON with `jq` --- .../bid-request/2.5/expandable-creative.json | 142 +++++----- openrtb2/testdata/bid-request/2.5/mobile.json | 198 ++++++------- .../testdata/bid-request/2.5/native-ad.json | 90 +++--- .../bid-request/2.5/pmp-with-direct-deal.json | 118 ++++---- .../bid-request/2.5/simple-banner.json | 76 ++--- openrtb2/testdata/bid-request/2.5/video.json | 260 +++++++++--------- .../2.5/ad-served-on-win-notice.json | 64 ++--- .../direct-deal-ad-served-on-win-notice.json | 60 ++-- .../2.5/native-markup-returned-inline.json | 28 +- .../vast-xml-document-returned-inline.json | 28 +- 10 files changed, 532 insertions(+), 532 deletions(-) diff --git a/openrtb2/testdata/bid-request/2.5/expandable-creative.json b/openrtb2/testdata/bid-request/2.5/expandable-creative.json index 34bfa4e..8498312 100644 --- a/openrtb2/testdata/bid-request/2.5/expandable-creative.json +++ b/openrtb2/testdata/bid-request/2.5/expandable-creative.json @@ -1,73 +1,73 @@ { - "id": "123456789316e6ede735f123ef6e32361bfc7b22", - "at": 2, - "cur": [ - "USD" - ], - "imp": [ - { - "id": "1", - "bidfloor": 0.03, - "iframebuster": [ - "vendor1.com", - "vendor2.com" - ], - "banner": { - "h": 250, - "w": 300, - "battr": [ - 13 - ], - "expdir": [ - 2, - 4 - ] - } - } - ], - "site": { - "id": "102855", - "cat": [ - "IAB3-1" - ], - "domain": "www.foobar.com", - "page": "http://www.foobar.com/1234.html", - "publisher": { - "id": "8953", - "name": "foobar.com", - "cat": [ - "IAB3-1" - ], - "domain": "foobar.com" - } - }, - "device": { - "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", - "ip": "123.145.167.10" - }, - "user": { - "id": "55816b39711f9b5acf3b90e313ed29e51665623f", - "buyeruid": "545678765467876567898765678987654", - "data": [ - { - "id": "6", - "name": "Data Provider 1", - "segment": [ - { - "id": "12341318394918", - "name": "auto intenders" - }, - { - "id": "1234131839491234", - "name": "auto enthusiasts" - }, - { - "id": "23423424", - "name": "data-provider1-age", - "value": "30-40" - } - ] - } - ] - } + "id": "123456789316e6ede735f123ef6e32361bfc7b22", + "at": 2, + "cur": [ + "USD" + ], + "imp": [ + { + "id": "1", + "bidfloor": 0.03, + "iframebuster": [ + "vendor1.com", + "vendor2.com" + ], + "banner": { + "h": 250, + "w": 300, + "battr": [ + 13 + ], + "expdir": [ + 2, + 4 + ] + } + } + ], + "site": { + "id": "102855", + "cat": [ + "IAB3-1" + ], + "domain": "www.foobar.com", + "page": "http://www.foobar.com/1234.html", + "publisher": { + "id": "8953", + "name": "foobar.com", + "cat": [ + "IAB3-1" + ], + "domain": "foobar.com" + } + }, + "device": { + "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", + "ip": "123.145.167.10" + }, + "user": { + "id": "55816b39711f9b5acf3b90e313ed29e51665623f", + "buyeruid": "545678765467876567898765678987654", + "data": [ + { + "id": "6", + "name": "Data Provider 1", + "segment": [ + { + "id": "12341318394918", + "name": "auto intenders" + }, + { + "id": "1234131839491234", + "name": "auto enthusiasts" + }, + { + "id": "23423424", + "name": "data-provider1-age", + "value": "30-40" + } + ] + } + ] + } } diff --git a/openrtb2/testdata/bid-request/2.5/mobile.json b/openrtb2/testdata/bid-request/2.5/mobile.json index 725fe35..6f30ad8 100644 --- a/openrtb2/testdata/bid-request/2.5/mobile.json +++ b/openrtb2/testdata/bid-request/2.5/mobile.json @@ -1,101 +1,101 @@ { - "id": "IxexyLDIIk", - "at": 2, - "bcat": [ - "IAB25", - "IAB7-39", - "IAB8-18", - "IAB8-5", - "IAB9-9" - ], - "badv": [ - "apple.com", - "go-text.me", - "heywire.com" - ], - "imp": [ - { - "id": "1", - "bidfloor": 0.5, - "tagid": "agltb3B1Yi1pbmNyDQsSBFNpdGUY7fD0FAw", - "banner": { - "w": 728, - "h": 90, - "pos": 1, - "btype": [ - 4 - ], - "battr": [ - 14 - ], - "api": [ - 3 - ] - } - }, - { - "id": "2", - "bidfloor": 0.5, - "tagid": "agltb3B1Yi1pbmNyDQsSBFNpdGUY7fD0FAwa", - "instl":1, - "banner": { - "w": 0, - "h": 0, - "pos": 2, - "btype": [ - 4 - ], - "battr": [ - 14 - ], - "api": [ - 3 - ] - } - } - ], - "app": { - "id": "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfIUDA", - "name": "Yahoo Weather", - "cat": [ - "IAB15", - "IAB15-10" - ], - "ver": "1.0.2", - "bundle": "12345", - "storeurl": "https://itunes.apple.com/id628677149", - "publisher": { - "id": "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfTUCV", - "name": "yahoo", - "domain": "www.yahoo.com" - } - }, - "device": { - "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3", - "ip": "123.145.167.189", - "ifa": "AA000DFE74168477C70D291f574D344790E0BB11", - "carrier": "VERIZON", - "language": "en", - "make": "Apple", - "model": "iPhone", - "os": "iOS", - "osv": "6.1", - "js": 1, - "connectiontype": 3, - "devicetype": 1, - "geo": { - "lat": 35.012345, - "lon": -115.12345, - "country": "USA", - "metro": "803", - "region": "CA", - "city": "Los Angeles", - "zip": "90049" - } - }, - "user": { - "id": "ffffffd5135596709273b3a1a07e466ea2bf4fff", - "yob": 1984, - "gender": "M" - } + "id": "IxexyLDIIk", + "at": 2, + "bcat": [ + "IAB25", + "IAB7-39", + "IAB8-18", + "IAB8-5", + "IAB9-9" + ], + "badv": [ + "apple.com", + "go-text.me", + "heywire.com" + ], + "imp": [ + { + "id": "1", + "bidfloor": 0.5, + "tagid": "agltb3B1Yi1pbmNyDQsSBFNpdGUY7fD0FAw", + "banner": { + "w": 728, + "h": 90, + "pos": 1, + "btype": [ + 4 + ], + "battr": [ + 14 + ], + "api": [ + 3 + ] + } + }, + { + "id": "2", + "bidfloor": 0.5, + "tagid": "agltb3B1Yi1pbmNyDQsSBFNpdGUY7fD0FAwa", + "instl": 1, + "banner": { + "w": 0, + "h": 0, + "pos": 2, + "btype": [ + 4 + ], + "battr": [ + 14 + ], + "api": [ + 3 + ] + } + } + ], + "app": { + "id": "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfIUDA", + "name": "Yahoo Weather", + "cat": [ + "IAB15", + "IAB15-10" + ], + "ver": "1.0.2", + "bundle": "12345", + "storeurl": "https://itunes.apple.com/id628677149", + "publisher": { + "id": "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfTUCV", + "name": "yahoo", + "domain": "www.yahoo.com" + } + }, + "device": { + "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3", + "ip": "123.145.167.189", + "ifa": "AA000DFE74168477C70D291f574D344790E0BB11", + "carrier": "VERIZON", + "language": "en", + "make": "Apple", + "model": "iPhone", + "os": "iOS", + "osv": "6.1", + "js": 1, + "connectiontype": 3, + "devicetype": 1, + "geo": { + "lat": 35.012345, + "lon": -115.12345, + "country": "USA", + "metro": "803", + "region": "CA", + "city": "Los Angeles", + "zip": "90049" + } + }, + "user": { + "id": "ffffffd5135596709273b3a1a07e466ea2bf4fff", + "yob": 1984, + "gender": "M" + } } diff --git a/openrtb2/testdata/bid-request/2.5/native-ad.json b/openrtb2/testdata/bid-request/2.5/native-ad.json index b8f444d..c058fa1 100644 --- a/openrtb2/testdata/bid-request/2.5/native-ad.json +++ b/openrtb2/testdata/bid-request/2.5/native-ad.json @@ -1,47 +1,47 @@ { - "id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22", - "at": 1, - "cur": [ - "USD" - ], - "imp": [ - { - "id": "1", - "bidfloor": 0.03, - "native": { - "request": "{\"native\":{\"ver\":\"1.0\",\"assets\":[ ... ]}}", - "ver": "1.0", - "api": [ - 3 - ], - "battr": [ - 13, - 14 - ] - } - } - ], - "site": { - "id": "102855", - "cat": [ - "IAB3-1" - ], - "domain": "www.foobar.com", - "page": "http://www.foobar.com/1234.html ", - "publisher": { - "id": "8953", - "name": "foobar.com", - "cat": [ - "IAB3-1" - ], - "domain": "foobar.com" - } - }, - "device": { - "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", - "ip": "123.145.167.10" - }, - "user": { - "id": "55816b39711f9b5acf3b90e313ed29e51665623f" - } + "id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22", + "at": 1, + "cur": [ + "USD" + ], + "imp": [ + { + "id": "1", + "bidfloor": 0.03, + "native": { + "request": "{\"native\":{\"ver\":\"1.0\",\"assets\":[ ... ]}}", + "ver": "1.0", + "api": [ + 3 + ], + "battr": [ + 13, + 14 + ] + } + } + ], + "site": { + "id": "102855", + "cat": [ + "IAB3-1" + ], + "domain": "www.foobar.com", + "page": "http://www.foobar.com/1234.html ", + "publisher": { + "id": "8953", + "name": "foobar.com", + "cat": [ + "IAB3-1" + ], + "domain": "foobar.com" + } + }, + "device": { + "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", + "ip": "123.145.167.10" + }, + "user": { + "id": "55816b39711f9b5acf3b90e313ed29e51665623f" + } } diff --git a/openrtb2/testdata/bid-request/2.5/pmp-with-direct-deal.json b/openrtb2/testdata/bid-request/2.5/pmp-with-direct-deal.json index 51e8adb..403c20f 100644 --- a/openrtb2/testdata/bid-request/2.5/pmp-with-direct-deal.json +++ b/openrtb2/testdata/bid-request/2.5/pmp-with-direct-deal.json @@ -1,61 +1,61 @@ { - "id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22", - "at": 1, - "cur": [ - "USD" - ], - "imp": [ - { - "id": "1", - "bidfloor": 0.03, - "banner": { - "h": 250, - "w": 300 - }, - "pmp": { - "private_auction": 1, - "deals": [ - { - "id": "AB-Agency1-0001", - "at": 1, - "bidfloor": 2.5, - "wseat": [ - "Agency1" - ] - }, - { - "id": "XY-Agency2-0001", - "at": 2, - "bidfloor": 2, - "wseat": [ - "Agency2" - ] - } - ] - } - } - ], - "site": { - "id": "102855", - "domain": "www.foobar.com", - "cat": [ - "IAB3-1" - ], - "page": "http://www.foobar.com/1234.html", - "publisher": { - "id": "8953", - "name": "foobar.com", - "cat": [ - "IAB3-1" - ], - "domain": "foobar.com" - } - }, - "device": { - "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", - "ip": "123.145.167.10" - }, - "user": { - "id": "55816b39711f9b5acf3b90e313ed29e51665623f" - } + "id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22", + "at": 1, + "cur": [ + "USD" + ], + "imp": [ + { + "id": "1", + "bidfloor": 0.03, + "banner": { + "h": 250, + "w": 300 + }, + "pmp": { + "private_auction": 1, + "deals": [ + { + "id": "AB-Agency1-0001", + "at": 1, + "bidfloor": 2.5, + "wseat": [ + "Agency1" + ] + }, + { + "id": "XY-Agency2-0001", + "at": 2, + "bidfloor": 2, + "wseat": [ + "Agency2" + ] + } + ] + } + } + ], + "site": { + "id": "102855", + "domain": "www.foobar.com", + "cat": [ + "IAB3-1" + ], + "page": "http://www.foobar.com/1234.html", + "publisher": { + "id": "8953", + "name": "foobar.com", + "cat": [ + "IAB3-1" + ], + "domain": "foobar.com" + } + }, + "device": { + "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", + "ip": "123.145.167.10" + }, + "user": { + "id": "55816b39711f9b5acf3b90e313ed29e51665623f" + } } diff --git a/openrtb2/testdata/bid-request/2.5/simple-banner.json b/openrtb2/testdata/bid-request/2.5/simple-banner.json index 490c4d0..a7dc7ba 100644 --- a/openrtb2/testdata/bid-request/2.5/simple-banner.json +++ b/openrtb2/testdata/bid-request/2.5/simple-banner.json @@ -1,40 +1,40 @@ { - "id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22", - "at": 1, - "cur": [ - "USD" - ], - "imp": [ - { - "id": "1", - "bidfloor": 0.03, - "banner": { - "h": 250, - "w": 300 - } - } - ], - "site": { - "id": "102855", - "cat": [ - "IAB3-1" - ], - "domain": "www.foobar.com", - "page": "http://www.foobar.com/1234.html ", - "publisher": { - "id": "8953", - "name": "foobar.com", - "cat": [ - "IAB3-1" - ], - "domain": "foobar.com" - } - }, - "device": { - "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", - "ip": "123.145.167.10" - }, - "user": { - "id": "55816b39711f9b5acf3b90e313ed29e51665623f" - } + "id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22", + "at": 1, + "cur": [ + "USD" + ], + "imp": [ + { + "id": "1", + "bidfloor": 0.03, + "banner": { + "h": 250, + "w": 300 + } + } + ], + "site": { + "id": "102855", + "cat": [ + "IAB3-1" + ], + "domain": "www.foobar.com", + "page": "http://www.foobar.com/1234.html ", + "publisher": { + "id": "8953", + "name": "foobar.com", + "cat": [ + "IAB3-1" + ], + "domain": "foobar.com" + } + }, + "device": { + "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", + "ip": "123.145.167.10" + }, + "user": { + "id": "55816b39711f9b5acf3b90e313ed29e51665623f" + } } diff --git a/openrtb2/testdata/bid-request/2.5/video.json b/openrtb2/testdata/bid-request/2.5/video.json index b61f04e..5664974 100644 --- a/openrtb2/testdata/bid-request/2.5/video.json +++ b/openrtb2/testdata/bid-request/2.5/video.json @@ -1,132 +1,132 @@ { - "id": "1234567893", - "at": 2, - "tmax": 120, - "imp": [ - { - "id": "1", - "bidfloor": 0.03, - "video": { - "w": 640, - "h": 480, - "pos": 1, - "minduration": 5, - "maxduration": 30, - "maxextended": 30, - "minbitrate": 300, - "maxbitrate": 1500, - "api": [ - 1, - 2 - ], - "protocols": [ - 2, - 3 - ], - "mimes": [ - "video/x-flv", - "video/mp4", - "application/x-shockwave-flash", - "application/javascript" - ], - "linearity": 1, - "boxingallowed": 1, - "playbackmethod": [ - 1, - 3 - ], - "delivery": [ - 2 - ], - "battr": [ - 13, - 14 - ], - "companionad": [ - { - "id": "1234567893-1", - "w": 300, - "h": 250, - "pos": 1, - "battr": [ - 13, - 14 - ], - "expdir": [ - 2, - 4 - ] - }, - { - "id": "1234567893-2", - "w": 728, - "h": 90, - "pos": 1, - "battr": [ - 13, - 14 - ] - } - ], - "companiontype": [ - 1, - 2 - ] - } - } - ], - "site": { - "id": "1345135123", - "name": "Site ABCD", - "domain": "siteabcd.com", - "cat": [ - "IAB2-1", - "IAB2-2" - ], - "page": "http://siteabcd.com/page.htm", - "ref": "http://referringsite.com/referringpage.htm", - "privacypolicy": 1, - "publisher": { - "id": "pub12345", - "name": "Publisher A" - }, - "content": { - "id": "1234567", - "series": "All About Cars", - "season": "2", - "episode": 23, - "title": "Car Show", - "cat": [ - "IAB2-2" - ], - "keywords": "keyword-a,keyword-b,keyword-c" - } - }, - "device": { - "ip": "64.124.253.1", - "ua": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16", - "os": "OS X", - "flashver": "10.1", - "js": 1 - }, - "user": { - "id": "456789876567897654678987656789", - "buyeruid": "545678765467876567898765678987654", - "data": [ - { - "id": "6", - "name": "Data Provider 1", - "segment": [ - { - "id": "12341318394918", - "name": "auto intenders" - }, - { - "id": "1234131839491234", - "name": "auto enthusiasts" - } - ] - } - ] - } + "id": "1234567893", + "at": 2, + "tmax": 120, + "imp": [ + { + "id": "1", + "bidfloor": 0.03, + "video": { + "w": 640, + "h": 480, + "pos": 1, + "minduration": 5, + "maxduration": 30, + "maxextended": 30, + "minbitrate": 300, + "maxbitrate": 1500, + "api": [ + 1, + 2 + ], + "protocols": [ + 2, + 3 + ], + "mimes": [ + "video/x-flv", + "video/mp4", + "application/x-shockwave-flash", + "application/javascript" + ], + "linearity": 1, + "boxingallowed": 1, + "playbackmethod": [ + 1, + 3 + ], + "delivery": [ + 2 + ], + "battr": [ + 13, + 14 + ], + "companionad": [ + { + "id": "1234567893-1", + "w": 300, + "h": 250, + "pos": 1, + "battr": [ + 13, + 14 + ], + "expdir": [ + 2, + 4 + ] + }, + { + "id": "1234567893-2", + "w": 728, + "h": 90, + "pos": 1, + "battr": [ + 13, + 14 + ] + } + ], + "companiontype": [ + 1, + 2 + ] + } + } + ], + "site": { + "id": "1345135123", + "name": "Site ABCD", + "domain": "siteabcd.com", + "cat": [ + "IAB2-1", + "IAB2-2" + ], + "page": "http://siteabcd.com/page.htm", + "ref": "http://referringsite.com/referringpage.htm", + "privacypolicy": 1, + "publisher": { + "id": "pub12345", + "name": "Publisher A" + }, + "content": { + "id": "1234567", + "series": "All About Cars", + "season": "2", + "episode": 23, + "title": "Car Show", + "cat": [ + "IAB2-2" + ], + "keywords": "keyword-a,keyword-b,keyword-c" + } + }, + "device": { + "ip": "64.124.253.1", + "ua": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16", + "os": "OS X", + "flashver": "10.1", + "js": 1 + }, + "user": { + "id": "456789876567897654678987656789", + "buyeruid": "545678765467876567898765678987654", + "data": [ + { + "id": "6", + "name": "Data Provider 1", + "segment": [ + { + "id": "12341318394918", + "name": "auto intenders" + }, + { + "id": "1234131839491234", + "name": "auto enthusiasts" + } + ] + } + ] + } } diff --git a/openrtb2/testdata/bid-response/2.5/ad-served-on-win-notice.json b/openrtb2/testdata/bid-response/2.5/ad-served-on-win-notice.json index 8415659..621b4cb 100644 --- a/openrtb2/testdata/bid-response/2.5/ad-served-on-win-notice.json +++ b/openrtb2/testdata/bid-response/2.5/ad-served-on-win-notice.json @@ -1,34 +1,34 @@ { - "id": "1234567890", - "bidid": "abc1123", - "cur": "USD", - "seatbid": [ - { - "seat": "512", - "bid": [ - { - "id": "1", - "impid": "102", - "price": 9.43, - "nurl": "http://adserver.com/winnotice?impid=102", - "iurl": "http://adserver.com/pathtosampleimage", - "adomain": [ - "advertiserdomain.com" - ], - "cid": "campaign111", - "crid": "creative112", - "attr": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 12 - ] - } - ] - } - ] + "id": "1234567890", + "bidid": "abc1123", + "cur": "USD", + "seatbid": [ + { + "seat": "512", + "bid": [ + { + "id": "1", + "impid": "102", + "price": 9.43, + "nurl": "http://adserver.com/winnotice?impid=102", + "iurl": "http://adserver.com/pathtosampleimage", + "adomain": [ + "advertiserdomain.com" + ], + "cid": "campaign111", + "crid": "creative112", + "attr": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 12 + ] + } + ] + } + ] } diff --git a/openrtb2/testdata/bid-response/2.5/direct-deal-ad-served-on-win-notice.json b/openrtb2/testdata/bid-response/2.5/direct-deal-ad-served-on-win-notice.json index 423c3e9..0aabb0d 100644 --- a/openrtb2/testdata/bid-response/2.5/direct-deal-ad-served-on-win-notice.json +++ b/openrtb2/testdata/bid-response/2.5/direct-deal-ad-served-on-win-notice.json @@ -1,32 +1,32 @@ { - "id": "1234567890", - "bidid": "abc1123", - "cur": "USD", - "seatbid": [ - { - "seat": "512", - "bid": [ - { - "id": "1", - "impid": "102", - "price": 5, - "dealid": "ABC-1234-6789", - "nurl": "http: //adserver.com/winnotice?impid=102", - "adomain": [ - "advertiserdomain.com" - ], - "iurl": "http: //adserver.com/pathtosampleimage", - "cid": "campaign111", - "crid": "creative112", - "adid": "314", - "attr": [ - 1, - 2, - 3, - 4 - ] - } - ] - } - ] + "id": "1234567890", + "bidid": "abc1123", + "cur": "USD", + "seatbid": [ + { + "seat": "512", + "bid": [ + { + "id": "1", + "impid": "102", + "price": 5, + "dealid": "ABC-1234-6789", + "nurl": "http: //adserver.com/winnotice?impid=102", + "adomain": [ + "advertiserdomain.com" + ], + "iurl": "http: //adserver.com/pathtosampleimage", + "cid": "campaign111", + "crid": "creative112", + "adid": "314", + "attr": [ + 1, + 2, + 3, + 4 + ] + } + ] + } + ] } diff --git a/openrtb2/testdata/bid-response/2.5/native-markup-returned-inline.json b/openrtb2/testdata/bid-response/2.5/native-markup-returned-inline.json index bf4b292..6ad0341 100644 --- a/openrtb2/testdata/bid-response/2.5/native-markup-returned-inline.json +++ b/openrtb2/testdata/bid-response/2.5/native-markup-returned-inline.json @@ -1,16 +1,16 @@ { - "id": "123", - "seatbid": [ - { - "bid": [ - { - "id": "12345", - "impid": "2", - "price": 3, - "nurl": "http://example.com/winnoticeurl", - "adm": "{\"native\":{\"ver\":\"1.0\",\"link\":{ ... },\"imptrackers\":[ ... ],\"assets\":[ ... ]}}" - } - ] - } - ] + "id": "123", + "seatbid": [ + { + "bid": [ + { + "id": "12345", + "impid": "2", + "price": 3, + "nurl": "http://example.com/winnoticeurl", + "adm": "{\"native\":{\"ver\":\"1.0\",\"link\":{ ... },\"imptrackers\":[ ... ],\"assets\":[ ... ]}}" + } + ] + } + ] } diff --git a/openrtb2/testdata/bid-response/2.5/vast-xml-document-returned-inline.json b/openrtb2/testdata/bid-response/2.5/vast-xml-document-returned-inline.json index 8529bd6..781eeac 100644 --- a/openrtb2/testdata/bid-response/2.5/vast-xml-document-returned-inline.json +++ b/openrtb2/testdata/bid-response/2.5/vast-xml-document-returned-inline.json @@ -1,16 +1,16 @@ { - "id": "123", - "seatbid": [ - { - "bid": [ - { - "id": "12345", - "impid": "2", - "price": 3, - "nurl": "http://example.com/winnoticeurl", - "adm": "\n\n\n\nSpotXchange\n\n \n\nhttp://sample.com\n\n\n\n \n\n\n00:00:30\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" - } - ] - } - ] + "id": "123", + "seatbid": [ + { + "bid": [ + { + "id": "12345", + "impid": "2", + "price": 3, + "nurl": "http://example.com/winnoticeurl", + "adm": "\n\n\n\nSpotXchange\n\n \n\nhttp://sample.com\n\n\n\n \n\n\n00:00:30\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + } + ] + } + ] } From 855ba226fec4b489ce2094311ebe80cb4f8ad922 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 01:33:30 -0400 Subject: [PATCH 23/62] AgentType Enum Added For OpenRTB 2.6 --- openrtb2/uid.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openrtb2/uid.go b/openrtb2/uid.go index c66c7c9..44ed0fa 100644 --- a/openrtb2/uid.go +++ b/openrtb2/uid.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.28 Object: UID // @@ -24,7 +28,7 @@ type UID struct { // Type of user agent the ID is from. It is highly recommended to set this, as // many DSPs separate app-native IDs from browser-based IDs and require a type // value for ID resolution. Refer to List: Agent Types in AdCOM 1.0 - AType int64 `json:"atype,omitempty"` + AType adcom1.AgentType `json:"atype,omitempty"` // Attribute: // ext From 57c96788617c054c9526d7d94790b2efe7ed6e17 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 01:40:26 -0400 Subject: [PATCH 24/62] PodSequence + SlotPositionInPod Enums --- openrtb2/audio.go | 10 +++++++--- openrtb2/bid.go | 8 ++++++-- openrtb2/video.go | 10 +++++++--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/openrtb2/audio.go b/openrtb2/audio.go index ca607a6..2f00abf 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.8 Object: Audio // @@ -103,7 +107,7 @@ type Audio struct { // The sequence (position) of the audio ad pod within a // content stream. Refer to List: Pod Sequence in AdCOM 1.0 // for guidance on the use of this field. - PodSeq int8 `json:"podseq,omitempty"` + PodSeq adcom1.PodSequence `json:"podseq,omitempty"` // Attribute: // sequence @@ -124,7 +128,7 @@ type Audio struct { // guarantee delivery against the indicated sequence. Refer to // List: Slot Position in Pod in AdCOM 1.0 for guidance on the // use of this field. - SlotInPod *int8 `json:"slotinpod,omitempty"` + SlotInPod adcom1.SlotPositionInPod `json:"slotinpod,omitempty"` // Attribute: // mincpmpersec diff --git a/openrtb2/bid.go b/openrtb2/bid.go index 5bf9c2a..722f160 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 4.3.19 Object: Bid // @@ -334,7 +338,7 @@ type Bid struct { // position within a video or audio ad pod (e.g. first position, // last position, or any). Refer to List: Slot Position in Pod in // AdCOM 1.0 for guidance on the use of this field. - SlotInPod *int8 `json:"slotinpod,omitempty"` + SlotInPod adcom1.SlotPositionInPod `json:"slotinpod,omitempty"` // Attribute: // ext diff --git a/openrtb2/video.go b/openrtb2/video.go index 26510b1..e39b7c1 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.7 Object: Video // @@ -123,7 +127,7 @@ type Video struct { // The sequence (position) of the video ad pod within a // content stream. Refer to List: Pod Sequence in AdCOM 1.0 // for guidance on the use of this field. - PodSeq int8 `json:"podseq,omitempty"` + PodSeq adcom1.PodSequence `json:"podseq,omitempty"` // Attribute: // rqddurs @@ -209,7 +213,7 @@ type Video struct { // guarantee delivery against the indicated slot position in the // pod. Refer to List: Slot Position in Pod in AdCOM 1.0 guidance // on the use of this field. - SlotInPod *int8 `json:"slotinpod,omitempty"` + SlotInPod adcom1.SlotPositionInPod `json:"slotinpod,omitempty"` // Attribute: // mincpmpersec From a224717b795af4e5d3aeb61886cecca07fd5731a Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 01:47:14 -0400 Subject: [PATCH 25/62] UserAgentSource Enum --- openrtb2/user_agent.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openrtb2/user_agent.go b/openrtb2/user_agent.go index 8646049..e145ff8 100644 --- a/openrtb2/user_agent.go +++ b/openrtb2/user_agent.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.29 Object: UserAgent // @@ -74,7 +78,7 @@ type UserAgent struct { // Description: // The source of data used to create this object, List: User-Agent Source in // AdCOM 1.0. - Source int8 `json:"source,omitempty"` + Source adcom1.UserAgentSource `json:"source,omitempty"` // Attribute: // ext From b6d49d195c3b0bbee74987bceb59cb62ede36f0d Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 01:48:53 -0400 Subject: [PATCH 26/62] Protocol Enum Value Typo --- native1/protocol.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native1/protocol.go b/native1/protocol.go index d23d54e..d2ce1b4 100644 --- a/native1/protocol.go +++ b/native1/protocol.go @@ -19,7 +19,7 @@ const ( ProtocolDAAST10 Protocol = 9 // DAAST 1.0 ProtocolDAAST10Wrapper Protocol = 10 // DAAST 1.0 Wrapper ProtocolVAST41 Protocol = 11 // VAST 4.1 - ProtocolVAST41Wrapper Protocol = 11 // VAST 4.1 Wrapper - ProtocolVAST42 Protocol = 11 // VAST 4.2 - ProtocolVAST42Wrapper Protocol = 11 // VAST 4.2 Wrapper + ProtocolVAST41Wrapper Protocol = 12 // VAST 4.1 Wrapper + ProtocolVAST42 Protocol = 13 // VAST 4.2 + ProtocolVAST42Wrapper Protocol = 14 // VAST 4.2 Wrapper ) From 8b983d7713117d4eb79093170c86d342af233a69 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:02:14 -0400 Subject: [PATCH 27/62] Protocols Enum + Restored Video.Protocol --- native1/protocol.go | 2 +- openrtb2/audio.go | 4 +++- openrtb2/video.go | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/native1/protocol.go b/native1/protocol.go index d2ce1b4..0f5ce4e 100644 --- a/native1/protocol.go +++ b/native1/protocol.go @@ -1,6 +1,6 @@ package native1 -// 5.8 Protocols (from AdCOM spec 1.0) +// Protocols (from AdCOM spec 1.0, List: Creative Subtypes - Audio/Video) // // Options for the various bid response protocols that could be supported by an exchange. // diff --git a/openrtb2/audio.go b/openrtb2/audio.go index 2f00abf..aa9c131 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -62,7 +62,9 @@ type Audio struct { // Description: // Array of supported audio protocols. Refer to List: Creative // Subtypes - Audio/Video in AdCOM 1.0. - Protocols []int8 `json:"protocols,omitempty"` + // Note: + // OpenRTB <=2.5 defined only protocols 1..10. + Protocols []adcom1.MediaCreativeSubtype `json:"protocols,omitempty"` // Attribute: // startdelay diff --git a/openrtb2/video.go b/openrtb2/video.go index e39b7c1..0b23de5 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -89,7 +89,22 @@ type Video struct { // Definition: // Array of supported video protocols. Refer to List: Creative // Subtypes - Audio/Video in AdCOM 1.0. - Protocols []int8 `json:"protocols,omitempty"` + // Note: + // OpenRTB <=2.5 defined only protocols 1..10. + Protocols []adcom1.MediaCreativeSubtype `json:"protocols,omitempty"` + + // Attribute: + // protocol + // Type: + // integer; DEPRECATED; REMOVED in OpenRTB 2.6 + // Description: + // NOTE: Deprecated in favor of protocols. + // Supported video protocol. Refer to List 5.8. At least one + // supported protocol must be specified in either the protocol + // or protocols attribute. + // Note: + // OpenRTB <=2.5 defined only protocols 1..10. + Protocol adcom1.MediaCreativeSubtype `json:"protocol,omitempty"` // Attribute: // w From bb5afb30e32e212a6f1ab0df8274fae72b642219 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:04:29 -0400 Subject: [PATCH 28/62] DeviceType Enum --- openrtb2/device.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openrtb2/device.go b/openrtb2/device.go index 32b68d8..c6320d8 100644 --- a/openrtb2/device.go +++ b/openrtb2/device.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.18 Object: Device // @@ -100,7 +104,9 @@ type Device struct { // Description: // The general type of device. Refer to List: Device Types in // AdCOM 1.0. - DeviceType int8 `json:"devicetype,omitempty"` + // Note: + // OpenRTB <=2.5 defined only types 1..7. + DeviceType adcom1.DeviceType `json:"devicetype,omitempty"` // Attribute: // make From cd5d1e704d345ddf5824ee6c5b09c561ffc6d381 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:07:31 -0400 Subject: [PATCH 29/62] PlaybackMethod Enum --- openrtb2/video.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openrtb2/video.go b/openrtb2/video.go index 0b23de5..15f5af5 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -298,7 +298,9 @@ type Video struct { // future version of the specification. It is strongly advised to use // only the first element of this array in preparation for this // change. - PlaybackMethod []int8 `json:"playbackmethod,omitempty"` + // Note: + // OpenRTB <=2.5 defined only methods 1..6. + PlaybackMethod []adcom1.PlaybackMethod `json:"playbackmethod,omitempty"` // Attribute: // playbackend From f1466dfd912f67710338b66280399d5d8a911630 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:18:50 -0400 Subject: [PATCH 30/62] StartDelayMode Enum --- adcom1/audio_placement.go | 2 +- adcom1/start_delay_mode.go | 13 +++++++++++++ adcom1/video_placement.go | 6 ++++-- openrtb2/audio.go | 2 +- openrtb2/video.go | 2 +- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/adcom1/audio_placement.go b/adcom1/audio_placement.go index ab0dd8d..e12e4c7 100644 --- a/adcom1/audio_placement.go +++ b/adcom1/audio_placement.go @@ -11,7 +11,7 @@ type AudioPlacement struct { // Definition: // Indicates the start delay in seconds for pre-roll, mid-roll, or post-roll placements. // For additional generic values, refer to List: Start Delay Modes. - Delay int64 `json:"delay,omitempty"` + Delay StartDelayMode `json:"delay,omitempty"` // Attribute: // skip diff --git a/adcom1/start_delay_mode.go b/adcom1/start_delay_mode.go index 7287939..72c52bf 100644 --- a/adcom1/start_delay_mode.go +++ b/adcom1/start_delay_mode.go @@ -10,3 +10,16 @@ const ( StartDelayGenericMidRoll StartDelayMode = -1 // Generic Mid-Roll StartDelayGenericPostRoll StartDelayMode = -2 // Generic Post-Roll ) + +// Ptr returns pointer to own value. +func (p StartDelayMode) Ptr() *StartDelayMode { + return &p +} + +// Val safely dereferences pointer, returning default value (StartDelayPreRoll) for nil. +func (p *StartDelayMode) Val() StartDelayMode { + if p == nil { + return StartDelayPreRoll + } + return *p +} diff --git a/adcom1/video_placement.go b/adcom1/video_placement.go index 896854e..c9d6d12 100644 --- a/adcom1/video_placement.go +++ b/adcom1/video_placement.go @@ -1,6 +1,8 @@ package adcom1 -import "encoding/json" +import ( + "encoding/json" +) // VideoPlacement object signals that the placement may be a video placement and provides additional detail about permitted video ads (e.g., VAST). type VideoPlacement struct { @@ -29,7 +31,7 @@ type VideoPlacement struct { // Definition: // Indicates the start delay in seconds for pre-roll, mid-roll, or post-roll placements. // For additional generic values, refer to List: Start Delay Modes. - Delay int64 `json:"delay,omitempty"` + Delay StartDelayMode `json:"delay,omitempty"` // Attribute: // skip diff --git a/openrtb2/audio.go b/openrtb2/audio.go index aa9c131..1878f94 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -74,7 +74,7 @@ type Audio struct { // Indicates the start delay in seconds for pre-roll, mid-roll, or // post-roll ad placements. Refer to List: Start Delay Modes in // AdCOM 1.0. - StartDelay *int8 `json:"startdelay,omitempty"` + StartDelay *adcom1.StartDelayMode `json:"startdelay,omitempty"` // Attribute: // rqddurs diff --git a/openrtb2/video.go b/openrtb2/video.go index 15f5af5..59468c3 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -55,7 +55,7 @@ type Video struct { // Indicates the start delay in seconds for pre-roll, mid-roll, or // post-roll ad placements. Refer to List: Start Delay Modes // in AdCOM 1.0. - StartDelay *int8 `json:"startdelay,omitempty"` + StartDelay *adcom1.StartDelayMode `json:"startdelay,omitempty"` // Attribute: // maxseq From 5dcbf7734128bd29b6c8d921f3edd1c9be579d89 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:22:41 -0400 Subject: [PATCH 31/62] BAttr Enum --- openrtb2/audio.go | 4 +++- openrtb2/native.go | 10 ++++++++-- openrtb2/video.go | 4 +++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/openrtb2/audio.go b/openrtb2/audio.go index 1878f94..7ca0479 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -149,7 +149,9 @@ type Audio struct { // Description: // Blocked creative attributes. Refer to List: Creative Attributes in // AdCOM 1.0. - BAttr []int64 `json:"battr,omitempty"` + // Note: + // OpenRTB <=2.5 defined only attributes with IDs 1..17. + BAttr []adcom1.CreativeAttribute `json:"battr,omitempty"` // Attribute: // maxextended diff --git a/openrtb2/native.go b/openrtb2/native.go index 50e917f..af2f60a 100644 --- a/openrtb2/native.go +++ b/openrtb2/native.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.9 Object: Native // @@ -63,7 +67,9 @@ type Native struct { // Description: // Blocked creative attributes. Refer to List: Creative Attributes in // AdCOM. - BAttr []int64 `json:"battr,omitempty"` + // Note: + // OpenRTB <=2.5 defined only attributes with IDs 1..17. + BAttr []adcom1.CreativeAttribute `json:"battr,omitempty"` // Attribute: // ext diff --git a/openrtb2/video.go b/openrtb2/video.go index 59468c3..da18610 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -247,7 +247,9 @@ type Video struct { // Description: // Blocked creative attributes. Refer to List: Creative Attributes in // AdCOM 1.0 - BAttr []int64 `json:"battr,omitempty"` + // Note: + // OpenRTB <=2.5 defined only attributes 1..17. + BAttr []adcom1.CreativeAttribute `json:"battr,omitempty"` // Attribute: // maxextended From e09d9fa9c43b9d4143bd30883f5b81d3a26b755b Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:27:31 -0400 Subject: [PATCH 32/62] Missed A Protocol Enum Reference --- openrtb2/bid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/bid.go b/openrtb2/bid.go index 722f160..83c1e34 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -225,7 +225,7 @@ type Bid struct { // Description: // Video response protocol of the markup if applicable. Refer to // List: Creative Subtypes - Audio/Video in AdCOM 1.0. - Protocol int8 `json:"protocol,omitempty"` + Protocol adcom1.MediaCreativeSubtype `json:"protocol,omitempty"` // Attribute: // qagmediarating From d93cf025b759942a602eb4e5ae4252691a26392b Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:32:16 -0400 Subject: [PATCH 33/62] CategoryTaxonomy Enum --- openrtb2/bid.go | 2 +- openrtb2/bid_request.go | 8 ++++++-- openrtb2/content.go | 8 ++++++-- openrtb2/producer.go | 8 ++++++-- openrtb2/publisher.go | 8 ++++++-- openrtb2/site.go | 8 ++++++-- 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/openrtb2/bid.go b/openrtb2/bid.go index 83c1e34..3f4051b 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -177,7 +177,7 @@ type Bid struct { // Description: // The taxonomy in use. Refer to the AdCOM 1.0 list List: Category // Taxonomies for values. - CatTax int64 `json:"cattax,omitempty"` + CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"` // Attribute: // cat diff --git a/openrtb2/bid_request.go b/openrtb2/bid_request.go index a318f40..f4ae66b 100644 --- a/openrtb2/bid_request.go +++ b/openrtb2/bid_request.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.1 Object: BidRequest // @@ -187,7 +191,7 @@ type BidRequest struct { // Description: // The taxonomy in use for bcat. Refer to the AdCOM // 1.0 list List: Category Taxonomies for values - CatTax int64 `json:"cattax,omitempty"` + CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"` // Attribute: // badv diff --git a/openrtb2/content.go b/openrtb2/content.go index 42b68b8..e1a21cf 100644 --- a/openrtb2/content.go +++ b/openrtb2/content.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.16 Object: Content // @@ -113,7 +117,7 @@ type Content struct { // Description: // The taxonomy in use. Refer to the AdCOM list List: Category // Taxonomies for values. - CatTax int64 `json:"cattax,omitempty"` + CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"` // Attribute: // cat diff --git a/openrtb2/producer.go b/openrtb2/producer.go index 56b8590..de0e295 100644 --- a/openrtb2/producer.go +++ b/openrtb2/producer.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.17 Object: Producer // @@ -32,7 +36,7 @@ type Producer struct { // Description: // The taxonomy in use. Refer to the AdCOM 1.0 list List: Category // Taxonomies for values. - CatTax int64 `json:"cattax,omitempty"` + CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"` // Attribute: // cat diff --git a/openrtb2/publisher.go b/openrtb2/publisher.go index b454db0..576a326 100644 --- a/openrtb2/publisher.go +++ b/openrtb2/publisher.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.15 Object: Publisher // @@ -31,7 +35,7 @@ type Publisher struct { // Description: // The taxonomy in use. Refer to the AdCOM list List: Category // Taxonomies for values. - CatTax int64 `json:"cattax,omitempty"` + CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"` // Attribute: // cat diff --git a/openrtb2/site.go b/openrtb2/site.go index 1beb89d..f2878f4 100644 --- a/openrtb2/site.go +++ b/openrtb2/site.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.13 Object: Site // @@ -41,7 +45,7 @@ type Site struct { // The taxonomy in use. Refer to the AdCOM list List: Category // Taxonomies for values. If no cattax field is supplied IAB Content // Category Taxonomy 1.0 is assumed. - CatTax int64 `json:"cattax,omitempty"` + CatTax adcom1.CategoryTaxonomy `json:"cattax,omitempty"` // Attribute: // cat From d61ab70ae38e1f768f4ef512604172c273ea21ef Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:33:39 -0400 Subject: [PATCH 34/62] Missed A CreativeAttribute Enum Field --- openrtb2/bid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/bid.go b/openrtb2/bid.go index 3f4051b..a8a8541 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -196,7 +196,7 @@ type Bid struct { // Description: // Set of attributes describing the creative. Refer to List: Creative // Attributes in AdCOM 1.0. - Attr []int64 `json:"attr,omitempty"` + Attr []adcom1.CreativeAttribute `json:"attr,omitempty"` // Attribute: // apis From ce8835cd94339ca0a5a18a7869b925031359cc4b Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:35:09 -0400 Subject: [PATCH 35/62] Added Note For Attr Enum --- openrtb2/bid.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openrtb2/bid.go b/openrtb2/bid.go index a8a8541..0831cb9 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -196,6 +196,8 @@ type Bid struct { // Description: // Set of attributes describing the creative. Refer to List: Creative // Attributes in AdCOM 1.0. + // Note: + // OpenRTB <=2.5 defined only attributes with IDs 1..17. Attr []adcom1.CreativeAttribute `json:"attr,omitempty"` // Attribute: From 92c8205e77bc7b1fe9553f4ed51abf3ac1bad57d Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:36:07 -0400 Subject: [PATCH 36/62] DeliveryMethod Enum --- openrtb2/audio.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/audio.go b/openrtb2/audio.go index 7ca0479..d642bac 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -189,7 +189,7 @@ type Audio struct { // Supported delivery methods (e.g., streaming, progressive). If // none specified, assume all are supported. Refer to List: Delivery // Methods in AdCOM 1.0. - Delivery []int8 `json:"delivery,omitempty"` + Delivery []adcom1.DeliveryMethod `json:"delivery,omitempty"` // Attribute: // companionad From 434839045b154cb24deb7b51c11e87aa8655ec67 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:41:35 -0400 Subject: [PATCH 37/62] APIFramework Enum + Fix APIs Type --- openrtb2/audio.go | 4 +++- openrtb2/bid.go | 6 ++++-- openrtb2/native.go | 4 +++- openrtb2/video.go | 4 +++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/openrtb2/audio.go b/openrtb2/audio.go index d642bac..23f3b58 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -208,7 +208,9 @@ type Audio struct { // List of supported API frameworks for this impression. Refer to // List: API Frameworks in AdCOM 1.0. If an API is not explicitly // listed, it is assumed not to be supported. - API []int64 `json:"api,omitempty"` + // Note: + // OpenRTB <=2.5 defined only frameworks 1..6. + API []adcom1.APIFramework `json:"api,omitempty"` // Attribute: // companiontype diff --git a/openrtb2/bid.go b/openrtb2/bid.go index 0831cb9..e26b881 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -208,7 +208,7 @@ type Bid struct { // List of supported APIs for the markup. If an API is not explicitly // listed, it is assumed to be unsupported. Refer to List: API // Frameworks in AdCOM 1.0. - APIs int64 `json:"apis,omitempty"` + APIs []adcom1.APIFramework `json:"apis,omitempty"` // Attribute: // api @@ -218,7 +218,9 @@ type Bid struct { // NOTE: Deprecated in favor of the apis integer array. // API required by the markup if applicable. Refer to List: API // Frameworks in AdCOM 1.0. - API int64 `json:"api,omitempty"` + // Note: + // OpenRTB <=2.5 defined only frameworks 1..6. + API adcom1.APIFramework `json:"api,omitempty"` // Attribute: // protocol diff --git a/openrtb2/native.go b/openrtb2/native.go index af2f60a..e7054cd 100644 --- a/openrtb2/native.go +++ b/openrtb2/native.go @@ -58,7 +58,9 @@ type Native struct { // List of supported API frameworks for this impression. Refer to // List: API Frameworks in AdCOM. If an API is not explicitly listed, // it is assumed not to be supported. - API []int64 `json:"api,omitempty"` + // Note: + // OpenRTB <=2.5 defined only frameworks 1..6. + API []adcom1.APIFramework `json:"api,omitempty"` // Attribute: // sequence diff --git a/openrtb2/video.go b/openrtb2/video.go index da18610..db9ab28 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -349,7 +349,9 @@ type Video struct { // List of supported API frameworks for this impression. Refer to // List: API Frameworks in AdCOM 1.0. If an API is not explicitly // listed, it is assumed not to be supported. - API []int64 `json:"api,omitempty"` + // Note: + // OpenRTB <=2.5 defined only frameworks 1..6. + API []adcom1.APIFramework `json:"api,omitempty"` // Attribute: // companiontype From 1bfa94faa3ce78a63956beab289ea826dec6b2ef Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:44:45 -0400 Subject: [PATCH 38/62] Missed A CreativeAttribute Enum --- openrtb2/video.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/video.go b/openrtb2/video.go index db9ab28..ff7aef9 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -189,7 +189,7 @@ type Video struct { // Bid object should include the attr array with an element of // 16 indicating skippable video. Refer to List: Creative // Attributes in AdCOM 1.0. - Skip *int8 `json:"skip,omitempty"` + Skip *adcom1.CreativeAttribute `json:"skip,omitempty"` // Attribute: // skipmin From 1e4159b4a339263e6da969fd1856de0ded9e81f3 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:46:49 -0400 Subject: [PATCH 39/62] PlaybackCessationMode Enum --- openrtb2/video.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/video.go b/openrtb2/video.go index ff7aef9..55ec78d 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -311,7 +311,7 @@ type Video struct { // Description: // The event that causes playback to end. Refer to List: Playback // Cessation Modes in AdCOM 1.0. - PlaybackEnd int8 `json:"playbackend,omitempty"` + PlaybackEnd adcom1.PlaybackCessationMode `json:"playbackend,omitempty"` // Attribute: // delivery From abbe874c638cbbdfd5e24d66b5161dac40e9d78a Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 02:49:09 -0400 Subject: [PATCH 40/62] Missed DeliveryMethod In Video.Delivery --- openrtb2/video.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/video.go b/openrtb2/video.go index 55ec78d..fe9f9b9 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -321,7 +321,7 @@ type Video struct { // Supported delivery methods (e.g., streaming, progressive). If // none specified, assume all are supported. Refer to List: // Delivery Methods in AdCOM 1.0. - Delivery []int8 `json:"delivery,omitempty"` + Delivery []adcom1.DeliveryMethod `json:"delivery,omitempty"` // Attribute: // pos From 5831ce1c69eb37664342cacb4135ac92a1234626 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Tue, 17 May 2022 12:40:58 +0300 Subject: [PATCH 41/62] openrtb2: neutral comment --- openrtb2/testdata/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/testdata/README.md b/openrtb2/testdata/README.md index 7db181f..0df06d6 100644 --- a/openrtb2/testdata/README.md +++ b/openrtb2/testdata/README.md @@ -6,7 +6,7 @@ JSON examples copied from [OpenRTB](https://iabtechlab.com/standards/openrtb/) s Some empty/zero attributes were omited (not copied) because of [encoding/json](https://golang.org/pkg/encoding/json/) `omitempty` and [gomega.MatchJSON(...)](http://onsi.github.io/gomega/#matchjsonjson-interface). -Sloppy examples (and types) is not something new for OpenRTB spec, so the following adjustments were made: +For [2.6](https://iabtechlab.com/wp-content/uploads/2022/04/OpenRTB-2-6_FINAL.pdf) the following adjustments were applied: - [bid-request/2.6/simple-banner.json](bid-request/2.6/simple-banner.json) - spec example embedded `user` into `site`, moved `user` to top level - [bid-request/2.6/expandable-creative.json](bid-request/2.6/expandable-creative.json) - `data[2].value` added, moved to `data[2].segment[0].value` From 9b01ff975cab46c22e8ae28aff6420050652c68a Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Tue, 17 May 2022 13:56:15 +0300 Subject: [PATCH 42/62] openrtb2: switch Video prop types to adcom1 --- openrtb2/video.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openrtb2/video.go b/openrtb2/video.go index fe9f9b9..1a47823 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -164,7 +164,7 @@ type Video struct { // Description: // Video placement type for the impression. Refer to List: // Placement Subtypes - Video in AdCOM 1.0. - Placement int8 `json:"placement,omitempty"` + Placement adcom1.VideoPlacementSubtype `json:"placement,omitempty"` // Attribute: // linearity @@ -176,7 +176,7 @@ type Video struct { // Modes in AdCOM 1.0. Note that this field describes the // expected VAST response and not whether a placement is in- // stream, out-stream, etc. For that, see placement. - Linearity int8 `json:"linearity,omitempty"` + Linearity adcom1.LinearityMode `json:"linearity,omitempty"` // Attribute: // skip @@ -189,7 +189,7 @@ type Video struct { // Bid object should include the attr array with an element of // 16 indicating skippable video. Refer to List: Creative // Attributes in AdCOM 1.0. - Skip *adcom1.CreativeAttribute `json:"skip,omitempty"` + Skip int8 `json:"skip,omitempty"` // Attribute: // skipmin @@ -330,7 +330,7 @@ type Video struct { // Description: // Ad position on screen. Refer to List: Placement Positions in // AdCOM 1.0. - Pos int8 `json:"pos,omitempty"` + Pos adcom1.PlacementPosition `json:"pos,omitempty"` // Attribute: // companionad @@ -364,7 +364,7 @@ type Video struct { // companionad array. If one of these banners will be // rendered as an end-card, this can be specified using the vcm // attribute with the particular banner (Section 3.2.6). - CompanionType []int8 `json:"companiontype,omitempty"` + CompanionType []adcom1.CompanionType `json:"companiontype,omitempty"` // Attribute: // ext From 84f4121d94990966b6d51d36fed817b46b374121 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Tue, 17 May 2022 20:59:43 +0300 Subject: [PATCH 43/62] openrtb2: make Video.Skip pointer again --- openrtb2/video.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/video.go b/openrtb2/video.go index 1a47823..2b98c0a 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -189,7 +189,7 @@ type Video struct { // Bid object should include the attr array with an element of // 16 indicating skippable video. Refer to List: Creative // Attributes in AdCOM 1.0. - Skip int8 `json:"skip,omitempty"` + Skip *int8 `json:"skip,omitempty"` // Attribute: // skipmin From 77333bef684c17f32a47354de0a1adfcc68a54ec Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 16:24:05 -0400 Subject: [PATCH 44/62] openrtb2: link audio enums to adcom1 --- openrtb2/audio.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openrtb2/audio.go b/openrtb2/audio.go index 23f3b58..1ede214 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -220,7 +220,7 @@ type Audio struct { // Supported companion ad types. Refer to List: Companion // Types in AdCOM 1.0. Recommended if companion Banner // objects are included via the companionad array. - CompanionType []int8 `json:"companiontype,omitempty"` + CompanionType []adcom1.CompanionType `json:"companiontype,omitempty"` // Attribute: // maxseq @@ -236,7 +236,7 @@ type Audio struct { // integer // Description: // Type of audio feed. Refer to List: Feed Types in AdCOM 1.0. - Feed int8 `json:"feed,omitempty"` + Feed adcom1.FeedType `json:"feed,omitempty"` // Attribute: // stitched @@ -254,7 +254,7 @@ type Audio struct { // Description: // Volume normalization mode. Refer to List: Volume // Normalization Modes in AdCOM 1.0. - NVol int8 `json:"nvol,omitempty"` + NVol adcom1.VolumeNormalizationMode `json:"nvol,omitempty"` // Attribute: // ext From 9770fec478c25cae86b7536f60adb0f89c6fa464 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 16:28:51 -0400 Subject: [PATCH 45/62] openrtb2: fix spec numbering + bid adcom enums --- openrtb2/bid.go | 2 +- openrtb2/bid_response.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openrtb2/bid.go b/openrtb2/bid.go index e26b881..5c32b73 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -238,7 +238,7 @@ type Bid struct { // Description: // Media rating per IQG guidelines. Refer to List: Media Ratings in // AdCOM 1.0. - QAGMediaRating int8 `json:"qagmediarating,omitempty"` + QAGMediaRating adcom1.MediaRating `json:"qagmediarating,omitempty"` // Attribute: // language diff --git a/openrtb2/bid_response.go b/openrtb2/bid_response.go index bf33d2f..788a8ce 100644 --- a/openrtb2/bid_response.go +++ b/openrtb2/bid_response.go @@ -2,7 +2,7 @@ package openrtb2 import "encoding/json" -// 4.3.17 Object: BidResponse +// 4.3.1 Object: BidResponse // // This object is the top-level bid response object (i.e., the unnamed outer JSON object). // The id attribute is a reflection of the bid request ID for logging purposes. From afa47f66c5f0fe0de4f0388a0c8777f7d4330bd7 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 16:35:07 -0400 Subject: [PATCH 46/62] openrtb2: bidresponse openrtb3 enum --- openrtb2/bid_response.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openrtb2/bid_response.go b/openrtb2/bid_response.go index 788a8ce..4c984cc 100644 --- a/openrtb2/bid_response.go +++ b/openrtb2/bid_response.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/openrtb3" +) // 4.3.1 Object: BidResponse // @@ -65,7 +69,9 @@ type BidResponse struct { // Description: // Reason for not bidding. Refer to List: No-Bid Reason Codes in // OpenRTB 3.0. - NBR *int64 `json:"nbr,omitempty"` + // Note: + // OpenRTB <=2.5 defined only reasons 0..10. + NBR *openrtb3.NoBidReason `json:"nbr,omitempty"` // Attribute: // ext From 26fcbfb9c282089b971a73df8b5baf08eeb2095b Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 16:38:06 -0400 Subject: [PATCH 47/62] openrtb2: content adcom enums --- openrtb2/content.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openrtb2/content.go b/openrtb2/content.go index e1a21cf..8f804dc 100644 --- a/openrtb2/content.go +++ b/openrtb2/content.go @@ -136,7 +136,7 @@ type Content struct { // integer // Description: // Production quality. Refer to List: Production Qualities in AdCOM 1.0. - ProdQ int8 `json:"prodq,omitempty"` + ProdQ adcom1.ProductionQuality `json:"prodq,omitempty"` // Attribute: // context @@ -145,7 +145,7 @@ type Content struct { // Description: // Type of content (game, video, text, etc.). Refer to List: Content // Contexts in AdCOM 1.0. - Context int8 `json:"context,omitempty"` + Context adcom1.ContentContext `json:"context,omitempty"` // Attribute: // contentrating @@ -170,7 +170,7 @@ type Content struct { // Description: // Media rating per IQG guidelines. Refer to List: Media Ratings in // AdCOM 1.0. - QAGMediaRating int8 `json:"qagmediarating,omitempty"` + QAGMediaRating adcom1.MediaRating `json:"qagmediarating,omitempty"` // Attribute: // keywords From 2f3d09587250b7f1f7cfb02378b0645ec7a590c0 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 17 May 2022 16:43:46 -0400 Subject: [PATCH 48/62] openrtb2: fix spec numbering for bid object --- openrtb2/bid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/bid.go b/openrtb2/bid.go index 5c32b73..2de4673 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -6,7 +6,7 @@ import ( "github.com/mxmCherry/openrtb/v16/adcom1" ) -// 4.3.19 Object: Bid +// 4.3.3 Object: Bid // // A SeatBid object contains one or more Bid objects, each of which relates to a specific impression in the bid request via the impid attribute and constitutes an offer to buy that impression for a given price. // From 017df4b9dc9ae265875c5bad953ed7026adb8e9a Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Thu, 19 May 2022 02:08:44 -0400 Subject: [PATCH 49/62] openrtb2: audio.nvol should still be a pointer --- openrtb2/audio.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/audio.go b/openrtb2/audio.go index 1ede214..7eaf906 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -254,7 +254,7 @@ type Audio struct { // Description: // Volume normalization mode. Refer to List: Volume // Normalization Modes in AdCOM 1.0. - NVol adcom1.VolumeNormalizationMode `json:"nvol,omitempty"` + NVol *adcom1.VolumeNormalizationMode `json:"nvol,omitempty"` // Attribute: // ext From c7f17835b1b9977326a4f8b70ee88771a15e3547 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Thu, 19 May 2022 02:12:24 -0400 Subject: [PATCH 50/62] adcom1: ptr helpers for nvol --- adcom1/start_delay_mode.go | 10 +++++----- adcom1/volume_normalization_mode.go | 13 +++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/adcom1/start_delay_mode.go b/adcom1/start_delay_mode.go index 72c52bf..4c30cad 100644 --- a/adcom1/start_delay_mode.go +++ b/adcom1/start_delay_mode.go @@ -12,14 +12,14 @@ const ( ) // Ptr returns pointer to own value. -func (p StartDelayMode) Ptr() *StartDelayMode { - return &p +func (s StartDelayMode) Ptr() *StartDelayMode { + return &s } // Val safely dereferences pointer, returning default value (StartDelayPreRoll) for nil. -func (p *StartDelayMode) Val() StartDelayMode { - if p == nil { +func (s *StartDelayMode) Val() StartDelayMode { + if s == nil { return StartDelayPreRoll } - return *p + return *s } diff --git a/adcom1/volume_normalization_mode.go b/adcom1/volume_normalization_mode.go index e3235cc..cb969b8 100644 --- a/adcom1/volume_normalization_mode.go +++ b/adcom1/volume_normalization_mode.go @@ -11,3 +11,16 @@ const ( VolumeNormLoudness VolumeNormalizationMode = 3 // Ad Loudness Normalized to Content VolumeNormCustom VolumeNormalizationMode = 4 // Custom Volume Normalization ) + +// Ptr returns pointer to own value. +func (v VolumeNormalizationMode) Ptr() *VolumeNormalizationMode { + return &v +} + +// Val safely dereferences pointer, returning default value (VolumeNormNone) for nil. +func (v *VolumeNormalizationMode) Val() VolumeNormalizationMode { + if v == nil { + return VolumeNormNone + } + return *v +} From 96cd4dbb174d3e2b4b272f3a97be5915332f016d Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Thu, 19 May 2022 02:13:44 -0400 Subject: [PATCH 51/62] openrtb2: fix comment whitespace --- openrtb2/bid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/bid.go b/openrtb2/bid.go index 2de4673..5a2ecbe 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -237,7 +237,7 @@ type Bid struct { // integer // Description: // Media rating per IQG guidelines. Refer to List: Media Ratings in - // AdCOM 1.0. + // AdCOM 1.0. QAGMediaRating adcom1.MediaRating `json:"qagmediarating,omitempty"` // Attribute: From c0ddd7985c1c33d1a5d4d229c2de6eba85842337 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Thu, 19 May 2022 02:15:42 -0400 Subject: [PATCH 52/62] openrtb2: content.prodq should be a pointer --- openrtb2/content.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/content.go b/openrtb2/content.go index 8f804dc..0234d0c 100644 --- a/openrtb2/content.go +++ b/openrtb2/content.go @@ -136,7 +136,7 @@ type Content struct { // integer // Description: // Production quality. Refer to List: Production Qualities in AdCOM 1.0. - ProdQ adcom1.ProductionQuality `json:"prodq,omitempty"` + ProdQ *adcom1.ProductionQuality `json:"prodq,omitempty"` // Attribute: // context From 09763a91ff2ee7577835911f94ca23300723a6a5 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Thu, 19 May 2022 02:18:18 -0400 Subject: [PATCH 53/62] openrtb2: device enums --- openrtb2/device.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openrtb2/device.go b/openrtb2/device.go index c6320d8..bba3113 100644 --- a/openrtb2/device.go +++ b/openrtb2/device.go @@ -256,7 +256,9 @@ type Device struct { // Description: // Network connection type. Refer to List: Connection Types in // AdCOM 1.0. - ConnectionType int8 `json:"connectiontype,omitempty"` + // Note: + // OpenRTB <=2.5 defined only connection types 1..6. + ConnectionType adcom1.ConnectionType `json:"connectiontype,omitempty"` // Attribute: // ifa From e68547865990cc6b8191d8b167231e0ee767d007 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Thu, 19 May 2022 02:21:41 -0400 Subject: [PATCH 54/62] openrtb2: geo enums --- openrtb2/geo.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openrtb2/geo.go b/openrtb2/geo.go index 7b141d6..65f02d7 100644 --- a/openrtb2/geo.go +++ b/openrtb2/geo.go @@ -1,6 +1,10 @@ package openrtb2 -import "encoding/json" +import ( + "encoding/json" + + "github.com/mxmCherry/openrtb/v16/adcom1" +) // 3.2.19 Object: Geo // @@ -36,7 +40,7 @@ type Geo struct { // Description: // Source of location data; recommended when passing // lat/lon. Refer to List: Location Types in AdCOM 1.0. - Type int8 `json:"type,omitempty"` + Type adcom1.LocationType `json:"type,omitempty"` // Attribute: // accuracy @@ -69,7 +73,7 @@ type Geo struct { // Service or provider used to determine geolocation from IP // address if applicable (i.e., type = 2). Refer to List: IP // Location Services in AdCOM 1.0. - IPService int8 `json:"ipservice,omitempty"` + IPService adcom1.IPLocationService `json:"ipservice,omitempty"` // Attribute: // country From bc3f47b576cbc8bb3b2fb4e0b8a49cde256f0006 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Thu, 19 May 2022 02:22:31 -0400 Subject: [PATCH 55/62] openrtb2: update to fixed seatbid spec id --- openrtb2/seat_bid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtb2/seat_bid.go b/openrtb2/seat_bid.go index 4bf422c..aaad621 100644 --- a/openrtb2/seat_bid.go +++ b/openrtb2/seat_bid.go @@ -2,7 +2,7 @@ package openrtb2 import "encoding/json" -// 4.3.18 Object: SeatBid +// 4.3.2 Object: SeatBid // // A bid response can contain multiple SeatBid objects, each on behalf of a different bidder seat and each containing one or more individual bids. // If multiple impressions are presented in the request, the group attribute can be used to specify if a seat is willing to accept any impressions that it can win (default) or if it is only interested in winning any if it can win them all as a group. From 77966648beafc24208eed0c0aebfc754f6f23ad1 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Thu, 19 May 2022 13:42:21 +0300 Subject: [PATCH 56/62] openrtb: extract MarkupType enum for Bid.mtype prop --- openrtb2/bid.go | 2 +- openrtb2/markup_type.go | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 openrtb2/markup_type.go diff --git a/openrtb2/bid.go b/openrtb2/bid.go index 5a2ecbe..17fd0a0 100644 --- a/openrtb2/bid.go +++ b/openrtb2/bid.go @@ -331,7 +331,7 @@ type Bid struct { // 2 = Video // 3 = Audio // 4 = Native - MType int8 `json:"mtype,omitempty"` + MType MarkupType `json:"mtype,omitempty"` // Attribute: // slotinpod diff --git a/openrtb2/markup_type.go b/openrtb2/markup_type.go new file mode 100644 index 0000000..76d7100 --- /dev/null +++ b/openrtb2/markup_type.go @@ -0,0 +1,11 @@ +package openrtb2 + +// MarkupType defines enum for creative markup type (Bid.mtype property). +type MarkupType int8 + +const ( + MarkupBanner = 1 + MarkupVideo = 2 + MarkupAudio = 3 + MarkupNative = 4 +) From 01ddfd5217cd089ffc742f3e9cc9894b34e30e01 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Thu, 19 May 2022 13:50:50 +0300 Subject: [PATCH 57/62] openrtb2: bring back Content.videoquality prop (deprecated in 2.5, rm-ed in 2.6) --- openrtb2/content.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openrtb2/content.go b/openrtb2/content.go index 0234d0c..8a99af6 100644 --- a/openrtb2/content.go +++ b/openrtb2/content.go @@ -138,6 +138,15 @@ type Content struct { // Production quality. Refer to List: Production Qualities in AdCOM 1.0. ProdQ *adcom1.ProductionQuality `json:"prodq,omitempty"` + // Attribute: + // videoquality + // Type: + // integer; DEPRECATED; REMOVED in OpenRTB 2.6 + // Description: + // Note: Deprecated in favor of prodq. + // Video quality. Refer to List 5.13. + VideoQuality *adcom1.ProductionQuality `json:"videoquality,omitempty"` + // Attribute: // context // Type: From 576d9f1aea6eb97360fc5dd13f4b92309a7c0e5b Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Thu, 19 May 2022 14:08:58 +0300 Subject: [PATCH 58/62] openrtb2: extract AdInsertion enum from Bid.ssai prop --- openrtb2/ad_insertion.go | 15 +++++++++++++++ openrtb2/imp.go | 2 +- openrtb2/markup_type.go | 13 ++++++++----- 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 openrtb2/ad_insertion.go diff --git a/openrtb2/ad_insertion.go b/openrtb2/ad_insertion.go new file mode 100644 index 0000000..6d11ebc --- /dev/null +++ b/openrtb2/ad_insertion.go @@ -0,0 +1,15 @@ +package openrtb2 + +// SSAI indicates if server-side ad insertion (e.g., stitching an ad into an +// audio or video stream) is in use and the impact of this on asset +// and tracker retrieval. +// +// Originates from Imp.ssai property, not a separately-defined enum. +type AdInsertion int8 + +const ( + AdInsertUnknown AdInsertion = 0 // status unknown + AdInsertClient AdInsertion = 1 // all client-side (i.e., not server-side) + AdInsertServerStitchClientTrack AdInsertion = 2 // assets stitched server-side but tracking pixels fired client-side + AdInsertServer AdInsertion = 3 // all server-side +) diff --git a/openrtb2/imp.go b/openrtb2/imp.go index 3b5976b..9e0f3d0 100644 --- a/openrtb2/imp.go +++ b/openrtb2/imp.go @@ -188,7 +188,7 @@ type Imp struct { // 1 = all client-side (i.e., not server-side), // 2 = assets stitched server-side but tracking pixels fired client-side, // 3 = all server-side. - SSAI int8 `json:"ssai,omitempty"` + SSAI AdInsertion `json:"ssai,omitempty"` // Attribute: // exp diff --git a/openrtb2/markup_type.go b/openrtb2/markup_type.go index 76d7100..77c89f8 100644 --- a/openrtb2/markup_type.go +++ b/openrtb2/markup_type.go @@ -1,11 +1,14 @@ package openrtb2 -// MarkupType defines enum for creative markup type (Bid.mtype property). +// MarkupType defines the type of the creative markup so that it can properly be +// associated with the right sub-object of the BidRequest.Imp. +// +// Originates from Bid.mtype property, not a separately-defined enum. type MarkupType int8 const ( - MarkupBanner = 1 - MarkupVideo = 2 - MarkupAudio = 3 - MarkupNative = 4 + MarkupBanner MarkupType = 1 + MarkupVideo MarkupType = 2 + MarkupAudio MarkupType = 3 + MarkupNative MarkupType = 4 ) From 7737be7e9b569cd7a85af8252a4742a6115aa72e Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Thu, 19 May 2022 15:02:48 +0300 Subject: [PATCH 59/62] openrtb3: update loss reason codes Mostly for enum shift (206 and higher IDs) introduced in: https://github.com/InteractiveAdvertisingBureau/openrtb/commit/5a6aac5491fc097e546c36bfb34461182542d24e > 3.0 September 2021 Clarified loss reason: Loss Reason Code 206 was renamed from Bundle to Store ID to keep the intent of this loss reason consistent across OpenRTB 2.x and 3.x. --- openrtb3/loss_reason.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/openrtb3/loss_reason.go b/openrtb3/loss_reason.go index 4d4ae3f..5ee7174 100644 --- a/openrtb3/loss_reason.go +++ b/openrtb3/loss_reason.go @@ -7,7 +7,7 @@ type LossReason int64 // LossReason options. // -// Values of 500+ are exchange specific values; should be communicated with buyers a priori. +// Values 500+ are exchange specific values; should be communicated with buyers beforehand. const ( LossWon LossReason = 0 // Bid Won LossInternalError LossReason = 1 // Internal Error @@ -31,11 +31,14 @@ const ( LossSizeNotAllowed LossReason = 203 // Creative Filtered - Size Not Allowed LossIncorrectFormat LossReason = 204 // Creative Filtered - Incorrect Creative Format LossAdvertiserExclusions LossReason = 205 // Creative Filtered - Advertiser Exclusions - LossNotSecure LossReason = 206 // Creative Filtered - Not Secure - LossLanguageExclusions LossReason = 207 // Creative Filtered - Language Exclusions - LossCategoryExclusions LossReason = 208 // Creative Filtered - Category Exclusions - LossAttributeExclusions LossReason = 209 // Creative Filtered - Creative Attribute Exclusions - LossAdTypeExclusions LossReason = 210 // Creative Filtered - Ad Type Exclusions - LossAnimationTooLong LossReason = 211 // Creative Filtered - Animation Too Long - LossNotAllowedInDeal LossReason = 212 // Creative Filtered - Not Allowed in Deal + LossAppStoreIDExclusions LossReason = 206 // Creative Filtered - App Store ID Exclusions (ex App Bundle Exclusions in OpenRTB <=2.5) + LossNotSecure LossReason = 207 // Creative Filtered - Not Secure + LossLanguageExclusions LossReason = 208 // Creative Filtered - Language Exclusions + LossCategoryExclusions LossReason = 209 // Creative Filtered - Category Exclusions + LossAttributeExclusions LossReason = 210 // Creative Filtered - Creative Attribute Exclusions + LossAdTypeExclusions LossReason = 211 // Creative Filtered - Ad Type Exclusions + LossAnimationTooLong LossReason = 212 // Creative Filtered - Animation Too Long + LossNotAllowedInDeal LossReason = 213 // Creative Filtered - Not Allowed in Deal + LossInvalidSKAdNetwork LossReason = 214 // Creative Filtered - Invalid SKAdNetwork + LossAppBundleExclusions LossReason = 215 // Creative Filtered - App Bundle Exclusions ) From adb3bd01b967491a92e5d3d5d2c42105a04a3797 Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Thu, 19 May 2022 15:25:33 +0300 Subject: [PATCH 60/62] openrtb3: update no-bid-reasons --- openrtb3/no_bid_reason.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openrtb3/no_bid_reason.go b/openrtb3/no_bid_reason.go index 64b554d..3782204 100644 --- a/openrtb3/no_bid_reason.go +++ b/openrtb3/no_bid_reason.go @@ -1,13 +1,11 @@ package openrtb3 -// NoBidReason represents OpenRTB No-Bid Reason Code enumeration. -// -// It lists the options for a bidder to signal the exchange as to why it did not offer a bid for the item. +// NoBidReason lists the options for a bidder to signal the exchange as to why it did not offer a bid for the item. type NoBidReason int64 // NoBidReason options. // -// Values of 500+ are exchange specific values; should be communicated with buyers a priori. +// Values 500+ are exchange specific values; should be communicated with buyers beforehand. const ( NoBidUnknownError NoBidReason = 0 // Unknown Error NoBidTechnicalError NoBidReason = 1 // Technical Error @@ -25,4 +23,6 @@ const ( NoBidAuthenticationUnavailable NoBidReason = 13 // Ads.cert Authentication Unavailable NoBidAuthenticationViolation NoBidReason = 14 // Ads.cert Authentication Violation NoBidInsufficientTime NoBidReason = 15 // Insufficient Auction Time + NoBidIncompleteSupplyChain NoBidReason = 16 // Incomplete SupplyChain + NoBidBlockedSupplyChainNode NoBidReason = 17 // Blocked SupplyChain Node ) From 7b1a4ea9d4a14ac2c5879cf8c8b00cae7d8b62ec Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Thu, 19 May 2022 15:45:45 +0300 Subject: [PATCH 61/62] adcom1: rename StartDelayMode -> StartDelay --- adcom1/audio_placement.go | 2 +- adcom1/start_delay.go | 25 +++++++++++++++++++++++++ adcom1/start_delay_mode.go | 25 ------------------------- adcom1/video_placement.go | 2 +- openrtb2/audio.go | 2 +- openrtb2/video.go | 2 +- 6 files changed, 29 insertions(+), 29 deletions(-) create mode 100644 adcom1/start_delay.go delete mode 100644 adcom1/start_delay_mode.go diff --git a/adcom1/audio_placement.go b/adcom1/audio_placement.go index e12e4c7..85ee02d 100644 --- a/adcom1/audio_placement.go +++ b/adcom1/audio_placement.go @@ -11,7 +11,7 @@ type AudioPlacement struct { // Definition: // Indicates the start delay in seconds for pre-roll, mid-roll, or post-roll placements. // For additional generic values, refer to List: Start Delay Modes. - Delay StartDelayMode `json:"delay,omitempty"` + Delay StartDelay `json:"delay,omitempty"` // Attribute: // skip diff --git a/adcom1/start_delay.go b/adcom1/start_delay.go new file mode 100644 index 0000000..f8d08dd --- /dev/null +++ b/adcom1/start_delay.go @@ -0,0 +1,25 @@ +package adcom1 + +// StartDelay represents video or audio start delay. +type StartDelay int64 + +// Options for the video or audio start delay. +// If the start delay value is greater than 0, then the position is mid-roll and the value indicates the start delay. +const ( + StartPreRoll StartDelay = 0 // Pre-Roll + StartMidRoll StartDelay = -1 // Generic Mid-Roll + StartPostRoll StartDelay = -2 // Generic Post-Roll +) + +// Ptr returns pointer to own value. +func (d StartDelay) Ptr() *StartDelay { + return &d +} + +// Val safely dereferences pointer, returning default value (StartDelayPreRoll) for nil. +func (d *StartDelay) Val() StartDelay { + if d == nil { + return StartPreRoll + } + return *d +} diff --git a/adcom1/start_delay_mode.go b/adcom1/start_delay_mode.go deleted file mode 100644 index 4c30cad..0000000 --- a/adcom1/start_delay_mode.go +++ /dev/null @@ -1,25 +0,0 @@ -package adcom1 - -// StartDelayMode represents video or audio start delay. -type StartDelayMode int64 - -// Options for the video or audio start delay. -// If the start delay value is greater than 0, then the position is mid-roll and the value indicates the start delay. -const ( - StartDelayPreRoll StartDelayMode = 0 // Pre-Roll - StartDelayGenericMidRoll StartDelayMode = -1 // Generic Mid-Roll - StartDelayGenericPostRoll StartDelayMode = -2 // Generic Post-Roll -) - -// Ptr returns pointer to own value. -func (s StartDelayMode) Ptr() *StartDelayMode { - return &s -} - -// Val safely dereferences pointer, returning default value (StartDelayPreRoll) for nil. -func (s *StartDelayMode) Val() StartDelayMode { - if s == nil { - return StartDelayPreRoll - } - return *s -} diff --git a/adcom1/video_placement.go b/adcom1/video_placement.go index c9d6d12..e21bea7 100644 --- a/adcom1/video_placement.go +++ b/adcom1/video_placement.go @@ -31,7 +31,7 @@ type VideoPlacement struct { // Definition: // Indicates the start delay in seconds for pre-roll, mid-roll, or post-roll placements. // For additional generic values, refer to List: Start Delay Modes. - Delay StartDelayMode `json:"delay,omitempty"` + Delay StartDelay `json:"delay,omitempty"` // Attribute: // skip diff --git a/openrtb2/audio.go b/openrtb2/audio.go index 7eaf906..ba6681c 100644 --- a/openrtb2/audio.go +++ b/openrtb2/audio.go @@ -74,7 +74,7 @@ type Audio struct { // Indicates the start delay in seconds for pre-roll, mid-roll, or // post-roll ad placements. Refer to List: Start Delay Modes in // AdCOM 1.0. - StartDelay *adcom1.StartDelayMode `json:"startdelay,omitempty"` + StartDelay *adcom1.StartDelay `json:"startdelay,omitempty"` // Attribute: // rqddurs diff --git a/openrtb2/video.go b/openrtb2/video.go index 2b98c0a..113ac67 100644 --- a/openrtb2/video.go +++ b/openrtb2/video.go @@ -55,7 +55,7 @@ type Video struct { // Indicates the start delay in seconds for pre-roll, mid-roll, or // post-roll ad placements. Refer to List: Start Delay Modes // in AdCOM 1.0. - StartDelay *adcom1.StartDelayMode `json:"startdelay,omitempty"` + StartDelay *adcom1.StartDelay `json:"startdelay,omitempty"` // Attribute: // maxseq From 185f7cb397059fdec4be058462fb8f5e3aa610bb Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Thu, 19 May 2022 15:54:31 +0300 Subject: [PATCH 62/62] adcom1: prod quality - add Unknown (0) - defined by recent AdCOM --- adcom1/production_quality.go | 1 + 1 file changed, 1 insertion(+) diff --git a/adcom1/production_quality.go b/adcom1/production_quality.go index 4be250a..565b38a 100644 --- a/adcom1/production_quality.go +++ b/adcom1/production_quality.go @@ -6,6 +6,7 @@ type ProductionQuality int8 // Options for content quality. // These values are defined by the IAB; refer to www.iab.com/wp-content/uploads/2015/03/long-form-video-final.pdf for more information. const ( + ProductionUnknown ProductionQuality = 0 // Unknown ProductionProfessional ProductionQuality = 1 // Professionally Produced ProductionProsumer ProductionQuality = 2 // Prosumer ProductionUser ProductionQuality = 3 // User Generated (UGC)