native/request: type fixes/changes

- Asset.{Title,Img,Video,Data} now use corresponding object types (ptr)
- Data.Len is uint64 now
- Image.{W,WMin,H,HMin} are uint64 now
- removed video.linearity from native fixture
This commit is contained in:
Max Cherry
2017-11-15 00:36:34 +02:00
parent 4036b4c3f2
commit 9aac16fc8e
4 changed files with 9 additions and 10 deletions
+4 -4
View File
@@ -50,7 +50,7 @@ type Asset struct {
// Description:
// Title object for title assets.
// See TitleObject definition.
Title interface{} `json:"title,omitempty"`
Title *Title `json:"title,omitempty"`
// Field:
// img
@@ -61,7 +61,7 @@ type Asset struct {
// Description:
// Image object for image assets.
// See ImageObject definition.
Img interface{} `json:"img,omitempty"`
Img *Image `json:"img,omitempty"`
// Field:
// video
@@ -72,7 +72,7 @@ type Asset struct {
// See the Video request object definition.
// Note that in-stream (ie preroll, etc) video ads are not part of Native.
// Native ads may contain a video as the ad creative itself.
Video interface{} `json:"video,omitempty"`
Video *Video `json:"video,omitempty"`
// Field:
// data
@@ -83,7 +83,7 @@ type Asset struct {
// Description:
// Data object for brand name, description, ratings, prices etc.
// See DataObject definition.
Data interface{} `json:"data,omitempty"`
Data *Data `json:"data,omitempty"`
// Field:
// ext
+1 -1
View File
@@ -27,7 +27,7 @@ type Data struct {
// integer
// Description:
// Maximum length of the text in the elements response.
Len int64 `json:"len,omitempty"`
Len uint64 `json:"len,omitempty"`
// Field:
// ext
+4 -4
View File
@@ -26,7 +26,7 @@ type Image struct {
// integer
// Description:
// Width of the image in pixels.
W int64 `json:"w,omitempty"`
W uint64 `json:"w,omitempty"`
// Field:
// wmin
@@ -39,7 +39,7 @@ type Image struct {
// This option should be used for any rescaling of images by the client.
// Either w or wmin should be transmitted.
// If only w is included, it should be considered an exact requirement.
WMin int64 `json:"wmin,omitempty"`
WMin uint64 `json:"wmin,omitempty"`
// Field:
// h
@@ -49,7 +49,7 @@ type Image struct {
// integer
// Description:
// Height of the image in pixels.
H int64 `json:"h,omitempty"`
H uint64 `json:"h,omitempty"`
// Field:
// hmin
@@ -62,7 +62,7 @@ type Image struct {
// This option should be used for any rescaling of images by the client.
// Either h or hmin should be transmitted.
// If only h is included, it should be considered an exact requirement.
HMin int64 `json:"hmin,omitempty"`
HMin uint64 `json:"hmin,omitempty"`
// Field:
// mimes
-1
View File
@@ -8,7 +8,6 @@
{
"id": 4,
"video": {
"linearity": 1,
"minduration": 15,
"maxduration": 30,
"protocols": [