Update device and geo to openrtb 2.5

This commit is contained in:
Brian O'Kelley
2017-05-07 14:20:27 -04:00
parent caae377f7d
commit b5b1fb39df
5 changed files with 54 additions and 7 deletions
+2 -1
View File
@@ -16,7 +16,8 @@ import "github.com/prebid/openrtb"
# History
Forked on April 23, 2017 from [mxmCherry](//github.com/mxmCherry/openrtb.v3)
- Forked on April 23, 2017 from [mxmCherry](//github.com/mxmCherry/openrtb.v3)
- Updated Device, Geo to OpenRTB 2.5
# Goals
+22 -3
View File
@@ -1,6 +1,7 @@
package openrtb
// 3.2.11 Object: Device
// OpenRTB 2.5
// 3.2.18 Object: Device
//
// This object provides information pertaining to the device through which the user is interacting. Device
// information includes its hardware, platform, location, and carrier data. The device can refer to a mobile
@@ -21,7 +22,7 @@ type Device struct {
// object; recommended
// Description:
// Location of the device assumed to be the users current
// location defined by a Geo object (Section 3.2.12).
// location defined by a Geo object (Section 3.2.19).
Geo *Geo `json:"geo,omitempty"`
// Attribute:
@@ -147,6 +148,14 @@ type Device struct {
// Support for JavaScript, where 0 = no, 1 = yes.
JS int8 `json:"js,omitempty"`
// Attribute:
// geofetch
// Type:
// integer
// Description:
// Indicates if the geolocation API will be available to JavaScript code running in the banner, where 0 = no, 1 = yes.
GeoFetch int8 `json:"geofetch,omitempty"`
// Attribute:
// flashver
// Type:
@@ -172,12 +181,22 @@ type Device struct {
// to indicate high bandwidth (e.g., video friendly vs. cellular).
Carrier string `json:"carrier,omitempty"`
// Attribute:
// mccmnc
// Type:
// string
// Description:
// Mobile carrier as the concatenated MCC-MNC code (e.g., “310-005” identifies Verizon Wireless CDMA in the USA).
// Refer to https://en.wikipedia.org/wiki/Mobile_country_code for further examples. Note that the dash between
// the MCC and MNC parts is required to remove parsing ambiguity.
MCCMNC string `json:"mccmnc,omitempty"`
// Attribute:
// connectiontype
// Type:
// integer
// Description:
// Network connection type. Refer to List 5.18.
// Network connection type. Refer to List 5.22.
Connectiontype int8 `json:"connectiontype,omitempty"`
// Attribute:
+28 -1
View File
@@ -1,6 +1,6 @@
package openrtb
// 3.2.12 Object: Geo
// 3.2.19 Object: Geo
//
// This object encapsulates various methods for specifying a geographic location. When subordinate to a
// Device object, it indicates the location of the device which can also be interpreted as the users current
@@ -35,6 +35,33 @@ type Geo struct {
// lat/lon. Refer to List 5.16.
Type int8 `json:"type,omitempty"`
// Attribute:
// accuracy
// Type:
// integer
// Description:
// Estimated location accuracy in meters; recommended when lat/lon are specified
// and derived from a devices location services (i.e., type = 1). Note that this is the accuracy as
// reported from the device. Consult OS specific documentation (e.g., Android, iOS) for exact interpretation.
Accuracy int32 `json:"accuracy,omitempty"`
// Attribute:
// lastfix
// Type:
// integer
// Description:
// Number of seconds since this geolocation fix was established. Note that devices may cache location data
// across multiple fetches. Ideally, this value should be from the time the actual fix was taken.
LastFix int32 `json:"lastfix,omitempty"`
// Attribute:
// ipservice
// Type:
// integer
// Description:
// Service or provider used to determine geolocation from IP address if applicable (i.e., type = 2). Refer to List 5.23.
IPService int8 `json:"ipservice,omitempty"`
// Attribute:
// country
// Type:
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"path/filepath"
"testing"
"github.com/mxmCherry/openrtb"
"github.com/prebid/openrtb"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
+1 -1
View File
@@ -3,7 +3,7 @@ package openrtb_test
import (
"encoding/json"
"github.com/mxmCherry/openrtb"
"github.com/prebid/openrtb"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"