|
| 1 | +package request |
| 2 | + |
| 3 | +import "encoding/json" |
| 4 | + |
| 5 | +type Request_Layout int |
| 6 | + |
| 7 | +const ( |
| 8 | + Request_ContentWall Request_Layout = 1 |
| 9 | + Request_AppWall Request_Layout = 2 |
| 10 | + Request_NewsFeed Request_Layout = 3 |
| 11 | + Request_ChatList Request_Layout = 4 |
| 12 | + Request_Carousel Request_Layout = 5 |
| 13 | + Request_ContentStream Request_Layout = 6 |
| 14 | + Request_GridAdjoiningContent Request_Layout = 7 |
| 15 | +) |
| 16 | + |
| 17 | +type Request_AdUnit int |
| 18 | + |
| 19 | +const ( |
| 20 | + Request_PaidSearchUnits Request_AdUnit = 1 |
| 21 | + Request_RecommendationWidgets Request_AdUnit = 2 |
| 22 | + Request_PromotedListings Request_AdUnit = 3 |
| 23 | + Request_InAdWithNativeElementUnits Request_AdUnit = 4 |
| 24 | + Request_Custom Request_AdUnit = 5 |
| 25 | +) |
| 26 | + |
| 27 | +type Request_Context int |
| 28 | + |
| 29 | +const ( |
| 30 | + Request_Content Request_Context = 1 // newsfeed, article, image gallery, video gallery |
| 31 | + Request_Social Request_Context = 2 // social network feed, email, chat |
| 32 | + Request_Product Request_Context = 3 // product listings, details, recommendations, reviews |
| 33 | +) |
| 34 | + |
| 35 | +type Request_ContextSubType int |
| 36 | + |
| 37 | +const ( |
| 38 | + Request_General Request_ContextSubType = 10 |
| 39 | + Request_Article Request_ContextSubType = 11 |
| 40 | + Request_Video Request_ContextSubType = 12 |
| 41 | + Request_Audio Request_ContextSubType = 13 |
| 42 | + Request_Image Request_ContextSubType = 14 |
| 43 | + Request_UserGenerated Request_ContextSubType = 15 |
| 44 | + Request_SubSocial Request_ContextSubType = 20 |
| 45 | + Request_Email Request_ContextSubType = 21 |
| 46 | + Request_Chat Request_ContextSubType = 22 |
| 47 | + Request_Selling Request_ContextSubType = 30 |
| 48 | + Request_AppStore Request_ContextSubType = 31 |
| 49 | + Request_ProductReviews Request_ContextSubType = 32 |
| 50 | +) |
| 51 | + |
| 52 | +type Request_PlacementType int |
| 53 | + |
| 54 | +const ( |
| 55 | + Request_InFeed Request_PlacementType = 1 // In the feed of content - for example as an item inside the organic feed/grid/listing/carousel |
| 56 | + Request_Atomic Request_PlacementType = 2 // In the atomic unit of the content - IE in the article page or single image page |
| 57 | + Request_Outside Request_PlacementType = 3 // Outside the core content - for example in the ads section on the right rail, as a banner-style placement near the content, etc. |
| 58 | + Request_Recommendation Request_PlacementType = 4 // Recommendation widget, most commonly presented below the article content |
| 59 | +) |
| 60 | + |
| 61 | +// This object represents a native type impression. Native ad units are intended to blend seamlessly into |
| 62 | +// the surrounding content (e.g., a sponsored Twitter or Facebook post). As such, the response must be |
| 63 | +// well-structured to afford the publisher fine-grained control over rendering. |
| 64 | +// The presence of a Native as a subordinate of the Imp object indicates that this impression is offered as |
| 65 | +// a native type impression. At the publisher’s discretion, that same impression may also be offered as |
| 66 | +// banner and/or video by also including as Imp subordinates the Banner and/or Video objects, |
| 67 | +// respectively. However, any given bid for the impression must conform to one of the offered types. |
| 68 | +type Request struct { |
| 69 | + Ver string `json:"ver,omitempty"` // Version of the Native Markup |
| 70 | + Layout Request_Layout `json:"layout,omitempty"` // DEPRECATED The Layout ID of the native ad |
| 71 | + AdUnit Request_AdUnit `json:"adunit,omitempty"` // DEPRECATED The Ad unit ID of the native ad |
| 72 | + Context Request_Context `json:"context,omitempty` // The context in which the ad appears |
| 73 | + ContextSubType Request_ContextSubType `json:"contextsubtype,omitempty"` // A more detailed context in which the ad appears |
| 74 | + PlacementType Request_PlacementType `json:"plcmttype,omitempty"` // The design/format/layout of the ad unit being offered |
| 75 | + PlacementCount int `json:"plcmtcnt,omitempty"` // The number of identical placements in this Layout |
| 76 | + Sequence int `json:"seq,omitempty"` // 0 for the first ad, 1 for the second ad, and so on |
| 77 | + Assets []Asset `json:"assets"` // An array of Asset Objects |
| 78 | + Ext json.RawMessage `json:"ext,omitempty"` |
| 79 | +} |
0 commit comments