4298 lines
95 KiB
Go
4298 lines
95 KiB
Go
// Code generated by ogen, DO NOT EDIT.
|
|
|
|
package go_youtubekids_client
|
|
|
|
import (
|
|
"github.com/go-faster/errors"
|
|
"github.com/go-faster/jx"
|
|
)
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *Accessibility) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *Accessibility) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.AccessibilityData.Set {
|
|
e.FieldStart("accessibilityData")
|
|
s.AccessibilityData.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfAccessibility = [1]string{
|
|
0: "accessibilityData",
|
|
}
|
|
|
|
// Decode decodes Accessibility from json.
|
|
func (s *Accessibility) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode Accessibility to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "accessibilityData":
|
|
if err := func() error {
|
|
s.AccessibilityData.Reset()
|
|
if err := s.AccessibilityData.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"accessibilityData\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode Accessibility")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *Accessibility) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *Accessibility) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *AccessibilityData) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *AccessibilityData) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Label.Set {
|
|
e.FieldStart("label")
|
|
s.Label.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfAccessibilityData = [1]string{
|
|
0: "label",
|
|
}
|
|
|
|
// Decode decodes AccessibilityData from json.
|
|
func (s *AccessibilityData) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode AccessibilityData to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "label":
|
|
if err := func() error {
|
|
s.Label.Reset()
|
|
if err := s.Label.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"label\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode AccessibilityData")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *AccessibilityData) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *AccessibilityData) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *AnchoredSectionRenderer) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *AnchoredSectionRenderer) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Title.Set {
|
|
e.FieldStart("title")
|
|
s.Title.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Content.Set {
|
|
e.FieldStart("content")
|
|
s.Content.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.TrackingParams.Set {
|
|
e.FieldStart("trackingParams")
|
|
s.TrackingParams.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.NavigationEndpoint.Set {
|
|
e.FieldStart("navigationEndpoint")
|
|
s.NavigationEndpoint.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.CategoryAssets.Set {
|
|
e.FieldStart("categoryAssets")
|
|
s.CategoryAssets.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.CategoryType.Set {
|
|
e.FieldStart("categoryType")
|
|
s.CategoryType.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfAnchoredSectionRenderer = [6]string{
|
|
0: "title",
|
|
1: "content",
|
|
2: "trackingParams",
|
|
3: "navigationEndpoint",
|
|
4: "categoryAssets",
|
|
5: "categoryType",
|
|
}
|
|
|
|
// Decode decodes AnchoredSectionRenderer from json.
|
|
func (s *AnchoredSectionRenderer) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode AnchoredSectionRenderer to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "title":
|
|
if err := func() error {
|
|
s.Title.Reset()
|
|
if err := s.Title.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"title\"")
|
|
}
|
|
case "content":
|
|
if err := func() error {
|
|
s.Content.Reset()
|
|
if err := s.Content.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"content\"")
|
|
}
|
|
case "trackingParams":
|
|
if err := func() error {
|
|
s.TrackingParams.Reset()
|
|
if err := s.TrackingParams.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"trackingParams\"")
|
|
}
|
|
case "navigationEndpoint":
|
|
if err := func() error {
|
|
s.NavigationEndpoint.Reset()
|
|
if err := s.NavigationEndpoint.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"navigationEndpoint\"")
|
|
}
|
|
case "categoryAssets":
|
|
if err := func() error {
|
|
s.CategoryAssets.Reset()
|
|
if err := s.CategoryAssets.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"categoryAssets\"")
|
|
}
|
|
case "categoryType":
|
|
if err := func() error {
|
|
s.CategoryType.Reset()
|
|
if err := s.CategoryType.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"categoryType\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode AnchoredSectionRenderer")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *AnchoredSectionRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *AnchoredSectionRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *AnchoredSectionRendererContent) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *AnchoredSectionRendererContent) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.SectionListRenderer.Set {
|
|
e.FieldStart("sectionListRenderer")
|
|
s.SectionListRenderer.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfAnchoredSectionRendererContent = [1]string{
|
|
0: "sectionListRenderer",
|
|
}
|
|
|
|
// Decode decodes AnchoredSectionRendererContent from json.
|
|
func (s *AnchoredSectionRendererContent) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode AnchoredSectionRendererContent to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "sectionListRenderer":
|
|
if err := func() error {
|
|
s.SectionListRenderer.Reset()
|
|
if err := s.SectionListRenderer.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"sectionListRenderer\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode AnchoredSectionRendererContent")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *AnchoredSectionRendererContent) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *AnchoredSectionRendererContent) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *BrowseEndpoint) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *BrowseEndpoint) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.BrowseId.Set {
|
|
e.FieldStart("browseId")
|
|
s.BrowseId.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.CanonicalBaseUrl.Set {
|
|
e.FieldStart("canonicalBaseUrl")
|
|
s.CanonicalBaseUrl.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfBrowseEndpoint = [2]string{
|
|
0: "browseId",
|
|
1: "canonicalBaseUrl",
|
|
}
|
|
|
|
// Decode decodes BrowseEndpoint from json.
|
|
func (s *BrowseEndpoint) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode BrowseEndpoint to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "browseId":
|
|
if err := func() error {
|
|
s.BrowseId.Reset()
|
|
if err := s.BrowseId.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"browseId\"")
|
|
}
|
|
case "canonicalBaseUrl":
|
|
if err := func() error {
|
|
s.CanonicalBaseUrl.Reset()
|
|
if err := s.CanonicalBaseUrl.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"canonicalBaseUrl\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode BrowseEndpoint")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *BrowseEndpoint) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *BrowseEndpoint) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *BrowseRequestPayload) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *BrowseRequestPayload) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Context.Set {
|
|
e.FieldStart("context")
|
|
s.Context.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.BrowseId.Set {
|
|
e.FieldStart("browseId")
|
|
s.BrowseId.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfBrowseRequestPayload = [2]string{
|
|
0: "context",
|
|
1: "browseId",
|
|
}
|
|
|
|
// Decode decodes BrowseRequestPayload from json.
|
|
func (s *BrowseRequestPayload) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode BrowseRequestPayload to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "context":
|
|
if err := func() error {
|
|
s.Context.Reset()
|
|
if err := s.Context.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"context\"")
|
|
}
|
|
case "browseId":
|
|
if err := func() error {
|
|
s.BrowseId.Reset()
|
|
if err := s.BrowseId.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"browseId\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode BrowseRequestPayload")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *BrowseRequestPayload) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *BrowseRequestPayload) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *BrowseResponsePayload) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *BrowseResponsePayload) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.ResponseContext.Set {
|
|
e.FieldStart("responseContext")
|
|
s.ResponseContext.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Header.Set {
|
|
e.FieldStart("header")
|
|
s.Header.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Contents.Set {
|
|
e.FieldStart("contents")
|
|
s.Contents.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.TrackingParams.Set {
|
|
e.FieldStart("trackingParams")
|
|
s.TrackingParams.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfBrowseResponsePayload = [4]string{
|
|
0: "responseContext",
|
|
1: "header",
|
|
2: "contents",
|
|
3: "trackingParams",
|
|
}
|
|
|
|
// Decode decodes BrowseResponsePayload from json.
|
|
func (s *BrowseResponsePayload) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode BrowseResponsePayload to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "responseContext":
|
|
if err := func() error {
|
|
s.ResponseContext.Reset()
|
|
if err := s.ResponseContext.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"responseContext\"")
|
|
}
|
|
case "header":
|
|
if err := func() error {
|
|
s.Header.Reset()
|
|
if err := s.Header.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"header\"")
|
|
}
|
|
case "contents":
|
|
if err := func() error {
|
|
s.Contents.Reset()
|
|
if err := s.Contents.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"contents\"")
|
|
}
|
|
case "trackingParams":
|
|
if err := func() error {
|
|
s.TrackingParams.Reset()
|
|
if err := s.TrackingParams.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"trackingParams\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode BrowseResponsePayload")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *BrowseResponsePayload) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *BrowseResponsePayload) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *BrowseResponsePayloadContents) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *BrowseResponsePayloadContents) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.KidsHomeScreenRenderer.Set {
|
|
e.FieldStart("kidsHomeScreenRenderer")
|
|
s.KidsHomeScreenRenderer.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfBrowseResponsePayloadContents = [1]string{
|
|
0: "kidsHomeScreenRenderer",
|
|
}
|
|
|
|
// Decode decodes BrowseResponsePayloadContents from json.
|
|
func (s *BrowseResponsePayloadContents) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode BrowseResponsePayloadContents to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "kidsHomeScreenRenderer":
|
|
if err := func() error {
|
|
s.KidsHomeScreenRenderer.Reset()
|
|
if err := s.KidsHomeScreenRenderer.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"kidsHomeScreenRenderer\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode BrowseResponsePayloadContents")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *BrowseResponsePayloadContents) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *BrowseResponsePayloadContents) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *BrowseResponsePayloadHeader) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *BrowseResponsePayloadHeader) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.KidsCategoriesHeaderRenderer.Set {
|
|
e.FieldStart("kidsCategoriesHeaderRenderer")
|
|
s.KidsCategoriesHeaderRenderer.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfBrowseResponsePayloadHeader = [1]string{
|
|
0: "kidsCategoriesHeaderRenderer",
|
|
}
|
|
|
|
// Decode decodes BrowseResponsePayloadHeader from json.
|
|
func (s *BrowseResponsePayloadHeader) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode BrowseResponsePayloadHeader to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "kidsCategoriesHeaderRenderer":
|
|
if err := func() error {
|
|
s.KidsCategoriesHeaderRenderer.Reset()
|
|
if err := s.KidsCategoriesHeaderRenderer.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"kidsCategoriesHeaderRenderer\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode BrowseResponsePayloadHeader")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *BrowseResponsePayloadHeader) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *BrowseResponsePayloadHeader) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *CategoriesHeaderRenderer) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *CategoriesHeaderRenderer) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.TrackingParams.Set {
|
|
e.FieldStart("trackingParams")
|
|
s.TrackingParams.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfCategoriesHeaderRenderer = [1]string{
|
|
0: "trackingParams",
|
|
}
|
|
|
|
// Decode decodes CategoriesHeaderRenderer from json.
|
|
func (s *CategoriesHeaderRenderer) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode CategoriesHeaderRenderer to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "trackingParams":
|
|
if err := func() error {
|
|
s.TrackingParams.Reset()
|
|
if err := s.TrackingParams.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"trackingParams\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode CategoriesHeaderRenderer")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *CategoriesHeaderRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *CategoriesHeaderRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *CategoryAssets) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *CategoryAssets) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.AssetKey.Set {
|
|
e.FieldStart("assetKey")
|
|
s.AssetKey.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.BackgroundColor.Set {
|
|
e.FieldStart("backgroundColor")
|
|
s.BackgroundColor.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfCategoryAssets = [2]string{
|
|
0: "assetKey",
|
|
1: "backgroundColor",
|
|
}
|
|
|
|
// Decode decodes CategoryAssets from json.
|
|
func (s *CategoryAssets) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode CategoryAssets to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "assetKey":
|
|
if err := func() error {
|
|
s.AssetKey.Reset()
|
|
if err := s.AssetKey.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"assetKey\"")
|
|
}
|
|
case "backgroundColor":
|
|
if err := func() error {
|
|
s.BackgroundColor.Reset()
|
|
if err := s.BackgroundColor.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"backgroundColor\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode CategoryAssets")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *CategoryAssets) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *CategoryAssets) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *CompactVideoRenderer) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *CompactVideoRenderer) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.VideoId.Set {
|
|
e.FieldStart("videoId")
|
|
s.VideoId.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Thumbnail.Set {
|
|
e.FieldStart("thumbnail")
|
|
s.Thumbnail.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Title.Set {
|
|
e.FieldStart("title")
|
|
s.Title.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.LongBylineText.Set {
|
|
e.FieldStart("longBylineText")
|
|
s.LongBylineText.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.PublishedTimeText.Set {
|
|
e.FieldStart("publishedTimeText")
|
|
s.PublishedTimeText.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.ViewCountText.Set {
|
|
e.FieldStart("viewCountText")
|
|
s.ViewCountText.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.LengthText.Set {
|
|
e.FieldStart("lengthText")
|
|
s.LengthText.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.NavigationEndpoint.Set {
|
|
e.FieldStart("navigationEndpoint")
|
|
s.NavigationEndpoint.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.ShortBylineText.Set {
|
|
e.FieldStart("shortBylineText")
|
|
s.ShortBylineText.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.ChannelThumbnail.Set {
|
|
e.FieldStart("channelThumbnail")
|
|
s.ChannelThumbnail.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.TrackingParams.Set {
|
|
e.FieldStart("trackingParams")
|
|
s.TrackingParams.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.ShortViewCountText.Set {
|
|
e.FieldStart("shortViewCountText")
|
|
s.ShortViewCountText.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Accessibility.Set {
|
|
e.FieldStart("accessibility")
|
|
s.Accessibility.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.KidsVideoOwnerExtension.Set {
|
|
e.FieldStart("kidsVideoOwnerExtension")
|
|
s.KidsVideoOwnerExtension.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfCompactVideoRenderer = [14]string{
|
|
0: "videoId",
|
|
1: "thumbnail",
|
|
2: "title",
|
|
3: "longBylineText",
|
|
4: "publishedTimeText",
|
|
5: "viewCountText",
|
|
6: "lengthText",
|
|
7: "navigationEndpoint",
|
|
8: "shortBylineText",
|
|
9: "channelThumbnail",
|
|
10: "trackingParams",
|
|
11: "shortViewCountText",
|
|
12: "accessibility",
|
|
13: "kidsVideoOwnerExtension",
|
|
}
|
|
|
|
// Decode decodes CompactVideoRenderer from json.
|
|
func (s *CompactVideoRenderer) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode CompactVideoRenderer to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "videoId":
|
|
if err := func() error {
|
|
s.VideoId.Reset()
|
|
if err := s.VideoId.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"videoId\"")
|
|
}
|
|
case "thumbnail":
|
|
if err := func() error {
|
|
s.Thumbnail.Reset()
|
|
if err := s.Thumbnail.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"thumbnail\"")
|
|
}
|
|
case "title":
|
|
if err := func() error {
|
|
s.Title.Reset()
|
|
if err := s.Title.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"title\"")
|
|
}
|
|
case "longBylineText":
|
|
if err := func() error {
|
|
s.LongBylineText.Reset()
|
|
if err := s.LongBylineText.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"longBylineText\"")
|
|
}
|
|
case "publishedTimeText":
|
|
if err := func() error {
|
|
s.PublishedTimeText.Reset()
|
|
if err := s.PublishedTimeText.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"publishedTimeText\"")
|
|
}
|
|
case "viewCountText":
|
|
if err := func() error {
|
|
s.ViewCountText.Reset()
|
|
if err := s.ViewCountText.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"viewCountText\"")
|
|
}
|
|
case "lengthText":
|
|
if err := func() error {
|
|
s.LengthText.Reset()
|
|
if err := s.LengthText.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"lengthText\"")
|
|
}
|
|
case "navigationEndpoint":
|
|
if err := func() error {
|
|
s.NavigationEndpoint.Reset()
|
|
if err := s.NavigationEndpoint.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"navigationEndpoint\"")
|
|
}
|
|
case "shortBylineText":
|
|
if err := func() error {
|
|
s.ShortBylineText.Reset()
|
|
if err := s.ShortBylineText.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"shortBylineText\"")
|
|
}
|
|
case "channelThumbnail":
|
|
if err := func() error {
|
|
s.ChannelThumbnail.Reset()
|
|
if err := s.ChannelThumbnail.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"channelThumbnail\"")
|
|
}
|
|
case "trackingParams":
|
|
if err := func() error {
|
|
s.TrackingParams.Reset()
|
|
if err := s.TrackingParams.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"trackingParams\"")
|
|
}
|
|
case "shortViewCountText":
|
|
if err := func() error {
|
|
s.ShortViewCountText.Reset()
|
|
if err := s.ShortViewCountText.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"shortViewCountText\"")
|
|
}
|
|
case "accessibility":
|
|
if err := func() error {
|
|
s.Accessibility.Reset()
|
|
if err := s.Accessibility.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"accessibility\"")
|
|
}
|
|
case "kidsVideoOwnerExtension":
|
|
if err := func() error {
|
|
s.KidsVideoOwnerExtension.Reset()
|
|
if err := s.KidsVideoOwnerExtension.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"kidsVideoOwnerExtension\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode CompactVideoRenderer")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *CompactVideoRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *CompactVideoRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *CompactVideoRendererChannelThumbnail) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *CompactVideoRendererChannelThumbnail) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Thumbnails != nil {
|
|
e.FieldStart("thumbnails")
|
|
e.ArrStart()
|
|
for _, elem := range s.Thumbnails {
|
|
elem.Encode(e)
|
|
}
|
|
e.ArrEnd()
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfCompactVideoRendererChannelThumbnail = [1]string{
|
|
0: "thumbnails",
|
|
}
|
|
|
|
// Decode decodes CompactVideoRendererChannelThumbnail from json.
|
|
func (s *CompactVideoRendererChannelThumbnail) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode CompactVideoRendererChannelThumbnail to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "thumbnails":
|
|
if err := func() error {
|
|
s.Thumbnails = make([]Thumbnail, 0)
|
|
if err := d.Arr(func(d *jx.Decoder) error {
|
|
var elem Thumbnail
|
|
if err := elem.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
s.Thumbnails = append(s.Thumbnails, elem)
|
|
return nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"thumbnails\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode CompactVideoRendererChannelThumbnail")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *CompactVideoRendererChannelThumbnail) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *CompactVideoRendererChannelThumbnail) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *CompactVideoRendererThumbnail) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *CompactVideoRendererThumbnail) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Thumbnails != nil {
|
|
e.FieldStart("thumbnails")
|
|
e.ArrStart()
|
|
for _, elem := range s.Thumbnails {
|
|
elem.Encode(e)
|
|
}
|
|
e.ArrEnd()
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfCompactVideoRendererThumbnail = [1]string{
|
|
0: "thumbnails",
|
|
}
|
|
|
|
// Decode decodes CompactVideoRendererThumbnail from json.
|
|
func (s *CompactVideoRendererThumbnail) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode CompactVideoRendererThumbnail to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "thumbnails":
|
|
if err := func() error {
|
|
s.Thumbnails = make([]Thumbnail, 0)
|
|
if err := d.Arr(func(d *jx.Decoder) error {
|
|
var elem Thumbnail
|
|
if err := elem.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
s.Thumbnails = append(s.Thumbnails, elem)
|
|
return nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"thumbnails\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode CompactVideoRendererThumbnail")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *CompactVideoRendererThumbnail) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *CompactVideoRendererThumbnail) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *Error) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *Error) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Message.Set {
|
|
e.FieldStart("message")
|
|
s.Message.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Domain.Set {
|
|
e.FieldStart("domain")
|
|
s.Domain.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Reason.Set {
|
|
e.FieldStart("reason")
|
|
s.Reason.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfError = [3]string{
|
|
0: "message",
|
|
1: "domain",
|
|
2: "reason",
|
|
}
|
|
|
|
// Decode decodes Error from json.
|
|
func (s *Error) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode Error to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "message":
|
|
if err := func() error {
|
|
s.Message.Reset()
|
|
if err := s.Message.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"message\"")
|
|
}
|
|
case "domain":
|
|
if err := func() error {
|
|
s.Domain.Reset()
|
|
if err := s.Domain.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"domain\"")
|
|
}
|
|
case "reason":
|
|
if err := func() error {
|
|
s.Reason.Reset()
|
|
if err := s.Reason.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"reason\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode Error")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *Error) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *Error) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *ErrorResponsePayload) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *ErrorResponsePayload) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Error.Set {
|
|
e.FieldStart("error")
|
|
s.Error.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfErrorResponsePayload = [1]string{
|
|
0: "error",
|
|
}
|
|
|
|
// Decode decodes ErrorResponsePayload from json.
|
|
func (s *ErrorResponsePayload) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode ErrorResponsePayload to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "error":
|
|
if err := func() error {
|
|
s.Error.Reset()
|
|
if err := s.Error.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"error\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode ErrorResponsePayload")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *ErrorResponsePayload) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *ErrorResponsePayload) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *ErrorResponsePayloadError) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *ErrorResponsePayloadError) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Code.Set {
|
|
e.FieldStart("code")
|
|
s.Code.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Message.Set {
|
|
e.FieldStart("message")
|
|
s.Message.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Errors != nil {
|
|
e.FieldStart("errors")
|
|
e.ArrStart()
|
|
for _, elem := range s.Errors {
|
|
elem.Encode(e)
|
|
}
|
|
e.ArrEnd()
|
|
}
|
|
}
|
|
{
|
|
if s.Status.Set {
|
|
e.FieldStart("status")
|
|
s.Status.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfErrorResponsePayloadError = [4]string{
|
|
0: "code",
|
|
1: "message",
|
|
2: "errors",
|
|
3: "status",
|
|
}
|
|
|
|
// Decode decodes ErrorResponsePayloadError from json.
|
|
func (s *ErrorResponsePayloadError) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode ErrorResponsePayloadError to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "code":
|
|
if err := func() error {
|
|
s.Code.Reset()
|
|
if err := s.Code.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"code\"")
|
|
}
|
|
case "message":
|
|
if err := func() error {
|
|
s.Message.Reset()
|
|
if err := s.Message.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"message\"")
|
|
}
|
|
case "errors":
|
|
if err := func() error {
|
|
s.Errors = make([]Error, 0)
|
|
if err := d.Arr(func(d *jx.Decoder) error {
|
|
var elem Error
|
|
if err := elem.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
s.Errors = append(s.Errors, elem)
|
|
return nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"errors\"")
|
|
}
|
|
case "status":
|
|
if err := func() error {
|
|
s.Status.Reset()
|
|
if err := s.Status.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"status\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode ErrorResponsePayloadError")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *ErrorResponsePayloadError) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *ErrorResponsePayloadError) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *ItemSectionRenderer) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *ItemSectionRenderer) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Contents != nil {
|
|
e.FieldStart("contents")
|
|
e.ArrStart()
|
|
for _, elem := range s.Contents {
|
|
elem.Encode(e)
|
|
}
|
|
e.ArrEnd()
|
|
}
|
|
}
|
|
{
|
|
if s.TrackingParams.Set {
|
|
e.FieldStart("trackingParams")
|
|
s.TrackingParams.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfItemSectionRenderer = [2]string{
|
|
0: "contents",
|
|
1: "trackingParams",
|
|
}
|
|
|
|
// Decode decodes ItemSectionRenderer from json.
|
|
func (s *ItemSectionRenderer) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode ItemSectionRenderer to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "contents":
|
|
if err := func() error {
|
|
s.Contents = make([]ItemSectionRendererContentsItem, 0)
|
|
if err := d.Arr(func(d *jx.Decoder) error {
|
|
var elem ItemSectionRendererContentsItem
|
|
if err := elem.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
s.Contents = append(s.Contents, elem)
|
|
return nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"contents\"")
|
|
}
|
|
case "trackingParams":
|
|
if err := func() error {
|
|
s.TrackingParams.Reset()
|
|
if err := s.TrackingParams.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"trackingParams\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode ItemSectionRenderer")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *ItemSectionRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *ItemSectionRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *ItemSectionRendererContentsItem) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *ItemSectionRendererContentsItem) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.CompactVideoRenderer.Set {
|
|
e.FieldStart("compactVideoRenderer")
|
|
s.CompactVideoRenderer.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfItemSectionRendererContentsItem = [1]string{
|
|
0: "compactVideoRenderer",
|
|
}
|
|
|
|
// Decode decodes ItemSectionRendererContentsItem from json.
|
|
func (s *ItemSectionRendererContentsItem) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode ItemSectionRendererContentsItem to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "compactVideoRenderer":
|
|
if err := func() error {
|
|
s.CompactVideoRenderer.Reset()
|
|
if err := s.CompactVideoRenderer.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"compactVideoRenderer\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode ItemSectionRendererContentsItem")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *ItemSectionRendererContentsItem) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *ItemSectionRendererContentsItem) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *KeyStringValue) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *KeyStringValue) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Key.Set {
|
|
e.FieldStart("key")
|
|
s.Key.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Value.Set {
|
|
e.FieldStart("value")
|
|
s.Value.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfKeyStringValue = [2]string{
|
|
0: "key",
|
|
1: "value",
|
|
}
|
|
|
|
// Decode decodes KeyStringValue from json.
|
|
func (s *KeyStringValue) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode KeyStringValue to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "key":
|
|
if err := func() error {
|
|
s.Key.Reset()
|
|
if err := s.Key.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"key\"")
|
|
}
|
|
case "value":
|
|
if err := func() error {
|
|
s.Value.Reset()
|
|
if err := s.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"value\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode KeyStringValue")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *KeyStringValue) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *KeyStringValue) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *KidsAppCategorySettings) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *KidsAppCategorySettings) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.EnabledCategories != nil {
|
|
e.FieldStart("enabledCategories")
|
|
e.ArrStart()
|
|
for _, elem := range s.EnabledCategories {
|
|
e.Str(elem)
|
|
}
|
|
e.ArrEnd()
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfKidsAppCategorySettings = [1]string{
|
|
0: "enabledCategories",
|
|
}
|
|
|
|
// Decode decodes KidsAppCategorySettings from json.
|
|
func (s *KidsAppCategorySettings) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode KidsAppCategorySettings to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "enabledCategories":
|
|
if err := func() error {
|
|
s.EnabledCategories = make([]string, 0)
|
|
if err := d.Arr(func(d *jx.Decoder) error {
|
|
var elem string
|
|
v, err := d.Str()
|
|
elem = string(v)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
s.EnabledCategories = append(s.EnabledCategories, elem)
|
|
return nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"enabledCategories\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode KidsAppCategorySettings")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *KidsAppCategorySettings) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *KidsAppCategorySettings) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *KidsAppContentSettings) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *KidsAppContentSettings) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.CorpusPreference.Set {
|
|
e.FieldStart("corpusPreference")
|
|
s.CorpusPreference.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.KidsNoSearchMode.Set {
|
|
e.FieldStart("kidsNoSearchMode")
|
|
s.KidsNoSearchMode.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfKidsAppContentSettings = [2]string{
|
|
0: "corpusPreference",
|
|
1: "kidsNoSearchMode",
|
|
}
|
|
|
|
// Decode decodes KidsAppContentSettings from json.
|
|
func (s *KidsAppContentSettings) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode KidsAppContentSettings to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "corpusPreference":
|
|
if err := func() error {
|
|
s.CorpusPreference.Reset()
|
|
if err := s.CorpusPreference.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"corpusPreference\"")
|
|
}
|
|
case "kidsNoSearchMode":
|
|
if err := func() error {
|
|
s.KidsNoSearchMode.Reset()
|
|
if err := s.KidsNoSearchMode.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"kidsNoSearchMode\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode KidsAppContentSettings")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *KidsAppContentSettings) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *KidsAppContentSettings) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *KidsAppInfo) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *KidsAppInfo) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.ContentSettings.Set {
|
|
e.FieldStart("contentSettings")
|
|
s.ContentSettings.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.CategorySettings.Set {
|
|
e.FieldStart("categorySettings")
|
|
s.CategorySettings.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfKidsAppInfo = [2]string{
|
|
0: "contentSettings",
|
|
1: "categorySettings",
|
|
}
|
|
|
|
// Decode decodes KidsAppInfo from json.
|
|
func (s *KidsAppInfo) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode KidsAppInfo to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "contentSettings":
|
|
if err := func() error {
|
|
s.ContentSettings.Reset()
|
|
if err := s.ContentSettings.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"contentSettings\"")
|
|
}
|
|
case "categorySettings":
|
|
if err := func() error {
|
|
s.CategorySettings.Reset()
|
|
if err := s.CategorySettings.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"categorySettings\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode KidsAppInfo")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *KidsAppInfo) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *KidsAppInfo) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *KidsVideoOwnerExtension) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *KidsVideoOwnerExtension) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.ExternalChannelId.Set {
|
|
e.FieldStart("externalChannelId")
|
|
s.ExternalChannelId.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfKidsVideoOwnerExtension = [1]string{
|
|
0: "externalChannelId",
|
|
}
|
|
|
|
// Decode decodes KidsVideoOwnerExtension from json.
|
|
func (s *KidsVideoOwnerExtension) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode KidsVideoOwnerExtension to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "externalChannelId":
|
|
if err := func() error {
|
|
s.ExternalChannelId.Reset()
|
|
if err := s.ExternalChannelId.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"externalChannelId\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode KidsVideoOwnerExtension")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *KidsVideoOwnerExtension) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *KidsVideoOwnerExtension) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *NavigationEndpoint) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *NavigationEndpoint) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.ClickTrackingParams.Set {
|
|
e.FieldStart("clickTrackingParams")
|
|
s.ClickTrackingParams.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.WatchEndpoint.Set {
|
|
e.FieldStart("watchEndpoint")
|
|
s.WatchEndpoint.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.BrowseEndpoint.Set {
|
|
e.FieldStart("browseEndpoint")
|
|
s.BrowseEndpoint.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfNavigationEndpoint = [3]string{
|
|
0: "clickTrackingParams",
|
|
1: "watchEndpoint",
|
|
2: "browseEndpoint",
|
|
}
|
|
|
|
// Decode decodes NavigationEndpoint from json.
|
|
func (s *NavigationEndpoint) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode NavigationEndpoint to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "clickTrackingParams":
|
|
if err := func() error {
|
|
s.ClickTrackingParams.Reset()
|
|
if err := s.ClickTrackingParams.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"clickTrackingParams\"")
|
|
}
|
|
case "watchEndpoint":
|
|
if err := func() error {
|
|
s.WatchEndpoint.Reset()
|
|
if err := s.WatchEndpoint.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"watchEndpoint\"")
|
|
}
|
|
case "browseEndpoint":
|
|
if err := func() error {
|
|
s.BrowseEndpoint.Reset()
|
|
if err := s.BrowseEndpoint.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"browseEndpoint\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode NavigationEndpoint")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *NavigationEndpoint) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *NavigationEndpoint) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes Accessibility as json.
|
|
func (o OptAccessibility) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes Accessibility from json.
|
|
func (o *OptAccessibility) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptAccessibility to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptAccessibility) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptAccessibility) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes AccessibilityData as json.
|
|
func (o OptAccessibilityData) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes AccessibilityData from json.
|
|
func (o *OptAccessibilityData) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptAccessibilityData to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptAccessibilityData) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptAccessibilityData) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes AnchoredSectionRenderer as json.
|
|
func (o OptAnchoredSectionRenderer) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes AnchoredSectionRenderer from json.
|
|
func (o *OptAnchoredSectionRenderer) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptAnchoredSectionRenderer to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptAnchoredSectionRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptAnchoredSectionRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes AnchoredSectionRendererContent as json.
|
|
func (o OptAnchoredSectionRendererContent) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes AnchoredSectionRendererContent from json.
|
|
func (o *OptAnchoredSectionRendererContent) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptAnchoredSectionRendererContent to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptAnchoredSectionRendererContent) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptAnchoredSectionRendererContent) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes BrowseEndpoint as json.
|
|
func (o OptBrowseEndpoint) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes BrowseEndpoint from json.
|
|
func (o *OptBrowseEndpoint) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptBrowseEndpoint to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptBrowseEndpoint) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptBrowseEndpoint) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes BrowseResponsePayloadContents as json.
|
|
func (o OptBrowseResponsePayloadContents) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes BrowseResponsePayloadContents from json.
|
|
func (o *OptBrowseResponsePayloadContents) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptBrowseResponsePayloadContents to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptBrowseResponsePayloadContents) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptBrowseResponsePayloadContents) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes BrowseResponsePayloadHeader as json.
|
|
func (o OptBrowseResponsePayloadHeader) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes BrowseResponsePayloadHeader from json.
|
|
func (o *OptBrowseResponsePayloadHeader) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptBrowseResponsePayloadHeader to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptBrowseResponsePayloadHeader) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptBrowseResponsePayloadHeader) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes CategoriesHeaderRenderer as json.
|
|
func (o OptCategoriesHeaderRenderer) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes CategoriesHeaderRenderer from json.
|
|
func (o *OptCategoriesHeaderRenderer) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptCategoriesHeaderRenderer to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptCategoriesHeaderRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptCategoriesHeaderRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes CategoryAssets as json.
|
|
func (o OptCategoryAssets) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes CategoryAssets from json.
|
|
func (o *OptCategoryAssets) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptCategoryAssets to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptCategoryAssets) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptCategoryAssets) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes CompactVideoRenderer as json.
|
|
func (o OptCompactVideoRenderer) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes CompactVideoRenderer from json.
|
|
func (o *OptCompactVideoRenderer) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptCompactVideoRenderer to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptCompactVideoRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptCompactVideoRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes CompactVideoRendererChannelThumbnail as json.
|
|
func (o OptCompactVideoRendererChannelThumbnail) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes CompactVideoRendererChannelThumbnail from json.
|
|
func (o *OptCompactVideoRendererChannelThumbnail) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptCompactVideoRendererChannelThumbnail to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptCompactVideoRendererChannelThumbnail) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptCompactVideoRendererChannelThumbnail) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes CompactVideoRendererThumbnail as json.
|
|
func (o OptCompactVideoRendererThumbnail) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes CompactVideoRendererThumbnail from json.
|
|
func (o *OptCompactVideoRendererThumbnail) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptCompactVideoRendererThumbnail to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptCompactVideoRendererThumbnail) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptCompactVideoRendererThumbnail) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes ErrorResponsePayloadError as json.
|
|
func (o OptErrorResponsePayloadError) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes ErrorResponsePayloadError from json.
|
|
func (o *OptErrorResponsePayloadError) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptErrorResponsePayloadError to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptErrorResponsePayloadError) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptErrorResponsePayloadError) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes float64 as json.
|
|
func (o OptFloat64) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
e.Float64(float64(o.Value))
|
|
}
|
|
|
|
// Decode decodes float64 from json.
|
|
func (o *OptFloat64) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptFloat64 to nil")
|
|
}
|
|
o.Set = true
|
|
v, err := d.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
o.Value = float64(v)
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptFloat64) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptFloat64) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes ItemSectionRenderer as json.
|
|
func (o OptItemSectionRenderer) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes ItemSectionRenderer from json.
|
|
func (o *OptItemSectionRenderer) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptItemSectionRenderer to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptItemSectionRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptItemSectionRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes KidsAppCategorySettings as json.
|
|
func (o OptKidsAppCategorySettings) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes KidsAppCategorySettings from json.
|
|
func (o *OptKidsAppCategorySettings) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptKidsAppCategorySettings to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptKidsAppCategorySettings) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptKidsAppCategorySettings) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes KidsAppContentSettings as json.
|
|
func (o OptKidsAppContentSettings) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes KidsAppContentSettings from json.
|
|
func (o *OptKidsAppContentSettings) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptKidsAppContentSettings to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptKidsAppContentSettings) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptKidsAppContentSettings) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes KidsAppInfo as json.
|
|
func (o OptKidsAppInfo) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes KidsAppInfo from json.
|
|
func (o *OptKidsAppInfo) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptKidsAppInfo to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptKidsAppInfo) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptKidsAppInfo) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes KidsVideoOwnerExtension as json.
|
|
func (o OptKidsVideoOwnerExtension) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes KidsVideoOwnerExtension from json.
|
|
func (o *OptKidsVideoOwnerExtension) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptKidsVideoOwnerExtension to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptKidsVideoOwnerExtension) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptKidsVideoOwnerExtension) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes NavigationEndpoint as json.
|
|
func (o OptNavigationEndpoint) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes NavigationEndpoint from json.
|
|
func (o *OptNavigationEndpoint) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptNavigationEndpoint to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptNavigationEndpoint) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptNavigationEndpoint) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes RequestClient as json.
|
|
func (o OptRequestClient) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes RequestClient from json.
|
|
func (o *OptRequestClient) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptRequestClient to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptRequestClient) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptRequestClient) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes RequestContext as json.
|
|
func (o OptRequestContext) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes RequestContext from json.
|
|
func (o *OptRequestContext) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptRequestContext to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptRequestContext) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptRequestContext) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes ResponseContext as json.
|
|
func (o OptResponseContext) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes ResponseContext from json.
|
|
func (o *OptResponseContext) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptResponseContext to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptResponseContext) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptResponseContext) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes ScreenRenderer as json.
|
|
func (o OptScreenRenderer) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes ScreenRenderer from json.
|
|
func (o *OptScreenRenderer) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptScreenRenderer to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptScreenRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptScreenRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes SectionListRenderer as json.
|
|
func (o OptSectionListRenderer) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes SectionListRenderer from json.
|
|
func (o *OptSectionListRenderer) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptSectionListRenderer to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptSectionListRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptSectionListRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes string as json.
|
|
func (o OptString) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
e.Str(string(o.Value))
|
|
}
|
|
|
|
// Decode decodes string from json.
|
|
func (o *OptString) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptString to nil")
|
|
}
|
|
o.Set = true
|
|
v, err := d.Str()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
o.Value = string(v)
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptString) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptString) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes Text as json.
|
|
func (o OptText) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes Text from json.
|
|
func (o *OptText) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptText to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptText) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptText) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode encodes WatchEndpoint as json.
|
|
func (o OptWatchEndpoint) Encode(e *jx.Encoder) {
|
|
if !o.Set {
|
|
return
|
|
}
|
|
o.Value.Encode(e)
|
|
}
|
|
|
|
// Decode decodes WatchEndpoint from json.
|
|
func (o *OptWatchEndpoint) Decode(d *jx.Decoder) error {
|
|
if o == nil {
|
|
return errors.New("invalid: unable to decode OptWatchEndpoint to nil")
|
|
}
|
|
o.Set = true
|
|
if err := o.Value.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s OptWatchEndpoint) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *OptWatchEndpoint) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *RequestClient) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *RequestClient) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.ClientName.Set {
|
|
e.FieldStart("clientName")
|
|
s.ClientName.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.ClientVersion.Set {
|
|
e.FieldStart("clientVersion")
|
|
s.ClientVersion.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Hl.Set {
|
|
e.FieldStart("hl")
|
|
s.Hl.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Gl.Set {
|
|
e.FieldStart("gl")
|
|
s.Gl.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.ExperimentsToken.Set {
|
|
e.FieldStart("experimentsToken")
|
|
s.ExperimentsToken.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.BrowserName.Set {
|
|
e.FieldStart("browserName")
|
|
s.BrowserName.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.DeviceMake.Set {
|
|
e.FieldStart("deviceMake")
|
|
s.DeviceMake.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.BrowserVersion.Set {
|
|
e.FieldStart("browserVersion")
|
|
s.BrowserVersion.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.OsName.Set {
|
|
e.FieldStart("osName")
|
|
s.OsName.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.OsVersion.Set {
|
|
e.FieldStart("osVersion")
|
|
s.OsVersion.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Platform.Set {
|
|
e.FieldStart("platform")
|
|
s.Platform.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.KidsAppInfo.Set {
|
|
e.FieldStart("kidsAppInfo")
|
|
s.KidsAppInfo.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfRequestClient = [12]string{
|
|
0: "clientName",
|
|
1: "clientVersion",
|
|
2: "hl",
|
|
3: "gl",
|
|
4: "experimentsToken",
|
|
5: "browserName",
|
|
6: "deviceMake",
|
|
7: "browserVersion",
|
|
8: "osName",
|
|
9: "osVersion",
|
|
10: "platform",
|
|
11: "kidsAppInfo",
|
|
}
|
|
|
|
// Decode decodes RequestClient from json.
|
|
func (s *RequestClient) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode RequestClient to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "clientName":
|
|
if err := func() error {
|
|
s.ClientName.Reset()
|
|
if err := s.ClientName.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"clientName\"")
|
|
}
|
|
case "clientVersion":
|
|
if err := func() error {
|
|
s.ClientVersion.Reset()
|
|
if err := s.ClientVersion.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"clientVersion\"")
|
|
}
|
|
case "hl":
|
|
if err := func() error {
|
|
s.Hl.Reset()
|
|
if err := s.Hl.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"hl\"")
|
|
}
|
|
case "gl":
|
|
if err := func() error {
|
|
s.Gl.Reset()
|
|
if err := s.Gl.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"gl\"")
|
|
}
|
|
case "experimentsToken":
|
|
if err := func() error {
|
|
s.ExperimentsToken.Reset()
|
|
if err := s.ExperimentsToken.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"experimentsToken\"")
|
|
}
|
|
case "browserName":
|
|
if err := func() error {
|
|
s.BrowserName.Reset()
|
|
if err := s.BrowserName.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"browserName\"")
|
|
}
|
|
case "deviceMake":
|
|
if err := func() error {
|
|
s.DeviceMake.Reset()
|
|
if err := s.DeviceMake.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"deviceMake\"")
|
|
}
|
|
case "browserVersion":
|
|
if err := func() error {
|
|
s.BrowserVersion.Reset()
|
|
if err := s.BrowserVersion.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"browserVersion\"")
|
|
}
|
|
case "osName":
|
|
if err := func() error {
|
|
s.OsName.Reset()
|
|
if err := s.OsName.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"osName\"")
|
|
}
|
|
case "osVersion":
|
|
if err := func() error {
|
|
s.OsVersion.Reset()
|
|
if err := s.OsVersion.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"osVersion\"")
|
|
}
|
|
case "platform":
|
|
if err := func() error {
|
|
s.Platform.Reset()
|
|
if err := s.Platform.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"platform\"")
|
|
}
|
|
case "kidsAppInfo":
|
|
if err := func() error {
|
|
s.KidsAppInfo.Reset()
|
|
if err := s.KidsAppInfo.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"kidsAppInfo\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode RequestClient")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *RequestClient) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *RequestClient) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *RequestContext) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *RequestContext) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Client.Set {
|
|
e.FieldStart("client")
|
|
s.Client.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfRequestContext = [1]string{
|
|
0: "client",
|
|
}
|
|
|
|
// Decode decodes RequestContext from json.
|
|
func (s *RequestContext) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode RequestContext to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "client":
|
|
if err := func() error {
|
|
s.Client.Reset()
|
|
if err := s.Client.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"client\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode RequestContext")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *RequestContext) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *RequestContext) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *ResponseContext) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *ResponseContext) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.VisitorData.Set {
|
|
e.FieldStart("visitorData")
|
|
s.VisitorData.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.MaxAgeSeconds.Set {
|
|
e.FieldStart("maxAgeSeconds")
|
|
s.MaxAgeSeconds.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.ServiceTrackingParams != nil {
|
|
e.FieldStart("serviceTrackingParams")
|
|
e.ArrStart()
|
|
for _, elem := range s.ServiceTrackingParams {
|
|
elem.Encode(e)
|
|
}
|
|
e.ArrEnd()
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfResponseContext = [3]string{
|
|
0: "visitorData",
|
|
1: "maxAgeSeconds",
|
|
2: "serviceTrackingParams",
|
|
}
|
|
|
|
// Decode decodes ResponseContext from json.
|
|
func (s *ResponseContext) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode ResponseContext to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "visitorData":
|
|
if err := func() error {
|
|
s.VisitorData.Reset()
|
|
if err := s.VisitorData.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"visitorData\"")
|
|
}
|
|
case "maxAgeSeconds":
|
|
if err := func() error {
|
|
s.MaxAgeSeconds.Reset()
|
|
if err := s.MaxAgeSeconds.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"maxAgeSeconds\"")
|
|
}
|
|
case "serviceTrackingParams":
|
|
if err := func() error {
|
|
s.ServiceTrackingParams = make([]ResponseContextServiceTrackingParamsItem, 0)
|
|
if err := d.Arr(func(d *jx.Decoder) error {
|
|
var elem ResponseContextServiceTrackingParamsItem
|
|
if err := elem.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
s.ServiceTrackingParams = append(s.ServiceTrackingParams, elem)
|
|
return nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"serviceTrackingParams\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode ResponseContext")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *ResponseContext) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *ResponseContext) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *ResponseContextServiceTrackingParamsItem) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *ResponseContextServiceTrackingParamsItem) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Service.Set {
|
|
e.FieldStart("service")
|
|
s.Service.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Params != nil {
|
|
e.FieldStart("params")
|
|
e.ArrStart()
|
|
for _, elem := range s.Params {
|
|
elem.Encode(e)
|
|
}
|
|
e.ArrEnd()
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfResponseContextServiceTrackingParamsItem = [2]string{
|
|
0: "service",
|
|
1: "params",
|
|
}
|
|
|
|
// Decode decodes ResponseContextServiceTrackingParamsItem from json.
|
|
func (s *ResponseContextServiceTrackingParamsItem) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode ResponseContextServiceTrackingParamsItem to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "service":
|
|
if err := func() error {
|
|
s.Service.Reset()
|
|
if err := s.Service.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"service\"")
|
|
}
|
|
case "params":
|
|
if err := func() error {
|
|
s.Params = make([]KeyStringValue, 0)
|
|
if err := d.Arr(func(d *jx.Decoder) error {
|
|
var elem KeyStringValue
|
|
if err := elem.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
s.Params = append(s.Params, elem)
|
|
return nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"params\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode ResponseContextServiceTrackingParamsItem")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *ResponseContextServiceTrackingParamsItem) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *ResponseContextServiceTrackingParamsItem) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *ScreenAnchor) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *ScreenAnchor) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.AnchoredSectionRenderer.Set {
|
|
e.FieldStart("anchoredSectionRenderer")
|
|
s.AnchoredSectionRenderer.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfScreenAnchor = [1]string{
|
|
0: "anchoredSectionRenderer",
|
|
}
|
|
|
|
// Decode decodes ScreenAnchor from json.
|
|
func (s *ScreenAnchor) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode ScreenAnchor to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "anchoredSectionRenderer":
|
|
if err := func() error {
|
|
s.AnchoredSectionRenderer.Reset()
|
|
if err := s.AnchoredSectionRenderer.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"anchoredSectionRenderer\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode ScreenAnchor")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *ScreenAnchor) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *ScreenAnchor) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *ScreenRenderer) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *ScreenRenderer) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Anchors != nil {
|
|
e.FieldStart("anchors")
|
|
e.ArrStart()
|
|
for _, elem := range s.Anchors {
|
|
elem.Encode(e)
|
|
}
|
|
e.ArrEnd()
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfScreenRenderer = [1]string{
|
|
0: "anchors",
|
|
}
|
|
|
|
// Decode decodes ScreenRenderer from json.
|
|
func (s *ScreenRenderer) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode ScreenRenderer to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "anchors":
|
|
if err := func() error {
|
|
s.Anchors = make([]ScreenAnchor, 0)
|
|
if err := d.Arr(func(d *jx.Decoder) error {
|
|
var elem ScreenAnchor
|
|
if err := elem.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
s.Anchors = append(s.Anchors, elem)
|
|
return nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"anchors\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode ScreenRenderer")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *ScreenRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *ScreenRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *SectionListRenderer) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *SectionListRenderer) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Contents != nil {
|
|
e.FieldStart("contents")
|
|
e.ArrStart()
|
|
for _, elem := range s.Contents {
|
|
elem.Encode(e)
|
|
}
|
|
e.ArrEnd()
|
|
}
|
|
}
|
|
{
|
|
if s.TrackingParams.Set {
|
|
e.FieldStart("trackingParams")
|
|
s.TrackingParams.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfSectionListRenderer = [2]string{
|
|
0: "contents",
|
|
1: "trackingParams",
|
|
}
|
|
|
|
// Decode decodes SectionListRenderer from json.
|
|
func (s *SectionListRenderer) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode SectionListRenderer to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "contents":
|
|
if err := func() error {
|
|
s.Contents = make([]SectionListRendererContentsItem, 0)
|
|
if err := d.Arr(func(d *jx.Decoder) error {
|
|
var elem SectionListRendererContentsItem
|
|
if err := elem.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
s.Contents = append(s.Contents, elem)
|
|
return nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"contents\"")
|
|
}
|
|
case "trackingParams":
|
|
if err := func() error {
|
|
s.TrackingParams.Reset()
|
|
if err := s.TrackingParams.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"trackingParams\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode SectionListRenderer")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *SectionListRenderer) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *SectionListRenderer) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *SectionListRendererContentsItem) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *SectionListRendererContentsItem) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.ItemSectionRenderer.Set {
|
|
e.FieldStart("itemSectionRenderer")
|
|
s.ItemSectionRenderer.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfSectionListRendererContentsItem = [1]string{
|
|
0: "itemSectionRenderer",
|
|
}
|
|
|
|
// Decode decodes SectionListRendererContentsItem from json.
|
|
func (s *SectionListRendererContentsItem) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode SectionListRendererContentsItem to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "itemSectionRenderer":
|
|
if err := func() error {
|
|
s.ItemSectionRenderer.Reset()
|
|
if err := s.ItemSectionRenderer.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"itemSectionRenderer\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode SectionListRendererContentsItem")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *SectionListRendererContentsItem) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *SectionListRendererContentsItem) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *Text) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *Text) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Runs != nil {
|
|
e.FieldStart("runs")
|
|
e.ArrStart()
|
|
for _, elem := range s.Runs {
|
|
elem.Encode(e)
|
|
}
|
|
e.ArrEnd()
|
|
}
|
|
}
|
|
{
|
|
if s.Accessibility.Set {
|
|
e.FieldStart("accessibility")
|
|
s.Accessibility.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfText = [2]string{
|
|
0: "runs",
|
|
1: "accessibility",
|
|
}
|
|
|
|
// Decode decodes Text from json.
|
|
func (s *Text) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode Text to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "runs":
|
|
if err := func() error {
|
|
s.Runs = make([]TextRun, 0)
|
|
if err := d.Arr(func(d *jx.Decoder) error {
|
|
var elem TextRun
|
|
if err := elem.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
s.Runs = append(s.Runs, elem)
|
|
return nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"runs\"")
|
|
}
|
|
case "accessibility":
|
|
if err := func() error {
|
|
s.Accessibility.Reset()
|
|
if err := s.Accessibility.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"accessibility\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode Text")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *Text) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *Text) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *TextRun) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *TextRun) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.Text.Set {
|
|
e.FieldStart("text")
|
|
s.Text.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.NavigationEndpoint.Set {
|
|
e.FieldStart("navigationEndpoint")
|
|
s.NavigationEndpoint.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfTextRun = [2]string{
|
|
0: "text",
|
|
1: "navigationEndpoint",
|
|
}
|
|
|
|
// Decode decodes TextRun from json.
|
|
func (s *TextRun) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode TextRun to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "text":
|
|
if err := func() error {
|
|
s.Text.Reset()
|
|
if err := s.Text.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"text\"")
|
|
}
|
|
case "navigationEndpoint":
|
|
if err := func() error {
|
|
s.NavigationEndpoint.Reset()
|
|
if err := s.NavigationEndpoint.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"navigationEndpoint\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode TextRun")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *TextRun) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *TextRun) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *Thumbnail) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *Thumbnail) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.URL.Set {
|
|
e.FieldStart("url")
|
|
s.URL.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Width.Set {
|
|
e.FieldStart("width")
|
|
s.Width.Encode(e)
|
|
}
|
|
}
|
|
{
|
|
if s.Height.Set {
|
|
e.FieldStart("height")
|
|
s.Height.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfThumbnail = [3]string{
|
|
0: "url",
|
|
1: "width",
|
|
2: "height",
|
|
}
|
|
|
|
// Decode decodes Thumbnail from json.
|
|
func (s *Thumbnail) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode Thumbnail to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "url":
|
|
if err := func() error {
|
|
s.URL.Reset()
|
|
if err := s.URL.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"url\"")
|
|
}
|
|
case "width":
|
|
if err := func() error {
|
|
s.Width.Reset()
|
|
if err := s.Width.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"width\"")
|
|
}
|
|
case "height":
|
|
if err := func() error {
|
|
s.Height.Reset()
|
|
if err := s.Height.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"height\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode Thumbnail")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *Thumbnail) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *Thumbnail) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|
|
|
|
// Encode implements json.Marshaler.
|
|
func (s *WatchEndpoint) Encode(e *jx.Encoder) {
|
|
e.ObjStart()
|
|
s.encodeFields(e)
|
|
e.ObjEnd()
|
|
}
|
|
|
|
// encodeFields encodes fields.
|
|
func (s *WatchEndpoint) encodeFields(e *jx.Encoder) {
|
|
{
|
|
if s.VideoId.Set {
|
|
e.FieldStart("videoId")
|
|
s.VideoId.Encode(e)
|
|
}
|
|
}
|
|
}
|
|
|
|
var jsonFieldsNameOfWatchEndpoint = [1]string{
|
|
0: "videoId",
|
|
}
|
|
|
|
// Decode decodes WatchEndpoint from json.
|
|
func (s *WatchEndpoint) Decode(d *jx.Decoder) error {
|
|
if s == nil {
|
|
return errors.New("invalid: unable to decode WatchEndpoint to nil")
|
|
}
|
|
|
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
|
switch string(k) {
|
|
case "videoId":
|
|
if err := func() error {
|
|
s.VideoId.Reset()
|
|
if err := s.VideoId.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
return errors.Wrap(err, "decode field \"videoId\"")
|
|
}
|
|
default:
|
|
return d.Skip()
|
|
}
|
|
return nil
|
|
}); err != nil {
|
|
return errors.Wrap(err, "decode WatchEndpoint")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON implements stdjson.Marshaler.
|
|
func (s *WatchEndpoint) MarshalJSON() ([]byte, error) {
|
|
e := jx.Encoder{}
|
|
s.Encode(&e)
|
|
return e.Bytes(), nil
|
|
}
|
|
|
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
|
func (s *WatchEndpoint) UnmarshalJSON(data []byte) error {
|
|
d := jx.DecodeBytes(data)
|
|
return s.Decode(d)
|
|
}
|