twofive

package
v0.0.0-...-9c64db6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 4 Imported by: 0

README

twofive

import "github.com/timehop/nimbus-openrtb/go/request/rtb_twofive"

Overview

Index

Package files

app.go aps.go aps_custom_unmarshaller.go banner.go data.go device.go format.go geo.go imp.go primitives-to-references.go primitives.go publisher.go regs.go request.go segment.go source.go user.go video.go

Constants

const (
    Header  = "x-openrtb-version"
    Version = "2.5"

    EncodingHeader = "Content-Encoding"
    EncodingValue  = "gzip"
)

Header required in RTB requests

func FloatPointer

func FloatPointer(f float64) *float64

FloatPointer is a utility function to return a reference of a float64

func IntPointer

func IntPointer(i int) *int

IntPointer is a utility function to return a reference of a int

type APS

type APS struct {
    AmznB     []string `json:"amzn_b"     valid:"optional"`
    AmznVid   []string `json:"amzn_vid"   valid:"optional"`
    AmznH     []string `json:"amzn_h"     valid:"optional"`
    Amznp     []string `json:"amznp"      valid:"optional"`
    Amznrdr   []string `json:"amznrdr"    valid:"optional"`
    Amznslots []string `json:"amznslots"  valid:"optional"`
    Dc        []string `json:"dc"         valid:"optional"`
}

APS is the response Object the APS sdk generates

func (*APS) IsNil
func (s *APS) IsNil() bool

IsNil checks if instance is nil

func (*APS) MarshalJSONObject
func (s *APS) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*APS) NKeys
func (s *APS) NKeys() int

NKeys returns the number of keys to unmarshal

func (*APS) UnmarshalJSON
func (a *APS) UnmarshalJSON(b []byte) error

UnmarshalJSON handles mixed content from APS SDK, this silently fails so that Nimbus's auctions are uneffected if APS changes the data structures underneath

func (*APS) UnmarshalJSONObject
func (s *APS) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type APSs

type APSs []APS

APSs ...

func (APSs) IsNil
func (s APSs) IsNil() bool

IsNil ...

func (APSs) MarshalJSONArray
func (s APSs) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*APSs) UnmarshalJSONArray
func (s *APSs) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type App

type App struct {
    Name          string    `json:"name"                 valid:"required"`
    Bundle        string    `json:"bundle"               valid:"required"`
    Domain        string    `json:"domain"               valid:"required"`
    StoreURL      string    `json:"storeurl"             valid:"required"`
    Cat           []string  `json:"cat,omitempty"        valid:"optional"`
    SectionCat    []string  `json:"sectioncat,omitempty" valid:"optional"`
    PageCat       []string  `json:"pagecat,omitempty"    valid:"optional"`
    Ver           string    `json:"ver,omitempty"        valid:"optional"`
    PrivacyPolicy int       `json:"privacypolicy"        valid:"range(0|1),optional"` // no policy 0 policy 1
    Paid          int       `json:"paid"                 valid:"range(0|1),optional"` // free 0 paid 1
    Publisher     Publisher `json:"publisher"            valid:"required"`
}

App object should be included if the ad supported content is a non-browser application (typically in mobile) as opposed to a website. A bid request must not contain both an App and a Site object. At a minimum, it is useful to provide an App ID or bundle, but this is not strictly required

func (*App) IsNil
func (a *App) IsNil() bool

IsNil checks if instance is nil

func (*App) MarshalJSONObject
func (a *App) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*App) NKeys
func (a *App) NKeys() int

NKeys returns the number of keys to unmarshal

func (*App) UnmarshalJSONObject
func (a *App) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Banner

type Banner struct {
    BidFloor *float64 `json:"bidfloor,omitempty" valid:"optional"`
    BAttr    []int    `json:"battr,omitempty"    valid:"optional"`
    Format   []Format `json:"format,omitempty"   valid:"optional"`
    W        int      `json:"w"                  valid:"required"`
    H        int      `json:"h"                  valid:"required"`
    API      []int    `json:"api,omitempty"      valid:"inintarr(1|2|3|4|5|6),optional"` // 3,5,6 -> mraid1, 2, and 3
    Pos      int      `json:"pos,omitempty"      valid:"range(0|7),optional"`            // 0,1,2,3,4,5,6,7 -> Unknown, Above the Fold, DEPRECATED - May or may not be initially visible depending on screen size/resolution.,Below the Fold,Header,Footer,Sidebar,Full Screen
    Vcm      int      `json:"vcm,omitempty"      valid:"optional"`                       // Relevant only for Banner objects used with a Video object (Section 3.2.7) in an array of companion ads. Indicates the  companion banner rendering mode relative to the associated video, where 0 = concurrent, 1 = end-card.
}

Banner represents the most general type of impression. Although the term “banner” may have very specific meaning in other contexts, here it can be many things including a simple static image, an expandable ad unit, or even in-banner video (refer to the Video object in Section 3.2.4 for the more generalized and full featured video ad units). An array of Banner objects can also appear within the Video to describe optional companion ads defined in the VAST specification.

func (*Banner) IsNil
func (b *Banner) IsNil() bool

IsNil checks if instance is nil

func (*Banner) MarshalJSONObject
func (b *Banner) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Banner) NKeys
func (b *Banner) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Banner) UnmarshalJSONObject
func (b *Banner) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Banners

type Banners []Banner

Banners ...

func (Banners) IsNil
func (s Banners) IsNil() bool

IsNil ...

func (Banners) MarshalJSONArray
func (s Banners) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*Banners) UnmarshalJSONArray
func (s *Banners) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type Data

type Data struct {
    ID      string    `json:"id,omitempty"      valid:"optional"`
    Name    string    `json:"name,omitempty"    valid:"optional"`
    Segment []Segment `json:"segment,omitempty" valid:"optional"`
}

Data and Segment objects together allow additional data about the user to be specified. This data may be from multiple sources whether from the exchange itself or third party providers as specified by the id field. A bid request can mix data objects from multiple providers. The specific data providers in use should be published by the exchange a priori to its bidders.

func (*Data) IsNil
func (d *Data) IsNil() bool

IsNil checks if instance is nil

func (*Data) MarshalJSONObject
func (d *Data) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Data) NKeys
func (d *Data) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Data) UnmarshalJSONObject
func (d *Data) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Datas

type Datas []Data

Datas ...

func (Datas) IsNil
func (s Datas) IsNil() bool

IsNil ...

func (Datas) MarshalJSONArray
func (s Datas) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*Datas) UnmarshalJSONArray
func (s *Datas) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type Device

type Device struct {
    Ua             string `json:"ua"                        valid:"required"`
    Geo            *Geo   `json:"geo,omitempty"             valid:"optional"`
    Dnt            int    `json:"dnt"                       valid:"range(0|1),optional"` // 0 = tracking is unrestricted, 1 = tracking is restricted
    Lmt            int    `json:"lmt"                       valid:"range(0|1),optional"` // 0 = tracking is unrestricted, 1 = tracking must be limited by commercial guidelines
    IP             string `json:"ip"                        valid:"ipv4,optional"`
    DeviceType     int    `json:"devicetype,omitempty"      valid:"required"`
    Make           string `json:"make,omitempty"            valid:"optional"`
    Model          string `json:"model,omitempty"           valid:"optional"`
    OS             string `json:"os,omitempty"              valid:"in(android|ios),required"`
    OSV            string `json:"osv,omitempty"             valid:"optional"`
    H              int    `json:"h,omitempty"               valid:"optional"`
    W              int    `json:"w,omitempty"               valid:"optional"`
    Language       string `json:"language,omitempty"        valid:"optional"`
    Carrier        string `json:"carrier,omitempty"         valid:"optional"`
    ConnectionType int    `json:"connectiontype,omitempty"  valid:"optional"`
    Ifa            string `json:"ifa"                       valid:"required"`
}

Device 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 handset, a desktop computer, set top box, or other digital device.

func (*Device) IsNil
func (d *Device) IsNil() bool

IsNil checks if instance is nil

func (*Device) MarshalJSONObject
func (d *Device) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Device) NKeys
func (d *Device) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Device) UnmarshalJSONObject
func (d *Device) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Format

type Format struct {
    W int `json:"w"      valid:"required"`
    H int `json:"h"      valid:"required"`
}

Format object represents an allowed size (i.e., height and width combination) for a banner impression. These are typically used in an array for an impression where multiple sizes are permitted.

func (*Format) IsNil
func (f *Format) IsNil() bool

IsNil checks if instance is nil

func (*Format) MarshalJSONObject
func (f *Format) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Format) NKeys
func (f *Format) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Format) UnmarshalJSONObject
func (f *Format) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Formats

type Formats []Format

Formats ...

func (Formats) IsNil
func (s Formats) IsNil() bool

IsNil ...

func (Formats) MarshalJSONArray
func (s Formats) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*Formats) UnmarshalJSONArray
func (s *Formats) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type Geo

type Geo struct {
    Lat       float64 `json:"lat,omitempty"       valid:"required"`
    Lon       float64 `json:"lon,omitempty"       valid:"required"`
    Type      int     `json:"type,omitempty"      valid:"range(1|3),optional"`    // 1,2,3 -> GPS/Location Services, IP Address, User provided (e.g., registration data)
    IPService int     `json:"ipservice,omitempty" valid:"range(1|4),optional"`    // 1,2,3,4 -> ip2location, Neustar (Quova), MaxMind, NetAcuity (Digital Element)
    Country   string  `json:"country,omitempty"   valid:"ISO3166Alpha3,optional"` // alpha 3
    City      string  `json:"city,omitempty"      valid:"optional"`
    Metro     string  `json:"metro,omitempty"     valid:"optional"`
    State     string  `json:"state,omitempty"     valid:"optional"`
}

Geo 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 user’s current location. When subordinate to a User object, it indicates the location of the user’s home base (i.e., not necessarily their current location).

func (*Geo) IsNil
func (g *Geo) IsNil() bool

IsNil checks if instance is nil

func (*Geo) MarshalJSONObject
func (g *Geo) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Geo) NKeys
func (g *Geo) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Geo) UnmarshalJSONObject
func (g *Geo) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Imp

type Imp struct {
    ID       string  `json:"id,omitempty"                   valid:"optional"`
    Banner   *Banner `json:"banner,omitempty"               valid:"optional"`
    Video    *Video  `json:"video,omitempty"                valid:"optional"`
    Instl    int     `json:"instl"                          valid:"range(0|1),optional"` // 0 = not interstitial, 1 = interstitial
    BidFloor float64 `json:"bidfloor"                       valid:"optional"`
    Secure   *int    `json:"secure"                         valid:"range(0|1),optional"`
    Ext      *ImpExt `json:"ext,omitempty"                  valid:"optional"`
}

Imp describes an ad placement or impression being auctioned. A single bid request can include multiple Imp objects, a use case for which might be an exchange that supports selling all ad positions on a given page. Each Imp object has a required ID so that bids can reference them individually.

func (*Imp) IsNil
func (i *Imp) IsNil() bool

IsNil checks if instance is nil

func (*Imp) MarshalJSONObject
func (i *Imp) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Imp) NKeys
func (i *Imp) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Imp) UnmarshalJSONObject
func (i *Imp) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type ImpExt

type ImpExt struct {
    APS           []APS  `json:"aps,omitempty"             valid:"optional"`
    FacebookAppID string `json:"facebook_app_id,omitempty" valid:"optional"` // needed for pubs that have FB hybrid SDK solution in thier stack
    Position      string `json:"position,omitempty"        valid:"required"` // flexible optional field for publishers to track on ad position performance
}

ImpExt ...

func (*ImpExt) IsNil
func (e *ImpExt) IsNil() bool

IsNil checks if instance is nil

func (*ImpExt) MarshalJSONObject
func (e *ImpExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*ImpExt) NKeys
func (e *ImpExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*ImpExt) UnmarshalJSONObject
func (e *ImpExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Imps

type Imps []Imp

Imps ...

func (Imps) IsNil
func (s Imps) IsNil() bool

IsNil ...

func (Imps) MarshalJSONArray
func (s Imps) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*Imps) UnmarshalJSONArray
func (s *Imps) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type Ints

type Ints []int

Ints ...

func (Ints) IsNil
func (a Ints) IsNil() bool

IsNil checks if array is nil

func (Ints) MarshalJSONArray
func (a Ints) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray encodes arrays into JSON

func (*Ints) UnmarshalJSONArray
func (a *Ints) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray decodes JSON array elements into slice

type Publisher

type Publisher struct {
    Name   string   `json:"name"          valid:"required"`
    Cat    []string `json:"cat,omitempty" valid:"optional"`
    Domain string   `json:"domain"        valid:"required"`
}

Publisher object describes the publisher of the media in which the ad will be displayed. The publisher is typically the seller in an OpenRTB transaction.

func (*Publisher) IsNil
func (p *Publisher) IsNil() bool

IsNil checks if instance is nil

func (*Publisher) MarshalJSONObject
func (p *Publisher) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Publisher) NKeys
func (p *Publisher) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Publisher) UnmarshalJSONObject
func (p *Publisher) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Regs

type Regs struct {
    Coppa int      `json:"coppa" valid:"range(0|1),optional"`
    Ext   *RegsExt `json:"ext"   valid:"optional"`
}

Regs object contains any legal, governmental, or industry regulations that apply to the request. The coppa flag signals whether or not the request falls under the United States Federal Trade Commission’s regulations for the United States Children’s Online Privacy Protection Act (“COPPA”).

func (*Regs) IsNil
func (r *Regs) IsNil() bool

IsNil checks if instance is nil

func (*Regs) MarshalJSONObject
func (r *Regs) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Regs) NKeys
func (r *Regs) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Regs) UnmarshalJSONObject
func (r *Regs) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type RegsExt

type RegsExt struct {
    GDPR      int    `json:"gdpr" valid:"range(0|1),optional"`
    USPrivacy string `json:"us_privacy,omitempty" valid:"optional"`
    GPP       string `json:"gpp,omitempty" valid:"optional"`
	GPPSIDs   string `json:"gpp_sid,omitempty" valid:"optional"`
}

RegsExt being used for GDPR, CCPA as US Privacy, and any regulations via the Global Privacy Platform (GPP) string. The relevant regulations are specified within the GPP string and GPP Section ID (SID) list. GPPSIDs is a comma-separated list of GPP Section IDs.

func (*RegsExt) IsNil
func (e *RegsExt) IsNil() bool

IsNil checks if instance is nil

func (*RegsExt) MarshalJSONObject
func (e *RegsExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*RegsExt) NKeys
func (e *RegsExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*RegsExt) UnmarshalJSONObject
func (e *RegsExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Request

type Request struct {
    Imp    []Imp      `json:"imp"               valid:"required"`
    App    App        `json:"app"               valid:"required"`
    Device Device     `json:"device"            valid:"required"`
    Format *Format    `json:"format"            valid:"required"` // this is not part of the spec, adding this here for convience allows h and width to be passed without the video/banner object to backwards support the GET
    User   User       `json:"user,omitempty"    valid:"optional"`
    Test   int        `json:"test,omitempty"    valid:"range(0|1),optional"`
    WSeat  []string   `json:"wseat,omitempty"   valid:"optional"`
    BSeat  []string   `json:"bseat,omitempty"   valid:"optional"`
    Wlang  []string   `json:"wlang,omitempty"   valid:"optional"`
    Bcat   []string   `json:"bcat,omitempty"    valid:"optional"`
    BAdv   []string   `json:"badv,omitempty"    valid:"optional"`
    BApp   []string   `json:"bapp,omitempty"    valid:"optional"`
    Source Source     `json:"source,omitempty"  valid:"optional"`
    Regs   Regs       `json:"regs,omitempty"    valid:"optional"`
    Ext    RequestExt `json:"ext,omitempty"     valid:"required"`
}

Request openRTB 2.5 spec

func (*Request) IsNil
func (r *Request) IsNil() bool

IsNil checks if instance is nil

func (*Request) MarshalJSONObject
func (r *Request) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Request) NKeys
func (r *Request) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Request) UnmarshalJSONObject
func (r *Request) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type RequestExt

type RequestExt struct {
    APIKey    string `json:"api_key,omitempty"     valid:"uuidv4,required"`
    SessionID string `json:"session_id,omitempty"  valid:"required"`
}

RequestExt used to communicate the publishers api key to nimbus

func (*RequestExt) IsNil
func (e *RequestExt) IsNil() bool

IsNil checks if instance is nil

func (*RequestExt) MarshalJSONObject
func (e *RequestExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*RequestExt) NKeys
func (e *RequestExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*RequestExt) UnmarshalJSONObject
func (e *RequestExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Segment

type Segment struct {
    ID    string `json:"id,omitempty"    valid:"optional"`
    Name  string `json:"name,omitempty"  valid:"optional"`
    Value string `json:"value,omitempty" valid:"optional"`
}

Segment objects are essentially key-value pairs that convey specific units of data about the user. The parent Data object is a collection of such values from a given data provider. The specific segment names and value options must be published by the exchange a priori to its bidders.

func (*Segment) IsNil
func (s *Segment) IsNil() bool

IsNil checks if instance is nil

func (*Segment) MarshalJSONObject
func (s *Segment) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Segment) NKeys
func (s *Segment) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Segment) UnmarshalJSONObject
func (s *Segment) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Segments

type Segments []Segment

Segments ...

func (Segments) IsNil
func (s Segments) IsNil() bool

IsNil ...

func (Segments) MarshalJSONArray
func (s Segments) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*Segments) UnmarshalJSONArray
func (s *Segments) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type Source

type Source struct {
    Ext SourceExt `json:"ext,omitempty"    valid:"optional"`
}

Source describes the nature and behavior of the entity that is the source of the bid request upstream from the exchange. The primary purpose of this object is to define post-auction or upstream decisioning when the exchange itself does not control the final decision. A common example of this is header bidding, but it can also apply to upstream server entities such as another RTB exchange, a mediation platform, or an ad server combines direct campaigns with 3rd party demand in decisioning.

func (*Source) IsNil
func (s *Source) IsNil() bool

IsNil checks if instance is nil

func (*Source) MarshalJSONObject
func (s *Source) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Source) NKeys
func (s *Source) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Source) UnmarshalJSONObject
func (s *Source) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type SourceExt

type SourceExt struct {
    Omidpn string `json:"omidpn,omitempty" valid:"optional"` // identifier of the OM SDK integration, this is the same as the "name" parameter of the OMID Partner object
    Omidpv string `json:"omidpv,omitempty" valid:"optional"` // (optional) Version of the OM SDK version
}

SourceExt also for OM SDK extensions to be passed to demand

func (*SourceExt) IsNil
func (s *SourceExt) IsNil() bool

IsNil checks if instance is nil

func (*SourceExt) MarshalJSONObject
func (s *SourceExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*SourceExt) NKeys
func (s *SourceExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*SourceExt) UnmarshalJSONObject
func (s *SourceExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Strings

type Strings []string

Strings ...

func (Strings) IsNil
func (a Strings) IsNil() bool

IsNil checks if array is nil

func (Strings) MarshalJSONArray
func (a Strings) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray encodes arrays into JSON

func (*Strings) UnmarshalJSONArray
func (a *Strings) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray decodes JSON array elements into slice

type User

type User struct {
    Age        int      `json:"age,omitempty"         valid:"optional"`
    BuyerUID   string   `json:"buyeruid,omitempty"    valid:"optional"`
    YOB        int      `json:"yob,omitempty"         valid:"optional"`
    Gender     string   `json:"gender,omitempty"      valid:"in(male|female),optional"`
    Keywords   string   `json:"keywords,omitempty"    valid:"optional"`
    CustomData string   `json:"custom_data,omitempty" valid:"optional"`
    Data       []Data   `json:"data,omitempty"        valid:"optional"`
    Ext        *UserExt `json:"ext"                   valid:"optional"`
}

User object contains information known or derived about the human user of the device (i.e., the audience for advertising). The user id is an exchange artifact and may be subject to rotation or other privacy policies. However, this user ID must be stable long enough to serve reasonably as the basis for frequency capping and retargeting.

func (*User) IsNil
func (u *User) IsNil() bool

IsNil checks if instance is nil

func (*User) MarshalJSONObject
func (u *User) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*User) NKeys
func (u *User) NKeys() int

NKeys returns the number of keys to unmarshal

func (*User) UnmarshalJSONObject
func (u *User) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type UserExt

type UserExt struct {
    Consent    string `json:"consent,omitempty"     valid:"base64rawstring,optional"` // if a publisher has their own cpm they can supply thier own GDPR consent string
    DidConsent int    `json:"did_consent,omitempty" valid:"range(0|1),optional"`      // Allows a publisher to let Nimbus know thier user has consent to thier data use policy for ads
}

UserExt being used for GDPR

func (*UserExt) IsNil
func (e *UserExt) IsNil() bool

IsNil checks if instance is nil

func (*UserExt) MarshalJSONObject
func (e *UserExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*UserExt) NKeys
func (e *UserExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*UserExt) UnmarshalJSONObject
func (e *UserExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Video

type Video struct {
    BidFloor       *float64 `json:"bidfloor,omitempty"       valid:"optional"`
    CompanionAd    []Banner `json:"companionad,omitempty"    valid:"optional"`
    CompanionType  []int    `json:"companiontype,omitempty"  valid:"optional"` //1, 2, 3 -> Static Resource, HTM Resource, iframe Resource
    Mimes          []string `json:"mimes,omitempty"          valid:"optional"`
    Minduration    int      `json:"minduration"              valid:"optional"`
    Maxduration    int      `json:"maxduration,omitempty"    valid:"optional"`
    Protocols      []int    `json:"protocols,omitempty"      valid:"inintarr(2|3|5|6),optional"` // 1,2,3,4,5,6,7,8,9,10 -> VAST 1.0,VAST 2.0,VAST 3.0,VAST 1.0 Wrapper,VAST 2.0 Wrapper,VAST 3.0 Wrapper,VAST 4.0,VAST 4.0 Wrapper,DAAST 1.0,DAAST 1.0 Wrapper
    W              int      `json:"w,omitempty"              valid:"required"`
    H              int      `json:"h,omitempty"              valid:"required"`
    StartDelay     int      `json:"startdelay"               valid:"optional"`
    Placement      int      `json:"placement,omitempty"      valid:"range(1|5),optional"`            // 1,2,3,4,5 -> In-Stream, In-Banner, In-Article, In-Feed - Found in content, social, or product feeds, Interstitial/Slider/Floating
    Linearity      int      `json:"linearity,omitempty"      valid:"range(1|2),optional"`            // 1,2 -> linear, non linear
    Playbackmethod []int    `json:"playbackmethod,omitempty" valid:"inintarr(1|2|3|4|5|6),optional"` // 1,2,3,4,5,6 - > Initiates on Page Load with Sound On, Initiates on Page Load with Sound Off by Default, Initiates on Click with Sound On, Initiates on Mouse-Over with Sound On, Initiates on Entering Viewport with Sound On, Initiates on Entering Viewport with Sound Off by Default
    Skip           int      `json:"skip"                     valid:"range(0|1),optional"`            // 0 no 1 yes
    Delivery       []int    `json:"delivery,omitempty"       valid:"range(0|3),optional"`            // 0,1,2,3 -> Unknown, Professionally Produced, Prosumer, User Generated (UGC)
    Pos            int      `json:"pos,omitempty"            valid:"range(0|7),optional"`            // 0,1,2,3,4,5,6,7 -> Unknown,Above the Fold,DEPRECATED - May or may not be initially visible depending on screen size/resolution.,Below the Fold,Header,Footer,Sidebar,Full Screen
    API            []int    `json:"api,omitempty"            valid:"inintarr(1|2|3|4|5|6),optional"`
    MinBitRate     int      `json:"minbitrate,omitempty"     valid:"optional"`
    MaxBitRate     int      `json:"maxbitrate,omitempty"     valid:"optional"`
}

Video object represents an in-stream video impression. Many of the fields are non-essential for minimally viable transactions, but are included to offer fine control when needed. Video in OpenRTB generally assumes compliance with the VAST standard. As such, the notion of companion ads is supported by optionally including an array of Banner objects (refer to the Banner object in Section 3.2.3) that define these companion ads.

func (*Video) IsNil
func (v *Video) IsNil() bool

IsNil checks if instance is nil

func (*Video) MarshalJSONObject
func (v *Video) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Video) NKeys
func (v *Video) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Video) UnmarshalJSONObject
func (v *Video) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject


Generated by godoc2md

Documentation

Index

Constants

View Source
const (
	VideoLandscapeAppInstall46Seconds FacebookTestAdType = "VID_HD_16_9_46S_APP_INSTALL"
	VideoLandscapeLink46Seconds                          = "VID_HD_16_9_46S_LINK"
	VideoLandscapeAppInstall15Seconds                    = "VID_HD_16_9_15S_APP_INSTALL"
	VideoLandscapeLink15Seconds                          = "VID_HD_16_9_15S_LINK"
	VideoPortraitAppInstall39Seconds                     = "VID_HD_9_16_39S_APP_INSTALL"
	VideoPortraitLink39Seconds                           = "VID_HD_9_16_39S_LINK"
	ImageLandscapeAppInstall                             = "IMG_16_9_APP_INSTALL"
	ImageLandscapeLink                                   = "IMG_16_9_LINK"
	CarouselImageAppInstall                              = "CAROUSEL_IMG_SQUARE_APP_INSTALL"
	CarouselImageLink                                    = "CAROUSEL_IMG_SQUARE_LINK"
)

below are constants that can used to change the ad demo type in the Facebook response for more information on the details of each demo type and requirements see the Facebook documentation in the below link https://developers.facebook.com/docs/audience-network/overview/in-house-mediation/server-to-server/testing

View Source
const (
	Header  = "x-openrtb-version"
	Version = "2.5"

	EncodingHeader = "Content-Encoding"
	EncodingValue  = "gzip"
)

Header required in RTB requests

Variables

This section is empty.

Functions

func FloatPointer

func FloatPointer(f float64) *float64

FloatPointer is a utility function to return a reference of a float64

func IntPointer

func IntPointer(i int) *int

IntPointer is a utility function to return a reference of a int

Types

type APS

type APS struct {
	AmznB     []string `json:"amzn_b"     valid:"optional"`
	AmznVid   []string `json:"amzn_vid"   valid:"optional"`
	AmznH     []string `json:"amzn_h"     valid:"optional"`
	Amznp     []string `json:"amznp"      valid:"optional"`
	Amznrdr   []string `json:"amznrdr"    valid:"optional"`
	Amznslots []string `json:"amznslots"  valid:"optional"`
	Dc        []string `json:"dc"         valid:"optional"`
}

APS is the response Object the APS sdk generates

func (*APS) IsNil

func (s *APS) IsNil() bool

IsNil checks if instance is nil

func (*APS) MarshalJSONObject

func (s *APS) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*APS) NKeys

func (s *APS) NKeys() int

NKeys returns the number of keys to unmarshal

func (*APS) UnmarshalJSON

func (a *APS) UnmarshalJSON(b []byte) error

UnmarshalJSON handles mixed content from APS SDK, this silently fails so that Nimbus's auctions are uneffected if APS changes the data structures underneath

func (*APS) UnmarshalJSONObject

func (s *APS) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type APSs

type APSs []APS

APSs ...

func (APSs) IsNil

func (s APSs) IsNil() bool

IsNil ...

func (APSs) MarshalJSONArray

func (s APSs) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*APSs) UnmarshalJSONArray

func (s *APSs) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type App

type App struct {
	Name          string    `json:"name"                 valid:"required"`
	Bundle        string    `json:"bundle"               valid:"required"`
	Domain        string    `json:"domain"               valid:"required"`
	StoreURL      string    `json:"storeurl"             valid:"required"`
	Cat           []string  `json:"cat,omitempty"        valid:"optional"`
	SectionCat    []string  `json:"sectioncat,omitempty" valid:"optional"`
	PageCat       []string  `json:"pagecat,omitempty"    valid:"optional"`
	Ver           string    `json:"ver,omitempty"        valid:"optional"`
	PrivacyPolicy int       `json:"privacypolicy"        valid:"range(0|1),optional"` // no policy 0 policy 1
	Paid          int       `json:"paid"                 valid:"range(0|1),optional"` // free 0 paid 1
	Publisher     Publisher `json:"publisher"            valid:"required"`
}

App object should be included if the ad supported content is a non-browser application (typically in mobile) as opposed to a website. A bid request must not contain both an App and a Site object. At a minimum, it is useful to provide an App ID or bundle, but this is not strictly required

func (*App) IsNil

func (a *App) IsNil() bool

IsNil checks if instance is nil

func (*App) MarshalJSONObject

func (a *App) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*App) NKeys

func (a *App) NKeys() int

NKeys returns the number of keys to unmarshal

func (*App) UnmarshalJSONObject

func (a *App) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Banner struct {
	BidFloor *float64 `json:"bidfloor,omitempty" valid:"optional"`
	BAttr    []int    `json:"battr,omitempty"    valid:"optional"`
	Format   []Format `json:"format,omitempty"   valid:"optional"`
	W        int      `json:"w"                  valid:"required"`
	H        int      `json:"h"                  valid:"required"`
	API      []int    `json:"api,omitempty"      valid:"inintarr(1|2|3|4|5|6|7),optional"` // 3,5,6 -> mraid1, 2, and 3
	Pos      int      `json:"pos,omitempty"      valid:"range(0|7),optional"`              // 0,1,2,3,4,5,6,7 -> Unknown, Above the Fold, DEPRECATED - May or may not be initially visible depending on screen size/resolution.,Below the Fold,Header,Footer,Sidebar,Full Screen
	Vcm      int      `json:"vcm,omitempty"      valid:"optional"`                         // Relevant only for Banner objects used with a Video object (Section 3.2.7) in an array of companion ads. Indicates the  companion banner rendering mode relative to the associated video, where 0 = concurrent, 1 = end-card.
}

Banner represents the most general type of impression. Although the term “banner” may have very specific meaning in other contexts, here it can be many things including a simple static image, an expandable ad unit, or even in-banner video (refer to the Video object in Section 3.2.4 for the more generalized and full featured video ad units). An array of Banner objects can also appear within the Video to describe optional companion ads defined in the VAST specification.

func (*Banner) IsNil

func (b *Banner) IsNil() bool

IsNil checks if instance is nil

func (*Banner) MarshalJSONObject

func (b *Banner) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Banner) NKeys

func (b *Banner) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Banner) UnmarshalJSONObject

func (b *Banner) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Banners

type Banners []Banner

Banners ...

func (Banners) IsNil

func (s Banners) IsNil() bool

IsNil ...

func (Banners) MarshalJSONArray

func (s Banners) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*Banners) UnmarshalJSONArray

func (s *Banners) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type Data

type Data struct {
	ID      string    `json:"id,omitempty"      valid:"optional"`
	Name    string    `json:"name,omitempty"    valid:"optional"`
	Segment []Segment `json:"segment,omitempty" valid:"optional"`
}

Data and Segment objects together allow additional data about the user to be specified. This data may be from multiple sources whether from the exchange itself or third party providers as specified by the id field. A bid request can mix data objects from multiple providers. The specific data providers in use should be published by the exchange a priori to its bidders.

func (*Data) IsNil

func (d *Data) IsNil() bool

IsNil checks if instance is nil

func (*Data) MarshalJSONObject

func (d *Data) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Data) NKeys

func (d *Data) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Data) UnmarshalJSONObject

func (d *Data) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Datas

type Datas []Data

Datas ...

func (Datas) IsNil

func (s Datas) IsNil() bool

IsNil ...

func (Datas) MarshalJSONArray

func (s Datas) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*Datas) UnmarshalJSONArray

func (s *Datas) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type Device

type Device struct {
	Ua             string     `json:"ua"                        valid:"required"`
	Geo            *Geo       `json:"geo,omitempty"             valid:"optional"`
	Dnt            int        `json:"dnt"                       valid:"range(0|1),optional"` // 0 = tracking is unrestricted, 1 = tracking is restricted
	Lmt            int        `json:"lmt"                       valid:"range(0|1),optional"` // 0 = tracking is unrestricted, 1 = tracking must be limited by commercial guidelines
	IP             string     `json:"ip"                        valid:"ipv4,optional"`
	DeviceType     int        `json:"devicetype,omitempty"      valid:"required"`
	Make           string     `json:"make,omitempty"            valid:"optional"`
	Model          string     `json:"model,omitempty"           valid:"optional"`
	HWV            string     `json:"hwv,omitempty"             valid:"optional"`
	OS             string     `json:"os,omitempty"              valid:"in(android|ios),required"`
	OSV            string     `json:"osv,omitempty"             valid:"optional"`
	H              int        `json:"h,omitempty"               valid:"optional"`
	W              int        `json:"w,omitempty"               valid:"optional"`
	Language       string     `json:"language,omitempty"        valid:"optional"`
	Carrier        string     `json:"carrier,omitempty"         valid:"optional"`
	ConnectionType int        `json:"connectiontype,omitempty"  valid:"optional"`
	Ifa            string     `json:"ifa"                       valid:"required"`
	Ext            *DeviceExt `json:"ext,omitempty"             valid:"optional"`
}

Device 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 handset, a desktop computer, set top box, or other digital device.

func (*Device) IsNil

func (d *Device) IsNil() bool

IsNil checks if instance is nil

func (*Device) MarshalJSONObject

func (d *Device) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Device) NKeys

func (d *Device) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Device) UnmarshalJSONObject

func (d *Device) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type DeviceExt

type DeviceExt struct {
	Atts int    `json:"atts" valid:"optional"`
	Ifv  string `json:"ifv"  valid:"optional"`
}

DeviceExt adds extended in IAB support SKAdNetwork. If the IDFA is not available, DSPs require an alternative, limited-scope identifier in order to provide basic frequency capping functionality to advertisers. The IDFV is the same for apps from the same vendor but different across vendors. Please refer to Apple's Guidelines for further information about when it can be accessed and used. DSPs may also want to understand what is the status of a user on iOS 14+. The atts field will pass the AppTrackingTransparency Framework's authorization status.

func (*DeviceExt) IsNil

func (d *DeviceExt) IsNil() bool

IsNil checks if instance is nil

func (*DeviceExt) MarshalJSONObject

func (d *DeviceExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*DeviceExt) NKeys

func (d *DeviceExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*DeviceExt) UnmarshalJSONObject

func (d *DeviceExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type EID

type EID struct {
	Source string `json:"source"`
	UIDS   UIDS   `json:"uids"`
}

EID is a higher level wrapper for vendor identifiers

func (*EID) IsNil

func (e *EID) IsNil() bool

IsNil checks if instance is nil

func (*EID) MarshalJSONObject

func (e *EID) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*EID) NKeys

func (e *EID) NKeys() int

NKeys returns the number of keys to unmarshal, by returning 0 we are saying to return all keys for marshalling

func (*EID) UnmarshalJSONObject

func (e *EID) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type EIDS

type EIDS []EID

EIDS defines a slice of EID

func (EIDS) IsNil

func (e EIDS) IsNil() bool

IsNil checks if instance is nil

func (EIDS) MarshalJSONArray

func (e EIDS) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*EIDS) UnmarshalJSONArray

func (e *EIDS) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray implements gojay's array Unmarshaler

type FacebookTestAdType

type FacebookTestAdType string

type Format

type Format struct {
	W int `json:"w"      valid:"required"`
	H int `json:"h"      valid:"required"`
}

Format object represents an allowed size (i.e., height and width combination) for a banner impression. These are typically used in an array for an impression where multiple sizes are permitted.

func (*Format) IsNil

func (f *Format) IsNil() bool

IsNil checks if instance is nil

func (*Format) MarshalJSONObject

func (f *Format) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Format) NKeys

func (f *Format) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Format) UnmarshalJSONObject

func (f *Format) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Formats

type Formats []Format

Formats ...

func (Formats) IsNil

func (s Formats) IsNil() bool

IsNil ...

func (Formats) MarshalJSONArray

func (s Formats) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*Formats) UnmarshalJSONArray

func (s *Formats) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type Geo

type Geo struct {
	Lat       float64 `json:"lat,omitempty"       valid:"required"`
	Lon       float64 `json:"lon,omitempty"       valid:"required"`
	Type      int     `json:"type,omitempty"      valid:"range(1|3),optional"`    // 1,2,3 -> GPS/Location Services, IP Address, User provided (e.g., registration data)
	IPService int     `json:"ipservice,omitempty" valid:"range(1|4),optional"`    // 1,2,3,4 -> ip2location, Neustar (Quova), MaxMind, NetAcuity (Digital Element)
	Country   string  `json:"country,omitempty"   valid:"ISO3166Alpha3,optional"` // alpha 3
	City      string  `json:"city,omitempty"      valid:"optional"`
	Metro     string  `json:"metro,omitempty"     valid:"optional"`
	State     string  `json:"state,omitempty"     valid:"optional"`
}

Geo 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 user’s current location. When subordinate to a User object, it indicates the location of the user’s home base (i.e., not necessarily their current location).

func (*Geo) IsNil

func (g *Geo) IsNil() bool

IsNil checks if instance is nil

func (*Geo) MarshalJSONObject

func (g *Geo) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Geo) NKeys

func (g *Geo) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Geo) UnmarshalJSONObject

func (g *Geo) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type IdentityExt

type IdentityExt struct {
	RTIPartner string `json:"rtiPartner"`
}

func (*IdentityExt) IsNil

func (i *IdentityExt) IsNil() bool

IsNil checks if instance is nil

func (*IdentityExt) MarshalJSONObject

func (i *IdentityExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*IdentityExt) NKeys

func (i *IdentityExt) NKeys() int

NKeys returns the number of keys to unmarshal, by returning 0 we are saying to return all keys for marshalling

func (*IdentityExt) UnmarshalJSONObject

func (i *IdentityExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Imp

type Imp struct {
	ID       string  `json:"id,omitempty"                   valid:"optional"`
	Banner   *Banner `json:"banner,omitempty"               valid:"optional"`
	Video    *Video  `json:"video,omitempty"                valid:"optional"`
	Native   *Native `json:"native,omitempty"               valid:"optional"`
	Instl    int     `json:"instl"                          valid:"range(0|1),optional"` // 0 = not interstitial, 1 = interstitial
	BidFloor float64 `json:"bidfloor"                       valid:"optional"`
	Secure   *int    `json:"secure"                         valid:"range(0|1),optional"`
	Ext      *ImpExt `json:"ext,omitempty"                  valid:"optional"`
}

Imp describes an ad placement or impression being auctioned. A single bid request can include multiple Imp objects, a use case for which might be an exchange that supports selling all ad positions on a given page. Each Imp object has a required ID so that bids can reference them individually.

func (*Imp) IsNil

func (i *Imp) IsNil() bool

IsNil checks if instance is nil

func (*Imp) MarshalJSONObject

func (i *Imp) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Imp) NKeys

func (i *Imp) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Imp) UnmarshalJSONObject

func (i *Imp) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type ImpExt

type ImpExt struct {
	APS                []APS              `json:"aps,omitempty"                   valid:"optional"`
	FacebookAppID      string             `json:"facebook_app_id,omitempty"       valid:"optional"`
	FacebookTestAdType FacebookTestAdType `json:"facebook_test_ad_type,omitempty" valid:"optional"` // used of facebook test ads are to be returned https://developers.facebook.com/docs/audience-network/overview/in-house-mediation/server-to-server/testing
	Position           string             `json:"position,omitempty"              valid:"required"` // flexible optional field for publishers to track on ad position performance
	Skadn              *Skadn             `json:"skadn"                           valid:"optional"`
}

ImpExt ...

func (*ImpExt) IsNil

func (e *ImpExt) IsNil() bool

IsNil checks if instance is nil

func (*ImpExt) MarshalJSONObject

func (e *ImpExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*ImpExt) NKeys

func (e *ImpExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*ImpExt) UnmarshalJSONObject

func (e *ImpExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Imps

type Imps []Imp

Imps ...

func (Imps) IsNil

func (s Imps) IsNil() bool

IsNil ...

func (Imps) MarshalJSONArray

func (s Imps) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*Imps) UnmarshalJSONArray

func (s *Imps) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type Ints

type Ints []int

Ints ...

func (Ints) IsNil

func (a Ints) IsNil() bool

IsNil checks if array is nil

func (Ints) MarshalJSONArray

func (a Ints) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray encodes arrays into JSON

func (*Ints) UnmarshalJSONArray

func (a *Ints) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray decodes JSON array elements into slice

type Native

type Native struct {
	ID       string   `json:"id,omitempty"       valid:"optional"`
	BidFloor *float64 `json:"bidfloor,omitempty" valid:"optional"`
	Request  string   `json:"request,omitempty"  valid:"required"`
	Ver      string   `json:"ver,omitempty"      valid:"optional"`
	API      []int    `json:"api,omitempty"      valid:"optional"`
	Battr    []int    `json:"battr,omitempty"    valid:"optional"`
}

Native object represents a native type impression. Native ad units are intended to blend seamlessly into the surrounding content (e.g., a sponsored Twitter or Facebook post). As such, the response must be well-structured to afford the publisher fine-grained control over rendering.

func (*Native) IsNil

func (n *Native) IsNil() bool

IsNil checks if instance is nil

func (*Native) MarshalJSONObject

func (n *Native) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Native) NKeys

func (n *Native) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Native) UnmarshalJSONObject

func (n *Native) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Publisher

type Publisher struct {
	Name   string   `json:"name"          valid:"required"`
	Cat    []string `json:"cat,omitempty" valid:"optional"`
	Domain string   `json:"domain"        valid:"required"`
}

Publisher object describes the publisher of the media in which the ad will be displayed. The publisher is typically the seller in an OpenRTB transaction.

func (*Publisher) IsNil

func (p *Publisher) IsNil() bool

IsNil checks if instance is nil

func (*Publisher) MarshalJSONObject

func (p *Publisher) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Publisher) NKeys

func (p *Publisher) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Publisher) UnmarshalJSONObject

func (p *Publisher) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Regs

type Regs struct {
	Coppa int      `json:"coppa" valid:"range(0|1),optional"`
	Ext   *RegsExt `json:"ext"   valid:"optional"`
}

Regs object contains any legal, governmental, or industry regulations that apply to the request. The coppa flag signals whether or not the request falls under the United States Federal Trade Commission’s regulations for the United States Children’s Online Privacy Protection Act (“COPPA”).

func (*Regs) IsNil

func (r *Regs) IsNil() bool

IsNil checks if instance is nil

func (*Regs) MarshalJSONObject

func (r *Regs) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Regs) NKeys

func (r *Regs) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Regs) UnmarshalJSONObject

func (r *Regs) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type RegsExt

type RegsExt struct {
	GDPR      int    `json:"gdpr" valid:"range(0|1),optional"`
	USPrivacy string `json:"us_privacy,omitempty" valid:"optional"`
	GPP       string `json:"gpp,omitempty" valid:"optional"`
	GPPSIDs   string `json:"gpp_sid,omitempty" valid:"optional"`
}

RegsExt being used for GDPR, CCPA as US Privacy, and any regulations via the Global Privacy Platform (GPP) string. The relevant regulations are specified within the GPP string and GPP Section ID (SID) list. GPPSIDs is a comma-separated list of GPP Section IDs.

func (*RegsExt) IsNil

func (e *RegsExt) IsNil() bool

IsNil checks if instance is nil

func (*RegsExt) MarshalJSONObject

func (e *RegsExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*RegsExt) NKeys

func (e *RegsExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*RegsExt) UnmarshalJSONObject

func (e *RegsExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Request

type Request struct {
	Imp    []Imp      `json:"imp"               valid:"required"`
	App    App        `json:"app"               valid:"required"`
	Device Device     `json:"device"            valid:"required"`
	Format *Format    `json:"format"            valid:"required"` // this is not part of the spec, adding this here for convience allows h and width to be passed without the video/banner object to backwards support the GET
	User   User       `json:"user,omitempty"    valid:"optional"`
	Test   int        `json:"test,omitempty"    valid:"range(0|1),optional"`
	WSeat  []string   `json:"wseat,omitempty"   valid:"optional"`
	BSeat  []string   `json:"bseat,omitempty"   valid:"optional"`
	Wlang  []string   `json:"wlang,omitempty"   valid:"optional"`
	Bcat   []string   `json:"bcat,omitempty"    valid:"optional"`
	BAdv   []string   `json:"badv,omitempty"    valid:"optional"`
	BApp   []string   `json:"bapp,omitempty"    valid:"optional"`
	Source *Source    `json:"source,omitempty"  valid:"optional"`
	Regs   Regs       `json:"regs,omitempty"    valid:"optional"`
	Ext    RequestExt `json:"ext,omitempty"     valid:"required"`
}

Request openRTB 2.5 spec

func (*Request) IsNil

func (r *Request) IsNil() bool

IsNil checks if instance is nil

func (*Request) MarshalJSONObject

func (r *Request) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Request) NKeys

func (r *Request) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Request) UnmarshalJSONObject

func (r *Request) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type RequestExt

type RequestExt struct {
	APIKey    string `json:"api_key,omitempty"     valid:"uuidv4,required"`
	SessionID string `json:"session_id,omitempty"  valid:"required"`
}

RequestExt used to communicate the publishers api key to nimbus

func (*RequestExt) IsNil

func (e *RequestExt) IsNil() bool

IsNil checks if instance is nil

func (*RequestExt) MarshalJSONObject

func (e *RequestExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*RequestExt) NKeys

func (e *RequestExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*RequestExt) UnmarshalJSONObject

func (e *RequestExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Segment

type Segment struct {
	ID    string `json:"id,omitempty"    valid:"optional"`
	Name  string `json:"name,omitempty"  valid:"optional"`
	Value string `json:"value,omitempty" valid:"optional"`
}

Segment objects are essentially key-value pairs that convey specific units of data about the user. The parent Data object is a collection of such values from a given data provider. The specific segment names and value options must be published by the exchange a priori to its bidders.

func (*Segment) IsNil

func (s *Segment) IsNil() bool

IsNil checks if instance is nil

func (*Segment) MarshalJSONObject

func (s *Segment) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Segment) NKeys

func (s *Segment) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Segment) UnmarshalJSONObject

func (s *Segment) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Segments

type Segments []Segment

Segments ...

func (Segments) IsNil

func (s Segments) IsNil() bool

IsNil ...

func (Segments) MarshalJSONArray

func (s Segments) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*Segments) UnmarshalJSONArray

func (s *Segments) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray ...

type Skadn

type Skadn struct {
	Version    string   `json:"version,omitempty"    valid:"optional"` // Version of skadnetwork supported. Always "2.0" or higher. Dependent on both the OS version and the SDK version.
	SourceApp  string   `json:"sourceapp,omitempty"  valid:"required"` // ID of publisher app in Apple’s App Store. Should match app.bundle in OpenRTB 2.x and app.storeid in AdCOM 1.x
	Skadnetids []string `json:"skadnetids,omitempty" valid:"optional"` // 	A subset of SKAdNetworkItem entries in the publisher app’s Info.plist that are relevant to the DSP. Recommended that this list not exceed 20.
}

Skadn is used for direct SSP to DSP connections where a DSP wants to only consume their own relevant SKAdNetwork IDs. Object should only be present if both the SSP SDK version and the OS version (iOS 14.0+) support SKAdNetwork.

func (*Skadn) IsNil

func (s *Skadn) IsNil() bool

IsNil checks if instance is nil

func (*Skadn) MarshalJSONObject

func (s *Skadn) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Skadn) NKeys

func (s *Skadn) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Skadn) UnmarshalJSONObject

func (s *Skadn) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Source

type Source struct {
	Ext SourceExt `json:"ext,omitempty"    valid:"optional"`
}

Source describes the nature and behavior of the entity that is the source of the bid request upstream from the exchange. The primary purpose of this object is to define post-auction or upstream decisioning when the exchange itself does not control the final decision. A common example of this is header bidding, but it can also apply to upstream server entities such as another RTB exchange, a mediation platform, or an ad server combines direct campaigns with 3rd party demand in decisioning.

func (*Source) IsNil

func (s *Source) IsNil() bool

IsNil checks if instance is nil

func (*Source) MarshalJSONObject

func (s *Source) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Source) NKeys

func (s *Source) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Source) UnmarshalJSONObject

func (s *Source) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type SourceExt

type SourceExt struct {
	Omidpn string `json:"omidpn,omitempty" valid:"optional"` // identifier of the OM SDK integration, this is the same as the "name" parameter of the OMID Partner object
	Omidpv string `json:"omidpv,omitempty" valid:"optional"` // (optional) Version of the OM SDK version
}

SourceExt also for OM SDK extensions to be passed to demand

func (*SourceExt) IsNil

func (s *SourceExt) IsNil() bool

IsNil checks if instance is nil

func (*SourceExt) MarshalJSONObject

func (s *SourceExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*SourceExt) NKeys

func (s *SourceExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*SourceExt) UnmarshalJSONObject

func (s *SourceExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Strings

type Strings []string

Strings ...

func (Strings) IsNil

func (a Strings) IsNil() bool

IsNil checks if array is nil

func (Strings) MarshalJSONArray

func (a Strings) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray encodes arrays into JSON

func (*Strings) UnmarshalJSONArray

func (a *Strings) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray decodes JSON array elements into slice

type UID

type UID struct {
	ID  string       `json:"id"`
	Ext *IdentityExt `json:"ext"`
}

UID defines metadata for vendors

func (*UID) IsNil

func (u *UID) IsNil() bool

IsNil checks if instance is nil

func (*UID) MarshalJSONObject

func (u *UID) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*UID) NKeys

func (u *UID) NKeys() int

NKeys returns the number of keys to unmarshal, by returning 0 we are saying to return all keys for marshalling

func (*UID) UnmarshalJSONObject

func (u *UID) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type UIDS

type UIDS []UID

UIDS defines a slice of UID

func (UIDS) IsNil

func (u UIDS) IsNil() bool

IsNil provides on abstraction to determine if the object is empty

func (UIDS) MarshalJSONArray

func (u UIDS) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

func (*UIDS) UnmarshalJSONArray

func (u *UIDS) UnmarshalJSONArray(dec *gojay.Decoder) error

UnmarshalJSONArray implements gojay's array Unmarshaler

type User

type User struct {
	Age        int      `json:"age,omitempty"         valid:"optional"`
	BuyerUID   string   `json:"buyeruid,omitempty"    valid:"optional"`
	YOB        int      `json:"yob,omitempty"         valid:"optional"`
	Gender     string   `json:"gender,omitempty"      valid:"in(male|female),optional"`
	Keywords   string   `json:"keywords,omitempty"    valid:"optional"`
	CustomData string   `json:"custom_data,omitempty" valid:"optional"`
	Data       []Data   `json:"data,omitempty"        valid:"optional"`
	Ext        *UserExt `json:"ext"                   valid:"optional"`
}

User object contains information known or derived about the human user of the device (i.e., the audience for advertising). The user id is an exchange artifact and may be subject to rotation or other privacy policies. However, this user ID must be stable long enough to serve reasonably as the basis for frequency capping and retargeting.

func (*User) IsNil

func (u *User) IsNil() bool

IsNil checks if instance is nil

func (*User) MarshalJSONObject

func (u *User) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*User) NKeys

func (u *User) NKeys() int

NKeys returns the number of keys to unmarshal

func (*User) UnmarshalJSONObject

func (u *User) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type UserExt

type UserExt struct {
	Consent          string `json:"consent,omitempty"           valid:"-"` // publisher provided GDPR TCF string
	UnityBuyerUID    string `json:"unity_buyeruid,omitempty"    valid:"-"`
	FacebookBuyerUID string `json:"facebook_buyeruid,omitempty" valid:"-"`
	VungleBuyerUID   string `json:"vungle_buyeruid,omitempty"   valid:"-"` // buyer id that is generated from the unity sdk and passed to nimbus in the rtb request
	EIDS             EIDS   `json:"eids,omitempty"              valid:"-"`
}

UserExt Nimbus and IAB extensions

func (*UserExt) IsNil

func (e *UserExt) IsNil() bool

IsNil checks if instance is nil

func (*UserExt) MarshalJSONObject

func (e *UserExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*UserExt) NKeys

func (e *UserExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*UserExt) UnmarshalJSONObject

func (e *UserExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type Video

type Video struct {
	BidFloor       *float64  `json:"bidfloor,omitempty"       valid:"optional"`
	CompanionAd    []Banner  `json:"companionad,omitempty"    valid:"optional"`
	CompanionType  []int     `json:"companiontype,omitempty"  valid:"optional"` //1, 2, 3 -> Static Resource, HTM Resource, iframe Resource
	Mimes          []string  `json:"mimes,omitempty"          valid:"optional"`
	Minduration    int       `json:"minduration"              valid:"optional"`
	Maxduration    int       `json:"maxduration,omitempty"    valid:"optional"`
	Protocols      []int     `json:"protocols,omitempty"      valid:"inintarr(2|3|5|6),optional"` // 1,2,3,4,5,6,7,8,9,10 -> VAST 1.0,VAST 2.0,VAST 3.0,VAST 1.0 Wrapper,VAST 2.0 Wrapper,VAST 3.0 Wrapper,VAST 4.0,VAST 4.0 Wrapper,DAAST 1.0,DAAST 1.0 Wrapper
	W              int       `json:"w,omitempty"              valid:"required"`
	H              int       `json:"h,omitempty"              valid:"required"`
	StartDelay     int       `json:"startdelay"               valid:"optional"`
	Placement      int       `json:"placement,omitempty"      valid:"range(1|5),optional"`            // 1,2,3,4,5 -> In-Stream, In-Banner, In-Article, In-Feed - Found in content, social, or product feeds, Interstitial/Slider/Floating
	Linearity      int       `json:"linearity,omitempty"      valid:"range(1|2),optional"`            // 1,2 -> linear, non linear
	Playbackmethod []int     `json:"playbackmethod,omitempty" valid:"inintarr(1|2|3|4|5|6),optional"` // 1,2,3,4,5,6 - > Initiates on Page Load with Sound On, Initiates on Page Load with Sound Off by Default, Initiates on Click with Sound On, Initiates on Mouse-Over with Sound On, Initiates on Entering Viewport with Sound On, Initiates on Entering Viewport with Sound Off by Default
	Skip           int       `json:"skip"                     valid:"range(0|1),optional"`            // 0 no 1 yes
	Delivery       []int     `json:"delivery,omitempty"       valid:"range(0|3),optional"`            // 0,1,2,3 -> Unknown, Professionally Produced, Prosumer, User Generated (UGC)
	Pos            int       `json:"pos,omitempty"            valid:"range(0|7),optional"`            // 0,1,2,3,4,5,6,7 -> Unknown,Above the Fold,DEPRECATED - May or may not be initially visible depending on screen size/resolution.,Below the Fold,Header,Footer,Sidebar,Full Screen
	API            []int     `json:"api,omitempty"            valid:"inintarr(1|2|3|4|5|6|7),optional"`
	MinBitRate     int       `json:"minbitrate,omitempty"     valid:"optional"`
	MaxBitRate     int       `json:"maxbitrate,omitempty"     valid:"optional"`
	Ext            *VideoExt `json:"ext"                      valid:"optional"`
}

Video object represents an in-stream video impression. Many of the fields are non-essential for minimally viable transactions, but are included to offer fine control when needed. Video in OpenRTB generally assumes compliance with the VAST standard. As such, the notion of companion ads is supported by optionally including an array of Banner objects (refer to the Banner object in Section 3.2.3) that define these companion ads.

func (*Video) IsNil

func (v *Video) IsNil() bool

IsNil checks if instance is nil

func (*Video) MarshalJSONObject

func (v *Video) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*Video) NKeys

func (v *Video) NKeys() int

NKeys returns the number of keys to unmarshal

func (*Video) UnmarshalJSONObject

func (v *Video) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

type VideoExt

type VideoExt struct {
	IsRewarded int `json:"is_rewarded,omitempty"  valid:"range(0|1),optional"`
}

VideoExt ...

func (*VideoExt) IsNil

func (e *VideoExt) IsNil() bool

IsNil checks if instance is nil

func (*VideoExt) MarshalJSONObject

func (e *VideoExt) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

func (*VideoExt) NKeys

func (e *VideoExt) NKeys() int

NKeys returns the number of keys to unmarshal

func (*VideoExt) UnmarshalJSONObject

func (e *VideoExt) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

UnmarshalJSONObject implements gojay's UnmarshalerJSONObject

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL