diff --git a/ad_position.go b/ad_position.go new file mode 100644 index 0000000..71d3d8a --- /dev/null +++ b/ad_position.go @@ -0,0 +1,20 @@ +package openrtb + +// 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 +) diff --git a/api_framework.go b/api_framework.go new file mode 100644 index 0000000..835e46d --- /dev/null +++ b/api_framework.go @@ -0,0 +1,15 @@ +package openrtb + +// 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/audio.go b/audio.go index 72b1d0f..e371e59 100644 --- a/audio.go +++ b/audio.go @@ -44,7 +44,7 @@ type Audio struct { // integer array; recommended // Description: // Array of supported audio protocols. Refer to List 5.8. - Protocols []int8 `json:"protocols,omitempty"` + Protocols []Protocol `json:"protocols,omitempty"` // Attribute: // startdelay @@ -53,7 +53,7 @@ type Audio struct { // Description: // Indicates the start delay in seconds for pre-roll, mid-roll, or // post-roll ad placements. Refer to List 5.12. - StartDelay *int64 `json:"startdelay,omitempty"` + StartDelay *StartDelay `json:"startdelay,omitempty"` // Attribute: // sequence @@ -71,7 +71,7 @@ type Audio struct { // integer array // Description: // Blocked creative attributes. Refer to List 5.3. - BAttr []int8 `json:"battr,omitempty"` + BAttr []CreativeAttribute `json:"battr,omitempty"` // Attribute: // maxextended @@ -99,10 +99,17 @@ type Audio struct { // integer // Description: // Maximum bit rate in Kbps. - // delivery integer array Supported delivery methods (e.g., streaming, progressive). If - // none specified, assume all are supported. Refer to List 5.15. MaxBitrate uint64 `json:"maxbitrate,omitempty"` + // Attribute: + // delivery + // Type: + // 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"` + // Attribute: // companionad // Type: @@ -120,7 +127,7 @@ type Audio struct { // 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 []int8 `json:"api,omitempty"` + API []APIFramework `json:"api,omitempty"` // Attribute: // companiontype @@ -130,7 +137,7 @@ type Audio struct { // Supported DAAST companion ad types. Refer to List 5.14. // Recommended if companion Banner objects are included via // the companionad array. - CompanionType []int8 `json:"companiontype,omitempty"` + CompanionType []CompanionType `json:"companiontype,omitempty"` // Attribute: // maxseq @@ -148,9 +155,7 @@ type Audio struct { // integer // Description: // Type of audio feed. Refer to List 5.16. - // stitched integer Indicates if the ad is stitched with audio content or delivered - // independently, where 0 = no, 1 = yes. - Feed int8 `json:"feed,omitempty"` + Feed FeedType `json:"feed,omitempty"` // Attribute: // stitched @@ -167,7 +172,7 @@ type Audio struct { // integer // Description: // Volume normalization mode. Refer to List 5.17. - NVol *int8 `json:"nvol,omitempty"` + NVol *VolumeNormalizationMode `json:"nvol,omitempty"` // Attribute: // ext diff --git a/banner.go b/banner.go index 3f5aa74..de8c969 100644 --- a/banner.go +++ b/banner.go @@ -84,7 +84,7 @@ type Banner struct { // integer array // Description: // Blocked banner ad types. Refer to List 5.2. - BType []int8 `json:"btype,omitempty"` + BType []BannerAdType `json:"btype,omitempty"` // Attribute: // battr @@ -92,7 +92,7 @@ type Banner struct { // integer array // Description: // Blocked creative attributes. Refer to List 5.3. - BAttr []int8 `json:"battr,omitempty"` + BAttr []CreativeAttribute `json:"battr,omitempty"` // Attribute: // pos @@ -100,7 +100,7 @@ type Banner struct { // integer // Description: // Ad position on screen. Refer to List 5.4. - Pos *int8 `json:"pos,omitempty"` + Pos *AdPosition `json:"pos,omitempty"` // Attribute: // mimes @@ -127,7 +127,7 @@ type Banner struct { // integer array // Description: // Directions in which the banner may expand. Refer to List 5.5. - ExpDir []int8 `json:"expdir,omitempty"` + ExpDir []ExpandableDirection `json:"expdir,omitempty"` // Attribute: // api @@ -137,7 +137,7 @@ type Banner struct { // 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 []int8 `json:"api,omitempty"` + API []APIFramework `json:"api,omitempty"` // Attribute: // id diff --git a/banner_ad_type.go b/banner_ad_type.go new file mode 100644 index 0000000..65b6efe --- /dev/null +++ b/banner_ad_type.go @@ -0,0 +1,13 @@ +package openrtb + +// 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/bid.go b/bid.go index 5ae80f7..50b819e 100644 --- a/bid.go +++ b/bid.go @@ -185,7 +185,7 @@ type Bid struct { // integer array // Description: // Set of attributes describing the creative. Refer to List 5.3. - Attr []int8 `json:"attr,omitempty"` + Attr []CreativeAttribute `json:"attr,omitempty"` // Attribute: // api @@ -193,7 +193,7 @@ type Bid struct { // integer // Description: // API required by the markup if applicable. Refer to List 5.6. - API int8 `json:"api,omitempty"` + API APIFramework `json:"api,omitempty"` // Attribute: // protocol @@ -202,7 +202,7 @@ type Bid struct { // Description: // Video response protocol of the markup if applicable. Refer to // List 5.8. - Protocol int8 `json:"protocol,omitempty"` + Protocol Protocol `json:"protocol,omitempty"` // Attribute: // qagmediarating @@ -210,7 +210,7 @@ type Bid struct { // integer // Description: // Creative media rating per IQG guidelines. Refer to List 5.19. - QAGMediaRating int8 `json:"qagmediarating,omitempty"` + QAGMediaRating IQGMediaRating `json:"qagmediarating,omitempty"` // Attribute: // language diff --git a/bid_response.go b/bid_response.go index 7b37e73..cf29618 100644 --- a/bid_response.go +++ b/bid_response.go @@ -62,7 +62,7 @@ type BidResponse struct { // integer // Description: // Reason for not bidding. Refer to List 5.24. - NBR *int8 `json:"nbr,omitempty"` + NBR *NoBidReasonCode `json:"nbr,omitempty"` // Attribute: // ext diff --git a/companion_type.go b/companion_type.go new file mode 100644 index 0000000..4c38e50 --- /dev/null +++ b/companion_type.go @@ -0,0 +1,14 @@ +package openrtb + +// 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/connection_type.go b/connection_type.go new file mode 100644 index 0000000..3504fe5 --- /dev/null +++ b/connection_type.go @@ -0,0 +1,16 @@ +package openrtb + +// 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 +) diff --git a/content.go b/content.go index 8b768d1..65c1b47 100644 --- a/content.go +++ b/content.go @@ -120,7 +120,7 @@ type Content struct { // integer // Description: // Production quality. Refer to List 5.13 - ProdQ *int8 `json:"prodq,omitempty"` + ProdQ *ProductionQuality `json:"prodq,omitempty"` // Attribute: // videoquality @@ -129,7 +129,7 @@ type Content struct { // Description: // Note: Deprecated in favor of prodq. // Video quality. Refer to List 5.13. - VideoQuality int8 `json:"videoquality,omitempty"` + VideoQuality *ProductionQuality `json:"videoquality,omitempty"` // Attribute: // context @@ -137,7 +137,7 @@ type Content struct { // integer // Description: // Type of content (game, video, text, etc.). Refer to List 5.18. - Context int8 `json:"context,omitempty"` + Context ContentContext `json:"context,omitempty"` // Attribute: // contentrating @@ -161,7 +161,7 @@ type Content struct { // integer // Description: // Media rating per IQG guidelines. Refer to List 5.19. - QAGMediaRating int8 `json:"qagmediarating,omitempty"` + QAGMediaRating IQGMediaRating `json:"qagmediarating,omitempty"` // Attribute: // keywords diff --git a/content_context.go b/content_context.go new file mode 100644 index 0000000..c0291f3 --- /dev/null +++ b/content_context.go @@ -0,0 +1,18 @@ +package openrtb + +// 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/content_delivery_method.go b/content_delivery_method.go new file mode 100644 index 0000000..f33bd00 --- /dev/null +++ b/content_delivery_method.go @@ -0,0 +1,12 @@ +package openrtb + +// 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/creative_attribute.go b/creative_attribute.go new file mode 100644 index 0000000..32f3908 --- /dev/null +++ b/creative_attribute.go @@ -0,0 +1,26 @@ +package openrtb + +// 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/device.go b/device.go index ddb93cf..6da0d95 100644 --- a/device.go +++ b/device.go @@ -75,7 +75,7 @@ type Device struct { // integer // Description: // The general type of device. Refer to List 5.21. - DeviceType int8 `json:"devicetype,omitempty"` + DeviceType DeviceType `json:"devicetype,omitempty"` // Attribute: // make @@ -209,7 +209,7 @@ type Device struct { // integer // Description: // Network connection type. Refer to List 5.22. - ConnectionType *int8 `json:"connectiontype,omitempty"` + ConnectionType *ConnectionType `json:"connectiontype,omitempty"` // Attribute: // ifa diff --git a/device_type.go b/device_type.go new file mode 100644 index 0000000..b710f6b --- /dev/null +++ b/device_type.go @@ -0,0 +1,22 @@ +package openrtb + +// 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/expandable_direction.go b/expandable_direction.go new file mode 100644 index 0000000..d51a28d --- /dev/null +++ b/expandable_direction.go @@ -0,0 +1,14 @@ +package openrtb + +// 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/feed_type.go b/feed_type.go new file mode 100644 index 0000000..785edab --- /dev/null +++ b/feed_type.go @@ -0,0 +1,12 @@ +package openrtb + +// 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/geo.go b/geo.go index 932340a..7068fa8 100644 --- a/geo.go +++ b/geo.go @@ -34,7 +34,7 @@ type Geo struct { // Description: // Source of location data; recommended when passing // lat/lon. Refer to List 5.20. - Type int8 `json:"type,omitempty"` + Type LocationType `json:"type,omitempty"` // Attribute: // accuracy @@ -66,7 +66,7 @@ type Geo struct { // Description: // Service or provider used to determine geolocation from IP // address if applicable (i.e., type = 2). Refer to List 5.23. - IPService int8 `json:"ipservice,omitempty"` + IPService IPLocationService `json:"ipservice,omitempty"` // Attribute: // country diff --git a/ip_location_service.go b/ip_location_service.go new file mode 100644 index 0000000..1053a00 --- /dev/null +++ b/ip_location_service.go @@ -0,0 +1,13 @@ +package openrtb + +// 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/iqg_media_rating.go b/iqg_media_rating.go new file mode 100644 index 0000000..eeeb773 --- /dev/null +++ b/iqg_media_rating.go @@ -0,0 +1,13 @@ +package openrtb + +// 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/location_type.go b/location_type.go new file mode 100644 index 0000000..ec44166 --- /dev/null +++ b/location_type.go @@ -0,0 +1,12 @@ +package openrtb + +// 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/loss_reason_code.go b/loss_reason_code.go new file mode 100644 index 0000000..ff0eff9 --- /dev/null +++ b/loss_reason_code.go @@ -0,0 +1,41 @@ +package openrtb + +// 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/native.go b/native.go index d9dc2af..7655700 100644 --- a/native.go +++ b/native.go @@ -43,7 +43,7 @@ type Native struct { // 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 []int8 `json:"api,omitempty"` + API []APIFramework `json:"api,omitempty"` // Attribute: // sequence @@ -51,7 +51,7 @@ type Native struct { // integer array // Description: // Blocked creative attributes. Refer to List 5.3. - BAttr []int8 `json:"battr,omitempty"` + BAttr []CreativeAttribute `json:"battr,omitempty"` // Attribute: // ext diff --git a/no_bid_reason_code.go b/no_bid_reason_code.go new file mode 100644 index 0000000..0aa0328 --- /dev/null +++ b/no_bid_reason_code.go @@ -0,0 +1,20 @@ +package openrtb + +// 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 +) diff --git a/playback_cessation_mode.go b/playback_cessation_mode.go new file mode 100644 index 0000000..3ef3d56 --- /dev/null +++ b/playback_cessation_mode.go @@ -0,0 +1,12 @@ +package openrtb + +// 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/playback_method.go b/playback_method.go new file mode 100644 index 0000000..87d8289 --- /dev/null +++ b/playback_method.go @@ -0,0 +1,15 @@ +package openrtb + +// 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/production_quality.go b/production_quality.go new file mode 100644 index 0000000..1dd5bce --- /dev/null +++ b/production_quality.go @@ -0,0 +1,14 @@ +package openrtb + +// 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) +) diff --git a/protocol.go b/protocol.go new file mode 100644 index 0000000..9b2860c --- /dev/null +++ b/protocol.go @@ -0,0 +1,19 @@ +package openrtb + +// 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/start_delay.go b/start_delay.go new file mode 100644 index 0000000..6a81dfc --- /dev/null +++ b/start_delay.go @@ -0,0 +1,15 @@ +package openrtb + +// 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 +) diff --git a/video.go b/video.go index 3a11347..7305cb6 100644 --- a/video.go +++ b/video.go @@ -47,7 +47,7 @@ type Video struct { // 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 []int8 `json:"protocols,omitempty"` + Protocols []Protocol `json:"protocols,omitempty"` // Attribute: // protocol @@ -58,7 +58,7 @@ type Video struct { // Supported video protocol. Refer to List 5.8. At least one // supported protocol must be specified in either the protocol // or protocols attribute. - Protocol int8 `json:"protocol,omitempty"` + Protocol Protocol `json:"protocol,omitempty"` // Attribute: // w @@ -84,7 +84,7 @@ type Video struct { // 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 *int64 `json:"startdelay,omitempty"` + StartDelay *StartDelay `json:"startdelay,omitempty"` // Attribute: // placement @@ -92,7 +92,7 @@ type Video struct { // integer // Description: // Placement type for the impression. Refer to List 5.9. - Placement int8 `json:"placement,omitempty"` + Placement VideoPlacementType `json:"placement,omitempty"` // Attribute: // linearity @@ -101,7 +101,7 @@ type Video struct { // Description: // Indicates if the impression must be linear, nonlinear, etc. If // none specified, assume all are allowed. Refer to List 5.7. - Linearity int8 `json:"linearity,omitempty"` + Linearity VideoLinearity `json:"linearity,omitempty"` // Attribute: // skip @@ -149,7 +149,7 @@ type Video struct { // integer array // Description: // Blocked creative attributes. Refer to List 5.3. - BAttr []int8 `json:"battr,omitempty"` + BAttr []CreativeAttribute `json:"battr,omitempty"` // Attribute: // maxextended @@ -199,7 +199,7 @@ type Video struct { // 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"` + PlaybackMethod []PlaybackMethod `json:"playbackmethod,omitempty"` // Attribute: // playbackend @@ -207,7 +207,7 @@ type Video struct { // integer // Description: // The event that causes playback to end. Refer to List 5.11. - PlaybackEnd int8 `json:"playbackend,omitempty"` + PlaybackEnd PlaybackCessationMode `json:"playbackend,omitempty"` // Attribute: // delivery @@ -216,7 +216,7 @@ type Video struct { // Description: // Supported delivery methods (e.g., streaming, progressive). If // none specified, assume all are supported. Refer to List 5.15. - Delivery []int8 `json:"delivery,omitempty"` + Delivery []ContentDeliveryMethod `json:"delivery,omitempty"` // Attribute: // pos @@ -224,7 +224,7 @@ type Video struct { // integer // Description: // Ad position on screen. Refer to List 5.4. - Pos *int8 `json:"pos,omitempty"` + Pos *AdPosition `json:"pos,omitempty"` // Attribute: // companionad @@ -243,7 +243,7 @@ type Video struct { // 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 []int8 `json:"api,omitempty"` + API []APIFramework `json:"api,omitempty"` // Attribute: // companiontype @@ -255,7 +255,7 @@ type Video struct { // 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 []int8 `json:"companiontype,omitempty"` + CompanionType []CompanionType `json:"companiontype,omitempty"` // Attribute: // ext diff --git a/video_linearity.go b/video_linearity.go new file mode 100644 index 0000000..9440910 --- /dev/null +++ b/video_linearity.go @@ -0,0 +1,16 @@ +package openrtb + +// 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/video_placement_type.go b/video_placement_type.go new file mode 100644 index 0000000..18e6e06 --- /dev/null +++ b/video_placement_type.go @@ -0,0 +1,14 @@ +package openrtb + +// 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/volume_normalization_mode.go b/volume_normalization_mode.go new file mode 100644 index 0000000..cbfc93b --- /dev/null +++ b/volume_normalization_mode.go @@ -0,0 +1,14 @@ +package openrtb + +// 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 +)