response

package
v3.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	ID       int             `json:"id"`                 // Unique asset ID, assigned by exchange, must match one of the asset IDs in request
	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.
	Link     *Link           `json:"link,omitempty"`     // Link object for call to actions. The link object applies if the asset item is activated (clicked)
	Ext      json.RawMessage `json:"ext,omitempty"`
}

Asset corresponds to the Asset Object in the request. The main container object for each asset requested or supported by Exchange on behalf of the rendering client. Any object that is required is to be flagged as such. Only one of the {title,img,video,data} objects should be present in each object. All others should be null/absent. 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 Data

type Data struct {
	Label string          `json:"label,omitempty"` // The optional formatted string name of the data type to be displayed
	Value string          `json:"value"`           // The formatted string of data to be displayed. Can contain a formatted value such as “5 stars” or “$10” or “3.4 stars out of 5”
	Ext   json.RawMessage `json:"ext,omitempty"`
}

Data object contains response data.

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 Image

type Image struct {
	URL    string          `json:"url,omitempty"` // URL of the image asset
	Width  int             `json:"w,omitempty"`   // Width of the image in pixels
	Height int             `json:"h,omitempty"`   // Height of the image in pixels
	Ext    json.RawMessage `json:"ext,omitempty"`
}

Image object contains response image.

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 Link struct {
	URL           string          `json:"url"`                     // Landing URL of the clickable link
	ClickTrackers []string        `json:"clicktrackers,omitempty"` // List of third-party tracker URLs to be fired on click of the URL
	FallbackURL   string          `json:"fallback,omitempty"`      // Fallback URL for deeplink. To be used if the URL given in url is not supported by the device.
	Ext           json.RawMessage `json:"ext,omitempty"`
}

Link object contains response link.

func (Link) MarshalEasyJSON

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (Link) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*Link) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Link) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Response

type Response struct {
	Version     string          `json:"ver,omitempty"`         // Version of the Native Markup
	Assets      []Asset         `json:"assets"`                // An array of Asset Objects
	Link        Link            `json:"link"`                  // Destination Link. This is default link object for the ad
	ImpTrackers []string        `json:"imptrackers,omitempty"` // Array of impression tracking URLs, expected to return a 1x1 image or 204 response
	JSTracker   string          `json:"jstracker,omitempty"`   // Optional JavaScript impression tracker. This is a valid HTML, Javascript is already wrapped in <script> tags. It should be executed at impression time where it can be supported
	Ext         json.RawMessage `json:"ext,omitempty"`
}

Response is the native object is the top level JSON object which identifies a native response.

func (Response) MarshalEasyJSON

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (Response) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*Response) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Response) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Title

type Title struct {
	Text string          `json:"text"` // The text associated with the text element
	Ext  json.RawMessage `json:"ext,omitempty"`
}

Title wraps title information.

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 {
	VASTTag string `json:"vasttag"` // VAST XML
}

Video is the VAST wrapper 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