forked from prebid/openrtb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ad.go
161 lines (143 loc) · 4.92 KB
/
ad.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package adcom1
import "encoding/json"
// Ad object is the root of a structure that defines in instance of advertising media.
// It includes metadata about the ad overall and sub-objects that provide additional detail specific to the type of media comprising the creative.
type Ad struct {
// Attribute:
// id
// Type:
// string; required
// Definition:
// ID of the creative; unique at least throughout the scope of a vendor (e.g., an exchange or buying platform).
// Note that multiple instances of the same ad when used in transactions must have the same ID.
ID string `json:"id"`
// Attribute:
// adomain
// Type:
// string array; recommended
// Definition:
// Advertiser domain; top two levels only (e.g., “ford.com”).
// This can be an array for the case of rotating creatives.
ADomain []string `json:"adomain,omitempty"`
// Attribute:
// bundle
// Type:
// string array
// Definition:
// When the product of the ad is an app, the unique ID of that app as a bundle or package name (e.g., “com.foo.mygame”).
// This should NOT be an app store ID (e.g., no iTunes store IDs).
// This can be an array of for the case of rotating creatives.
Bundle []string `json:"bundle,omitempty"`
// Attribute:
// iurl
// Type:
// string
// Definition:
// URL without cache-busting to an image that is representative of the ad content for cursory level ad quality checking.
IURL string `json:"iurl,omitempty"`
// Attribute:
// cat
// Type:
// string array
// Definition:
// Array of content categories describing the ad using IDs from the taxonomy indicated in cattax.
Cat []string `json:"cat,omitempty"`
// Attribute:
// cattax
// Type:
// integer; default 2
// Definition:
// The taxonomy in use for the cat attribute.
// Refer to List: Category Taxonomies.
CatTax CategoryTaxonomy `json:"cattax,omitempty"`
// Attribute:
// lang
// Type:
// string
// Definition:
// Language of the creative using ISO-639-1-alpha-2.
// In practice, vendors using this object may elect an alternate standard (e.g., BCP-47) in which case this must be communicated a priori.
// The non-standard code “xx” may also be used if the creative has no linguistic content (e.g., a banner with just a company logo).
Lang string `json:"lang,omitempty"`
// Attribute:
// attr
// Type:
// integer array
// Definition:
// Set of attributes describing the creative.
// Refer to List: Creative Attributes.
Attr []CreativeAttribute `json:"attr,omitempty"`
// Attribute:
// secure
// Type:
// integer
// Definition:
// Flag to indicate if the creative is secure (i.e., uses HTTPS for all assets and markup), where 0 = no, 1 = yes.
// There is no default and thus if omitted, the secure state is unknown.
// However, as a practical matter, the safe assumption is to treat unknown as non-secure.
Secure int8 `json:"secure,omitempty"`
// Attribute:
// mrating
// Type:
// integer
// Definition:
// Media rating per IQG guidelines.
// Refer to List: Media Ratings.
MRating MediaRating `json:"mrating,omitempty"`
// Attribute:
// init
// Type:
// integer
// Definition:
// Timestamp of the original instantiation of this ad (i.e., this object or any of its children) in Unix format (i.e., milliseconds since the epoch).
Init int64 `json:"init,omitempty"`
// Attribute:
// lastmod
// Type:
// integer
// Definition:
// Timestamp of most recent modification to this ad (i.e., this object or any of its children other than the Audit object) in Unix format (i.e., milliseconds since the epoch).
LastMod int64 `json:"lastmod,omitempty"`
// Attribute:
// display
// Type:
// Object; required *
// Definition:
// Media Subtype Object that indicates this is a display ad and provides additional detail as such.
// Refer to Object: Display.
// * Required if no other media subtype object is specified.
Display *Display `json:"display,omitempty"`
// Attribute:
// video
// Type:
// object; required *
// Definition:
// Media Subtype Object that indicates this is a video ad and provides additional detail as such.
// Refer to Object: Video.
// * Required if no other media subtype object is specified.
Video *Video `json:"video,omitempty"`
// Attribute:
// audio
// Type:
// object; required *
// Definition:
// Media Subtype Object that indicates this is an audio ad and provides additional detail as such.
// Refer to Object: Audio.
// * Required if no other media subtype object is specified.
Audio *Audio `json:"audio,omitempty"`
// Attribute:
// audit
// Type:
// object
// Definition:
// An object depicting the audit status of the ad; typically part of a quality/safety review process.
// Refer to Object: Audit.
Audit *Audit `json:"audit,omitempty"`
// Attribute:
// ext
// Type:
// object
// Definition:
// Optional vendor-specific extensions.
Ext json.RawMessage `json:"ext,omitempty"`
}