forked from bsm/openrtb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inventory.go
44 lines (40 loc) · 2.11 KB
/
inventory.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package openrtb
type Inventory struct {
ID string `json:"id,omitempty"` // ID on the exchange
Name string `json:"name,omitempty"`
Domain string `json:"domain,omitempty"`
Cat []string `json:"cat,omitempty"` // Array of IAB content categories
SectionCat []string `json:"sectioncat,omitempty"` // Array of IAB content categories for subsection
PageCat []string `json:"pagecat,omitempty"` // Array of IAB content categories for page
PrivacyPolicy *int `json:"pivacypolicy,omitempty"` // Default: 1 ("1": has a privacy policy)
Publisher *Publisher `json:"publisher,omitempty"` // Details about the Publisher
Content *Content `json:"content,omitempty"` // Details about the Content
Keywords string `json:"keywords,omitempty"` // Comma separated list of keywords about the site.
Ext Extension `json:"ext,omitempty"`
}
// GetPrivacyPolicy returns the privacy policy value
func (a *Inventory) GetPrivacyPolicy() int {
if a.PrivacyPolicy != nil {
return *a.PrivacyPolicy
}
return 1
}
// An "app" object should be included if the ad supported content is part of a mobile application
// (as opposed to a mobile website). A bid request must not contain both an "app" object and a
// "site" object.
type App struct {
Inventory
Bundle string `json:"bundle,omitempty"` // App bundle or package name
StoreURL string `json:"storeurl,omitempty"` // App store URL for an installed app
Ver string `json:"ver,omitempty"` // App version
Paid int `json:"paid,omitempty"` // "1": Paid, "2": Free
}
// A site object should be included if the ad supported content is part of a website (as opposed to
// an application). A bid request must not contain both a site object and an app object.
type Site struct {
Inventory
Page string `json:"page,omitempty"` // URL of the page
Ref string `json:"ref,omitempty"` // Referrer URL
Search string `json:"search,omitempty"` // Search string that caused naviation
Mobile int `json:"mobile,omitempty"` // Mobile ("1": site is mobile optimised)
}