From 8c1dc3a17a393988066833373eeea78cfd446488 Mon Sep 17 00:00:00 2001 From: warmans Date: Tue, 5 May 2015 21:48:38 +0100 Subject: [PATCH 1/2] Added Regs, Pmp, Deal. Gofmt. Fix missing quote --- 2.3/rtb/rtb.go | 393 ++++++++++++++++++++++++++++++------------------- README.md | 46 +++--- 2 files changed, 266 insertions(+), 173 deletions(-) diff --git a/2.3/rtb/rtb.go b/2.3/rtb/rtb.go index 5bbf9ec..b0f1249 100644 --- a/2.3/rtb/rtb.go +++ b/2.3/rtb/rtb.go @@ -3,7 +3,6 @@ // http://openrtb.github.io/OpenRTB/ package rtb - // Gender, where “M” = male, “F” = female, “O” = known to be // other (i.e., omitted is unknown). const ( @@ -13,7 +12,6 @@ const ( UserGenderUnknown string = "" // omitted is unknown ) - // 5.16 Location Type // The following table lists the options to indicate how the geographic information was determined. const ( @@ -22,35 +20,30 @@ const ( GeoTypeUserProvided uint8 = 3 // 3 User provided (e.g., registration data) ) - // Mobile-optimized signal, where 0 = no, 1 = yes. const ( SiteMobileNo uint8 = 0 // 0 = no SiteMobileYes uint8 = 1 // 1 = yes ) - // Indicates if the site has a privacy policy, where 0 = no, 1 = yes. const ( SitePrivacyPolicyNo uint8 = 0 // 0 = no SitePrivacyPolicyYes uint8 = 1 // 1 = yes ) - // Indicates if the app has a privacy policy, where 0 = no, 1 = yes. const ( AppPrivacyPolicyNo uint8 = 0 // 0 = no AppPrivacyPolicyYes uint8 = 1 // 1 = yes ) - // 0 = not live, 1 = content is live (e.g., stream, live blog). const ( ContentLiveStreamNo uint8 = 0 // 0 = not live ContentLiveStreamYes uint8 = 1 // 1 = content is live (e.g., stream, live blog) ) - // 0 = indirect, 1 = direct. const ( ContentSourceRelationshipIndirect uint8 = 0 // 0 = indirect @@ -64,7 +57,6 @@ const ( ContentEmbeddableYes uint8 = 1 // 1 = yes ) - // Standard “Do Not Track” flag as set in the header by the // browser, where 0 = tracking is unrestricted, 1 = do not track. const ( @@ -72,7 +64,6 @@ const ( DeviceDNT uint8 = 1 // 1 = do not track ) - // “Limit Ad Tracking” signal commercially endorsed (e.g., iOS, // Android), where 0 = tracking is unrestricted, 1 = tracking must // be limited per commercial guidelines. @@ -81,24 +72,21 @@ const ( DeviceLmtLimited uint8 = 1 // 1 = tracking must be limited per commercial guidelines. ) - // Support for JavaScript, where 0 = no, 1 = yes. const ( DeviceJSNo uint8 = 0 // 0 = no DeviceJSYes uint8 = 1 // 1 = yes ) - // Placeholder for exchange-specific extensions to OpenRTB. -type Ext interface {} - +type Ext interface{} // 3.2.6 Object: Site // This object should be included if the ad supported content is a website as opposed to a non-browser // application. A bid request must not contain both a Site and an App object. At a minimum, it is useful // to provide a site ID or page URL, but this is not strictly required. type Site struct { - + // Attribute: // id // Type: @@ -106,7 +94,7 @@ type Site struct { // Description: // Exchange-specific site ID. ID string `json:"id"` - + // Attribute: // name // Type: @@ -114,7 +102,7 @@ type Site struct { // Description: // Site name (may be aliased at the publisher’s request). Name string `json:"name"` - + // Attribute: // domain // Type: @@ -122,7 +110,7 @@ type Site struct { // Description: // Domain of the site (e.g., “mysite.foo.com”). Domain string `json:"domain"` - + // Attribute: // cat // Type: @@ -130,7 +118,7 @@ type Site struct { // Description: // Array of IAB content categories of the site. Refer to List 5.1. Cat []string `json:"cat"` - + // Attribute: // sectioncat // Type: @@ -139,7 +127,7 @@ type Site struct { // Array of IAB content categories that describe the current // section of the site. Refer to List 5.1. SectionCat []string `json:"sectioncat"` - + // Attribute: // pagecat // Type: @@ -148,7 +136,7 @@ type Site struct { // Array of IAB content categories that describe the current page // or view of the site. Refer to List 5.1. PageCat []string `json:"pagecat"` - + // Attribute: // page // Type: @@ -156,7 +144,7 @@ type Site struct { // Description: // URL of the page where the impression will be shown. Page string `json:"page"` - + // Attribute: // ref // Type: @@ -164,7 +152,7 @@ type Site struct { // Description: // Referrer URL that caused navigation to the current page. Ref string `json:"ref"` - + // Attribute: // search // Type: @@ -172,7 +160,7 @@ type Site struct { // Description: // Search string that caused navigation to the current page. Search string `json:"search"` - + // Attribute: // mobile // Type: @@ -180,7 +168,7 @@ type Site struct { // Description: // Mobile-optimized signal, where 0 = no, 1 = yes. Mobile uint8 `json:"mobile"` - + // Attribute: // privacypolicy // Type: @@ -188,7 +176,7 @@ type Site struct { // Description: // Indicates if the site has a privacy policy, where 0 = no, 1 = yes. PrivacyPolicy uint8 `json:"privacypolicy"` - + // Attribute: // publisher // Type: @@ -196,7 +184,7 @@ type Site struct { // Description: // Details about the Publisher (Section 3.2.8) of the site. Publisher Publisher `json:"publisher"` - + // Attribute: // content // Type: @@ -204,7 +192,7 @@ type Site struct { // Description: // Details about the Content (Section 3.2.9) within the site. Content Content `json:"content"` - + // Attribute: // keywords // Type: @@ -212,7 +200,7 @@ type Site struct { // Description: // Comma separated list of keywords about the site. Keywords string `json:"keywords"` - + // Attribute: // ext // Type: @@ -220,16 +208,14 @@ type Site struct { // Description: // Placeholder for exchange-specific extensions to OpenRTB. Ext Ext `json:"ext"` - } - // 3.2.7 Object: App // This object should be included if the ad supported content is a non-browser application (typically in // mobile) as opposed to a website. A bid request must not contain both an App and a Site object. At a // minimum, it is useful to provide an App ID or bundle, but this is not strictly required. type App struct { - + // Attrubute: // id // Type: @@ -237,7 +223,7 @@ type App struct { // Description: // Exchange-specific app ID. ID string `json:"id"` - + // Attribute: // name // Tyoe: @@ -245,7 +231,7 @@ type App struct { // Description: // App name (may be aliased at the publisher’s request). Name string `json:"name"` - + // Attribute: // bundle // Type: @@ -254,7 +240,7 @@ type App struct { // Application bundle or package name (e.g., com.foo.mygame); // intended to be a unique ID across exchanges. Bundle string `json:"bundle"` - + // Attribute: // domain // Type: @@ -262,7 +248,7 @@ type App struct { // Description: // Domain of the app (e.g., “mygame.foo.com”). Domain string `json:"domain"` - + // Attribute: // storeurl // Type: @@ -270,7 +256,7 @@ type App struct { // Description: // App store URL for an installed app; for QAG 1.5 compliance. StoreURL string `json:"storeurl"` - + // Attribute: // cat // Type: @@ -278,7 +264,7 @@ type App struct { // Description: // Array of IAB content categories of the app. Refer to List 5.1. Cat []string `json:"cat"` - + // Attribute: // sectioncat // Type: @@ -287,7 +273,7 @@ type App struct { // Array of IAB content categories that describe the current // section of the app. Refer to List 5.1. SectionCat []string `json:"sectioncat"` - + // Attribute: // pagecat // Type: @@ -296,7 +282,7 @@ type App struct { // Array of IAB content categories that describe the current page // or view of the app. Refer to List 5.1. PageCat []string `json:"pagecat"` - + // Attribute: // ver // Type: @@ -304,7 +290,7 @@ type App struct { // Description: // Application version. Ver string `json:"ver"` - + // Attribute: // privacypolicy // Type: @@ -312,7 +298,7 @@ type App struct { // Description: // Indicates if the app has a privacy policy, where 0 = no, 1 = yes. PrivacyPolicy uint8 `json:"privacypolicy"` - + // Attribute: // paid // Type: @@ -320,7 +306,7 @@ type App struct { // Description: // 0 = app is free, 1 = the app is a paid version. Paid uint8 `json:"paid"` - + // Attribute: // publisher // Type: @@ -328,7 +314,7 @@ type App struct { // Description: // Details about the Publisher (Section 3.2.8) of the app. Publisher Publisher `json:"publisher"` - + // Attribute: // content // Type: @@ -336,7 +322,7 @@ type App struct { // Description: // Details about the Content (Section 3.2.9) within the app. Content Content `json:"content"` - + // Attribute: // keywords // Type: @@ -344,7 +330,7 @@ type App struct { // Description: // Comma separated list of keywords about the app. Keywords string `json:"keywords"` - + // Attribute: // ext // Type: @@ -352,15 +338,13 @@ type App struct { // Description: // Placeholder for exchange-specific extensions to OpenRTB. Ext Ext `json:"ext"` - } - // 3.2.8 Object: Publisher // This object describes the publisher of the media in which the ad will be displayed. The publisher is // typically the seller in an OpenRTB transaction. type Publisher struct { - + // Attribute: // id // Type: @@ -368,7 +352,7 @@ type Publisher struct { // Description: // Exchange-specific publisher ID. ID string `json:"id"` - + // Attribute: // name // Type: @@ -376,7 +360,7 @@ type Publisher struct { // Description: // Publisher name (may be aliased at the publisher’s request). Name string `json:"name"` - + // Attribute: // cat // Type: @@ -385,7 +369,7 @@ type Publisher struct { // Array of IAB content categories that describe the publisher. // Refer to List 5.1. Cat []string `json:"cat"` - + // Attribute: // domain // Type: @@ -393,7 +377,7 @@ type Publisher struct { // Description: // Highest level domain of the publisher (e.g., “publisher.com”). Domain string `json:"domain"` - + // Attribute: // ext // Type: @@ -401,10 +385,8 @@ type Publisher struct { // Description: // Placeholder for exchange-specific extensions to OpenRTB. Ext Ext `json:"ext"` - } - // 3.2.9 Object: Content // This object describes the content in which the impression will appear, which may be syndicated or nonsyndicated // content. This object may be useful when syndicated content contains impressions and does @@ -412,7 +394,7 @@ type Publisher struct { // knowledge of the page where the content is running, as a result of the syndication method. For // example might be a video impression embedded in an iframe on an unknown web property or device. type Content struct { - + // Attribute: // id // Type: @@ -420,7 +402,7 @@ type Content struct { // Description: // ID uniquely identifying the content. ID string `json:"id"` - + // Attribute: // episode // Type: @@ -428,7 +410,7 @@ type Content struct { // Description: // Episode number (typically applies to video content). Episode uint64 `json:"episode"` - + // Attribute: // title // Type: @@ -440,7 +422,7 @@ type Content struct { // Non-Video Example: “Why an Antarctic Glacier Is Melting So // Quickly” (Time magazine article). Title string `json:"title"` - + // Attribute: // series // Type: @@ -451,7 +433,7 @@ type Content struct { // or “Arby ‘N’ The Chief” (made for web). // Non-Video Example: “Ecocentric” (Time Magazine blog). Series string `json:"series"` - + // Attribute: // season // Type: @@ -459,7 +441,7 @@ type Content struct { // Description: // Content season; typically for video content (e.g., “Season 3”). Season string `json:"season"` - + // Attribute: // producer // Type: @@ -467,7 +449,7 @@ type Content struct { // Description: // Details about the content Producer (Section 3.2.10). Producer Producer `json:"producer"` - + // Attribute: // url // Type: @@ -475,7 +457,7 @@ type Content struct { // Description: // URL of the content, for buy-side contextualization or review. URL string `json:"url"` - + // Attribute: // cat // Type: @@ -484,7 +466,7 @@ type Content struct { // Array of IAB content categories that describe the content // producer. Refer to List 5.1. Cat []string `json:"cat"` - + // Attribute: // videoquality // Type: @@ -492,7 +474,7 @@ type Content struct { // Description: // Video quality per IAB’s classification. Refer to List 5.11. VideoQuality uint64 `json:"videoquality"` - + // Attribute: // context // Type: @@ -500,7 +482,7 @@ type Content struct { // Description: // Type of content (game, video, text, etc.). Refer to List 5.14. Context uint64 `json:"context"` - + // Attribute: // contentrating // Type: @@ -508,7 +490,7 @@ type Content struct { // Description: // Content rating (e.g., MPAA). ContentRating string `json:"contentrating"` - + // Attribute: // userrating // Type: @@ -516,7 +498,7 @@ type Content struct { // Description: // User rating of the content (e.g., number of stars, likes, etc.). UserRating string `json:"userrating"` - + // Attribute: // qagmediarating // Type: @@ -524,7 +506,7 @@ type Content struct { // Description: // Media rating per QAG guidelines. Refer to List 5.15. QAGMediaRating uint64 `json:"qagmediarating"` - + // Attribute: // keywords // Type: @@ -532,7 +514,7 @@ type Content struct { // Description: // Comma separated list of keywords describing the content. Keywords string `json:"keywords"` - + // Attribute: // livestream // Type: @@ -540,7 +522,7 @@ type Content struct { // Description: // 0 = not live, 1 = content is live (e.g., stream, live blog). LiveStream uint8 `json:"livestream"` - + // Attribute: // sourcerelationship // Type: @@ -548,7 +530,7 @@ type Content struct { // Description: // 0 = indirect, 1 = direct. SourceRelationship uint8 `json:"sourcerelationship"` - + // Attribute: // len // Type: @@ -556,7 +538,7 @@ type Content struct { // Description: // Length of content in seconds; appropriate for video or audio. Len uint64 `json:"len"` - + // Attribute: // language // Type: @@ -564,7 +546,7 @@ type Content struct { // Description: // Content language using ISO-639-1-alpha-2. Language string `json:"language"` - + // Attribute: // embeddable // Type: @@ -573,7 +555,7 @@ type Content struct { // Indicator of whether or not the content is embeddable (e.g., // an embeddable video player), where 0 = no, 1 = yes. Embeddable uint8 `json:"embeddable"` - + // Attribute: // ext // Type: @@ -581,16 +563,14 @@ type Content struct { // Description: // Placeholder for exchange-specific extensions to OpenRTB. Ext Ext `json:"ext"` - } - // 3.2.10 Object: Producer // This object defines the producer of the content in which the ad will be shown. This is particularly useful // when the content is syndicated and may be distributed through different publishers and thus when the // producer and publisher are not necessarily the same entity. type Producer struct { - + // Attribute: // id // Type: @@ -599,7 +579,7 @@ type Producer struct { // Content producer or originator ID. Useful if content is // syndicated and may be posted on a site using embed tags. ID string `json:"id"` - + // Attribute: // name // Type: @@ -607,7 +587,7 @@ type Producer struct { // Description: // Content producer or originator name (e.g., “Warner Bros”). Name string `json:"name"` - + // Attribute: // cat // Type: @@ -616,7 +596,7 @@ type Producer struct { // Array of IAB content categories that describe the content // producer. Refer to List 5.1. Cat []string `json:"cat"` - + // Attribute: // domain // Type: @@ -625,7 +605,7 @@ type Producer struct { // Highest level domain of the content producer (e.g., // “producer.com”). Domain string `json:"domain"` - + // Attribute: // ext // Type: @@ -633,16 +613,14 @@ type Producer struct { // Description: // Placeholder for exchange-specific extensions to OpenRTB. Ext Ext `json:"ext"` - } - // 3.2.11 Object: Device // This object provides information pertaining to the device through which the user is interacting. Device // information includes its hardware, platform, location, and carrier data. The device can refer to a mobile // handset, a desktop computer, set top box, or other digital device. type Device struct { - + // Attribute: // ua // Type: @@ -650,7 +628,7 @@ type Device struct { // Description: // Browser user agent string. UA string `json:"ua"` - + // Attribute: // geo // Type: @@ -659,7 +637,7 @@ type Device struct { // Location of the device assumed to be the user’s current // location defined by a Geo object (Section 3.2.12). Geo Geo `json:"geo"` - + // Attribute: // dnt // Type: @@ -668,7 +646,7 @@ type Device struct { // Standard “Do Not Track” flag as set in the header by the // browser, where 0 = tracking is unrestricted, 1 = do not track. DNT uint8 `json:"dnt"` - + // Attribute: // lmt // Type: @@ -678,7 +656,7 @@ type Device struct { // Android), where 0 = tracking is unrestricted, 1 = tracking must // be limited per commercial guidelines. Lmt uint8 `json:"lmt"` - + // Attribute: // ip // Type: @@ -686,7 +664,7 @@ type Device struct { // Description: // IPv4 address closest to device. IP string `json:"ip"` - + // Attribute: // ipv6 // Type: @@ -694,7 +672,7 @@ type Device struct { // Description: // IP address closest to device as IPv6. IPv6 string `json:"ipv6"` - + // Attribute: // devicetype // Type: @@ -702,7 +680,7 @@ type Device struct { // Description: // The general type of device. Refer to List 5.17. DeviceType uint64 `json:"devicetype"` - + // Attribute: // make // Type: @@ -710,7 +688,7 @@ type Device struct { // Description: // Device make (e.g., “Apple”). Make string `json:"make"` - + // Attribute: // model // Type: @@ -718,7 +696,7 @@ type Device struct { // Description: // Device model (e.g., “iPhone”). Model string `json:"model"` - + // Attribute: // os // Type: @@ -726,7 +704,7 @@ type Device struct { // Description: // Device operating system (e.g., “iOS”). OS string `json:"os"` - + // Attribute: // osv // Type: @@ -734,7 +712,7 @@ type Device struct { // Description: // Device operating system version (e.g., “3.1.2”). OSV string `json:"osv"` - + // Attribute: // hwv // Type: @@ -742,7 +720,7 @@ type Device struct { // Description: // Hardware version of the device (e.g., “5S” for iPhone 5S). HWV string `json:"hwv"` - + // Attribute: // h // Type: @@ -750,7 +728,7 @@ type Device struct { // Description: // Physical height of the screen in pixels. H uint64 `json:"h"` - + // Attribute: // w // Type: @@ -758,7 +736,7 @@ type Device struct { // Description: // Physical width of the screen in pixels. W uint64 `json:"w"` - + // Attribute: // ppi // Type: @@ -766,7 +744,7 @@ type Device struct { // Description: // Screen size as pixels per linear inch. PPI uint64 `json:"ppi"` - + // Attribute: // pxratio // Type: @@ -774,7 +752,7 @@ type Device struct { // Description: // The ratio of physical pixels to device independent pixels. PxRatio float64 `json:"pxratio"` - + // Attribute: // js // Type: @@ -782,7 +760,7 @@ type Device struct { // Description: // Support for JavaScript, where 0 = no, 1 = yes. JS uint8 `json:"js"` - + // Attribute: // flashver // Type: @@ -790,7 +768,7 @@ type Device struct { // Description: // Version of Flash supported by the browser. FlashVer string `json:"flashver"` - + // Attribute: // language // Type: @@ -798,7 +776,7 @@ type Device struct { // Description: // Browser language using ISO-639-1-alpha-2. Language string `json:"language"` - + // Attribute: // carrier // Type: @@ -808,7 +786,7 @@ type Device struct { // to indicate high bandwidth (e.g., video friendly vs. cellular). // connectiontype integer Network connection type. Refer to List 5.18. Carrier string `json:"carrier"` - + // Attribute: // ifa // Type: @@ -816,7 +794,7 @@ type Device struct { // Description: // ID sanctioned for advertiser use in the clear (i.e., not hashed). IFA string `json:"ifa"` - + // Attribute: // didsha1 // Type: @@ -824,7 +802,7 @@ type Device struct { // Description: // Hardware device ID (e.g., IMEI); hashed via SHA1. DIDSHA1 string `json:"didsha1"` - + // Attribute: // didmd5 // Type: @@ -832,7 +810,7 @@ type Device struct { // Description: // Hardware device ID (e.g., IMEI); hashed via MD5. DIDMD5 string `json:"didmd5"` - + // Attribute: // dpidsha1 // Type: @@ -840,7 +818,7 @@ type Device struct { // Description: // Platform device ID (e.g., Android ID); hashed via SHA1. DPIDSHA1 string `json:"dpidsha1"` - + // Attribute: // dpidmd5 // Type: @@ -848,7 +826,7 @@ type Device struct { // Description: // Platform device ID (e.g., Android ID); hashed via MD5. DPIDMD5 string `json:"dpidmd5"` - + // Attribute: // macsha1 // Type: @@ -856,7 +834,7 @@ type Device struct { // Description: // MAC address of the device; hashed via SHA1. MACSHA1 string `json:"macsha1"` - + // Attribute: // macmd5 // Type: @@ -864,7 +842,7 @@ type Device struct { // Description: // MAC address of the device; hashed via MD5. MACMD5 string `json:"macmd5"` - + // Attribute: // ext // Type: @@ -872,10 +850,8 @@ type Device struct { // Description: // Placeholder for exchange-specific extensions to OpenRTB. Ext Ext `json:"ext"` - } - // 3.2.12 Object: Geo // This object encapsulates various methods for specifying a geographic location. When subordinate to a // Device object, it indicates the location of the device which can also be interpreted as the user’s current @@ -884,7 +860,7 @@ type Device struct { // The lat/lon attributes should only be passed if they conform to the accuracy depicted in the type // attribute. For example, the centroid of a geographic region such as postal code should not be passed. type Geo struct { - + // Attribute: // lat // Type: @@ -892,7 +868,7 @@ type Geo struct { // Description: // Latitude from -90.0 to +90.0, where negative is south. Lat float64 `json:"lat"` - + // Attribute: // lon // Type: @@ -900,7 +876,7 @@ type Geo struct { // Description: // Longitude from -180.0 to +180.0, where negative is west. Lon float64 `json:"lon"` - + // Attribute: // type // Type: @@ -909,7 +885,7 @@ type Geo struct { // Source of location data; recommended when passing // lat/lon. Refer to List 5.16. Type uint8 `json:"type"` - + // Attribute: // country // Type: @@ -917,7 +893,7 @@ type Geo struct { // Description: // Country code using ISO-3166-1-alpha-3. Country string `json:"country"` - + // Attribute: // region // Type: @@ -925,7 +901,7 @@ type Geo struct { // Description: // Region code using ISO-3166-2; 2-letter state code if USA. Region string `json:"region"` - + // Attribute: // regionfips104 // Type: @@ -934,7 +910,7 @@ type Geo struct { // Region of a country using FIPS 10-4 notation. While OpenRTB // supports this attribute, it has been withdrawn by NIST in 2008. RegionFIPS104 string `json:"regionfips104"` - + // Attribute: // metro // Type: @@ -943,7 +919,7 @@ type Geo struct { // Google metro code; similar to but not exactly Nielsen DMAs. // See Appendix A for a link to the codes. Metro string `json:"metro"` - + // Attribute: // city // Type: @@ -952,7 +928,7 @@ type Geo struct { // City using United Nations Code for Trade & Transport // Locations. See Appendix A for a link to the codes. City string `json:"city"` - + // Attribute: // zip // Type: @@ -960,7 +936,7 @@ type Geo struct { // Description: // Zip or postal code. ZIP string `json:"zip"` - + // Attribute: // utcoffset // Type: @@ -968,7 +944,7 @@ type Geo struct { // Description: // Local time as the number +/- of minutes from UTC. UTCOffset int8 `json:"utcoffset"` - + // Attribute: // ext // Type: @@ -976,17 +952,15 @@ type Geo struct { // Description: // Placeholder for exchange-specific extensions to OpenRTB. Ext Ext `json:"ext"` - } - // 3.2.13 Object: User // This object contains information known or derived about the human user of the device (i.e., the // audience for advertising). The user id is an exchange artifact and may be subject to rotation or other // privacy policies. However, this user ID must be stable long enough to serve reasonably as the basis for // frequency capping and retargeting. type User struct { - + // Attribute: // id // Type: @@ -995,7 +969,7 @@ type User struct { // Exchange-specific ID for the user. At least one of id or // buyerid is recommended. ID string `json:"id"` - + // Attribute: // buyerid // Type: @@ -1004,15 +978,15 @@ type User struct { // Buyer-specific ID for the user as mapped by the exchange for // the buyer. At least one of buyerid or id is recommended. BuyerID string `json:"buyerid"` - + // Attribute: // yob // Type: // integer // Description: // Year of birth as a 4-digit integer. - Yob uint16 `json:"yob` - + Yob uint16 `json:"yob"` + // Attribute: // gender // Type: @@ -1021,7 +995,7 @@ type User struct { // Gender, where “M” = male, “F” = female, “O” = known to be // other (i.e., omitted is unknown). Gender string `json:"gender"` - + // Attribute: // keywords // Type: @@ -1029,7 +1003,7 @@ type User struct { // Description: // Comma separated list of keywords, interests, or intent. Keywords string `json:"keywords"` - + // Attribute: // customdata // Type: @@ -1040,7 +1014,7 @@ type User struct { // characters and be in any format. Proper JSON encoding must // be used to include “escaped” quotation marks. CustomData string `json:"customdata"` - + // Attribute: // geo // Type @@ -1049,7 +1023,7 @@ type User struct { // Location of the user’s home base defined by a Geo object // (Section 3.2.12). This is not necessarily their current location. Geo Geo `json:"geo"` - + // Attribute: // data // Type: @@ -1058,7 +1032,7 @@ type User struct { // Additional user data. Each Data object (Section 3.2.14) // represents a different data source. Data Data `json:"data"` - + // Attribute: // ext // Type: @@ -1066,17 +1040,15 @@ type User struct { // Description: // Placeholder for exchange-specific extensions to OpenRTB. Ext Ext `json:"ext"` - } - // 3.2.14 Object: Data // The data and segment objects together allow additional data about the user to be specified. This data // may be from multiple sources whether from the exchange itself or third party providers as specified by // the id field. A bid request can mix data objects from multiple providers. The specific data providers in // use should be published by the exchange a priori to its bidders. type Data struct { - + // Attribute: // id // Type: @@ -1084,7 +1056,7 @@ type Data struct { // Description: // Exchange-specific ID for the data provider. ID string `json:"id"` - + // Attribute: // name // Type: @@ -1092,7 +1064,7 @@ type Data struct { // Description: // Exchange-specific name for the data provider. Name string `json:"name"` - + // Attribute: // segment // Type: @@ -1101,7 +1073,7 @@ type Data struct { // Array of Segment (Section 3.2.15) objects that contain the // actual data values. Segment []Segment `json:"segment"` - + // Attribute: // ext // Type: @@ -1109,16 +1081,14 @@ type Data struct { // Description: // Placeholder for exchange-specific extensions to OpenRTB. Ext Ext `json:"ext"` - } - // 3.2.15 Object: Segment // Segment objects are essentially key-value pairs that convey specific units of data about the user. The // parent Data object is a collection of such values from a given data provider. The specific segment // names and value options must be published by the exchange a priori to its bidders. type Segment struct { - + // Attribute: // id // Type: @@ -1126,7 +1096,7 @@ type Segment struct { // Description: // ID of the data segment specific to the data provider. ID string `json:"id"` - + // Attribute: // name // Type: @@ -1134,7 +1104,7 @@ type Segment struct { // Description: // Name of the data segment specific to the data provider. Name string `json:"name"` - + // Attribute: // value // Type: @@ -1142,7 +1112,7 @@ type Segment struct { // Description: // String representation of the data segment value. Value string `json:"value"` - + // Attribute: // ext // Type: @@ -1150,5 +1120,128 @@ type Segment struct { // Description: // Placeholder for exchange-specific extensions to OpenRTB. Ext Ext `json:"ext"` - -} \ No newline at end of file +} + +// 3.2.16 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”). Refer to Section 7.1 for more information. +type Regs struct { + + // Attribute: + // id + // Type: + // integer + // Description: + // Flag indicating if this request is subject to the COPPA + // regulations established by the USA FTC, where 0 = no, 1 = yes. + Coppa int8 `json:"coppa"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for exchange-specific extensions to OpenRTB. + Ext Ext `json:"ext"` +} + +// 3.2.17 Object: Pmp +// This object is the private marketplace container for direct deals between buyers and sellers that may pertain +// to this impression. The actual deals are represented as a collection of Deal objects. Refer to Section 7.2 +// for more details. +type Pmp struct { + + // Attribute: + // id + // Type: + // integer + // Description: + // Indicator of auction eligibility to seats named in the Direct Deals object, where 0 = all bids are accepted, + // 1 = bids are restricted to the deals specified and the terms thereof. + PrivateAuction int8 `json:"private_auction"` + + // Attribute: + // id + // Type: + // integer + // Description: + // Array of Deal (Section 3.2.18) objects that convey the specific deals applicable to this impression. + Deals []Deal `json:"deals"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for exchange-specific extensions to OpenRTB. + Ext Ext `json:"ext"` +} + +// 3.2.18 Object: Deal +// This object constitutes a specific deal that was struck a priori between a buyer and a seller. Its presence +// with the Pmp collection indicates that this impression is available under the terms of that deal. Refer to +// Section 7.2 for more details. +type Deal struct { + + // Attribute: + // id + // Type: + // string + // Description: + // A unique identifier for the direct deal. + ID string `json:"id"` + + // Attribute: + // bidfloor + // Type: + // float + // Description: + // Minimum bid for this impression expressed in CPM. + BidFloor float64 `json:"bidfloor"` + + // Attribute: + // bidfloorcur + // Type: + // string + // Description: + // Currency specified using ISO-4217 alpha codes. This may be different from bid currency returned + // by bidder if this is allowed by the exchange. + BidFloorCur string `json:"bidfloorcur"` + + // Attribute: + // at + // Type: + // integer + // Description: + // Optional override of the overall auction type of the bid request, where 1 = First Price, + // 2 = Second Price Plus, 3 = the value passed in bidfloor is the agreed upon deal price. Additional + // auction types can be defined by the exchange. + At int8 `json:"at"` + + // Attribute: + // wseat + // Type: + // string array + // Description: + // Whitelist of buyer seats allowed to bid on this deal. Seat IDs must be + // communicated between bidders and the exchange a priori. Omission implies no seat restrictions. + WSeat []string `json:"wseat"` + + // Attribute: + // wadomain + // Type: + // string array + // Description: + // Array of advertiser domains (e.g., advertiser.com) allowed to bid on this deal. Omission implies + // no advertiser restrictions. + WADomain []string `json:"wadomain"` + + // Attribute: + // ext + // Type: + // object + // Description: + // Placeholder for exchange-specific extensions to OpenRTB. + Ext Ext `json:"ext"` +} diff --git a/README.md b/README.md index a1e0525..38344dc 100644 --- a/README.md +++ b/README.md @@ -6,29 +6,29 @@ Common OpenRTB's Object types and constants for Go programming language # Types -- [ ] 3.2 Object Specifications - - [ ] 3.2.1 Object: BidRequest - - [ ] 3.2.2 Object: Imp - - [ ] 3.2.3 Object: Banner - - [ ] 3.2.4 Object: Video - - [ ] 3.2.5 Object: Native - - [x] 3.2.6 Object: Site - - [x] 3.2.7 Object: App - - [x] 3.2.8 Object: Publisher - - [x] 3.2.9 Object: Content - - [x] 3.2.10 Object: Producer - - [x] 3.2.11 Object: Device - - [x] 3.2.12 Object: Geo - - [x] 3.2.13 Object: User - - [x] 3.2.14 Object: Data - - [x] 3.2.15 Object: Segment - - [ ] 3.2.16 Object: Regs - - [ ] 3.2.17 Object: Pmp - - [ ] 3.2.18 Object: Deal -- [ ] 4.2 Object Specifications - - [ ] 4.2.1 Object: BidResponse - - [ ] 4.2.2 Object: SeatBid - - [ ] 4.2.3 Object: Bid +- [ ] 3.2 Object Specifications + - [ ] 3.2.1 Object: BidRequest + - [ ] 3.2.2 Object: Imp + - [ ] 3.2.3 Object: Banner + - [ ] 3.2.4 Object: Video + - [ ] 3.2.5 Object: Native + - [x] 3.2.6 Object: Site + - [x] 3.2.7 Object: App + - [x] 3.2.8 Object: Publisher + - [x] 3.2.9 Object: Content + - [x] 3.2.10 Object: Producer + - [x] 3.2.11 Object: Device + - [x] 3.2.12 Object: Geo + - [x] 3.2.13 Object: User + - [x] 3.2.14 Object: Data + - [x] 3.2.15 Object: Segment + - [x] 3.2.16 Object: Regs + - [x] 3.2.17 Object: Pmp + - [x] 3.2.18 Object: Deal +- [ ] 4.2 Object Specifications + - [ ] 4.2.1 Object: BidResponse + - [ ] 4.2.2 Object: SeatBid + - [ ] 4.2.3 Object: Bid # TODO From dca62c964e1b44a910310793ed8ca1707802615a Mon Sep 17 00:00:00 2001 From: warmans Date: Tue, 5 May 2015 21:53:25 +0100 Subject: [PATCH 2/2] Tabify README --- README.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 38344dc..c0bc24f 100644 --- a/README.md +++ b/README.md @@ -7,28 +7,28 @@ Common OpenRTB's Object types and constants for Go programming language # Types - [ ] 3.2 Object Specifications - - [ ] 3.2.1 Object: BidRequest - - [ ] 3.2.2 Object: Imp - - [ ] 3.2.3 Object: Banner - - [ ] 3.2.4 Object: Video - - [ ] 3.2.5 Object: Native - - [x] 3.2.6 Object: Site - - [x] 3.2.7 Object: App - - [x] 3.2.8 Object: Publisher - - [x] 3.2.9 Object: Content - - [x] 3.2.10 Object: Producer - - [x] 3.2.11 Object: Device - - [x] 3.2.12 Object: Geo - - [x] 3.2.13 Object: User - - [x] 3.2.14 Object: Data - - [x] 3.2.15 Object: Segment - - [x] 3.2.16 Object: Regs - - [x] 3.2.17 Object: Pmp - - [x] 3.2.18 Object: Deal + - [ ] 3.2.1 Object: BidRequest + - [ ] 3.2.2 Object: Imp + - [ ] 3.2.3 Object: Banner + - [ ] 3.2.4 Object: Video + - [ ] 3.2.5 Object: Native + - [x] 3.2.6 Object: Site + - [x] 3.2.7 Object: App + - [x] 3.2.8 Object: Publisher + - [x] 3.2.9 Object: Content + - [x] 3.2.10 Object: Producer + - [x] 3.2.11 Object: Device + - [x] 3.2.12 Object: Geo + - [x] 3.2.13 Object: User + - [x] 3.2.14 Object: Data + - [x] 3.2.15 Object: Segment + - [x] 3.2.16 Object: Regs + - [x] 3.2.17 Object: Pmp + - [x] 3.2.18 Object: Deal - [ ] 4.2 Object Specifications - - [ ] 4.2.1 Object: BidResponse - - [ ] 4.2.2 Object: SeatBid - - [ ] 4.2.3 Object: Bid + - [ ] 4.2.1 Object: BidResponse + - [ ] 4.2.2 Object: SeatBid + - [ ] 4.2.3 Object: Bid # TODO