request

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdUnitID

type AdUnitID int

AdUnitID enum.

const (
	AdUnitPaidSearch            AdUnitID = 1
	AdUnitRecommendationWidget  AdUnitID = 2
	AdUnitPromotedListings      AdUnitID = 3
	AdUnitInAdWithNativeElement AdUnitID = 4
	AdUnitCustom                AdUnitID = 5
)

AdUnitID enum values.

type Asset

type Asset struct {
	ID       int             `json:"id"`                 // Unique asset ID, assigned by exchange
	Required int             `json:"required,omitempty"` // Set to 1 if asset is required
	Title    *Title          `json:"title,omitempty"`    // Title object for title assets
	Image    *Image          `json:"img,omitempty"`      // Image object for image assets
	Video    *Video          `json:"video,omitempty"`    // Video object for video assets
	Data     *Data           `json:"data,omitempty"`     // Data object for brand name, description, ratings, prices etc.
	Ext      json.RawMessage `json:"ext,omitempty"`
}

Asset is the main container object for each asset requested or supported by Exchange on behalf of the rendering client. Only one of the {title,img,video,data} objects should be present in each object. The id is to be unique within the AssetObject array so that the response can be aligned.

func (Asset) MarshalEasyJSON

func (v Asset) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Asset) MarshalJSON

func (v Asset) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Asset) UnmarshalEasyJSON

func (v *Asset) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Asset) UnmarshalJSON

func (v *Asset) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ContextTypeID

type ContextTypeID int

ContextTypeID enum.

const (
	ContextTypeContent ContextTypeID = 1 // newsfeed, article, image gallery, video gallery
	ContextTypeSocial  ContextTypeID = 2 // social network feed, email, chat
	ContextTypeProduct ContextTypeID = 3 // product listings, details, recommendations, reviews

	ContextSubTypeGeneral        ContextTypeID = 10
	ContextSubTypeArticle        ContextTypeID = 11
	ContextSubTypeVideo          ContextTypeID = 12
	ContextSubTypeAudio          ContextTypeID = 13
	ContextSubTypeImage          ContextTypeID = 14
	ContextSubTypeUserGenerated  ContextTypeID = 15
	ContextSubTypeSocial         ContextTypeID = 20
	ContextSubTypeEmail          ContextTypeID = 21
	ContextSubTypeChat           ContextTypeID = 22
	ContextSubTypeSelling        ContextTypeID = 30
	ContextSubTypeAppStore       ContextTypeID = 31
	ContextSubTypeProductReviews ContextTypeID = 32
)

ContextTypeID enum values.

type Data

type Data struct {
	TypeID DataTypeID      `json:"type"` // Type ID of the element supported by the publisher. The publisher can display this information in an appropriate format
	Length int             `json:"len"`  // Maximum length of the text in the element’s response
	Ext    json.RawMessage `json:"ext,omitempty"`
}

Data is the native data object.

func (Data) MarshalEasyJSON

func (v Data) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Data) MarshalJSON

func (v Data) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Data) UnmarshalEasyJSON

func (v *Data) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Data) UnmarshalJSON

func (v *Data) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DataTypeID

type DataTypeID int

DataTypeID enum.

const (
	DataTypeSponsored      DataTypeID = 1  // Sponsored By message where response should contain the brand name of the sponsor
	DataTypeDesc           DataTypeID = 2  // Descriptive text associated with the product or service being advertised
	DataTypeRating         DataTypeID = 3  // Rating of the product being offered to the user
	DataTypeLikes          DataTypeID = 4  // Number of social ratings or “likes” of the product being offered to the user
	DataTypeDownloads      DataTypeID = 5  // Number downloads/installs of this product
	DataTypePrice          DataTypeID = 6  // Price for product / app / in-app purchase. Value should include currency symbol in localised format
	DataTypeSalePrice      DataTypeID = 7  // Sale price that can be used together with price to indicate a discounted price compared to a regular price. Value should include currency symbol in localised format
	DataTypePhone          DataTypeID = 8  // Phone number
	DataTypeAddress        DataTypeID = 9  // Address
	DataTypeDescAdditional DataTypeID = 10 // Additional descriptive text associated with the product or service being advertised
	DataTypeDisplayURL     DataTypeID = 11 // Display URL for the text ad. To be used when sponsoring entity doesn’t own the content. IE sponsored by BRAND on SITE (where SITE is transmitted in this field)
	DataTypeCTADesc        DataTypeID = 12 // CTA description - descriptive text describing a ‘call to action’ button for the destination URL

)

DataTypeID enum values.

type Image

type Image struct {
	TypeID ImageTypeID `json:"type,omitempty"` // Type ID of the image element supported by the publisher

	Width     int `json:"w,omitempty"`    // Width of the image in pixels
	WidthMin  int `json:"wmin,omitempty"` // The minimum requested width of the image in pixels
	Height    int `json:"h,omitempty"`    // Height of the image in pixels
	HeightMin int `json:"hmin,omitempty"` // The minimum requested height of the image in pixels
	// Either h/w or hmin/wmin should be transmitted. If only h/w is included, it
	// should be considered an exact requirement
	MIMEs []string        `json:"mimes,omitempty"` // Whitelist of content MIME types supported
	Ext   json.RawMessage `json:"ext,omitempty"`
}

Image is the native image object.

func (Image) MarshalEasyJSON

func (v Image) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Image) MarshalJSON

func (v Image) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Image) UnmarshalEasyJSON

func (v *Image) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Image) UnmarshalJSON

func (v *Image) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ImageTypeID

type ImageTypeID int

ImageTypeID enum.

const (
	ImageTypeIcon ImageTypeID = 1 // Icon image
	ImageTypeMain ImageTypeID = 3 // Large image preview for the ad
)

ImageTypeID enum values.

type LayoutID

type LayoutID int

LayoutID enum.

const (
	LayoutContentWall          LayoutID = 1
	LayoutAppWall              LayoutID = 2
	LayoutNewsFeed             LayoutID = 3
	LayoutChatList             LayoutID = 4
	LayoutCarousel             LayoutID = 5
	LayoutContentStream        LayoutID = 6
	LayoutGridAdjoiningContent LayoutID = 7
)

LayoutID enum values.

type PlacementTypeID

type PlacementTypeID int

PlacementTypeID enum.

const (
	PlacementTypeInFeed         PlacementTypeID = 1 // In the feed of content - for example as an item inside the organic feed/grid/listing/carousel
	PlacementTypeAtomic         PlacementTypeID = 2 // In the atomic unit of the content - IE in the article page or single image page
	PlacementTypeOutside        PlacementTypeID = 3 // Outside the core content - for example in the ads section on the right rail, as a banner-style placement near the content, etc.
	PlacementTypeRecommendation PlacementTypeID = 4 // Recommendation widget, most commonly presented below the article content
)

PlacementTypeID enum values.

type Request

type Request struct {
	Version          string          `json:"ver,omitempty"`            // Version of the Native Markup
	LayoutID         LayoutID        `json:"layout,omitempty"`         // DEPRECATED The Layout ID of the native ad
	AdUnitID         AdUnitID        `json:"adunit,omitempty"`         // DEPRECATED The Ad unit ID of the native ad
	ContextTypeID    ContextTypeID   `json:"context,omitempty"`        // The context in which the ad appears
	ContextSubTypeID ContextTypeID   `json:"contextsubtype,omitempty"` // A more detailed context in which the ad appears
	PlacementTypeID  PlacementTypeID `json:"plcmttype,omitempty"`      // The design/format/layout of the ad unit being offered
	PlacementCount   int             `json:"plcmtcnt,omitempty"`       // The number of identical placements in this Layout
	Sequence         int             `json:"seq,omitempty"`            // 0 for the first ad, 1 for the second ad, and so on
	Assets           []Asset         `json:"assets"`                   // An array of Asset Objects
	Ext              json.RawMessage `json:"ext,omitempty"`
}

Request 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. The presence of a Native as a subordinate of the Imp object indicates that this impression is offered as a native type impression. At the publisher’s discretion, that same impression may also be offered as banner and/or video by also including as Imp subordinates the Banner and/or Video objects, respectively. However, any given bid for the impression must conform to one of the offered types.

func (Request) MarshalEasyJSON

func (v Request) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Request) MarshalJSON

func (v Request) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Request) UnmarshalEasyJSON

func (v *Request) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Request) UnmarshalJSON

func (v *Request) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Title

type Title struct {
	Length int             `json:"len"` // Maximum length of the text in the title element
	Ext    json.RawMessage `json:"ext,omitempty"`
}

Title is the native title object.

func (Title) MarshalEasyJSON

func (v Title) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Title) MarshalJSON

func (v Title) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Title) UnmarshalEasyJSON

func (v *Title) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Title) UnmarshalJSON

func (v *Title) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Video

type Video struct {
	MIMEs       []string           `json:"mimes,omitempty"`       // Whitelist of content MIME types supported
	MinDuration int                `json:"minduration,omitempty"` // Minimum video ad duration in seconds
	MaxDuration int                `json:"maxduration,omitempty"` // Maximum video ad duration in seconds
	Protocols   []openrtb.Protocol `json:"protocols,omitempty"`   // Video bid response protocols
	Ext         json.RawMessage    `json:"ext,omitempty"`
}

Video is the native video object.

func (Video) MarshalEasyJSON

func (v Video) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Video) MarshalJSON

func (v Video) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Video) UnmarshalEasyJSON

func (v *Video) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Video) UnmarshalJSON

func (v *Video) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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