@@ -19,6 +19,7 @@ type Link struct {
19
19
Properties Properties `json:"properties,omitempty"` // Properties associated to the linked resource.
20
20
Height uint `json:"height,omitempty"` // Height of the linked resource in pixels.
21
21
Width uint `json:"width,omitempty"` // Width of the linked resource in pixels.
22
+ Size uint `json:"size,omitempty"` // Original size of the resource in bytes.
22
23
Bitrate float64 `json:"bitrate,omitempty"` // Bitrate of the linked resource in kbps.
23
24
Duration float64 `json:"duration,omitempty"` // Length of the linked resource in seconds.
24
25
Languages Strings `json:"language,omitempty"` // Expected language of the linked resource (BCP 47 tag).
@@ -68,6 +69,7 @@ func LinkFromJSON(rawJson map[string]interface{}) (*Link, error) {
68
69
Title : parseOptString (rawJson ["title" ]),
69
70
Height : float64ToUint (parseOptFloat64 (rawJson ["height" ])),
70
71
Width : float64ToUint (parseOptFloat64 (rawJson ["width" ])),
72
+ Size : float64ToUint (parseOptFloat64 (rawJson ["size" ])),
71
73
Bitrate : float64Positive (parseOptFloat64 (rawJson ["bitrate" ])),
72
74
Duration : float64Positive (parseOptFloat64 (rawJson ["duration" ])),
73
75
}
@@ -183,6 +185,9 @@ func (l Link) MarshalJSON() ([]byte, error) {
183
185
if l .Width > 0 {
184
186
res ["width" ] = l .Width
185
187
}
188
+ if l .Size > 0 {
189
+ res ["size" ] = l .Size
190
+ }
186
191
if l .Bitrate > 0 {
187
192
res ["bitrate" ] = l .Bitrate
188
193
}
0 commit comments