@@ -111,6 +111,22 @@ type Banner struct {
111111 Ext Extensions
112112}
113113
114+ // Returns topframe status, with default fallback
115+ func (b * Banner ) IsTopFrame () bool {
116+ if b .Topframe != nil {
117+ return * b .Topframe == 1
118+ }
119+ return false
120+ }
121+
122+ // Returns the position, with default fallback
123+ func (b * Banner ) Position () int {
124+ if b .Pos != nil {
125+ return * b .Pos
126+ }
127+ return AD_POS_UNKNOWN
128+ }
129+
114130// The "video" object must be included directly in the impression object if the impression offered
115131// for auction is an in-stream video ad opportunity.
116132type Video struct {
@@ -137,6 +153,30 @@ type Video struct {
137153 Ext Extensions
138154}
139155
156+ // Returns the sequence number, with default fallback
157+ func (v * Video ) Seq () int {
158+ if v .Sequence != nil {
159+ return * v .Sequence
160+ }
161+ return 1
162+ }
163+
164+ // Returns the boxing permission status, with default fallback
165+ func (v * Video ) IsBoxingAllowed () bool {
166+ if v .Boxingallowed != nil {
167+ return * v .Boxingallowed == 1
168+ }
169+ return true
170+ }
171+
172+ // Returns the position, with default fallback
173+ func (v * Video ) Position () int {
174+ if v .Pos != nil {
175+ return * v .Pos
176+ }
177+ return AD_POS_UNKNOWN
178+ }
179+
140180// A site object should be included if the ad supported content is part of a website (as opposed to
141181// an application). A bid request must not contain both a site object and an app object.
142182type Site struct {
@@ -156,6 +196,14 @@ type Site struct {
156196 Ext Extensions
157197}
158198
199+ // Returns the privacy policy status, with default fallback
200+ func (s * Site ) IsPrivacyPolicy () bool {
201+ if s .Privacypolicy != nil {
202+ return * s .Privacypolicy == 1
203+ }
204+ return false
205+ }
206+
159207// An "app" object should be included if the ad supported content is part of a mobile application
160208// (as opposed to a mobile website). A bid request must not contain both an "app" object and a
161209// "site" object.
@@ -177,6 +225,22 @@ type App struct {
177225 Ext Extensions
178226}
179227
228+ // Returns the privacy policy status, with default fallback
229+ func (a * App ) IsPrivacyPolicy () bool {
230+ if a .Privacypolicy != nil {
231+ return * a .Privacypolicy == 1
232+ }
233+ return false
234+ }
235+
236+ // Returns the paid status, with default fallback
237+ func (a * App ) IsPaid () bool {
238+ if a .Paid != nil {
239+ return * a .Paid == 1
240+ }
241+ return false
242+ }
243+
180244// This object may be useful in the situation where syndicated content contains impressions and
181245// does not necessarily match the publisher’s general content. The exchange might or might not
182246// have knowledge of the page where the content is running, as a result of the syndication
@@ -230,6 +294,38 @@ type Device struct {
230294 Ext map [string ]string
231295}
232296
297+ // Returns the DNT status, with default fallback
298+ func (d * Device ) IsDnt () bool {
299+ if d .Dnt != nil {
300+ return * d .Dnt == 1
301+ }
302+ return false
303+ }
304+
305+ // Returns the JS status, with default fallback
306+ func (d * Device ) IsJs () bool {
307+ if d .Js != nil {
308+ return * d .Js == 1
309+ }
310+ return false
311+ }
312+
313+ // Returns the connection type, with default fallback
314+ func (d * Device ) ConnectionType () int {
315+ if d .Connectiontype != nil {
316+ return * d .Connectiontype
317+ }
318+ return CONN_TYPE_UNKNOWN
319+ }
320+
321+ // Returns the connection type, with default fallback
322+ func (d * Device ) DeviceType () int {
323+ if d .Devicetype != nil {
324+ return * d .Devicetype
325+ }
326+ return DEVICE_TYPE_UNKNOWN
327+ }
328+
233329// Note that the Geo Object may appear in one or both the Device Object and the User Object.
234330// This is intentional, since the information may be derived from either a device-oriented source
235331// (such as IP geo lookup), or by user registration information (for example provided to a publisher
0 commit comments