-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvast2.go
153 lines (134 loc) · 5.46 KB
/
vast2.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
package vast
type VAST2 struct {
XMLName string `xml:"VAST"`
Ad []V2Ad `xml:",omitempty"`
Version string `xml:"version,attr"`
}
type V2Ad struct {
InLine *V2InLine `xml:",omitempty"`
Wrapper *V2Wrapper `xml:",omitempty"`
Id string `xml:"id,attr"`
}
// The "pointer to array" is a workaround. Without it, unmarshaling may creates an empty
// array that leads to "<Extensions></Extensions>" after marshaling.
type V2InLine struct {
AdSystem V2AdSystem
AdTitle string
Description string `xml:",omitempty"`
Survey *CDATAURI `xml:",omitempty"`
Error *CDATAURI `xml:",omitempty"`
Impression []IdURI
Creatives []V2Creative `xml:">Creative"`
Extensions *[]V2Extension `xml:">Extension,omitempty"`
}
type V2AdSystem struct {
Version string `xml:"version,attr,omitempty"`
Value string `xml:",chardata"`
}
type V2Creative struct {
Linear *V2Linear `xml:",omitempty"`
CompanionAds *[]V2Companion `xml:">Companion,omitempty"`
NonLinearAds *V2NonLinearAds `xml:",omitempty"`
Id string `xml:"id,attr,omitempty"`
Sequence *int `xml:"sequence,attr,omitempty"`
AdID string `xml:",attr,omitempty"`
}
type V2Linear struct {
Duration XsTime
TrackingEvents *[]V2Tracking `xml:">Tracking,omitempty"`
AdParameters string `xml:",omitempty"`
VideoClicks *V2VideoClicks `xml:",omitempty"`
MediaFiles *[]V2MediaFile `xml:">MediaFile,omitempty"`
}
type V2Tracking struct {
Event string `xml:"event,attr"`
Value AnyURI `xml:",cdata"`
}
type V2VideoClicks struct {
ClickThrough *IdURI `xml:",omitempty"`
ClickTracking []IdURI `xml:",omitempty"`
CustomClick []IdURI `xml:",omitempty"`
}
type V2MediaFile struct {
Id string `xml:"id,attr,omitempty"`
Delivery string `xml:"delivery,attr"`
Type string `xml:"type,attr"`
Bitrate int `xml:"bitrate,attr,omitempty"`
Width int `xml:"width,attr"`
Height int `xml:"height,attr"`
Scalable bool `xml:"scalable,attr,omitempty"`
MaintainAspectRatio bool `xml:"maintainAspectRatio,attr,omitempty"`
ApiFramework string `xml:"apiFramework,attr,omitempty"`
Value AnyURI `xml:",cdata"`
}
type V2Companion struct {
StaticResource *V2StaticResource `xml:",omitempty"`
IFrameResource *CDATAURI `xml:",omitempty"`
HTMLResource *V2HTMLResource `xml:",omitempty"`
TrackingEvents *[]V2Tracking `xml:">Tracking,omitempty"`
CompanionClickThrough *CDATAURI `xml:",omitempty"`
AltText string `xml:",omitempty"`
AdParameters string `xml:",omitempty"`
Id string `xml:"id,attr,omitempty"`
Width int `xml:"width,attr"`
Height int `xml:"height,attr"`
ExpandedWidth int `xml:"expandedWidth,attr,omitempty"`
ExpandedHeight int `xml:"expanededHeight,attr,omitempty"`
ApiFramework string `xml:"apiFramework,attr,omitempty"`
}
type V2StaticResource struct {
CreativeType string `xml:"creativeType,attr"`
Value AnyURI `xml:",cdata"`
}
type V2HTMLResource struct {
Value string `xml:",cdata"`
}
type V2NonLinearAds struct {
TrackingEvents *[]V2Tracking `xml:">Tracking,omitempty"`
NonLinear []V2NonLinear
}
type V2NonLinear struct {
StaticResource *V2StaticResource `xml:",omitempty"`
IFrameResource *CDATAURI `xml:",omitempty"`
HTMLResource *V2HTMLResource `xml:",omitempty"`
NonLinearClickThrough *CDATAURI `xml:",omitempty"`
AdParameters string `xml:",omitempty"`
Id string `xml:"id,attr,omitempty"`
Width int `xml:"width,attr"`
Height int `xml:"height,attr"`
ExpandedWidth int `xml:"expandedWidth,attr,omitempty"`
ExpandedHeight int `xml:"expanededHeight,attr,omitempty"`
Scalable bool `xml:"scalable,attr,omitempty"`
MaintainAspectRatio bool `xml:"maintainAspectRatio,attr,omitempty"`
MinSuggestedDuration *XsTime `xml:"minSuggestedDuration,attr,omitempty"`
ApiFramework string `xml:"apiFramework,attr,omitempty"`
}
type V2Extension struct {
Type string `xml:"type,attr,omitempty"`
Value []byte `xml:",innerxml"`
}
type V2Wrapper struct {
AdSystem V2AdSystem
VASTAdTagURI CDATAURI
Error *CDATAURI `xml:",omitempty"`
Impression []CDATAURI
Creatives *[]V2WrappedCreative `xml:">Creative,omitempty"`
Extensions *[]V2Extension `xml:">Extension,omitempty"`
}
type V2WrappedCreative struct {
Linear *V2WrappedLinear `xml:",omitempty"`
CompanionAds *[]V2Companion `xml:">Companion,omitempty"`
NonLinearAds *V2WrappedNonLinearAds `xml:",omitempty"`
Id string `xml:"id,attr,omitempty"`
Sequence *int `xml:"sequence,attr,omitempty"`
AdID string `xml:",omitempty"`
}
type V2WrappedLinear struct {
TrackingEvents *[]V2Tracking `xml:">Tracking,omitempty"`
VideoClicks *V2VideoClicks `xml:",omitempty"`
ClickTracking []IdURI `xml:",omitempty"`
}
type V2WrappedNonLinearAds struct {
TrackingEvents *[]V2Tracking `xml:">Tracking,omitempty"`
NonLinear []V2NonLinear `xml:",omitempty"`
}