|
| 1 | +package request |
| 2 | + |
| 3 | +import "encoding/json" |
| 4 | + |
| 5 | +type LayoutID int |
| 6 | + |
| 7 | +const ( |
| 8 | + LayoutContentWall LayoutID = 1 |
| 9 | + LayoutAppWall LayoutID = 2 |
| 10 | + LayoutNewsFeed LayoutID = 3 |
| 11 | + LayoutChatList LayoutID = 4 |
| 12 | + LayoutCarousel LayoutID = 5 |
| 13 | + LayoutContentStream LayoutID = 6 |
| 14 | + LayoutGridAdjoiningContent LayoutID = 7 |
| 15 | +) |
| 16 | + |
| 17 | +type AdUnitID int |
| 18 | + |
| 19 | +const ( |
| 20 | + AdUnitPaidSearch AdUnitID = 1 |
| 21 | + AdUnitRecommendationWidget AdUnitID = 2 |
| 22 | + AdUnitPromotedListings AdUnitID = 3 |
| 23 | + AdUnitInAdWithNativeElement AdUnitID = 4 |
| 24 | + AdUnitCustom AdUnitID = 5 |
| 25 | +) |
| 26 | + |
| 27 | +type ContextTypeID int |
| 28 | + |
| 29 | +const ( |
| 30 | + ContextTypeContent ContextTypeID = 1 // newsfeed, article, image gallery, video gallery |
| 31 | + ContextTypeSocial ContextTypeID = 2 // social network feed, email, chat |
| 32 | + ContextTypeProduct ContextTypeID = 3 // product listings, details, recommendations, reviews |
| 33 | +) |
| 34 | + |
| 35 | +type ContextSubTypeID int |
| 36 | + |
| 37 | +const ( |
| 38 | + ContextSubTypeGeneral ContextSubTypeID = 10 |
| 39 | + ContextSubTypeArticle ContextSubTypeID = 11 |
| 40 | + ContextSubTypeVideo ContextSubTypeID = 12 |
| 41 | + ContextSubTypeAudio ContextSubTypeID = 13 |
| 42 | + ContextSubTypeImage ContextSubTypeID = 14 |
| 43 | + ContextSubTypeUserGenerated ContextSubTypeID = 15 |
| 44 | + ContextSubTypeSocial ContextSubTypeID = 20 |
| 45 | + ContextSubTypeEmail ContextSubTypeID = 21 |
| 46 | + ContextSubTypeChat ContextSubTypeID = 22 |
| 47 | + ContextSubTypeSelling ContextSubTypeID = 30 |
| 48 | + ContextSubTypeAppStore ContextSubTypeID = 31 |
| 49 | + ContextSubTypeProductReviews ContextSubTypeID = 32 |
| 50 | +) |
| 51 | + |
| 52 | +type PlacementTypeID int |
| 53 | + |
| 54 | +const ( |
| 55 | + PlacementTypeInFeed PlacementTypeID = 1 // In the feed of content - for example as an item inside the organic feed/grid/listing/carousel |
| 56 | + PlacementTypeAtomic PlacementTypeID = 2 // In the atomic unit of the content - IE in the article page or single image page |
| 57 | + PlacementTypeOutside PlacementTypeID = 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 | + PlacementTypeRecommendation PlacementTypeID = 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 | + LayoutID LayoutID `json:"layout,omitempty"` // DEPRECATED The Layout ID of the native ad |
| 71 | + AdUnitID AdUnitID `json:"adunit,omitempty"` // DEPRECATED The Ad unit ID of the native ad |
| 72 | + ContextTypeID ContextTypeID `json:"context,omitempty"` // The context in which the ad appears |
| 73 | + ContextSubTypeID ContextSubTypeID `json:"contextsubtype,omitempty"` // A more detailed context in which the ad appears |
| 74 | + PlacementTypeID PlacementTypeID `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