Permalink
Browse files

Enums (except 5.1 Content Categories) + some fixes (missing attrs)

  • Loading branch information...
mxmCherry committed Oct 1, 2017
1 parent 7ef1e0d commit 5bbe78d9ffee369d7f2f5383d0ad71e4df5cdceb
View
@@ -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
)
View
@@ -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
)
View
@@ -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
View
@@ -84,23 +84,23 @@ 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
// Type:
// integer array
// Description:
// Blocked creative attributes. Refer to List 5.3.
BAttr []int8 `json:"battr,omitempty"`
BAttr []CreativeAttribute `json:"battr,omitempty"`
// Attribute:
// pos
// Type:
// 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
View
@@ -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
)
View
8 bid.go
@@ -185,15 +185,15 @@ 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
// Type:
// 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,15 +202,15 @@ 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
// Type:
// 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
View
@@ -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
View
@@ -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
)
View
@@ -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
)
View
@@ -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,15 +129,15 @@ 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
// Type:
// 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
View
@@ -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
)
View
@@ -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
)
View
@@ -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
)
View
@@ -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
View
@@ -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)
)
Oops, something went wrong.

0 comments on commit 5bbe78d

Please sign in to comment.