// Code generated by ogen, DO NOT EDIT.

package api

import (
	"math/bits"
	"strconv"
	"time"

	"github.com/go-faster/errors"
	"github.com/go-faster/jx"

	"github.com/ogen-go/ogen/json"
	"github.com/ogen-go/ogen/validate"
)

// Encode implements json.Marshaler.
func (s *APIV2BufferGoodsTaskGetBadRequest) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2BufferGoodsTaskGetBadRequest) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfAPIV2BufferGoodsTaskGetBadRequest = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes APIV2BufferGoodsTaskGetBadRequest from json.
func (s *APIV2BufferGoodsTaskGetBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2BufferGoodsTaskGetBadRequest to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV2BufferGoodsTaskGetBadRequest")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2BufferGoodsTaskGetBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2BufferGoodsTaskGetBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV2BufferGoodsTaskGetBadRequestData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2BufferGoodsTaskGetBadRequestData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfAPIV2BufferGoodsTaskGetBadRequestData = [0]string{}

// Decode decodes APIV2BufferGoodsTaskGetBadRequestData from json.
func (s *APIV2BufferGoodsTaskGetBadRequestData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2BufferGoodsTaskGetBadRequestData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode APIV2BufferGoodsTaskGetBadRequestData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2BufferGoodsTaskGetBadRequestData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2BufferGoodsTaskGetBadRequestData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV2BufferTasksGetBadRequest) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2BufferTasksGetBadRequest) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfAPIV2BufferTasksGetBadRequest = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes APIV2BufferTasksGetBadRequest from json.
func (s *APIV2BufferTasksGetBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2BufferTasksGetBadRequest to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV2BufferTasksGetBadRequest")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2BufferTasksGetBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2BufferTasksGetBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV2BufferTasksGetBadRequestData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2BufferTasksGetBadRequestData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfAPIV2BufferTasksGetBadRequestData = [0]string{}

// Decode decodes APIV2BufferTasksGetBadRequestData from json.
func (s *APIV2BufferTasksGetBadRequestData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2BufferTasksGetBadRequestData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode APIV2BufferTasksGetBadRequestData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2BufferTasksGetBadRequestData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2BufferTasksGetBadRequestData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV2HistoryGoodsTaskGetBadRequest) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2HistoryGoodsTaskGetBadRequest) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfAPIV2HistoryGoodsTaskGetBadRequest = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes APIV2HistoryGoodsTaskGetBadRequest from json.
func (s *APIV2HistoryGoodsTaskGetBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2HistoryGoodsTaskGetBadRequest to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV2HistoryGoodsTaskGetBadRequest")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2HistoryGoodsTaskGetBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2HistoryGoodsTaskGetBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV2HistoryGoodsTaskGetBadRequestData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2HistoryGoodsTaskGetBadRequestData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfAPIV2HistoryGoodsTaskGetBadRequestData = [0]string{}

// Decode decodes APIV2HistoryGoodsTaskGetBadRequestData from json.
func (s *APIV2HistoryGoodsTaskGetBadRequestData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2HistoryGoodsTaskGetBadRequestData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode APIV2HistoryGoodsTaskGetBadRequestData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2HistoryGoodsTaskGetBadRequestData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2HistoryGoodsTaskGetBadRequestData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV2HistoryTasksGetBadRequest) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2HistoryTasksGetBadRequest) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfAPIV2HistoryTasksGetBadRequest = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes APIV2HistoryTasksGetBadRequest from json.
func (s *APIV2HistoryTasksGetBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2HistoryTasksGetBadRequest to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV2HistoryTasksGetBadRequest")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2HistoryTasksGetBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2HistoryTasksGetBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV2HistoryTasksGetBadRequestData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2HistoryTasksGetBadRequestData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfAPIV2HistoryTasksGetBadRequestData = [0]string{}

// Decode decodes APIV2HistoryTasksGetBadRequestData from json.
func (s *APIV2HistoryTasksGetBadRequestData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2HistoryTasksGetBadRequestData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode APIV2HistoryTasksGetBadRequestData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2HistoryTasksGetBadRequestData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2HistoryTasksGetBadRequestData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV2QuarantineGoodsGetBadRequest as json.
func (s *APIV2QuarantineGoodsGetBadRequest) Encode(e *jx.Encoder) {
	unwrapped := (*ResponseError)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV2QuarantineGoodsGetBadRequest from json.
func (s *APIV2QuarantineGoodsGetBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2QuarantineGoodsGetBadRequest to nil")
	}
	var unwrapped ResponseError
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV2QuarantineGoodsGetBadRequest(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2QuarantineGoodsGetBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2QuarantineGoodsGetBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV2QuarantineGoodsGetUnprocessableEntity as json.
func (s *APIV2QuarantineGoodsGetUnprocessableEntity) Encode(e *jx.Encoder) {
	unwrapped := (*ResponseError)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV2QuarantineGoodsGetUnprocessableEntity from json.
func (s *APIV2QuarantineGoodsGetUnprocessableEntity) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2QuarantineGoodsGetUnprocessableEntity to nil")
	}
	var unwrapped ResponseError
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV2QuarantineGoodsGetUnprocessableEntity(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2QuarantineGoodsGetUnprocessableEntity) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2QuarantineGoodsGetUnprocessableEntity) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV2UploadTaskClubDiscountPostBadRequest as json.
func (s *APIV2UploadTaskClubDiscountPostBadRequest) Encode(e *jx.Encoder) {
	unwrapped := (*ResponseError)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV2UploadTaskClubDiscountPostBadRequest from json.
func (s *APIV2UploadTaskClubDiscountPostBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2UploadTaskClubDiscountPostBadRequest to nil")
	}
	var unwrapped ResponseError
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV2UploadTaskClubDiscountPostBadRequest(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2UploadTaskClubDiscountPostBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2UploadTaskClubDiscountPostBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV2UploadTaskClubDiscountPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2UploadTaskClubDiscountPostReq) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
}

var jsonFieldsNameOfAPIV2UploadTaskClubDiscountPostReq = [1]string{
	0: "data",
}

// Decode decodes APIV2UploadTaskClubDiscountPostReq from json.
func (s *APIV2UploadTaskClubDiscountPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2UploadTaskClubDiscountPostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV2UploadTaskClubDiscountPostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2UploadTaskClubDiscountPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2UploadTaskClubDiscountPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV2UploadTaskClubDiscountPostUnprocessableEntity as json.
func (s *APIV2UploadTaskClubDiscountPostUnprocessableEntity) Encode(e *jx.Encoder) {
	unwrapped := (*ResponseError)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV2UploadTaskClubDiscountPostUnprocessableEntity from json.
func (s *APIV2UploadTaskClubDiscountPostUnprocessableEntity) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2UploadTaskClubDiscountPostUnprocessableEntity to nil")
	}
	var unwrapped ResponseError
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV2UploadTaskClubDiscountPostUnprocessableEntity(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2UploadTaskClubDiscountPostUnprocessableEntity) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2UploadTaskClubDiscountPostUnprocessableEntity) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV2UploadTaskPostBadRequest as json.
func (s *APIV2UploadTaskPostBadRequest) Encode(e *jx.Encoder) {
	unwrapped := (*ResponseError)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV2UploadTaskPostBadRequest from json.
func (s *APIV2UploadTaskPostBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2UploadTaskPostBadRequest to nil")
	}
	var unwrapped ResponseError
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV2UploadTaskPostBadRequest(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2UploadTaskPostBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2UploadTaskPostBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV2UploadTaskPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2UploadTaskPostReq) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
}

var jsonFieldsNameOfAPIV2UploadTaskPostReq = [1]string{
	0: "data",
}

// Decode decodes APIV2UploadTaskPostReq from json.
func (s *APIV2UploadTaskPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2UploadTaskPostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV2UploadTaskPostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2UploadTaskPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2UploadTaskPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV2UploadTaskPostUnprocessableEntity as json.
func (s *APIV2UploadTaskPostUnprocessableEntity) Encode(e *jx.Encoder) {
	unwrapped := (*ResponseError)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV2UploadTaskPostUnprocessableEntity from json.
func (s *APIV2UploadTaskPostUnprocessableEntity) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2UploadTaskPostUnprocessableEntity to nil")
	}
	var unwrapped ResponseError
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV2UploadTaskPostUnprocessableEntity(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2UploadTaskPostUnprocessableEntity) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2UploadTaskPostUnprocessableEntity) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV2UploadTaskSizePostBadRequest as json.
func (s *APIV2UploadTaskSizePostBadRequest) Encode(e *jx.Encoder) {
	unwrapped := (*ResponseError)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV2UploadTaskSizePostBadRequest from json.
func (s *APIV2UploadTaskSizePostBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2UploadTaskSizePostBadRequest to nil")
	}
	var unwrapped ResponseError
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV2UploadTaskSizePostBadRequest(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2UploadTaskSizePostBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2UploadTaskSizePostBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV2UploadTaskSizePostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV2UploadTaskSizePostReq) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
}

var jsonFieldsNameOfAPIV2UploadTaskSizePostReq = [1]string{
	0: "data",
}

// Decode decodes APIV2UploadTaskSizePostReq from json.
func (s *APIV2UploadTaskSizePostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2UploadTaskSizePostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV2UploadTaskSizePostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2UploadTaskSizePostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2UploadTaskSizePostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV2UploadTaskSizePostUnprocessableEntity as json.
func (s *APIV2UploadTaskSizePostUnprocessableEntity) Encode(e *jx.Encoder) {
	unwrapped := (*ResponseError)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV2UploadTaskSizePostUnprocessableEntity from json.
func (s *APIV2UploadTaskSizePostUnprocessableEntity) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV2UploadTaskSizePostUnprocessableEntity to nil")
	}
	var unwrapped ResponseError
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV2UploadTaskSizePostUnprocessableEntity(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV2UploadTaskSizePostUnprocessableEntity) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV2UploadTaskSizePostUnprocessableEntity) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3OfficesGetOKApplicationJSON as json.
func (s APIV3OfficesGetOKApplicationJSON) Encode(e *jx.Encoder) {
	unwrapped := []Office(s)

	e.ArrStart()
	for _, elem := range unwrapped {
		elem.Encode(e)
	}
	e.ArrEnd()
}

// Decode decodes APIV3OfficesGetOKApplicationJSON from json.
func (s *APIV3OfficesGetOKApplicationJSON) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3OfficesGetOKApplicationJSON to nil")
	}
	var unwrapped []Office
	if err := func() error {
		unwrapped = make([]Office, 0)
		if err := d.Arr(func(d *jx.Decoder) error {
			var elem Office
			if err := elem.Decode(d); err != nil {
				return err
			}
			unwrapped = append(unwrapped, elem)
			return nil
		}); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3OfficesGetOKApplicationJSON(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s APIV3OfficesGetOKApplicationJSON) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3OfficesGetOKApplicationJSON) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdDeleteBadRequest as json.
func (s *APIV3StocksWarehouseIdDeleteBadRequest) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdDeleteBadRequest from json.
func (s *APIV3StocksWarehouseIdDeleteBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdDeleteBadRequest to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdDeleteBadRequest(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdDeleteBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdDeleteBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdDeleteConflict as json.
func (s *APIV3StocksWarehouseIdDeleteConflict) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdDeleteConflict from json.
func (s *APIV3StocksWarehouseIdDeleteConflict) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdDeleteConflict to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdDeleteConflict(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdDeleteConflict) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdDeleteConflict) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdDeleteForbidden as json.
func (s *APIV3StocksWarehouseIdDeleteForbidden) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdDeleteForbidden from json.
func (s *APIV3StocksWarehouseIdDeleteForbidden) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdDeleteForbidden to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdDeleteForbidden(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdDeleteForbidden) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdDeleteForbidden) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdDeleteNotFound as json.
func (s *APIV3StocksWarehouseIdDeleteNotFound) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdDeleteNotFound from json.
func (s *APIV3StocksWarehouseIdDeleteNotFound) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdDeleteNotFound to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdDeleteNotFound(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdDeleteNotFound) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdDeleteNotFound) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV3StocksWarehouseIdDeleteReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV3StocksWarehouseIdDeleteReq) encodeFields(e *jx.Encoder) {
	{
		if s.Skus != nil {
			e.FieldStart("skus")
			e.ArrStart()
			for _, elem := range s.Skus {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfAPIV3StocksWarehouseIdDeleteReq = [1]string{
	0: "skus",
}

// Decode decodes APIV3StocksWarehouseIdDeleteReq from json.
func (s *APIV3StocksWarehouseIdDeleteReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdDeleteReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "skus":
			if err := func() error {
				s.Skus = 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.Skus = append(s.Skus, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"skus\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV3StocksWarehouseIdDeleteReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdDeleteReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdDeleteReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdPostBadRequest as json.
func (s *APIV3StocksWarehouseIdPostBadRequest) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdPostBadRequest from json.
func (s *APIV3StocksWarehouseIdPostBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPostBadRequest to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdPostBadRequest(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPostBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPostBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdPostForbidden as json.
func (s *APIV3StocksWarehouseIdPostForbidden) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdPostForbidden from json.
func (s *APIV3StocksWarehouseIdPostForbidden) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPostForbidden to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdPostForbidden(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPostForbidden) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPostForbidden) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdPostNotFound as json.
func (s *APIV3StocksWarehouseIdPostNotFound) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdPostNotFound from json.
func (s *APIV3StocksWarehouseIdPostNotFound) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPostNotFound to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdPostNotFound(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPostNotFound) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPostNotFound) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV3StocksWarehouseIdPostOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV3StocksWarehouseIdPostOK) encodeFields(e *jx.Encoder) {
	{
		if s.Stocks != nil {
			e.FieldStart("stocks")
			e.ArrStart()
			for _, elem := range s.Stocks {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfAPIV3StocksWarehouseIdPostOK = [1]string{
	0: "stocks",
}

// Decode decodes APIV3StocksWarehouseIdPostOK from json.
func (s *APIV3StocksWarehouseIdPostOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPostOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "stocks":
			if err := func() error {
				s.Stocks = make([]APIV3StocksWarehouseIdPostOKStocksItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem APIV3StocksWarehouseIdPostOKStocksItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Stocks = append(s.Stocks, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"stocks\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV3StocksWarehouseIdPostOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPostOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPostOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV3StocksWarehouseIdPostOKStocksItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV3StocksWarehouseIdPostOKStocksItem) encodeFields(e *jx.Encoder) {
	{
		if s.Sku.Set {
			e.FieldStart("sku")
			s.Sku.Encode(e)
		}
	}
	{
		if s.Amount.Set {
			e.FieldStart("amount")
			s.Amount.Encode(e)
		}
	}
}

var jsonFieldsNameOfAPIV3StocksWarehouseIdPostOKStocksItem = [2]string{
	0: "sku",
	1: "amount",
}

// Decode decodes APIV3StocksWarehouseIdPostOKStocksItem from json.
func (s *APIV3StocksWarehouseIdPostOKStocksItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPostOKStocksItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "sku":
			if err := func() error {
				s.Sku.Reset()
				if err := s.Sku.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sku\"")
			}
		case "amount":
			if err := func() error {
				s.Amount.Reset()
				if err := s.Amount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"amount\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV3StocksWarehouseIdPostOKStocksItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPostOKStocksItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPostOKStocksItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV3StocksWarehouseIdPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV3StocksWarehouseIdPostReq) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("skus")
		e.ArrStart()
		for _, elem := range s.Skus {
			e.Str(elem)
		}
		e.ArrEnd()
	}
}

var jsonFieldsNameOfAPIV3StocksWarehouseIdPostReq = [1]string{
	0: "skus",
}

// Decode decodes APIV3StocksWarehouseIdPostReq from json.
func (s *APIV3StocksWarehouseIdPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPostReq to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "skus":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				s.Skus = 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.Skus = append(s.Skus, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"skus\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV3StocksWarehouseIdPostReq")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000001,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfAPIV3StocksWarehouseIdPostReq) {
					name = jsonFieldsNameOfAPIV3StocksWarehouseIdPostReq[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdPutConflict as json.
func (s *APIV3StocksWarehouseIdPutConflict) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdPutConflict from json.
func (s *APIV3StocksWarehouseIdPutConflict) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPutConflict to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdPutConflict(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPutConflict) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPutConflict) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdPutForbidden as json.
func (s *APIV3StocksWarehouseIdPutForbidden) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdPutForbidden from json.
func (s *APIV3StocksWarehouseIdPutForbidden) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPutForbidden to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdPutForbidden(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPutForbidden) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPutForbidden) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdPutNotAcceptableApplicationJSON as json.
func (s APIV3StocksWarehouseIdPutNotAcceptableApplicationJSON) Encode(e *jx.Encoder) {
	unwrapped := jx.Raw(s)

	if len(unwrapped) != 0 {
		e.Raw(unwrapped)
	}
}

// Decode decodes APIV3StocksWarehouseIdPutNotAcceptableApplicationJSON from json.
func (s *APIV3StocksWarehouseIdPutNotAcceptableApplicationJSON) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPutNotAcceptableApplicationJSON to nil")
	}
	var unwrapped jx.Raw
	if err := func() error {
		v, err := d.RawAppend(nil)
		unwrapped = jx.Raw(v)
		if err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdPutNotAcceptableApplicationJSON(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s APIV3StocksWarehouseIdPutNotAcceptableApplicationJSON) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPutNotAcceptableApplicationJSON) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdPutNotFound as json.
func (s *APIV3StocksWarehouseIdPutNotFound) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdPutNotFound from json.
func (s *APIV3StocksWarehouseIdPutNotFound) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPutNotFound to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3StocksWarehouseIdPutNotFound(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPutNotFound) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPutNotFound) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV3StocksWarehouseIdPutReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV3StocksWarehouseIdPutReq) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("stocks")
		e.ArrStart()
		for _, elem := range s.Stocks {
			elem.Encode(e)
		}
		e.ArrEnd()
	}
}

var jsonFieldsNameOfAPIV3StocksWarehouseIdPutReq = [1]string{
	0: "stocks",
}

// Decode decodes APIV3StocksWarehouseIdPutReq from json.
func (s *APIV3StocksWarehouseIdPutReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPutReq to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "stocks":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				s.Stocks = make([]APIV3StocksWarehouseIdPutReqStocksItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem APIV3StocksWarehouseIdPutReqStocksItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Stocks = append(s.Stocks, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"stocks\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV3StocksWarehouseIdPutReq")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000001,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfAPIV3StocksWarehouseIdPutReq) {
					name = jsonFieldsNameOfAPIV3StocksWarehouseIdPutReq[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPutReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPutReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV3StocksWarehouseIdPutReqStocksItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV3StocksWarehouseIdPutReqStocksItem) encodeFields(e *jx.Encoder) {
	{
		if s.Sku.Set {
			e.FieldStart("sku")
			s.Sku.Encode(e)
		}
	}
	{
		if s.Amount.Set {
			e.FieldStart("amount")
			s.Amount.Encode(e)
		}
	}
}

var jsonFieldsNameOfAPIV3StocksWarehouseIdPutReqStocksItem = [2]string{
	0: "sku",
	1: "amount",
}

// Decode decodes APIV3StocksWarehouseIdPutReqStocksItem from json.
func (s *APIV3StocksWarehouseIdPutReqStocksItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3StocksWarehouseIdPutReqStocksItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "sku":
			if err := func() error {
				s.Sku.Reset()
				if err := s.Sku.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sku\"")
			}
		case "amount":
			if err := func() error {
				s.Amount.Reset()
				if err := s.Amount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"amount\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV3StocksWarehouseIdPutReqStocksItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3StocksWarehouseIdPutReqStocksItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3StocksWarehouseIdPutReqStocksItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesGetOKApplicationJSON as json.
func (s APIV3WarehousesGetOKApplicationJSON) Encode(e *jx.Encoder) {
	unwrapped := []Warehouse(s)

	e.ArrStart()
	for _, elem := range unwrapped {
		elem.Encode(e)
	}
	e.ArrEnd()
}

// Decode decodes APIV3WarehousesGetOKApplicationJSON from json.
func (s *APIV3WarehousesGetOKApplicationJSON) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesGetOKApplicationJSON to nil")
	}
	var unwrapped []Warehouse
	if err := func() error {
		unwrapped = make([]Warehouse, 0)
		if err := d.Arr(func(d *jx.Decoder) error {
			var elem Warehouse
			if err := elem.Decode(d); err != nil {
				return err
			}
			unwrapped = append(unwrapped, elem)
			return nil
		}); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesGetOKApplicationJSON(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s APIV3WarehousesGetOKApplicationJSON) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesGetOKApplicationJSON) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesPostBadRequest as json.
func (s *APIV3WarehousesPostBadRequest) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3WarehousesPostBadRequest from json.
func (s *APIV3WarehousesPostBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesPostBadRequest to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesPostBadRequest(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesPostBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesPostBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesPostConflict as json.
func (s *APIV3WarehousesPostConflict) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3WarehousesPostConflict from json.
func (s *APIV3WarehousesPostConflict) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesPostConflict to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesPostConflict(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesPostConflict) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesPostConflict) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV3WarehousesPostCreated) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV3WarehousesPostCreated) encodeFields(e *jx.Encoder) {
	{
		if s.ID.Set {
			e.FieldStart("id")
			s.ID.Encode(e)
		}
	}
}

var jsonFieldsNameOfAPIV3WarehousesPostCreated = [1]string{
	0: "id",
}

// Decode decodes APIV3WarehousesPostCreated from json.
func (s *APIV3WarehousesPostCreated) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesPostCreated to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "id":
			if err := func() error {
				s.ID.Reset()
				if err := s.ID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV3WarehousesPostCreated")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesPostCreated) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesPostCreated) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesPostForbidden as json.
func (s *APIV3WarehousesPostForbidden) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3WarehousesPostForbidden from json.
func (s *APIV3WarehousesPostForbidden) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesPostForbidden to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesPostForbidden(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesPostForbidden) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesPostForbidden) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesPostNotFound as json.
func (s *APIV3WarehousesPostNotFound) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3WarehousesPostNotFound from json.
func (s *APIV3WarehousesPostNotFound) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesPostNotFound to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesPostNotFound(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesPostNotFound) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesPostNotFound) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV3WarehousesPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV3WarehousesPostReq) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("name")
		e.Str(s.Name)
	}
	{
		e.FieldStart("officeId")
		e.Int(s.OfficeId)
	}
}

var jsonFieldsNameOfAPIV3WarehousesPostReq = [2]string{
	0: "name",
	1: "officeId",
}

// Decode decodes APIV3WarehousesPostReq from json.
func (s *APIV3WarehousesPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesPostReq to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "name":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				v, err := d.Str()
				s.Name = string(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"name\"")
			}
		case "officeId":
			requiredBitSet[0] |= 1 << 1
			if err := func() error {
				v, err := d.Int()
				s.OfficeId = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"officeId\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV3WarehousesPostReq")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000011,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfAPIV3WarehousesPostReq) {
					name = jsonFieldsNameOfAPIV3WarehousesPostReq[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesWarehouseIdDeleteForbidden as json.
func (s *APIV3WarehousesWarehouseIdDeleteForbidden) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3WarehousesWarehouseIdDeleteForbidden from json.
func (s *APIV3WarehousesWarehouseIdDeleteForbidden) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesWarehouseIdDeleteForbidden to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesWarehouseIdDeleteForbidden(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesWarehouseIdDeleteForbidden) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesWarehouseIdDeleteForbidden) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesWarehouseIdDeleteNotFound as json.
func (s *APIV3WarehousesWarehouseIdDeleteNotFound) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3WarehousesWarehouseIdDeleteNotFound from json.
func (s *APIV3WarehousesWarehouseIdDeleteNotFound) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesWarehouseIdDeleteNotFound to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesWarehouseIdDeleteNotFound(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesWarehouseIdDeleteNotFound) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesWarehouseIdDeleteNotFound) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesWarehouseIdPutBadRequest as json.
func (s *APIV3WarehousesWarehouseIdPutBadRequest) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3WarehousesWarehouseIdPutBadRequest from json.
func (s *APIV3WarehousesWarehouseIdPutBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesWarehouseIdPutBadRequest to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesWarehouseIdPutBadRequest(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesWarehouseIdPutBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesWarehouseIdPutBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesWarehouseIdPutConflict as json.
func (s *APIV3WarehousesWarehouseIdPutConflict) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3WarehousesWarehouseIdPutConflict from json.
func (s *APIV3WarehousesWarehouseIdPutConflict) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesWarehouseIdPutConflict to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesWarehouseIdPutConflict(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesWarehouseIdPutConflict) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesWarehouseIdPutConflict) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesWarehouseIdPutForbidden as json.
func (s *APIV3WarehousesWarehouseIdPutForbidden) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3WarehousesWarehouseIdPutForbidden from json.
func (s *APIV3WarehousesWarehouseIdPutForbidden) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesWarehouseIdPutForbidden to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesWarehouseIdPutForbidden(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesWarehouseIdPutForbidden) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesWarehouseIdPutForbidden) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3WarehousesWarehouseIdPutNotFound as json.
func (s *APIV3WarehousesWarehouseIdPutNotFound) Encode(e *jx.Encoder) {
	unwrapped := (*Error)(s)

	unwrapped.Encode(e)
}

// Decode decodes APIV3WarehousesWarehouseIdPutNotFound from json.
func (s *APIV3WarehousesWarehouseIdPutNotFound) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesWarehouseIdPutNotFound to nil")
	}
	var unwrapped Error
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = APIV3WarehousesWarehouseIdPutNotFound(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesWarehouseIdPutNotFound) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesWarehouseIdPutNotFound) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *APIV3WarehousesWarehouseIdPutReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *APIV3WarehousesWarehouseIdPutReq) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("name")
		e.Str(s.Name)
	}
	{
		e.FieldStart("officeId")
		e.Int(s.OfficeId)
	}
}

var jsonFieldsNameOfAPIV3WarehousesWarehouseIdPutReq = [2]string{
	0: "name",
	1: "officeId",
}

// Decode decodes APIV3WarehousesWarehouseIdPutReq from json.
func (s *APIV3WarehousesWarehouseIdPutReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode APIV3WarehousesWarehouseIdPutReq to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "name":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				v, err := d.Str()
				s.Name = string(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"name\"")
			}
		case "officeId":
			requiredBitSet[0] |= 1 << 1
			if err := func() error {
				v, err := d.Int()
				s.OfficeId = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"officeId\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode APIV3WarehousesWarehouseIdPutReq")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000011,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfAPIV3WarehousesWarehouseIdPutReq) {
					name = jsonFieldsNameOfAPIV3WarehousesWarehouseIdPutReq[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *APIV3WarehousesWarehouseIdPutReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *APIV3WarehousesWarehouseIdPutReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ClubDisc as json.
func (s ClubDisc) Encode(e *jx.Encoder) {
	unwrapped := []ClubDiscReq(s)
	if unwrapped == nil {
		e.ArrEmpty()
		return
	}
	if unwrapped != nil {
		e.ArrStart()
		for _, elem := range unwrapped {
			elem.Encode(e)
		}
		e.ArrEnd()
	}
}

// Decode decodes ClubDisc from json.
func (s *ClubDisc) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ClubDisc to nil")
	}
	var unwrapped []ClubDiscReq
	if err := func() error {
		unwrapped = make([]ClubDiscReq, 0)
		if err := d.Arr(func(d *jx.Decoder) error {
			var elem ClubDiscReq
			if err := elem.Decode(d); err != nil {
				return err
			}
			unwrapped = append(unwrapped, elem)
			return nil
		}); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = ClubDisc(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s ClubDisc) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ClubDisc) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ClubDiscReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ClubDiscReq) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("nmID")
		e.Int(s.NmID)
	}
	{
		e.FieldStart("clubDiscount")
		e.Int(s.ClubDiscount)
	}
}

var jsonFieldsNameOfClubDiscReq = [2]string{
	0: "nmID",
	1: "clubDiscount",
}

// Decode decodes ClubDiscReq from json.
func (s *ClubDiscReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ClubDiscReq to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				v, err := d.Int()
				s.NmID = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "clubDiscount":
			requiredBitSet[0] |= 1 << 1
			if err := func() error {
				v, err := d.Int()
				s.ClubDiscount = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"clubDiscount\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ClubDiscReq")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000011,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfClubDiscReq) {
					name = jsonFieldsNameOfClubDiscReq[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ClubDiscReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ClubDiscReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2BarcodesPostOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2BarcodesPostOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			e.ArrStart()
			for _, elem := range s.Data {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2BarcodesPostOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2BarcodesPostOK from json.
func (s *ContentV2BarcodesPostOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2BarcodesPostOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data = 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.Data = append(s.Data, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2BarcodesPostOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2BarcodesPostOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2BarcodesPostOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2BarcodesPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2BarcodesPostReq) encodeFields(e *jx.Encoder) {
	{
		if s.Count.Set {
			e.FieldStart("count")
			s.Count.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2BarcodesPostReq = [1]string{
	0: "count",
}

// Decode decodes ContentV2BarcodesPostReq from json.
func (s *ContentV2BarcodesPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2BarcodesPostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "count":
			if err := func() error {
				s.Count.Reset()
				if err := s.Count.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"count\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2BarcodesPostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2BarcodesPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2BarcodesPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsDeleteTrashPostOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsDeleteTrashPostOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsDeleteTrashPostOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2CardsDeleteTrashPostOK from json.
func (s *ContentV2CardsDeleteTrashPostOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsDeleteTrashPostOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsDeleteTrashPostOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsDeleteTrashPostOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsDeleteTrashPostOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsDeleteTrashPostOKAdditionalErrors) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsDeleteTrashPostOKAdditionalErrors) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfContentV2CardsDeleteTrashPostOKAdditionalErrors = [0]string{}

// Decode decodes ContentV2CardsDeleteTrashPostOKAdditionalErrors from json.
func (s *ContentV2CardsDeleteTrashPostOKAdditionalErrors) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsDeleteTrashPostOKAdditionalErrors to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsDeleteTrashPostOKAdditionalErrors")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsDeleteTrashPostOKAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsDeleteTrashPostOKAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsDeleteTrashPostOKData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsDeleteTrashPostOKData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfContentV2CardsDeleteTrashPostOKData = [0]string{}

// Decode decodes ContentV2CardsDeleteTrashPostOKData from json.
func (s *ContentV2CardsDeleteTrashPostOKData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsDeleteTrashPostOKData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsDeleteTrashPostOKData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsDeleteTrashPostOKData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsDeleteTrashPostOKData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsDeleteTrashPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsDeleteTrashPostReq) encodeFields(e *jx.Encoder) {
	{
		if s.NmIDs != nil {
			e.FieldStart("nmIDs")
			e.ArrStart()
			for _, elem := range s.NmIDs {
				e.Int(elem)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2CardsDeleteTrashPostReq = [1]string{
	0: "nmIDs",
}

// Decode decodes ContentV2CardsDeleteTrashPostReq from json.
func (s *ContentV2CardsDeleteTrashPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsDeleteTrashPostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmIDs":
			if err := func() error {
				s.NmIDs = make([]int, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem int
					v, err := d.Int()
					elem = int(v)
					if err != nil {
						return err
					}
					s.NmIDs = append(s.NmIDs, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmIDs\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsDeleteTrashPostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsDeleteTrashPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsDeleteTrashPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsErrorListGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsErrorListGetOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			e.ArrStart()
			for _, elem := range s.Data {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsErrorListGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2CardsErrorListGetOK from json.
func (s *ContentV2CardsErrorListGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsErrorListGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data = make([]ContentV2CardsErrorListGetOKDataItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2CardsErrorListGetOKDataItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Data = append(s.Data, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsErrorListGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsErrorListGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsErrorListGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsErrorListGetOKDataItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsErrorListGetOKDataItem) encodeFields(e *jx.Encoder) {
	{
		if s.Object.Set {
			e.FieldStart("object")
			s.Object.Encode(e)
		}
	}
	{
		if s.VendorCode.Set {
			e.FieldStart("vendorCode")
			s.VendorCode.Encode(e)
		}
	}
	{
		if s.UpdateAt.Set {
			e.FieldStart("updateAt")
			s.UpdateAt.Encode(e)
		}
	}
	{
		if s.Errors != nil {
			e.FieldStart("errors")
			e.ArrStart()
			for _, elem := range s.Errors {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
	{
		if s.ObjectID.Set {
			e.FieldStart("objectID")
			s.ObjectID.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsErrorListGetOKDataItem = [5]string{
	0: "object",
	1: "vendorCode",
	2: "updateAt",
	3: "errors",
	4: "objectID",
}

// Decode decodes ContentV2CardsErrorListGetOKDataItem from json.
func (s *ContentV2CardsErrorListGetOKDataItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsErrorListGetOKDataItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "object":
			if err := func() error {
				s.Object.Reset()
				if err := s.Object.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"object\"")
			}
		case "vendorCode":
			if err := func() error {
				s.VendorCode.Reset()
				if err := s.VendorCode.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"vendorCode\"")
			}
		case "updateAt":
			if err := func() error {
				s.UpdateAt.Reset()
				if err := s.UpdateAt.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"updateAt\"")
			}
		case "errors":
			if err := func() error {
				s.Errors = 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.Errors = append(s.Errors, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errors\"")
			}
		case "objectID":
			if err := func() error {
				s.ObjectID.Reset()
				if err := s.ObjectID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"objectID\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsErrorListGetOKDataItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsErrorListGetOKDataItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsErrorListGetOKDataItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsLimitsGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsLimitsGetOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsLimitsGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2CardsLimitsGetOK from json.
func (s *ContentV2CardsLimitsGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsLimitsGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsLimitsGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsLimitsGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsLimitsGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsLimitsGetOKData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsLimitsGetOKData) encodeFields(e *jx.Encoder) {
	{
		if s.FreeLimits.Set {
			e.FieldStart("freeLimits")
			s.FreeLimits.Encode(e)
		}
	}
	{
		if s.PaidLimits.Set {
			e.FieldStart("paidLimits")
			s.PaidLimits.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsLimitsGetOKData = [2]string{
	0: "freeLimits",
	1: "paidLimits",
}

// Decode decodes ContentV2CardsLimitsGetOKData from json.
func (s *ContentV2CardsLimitsGetOKData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsLimitsGetOKData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "freeLimits":
			if err := func() error {
				s.FreeLimits.Reset()
				if err := s.FreeLimits.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"freeLimits\"")
			}
		case "paidLimits":
			if err := func() error {
				s.PaidLimits.Reset()
				if err := s.PaidLimits.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"paidLimits\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsLimitsGetOKData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsLimitsGetOKData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsLimitsGetOKData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsRecoverPostOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsRecoverPostOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsRecoverPostOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2CardsRecoverPostOK from json.
func (s *ContentV2CardsRecoverPostOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsRecoverPostOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsRecoverPostOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsRecoverPostOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsRecoverPostOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsRecoverPostOKAdditionalErrors) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsRecoverPostOKAdditionalErrors) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfContentV2CardsRecoverPostOKAdditionalErrors = [0]string{}

// Decode decodes ContentV2CardsRecoverPostOKAdditionalErrors from json.
func (s *ContentV2CardsRecoverPostOKAdditionalErrors) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsRecoverPostOKAdditionalErrors to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsRecoverPostOKAdditionalErrors")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsRecoverPostOKAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsRecoverPostOKAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsRecoverPostOKData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsRecoverPostOKData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfContentV2CardsRecoverPostOKData = [0]string{}

// Decode decodes ContentV2CardsRecoverPostOKData from json.
func (s *ContentV2CardsRecoverPostOKData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsRecoverPostOKData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsRecoverPostOKData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsRecoverPostOKData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsRecoverPostOKData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsRecoverPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsRecoverPostReq) encodeFields(e *jx.Encoder) {
	{
		if s.NmIDs != nil {
			e.FieldStart("nmIDs")
			e.ArrStart()
			for _, elem := range s.NmIDs {
				e.Int(elem)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2CardsRecoverPostReq = [1]string{
	0: "nmIDs",
}

// Decode decodes ContentV2CardsRecoverPostReq from json.
func (s *ContentV2CardsRecoverPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsRecoverPostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmIDs":
			if err := func() error {
				s.NmIDs = make([]int, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem int
					v, err := d.Int()
					elem = int(v)
					if err != nil {
						return err
					}
					s.NmIDs = append(s.NmIDs, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmIDs\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsRecoverPostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsRecoverPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsRecoverPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUpdatePostReqItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUpdatePostReqItem) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("nmID")
		e.Int(s.NmID)
	}
	{
		e.FieldStart("vendorCode")
		e.Str(s.VendorCode)
	}
	{
		if s.Brand.Set {
			e.FieldStart("brand")
			s.Brand.Encode(e)
		}
	}
	{
		if s.Title.Set {
			e.FieldStart("title")
			s.Title.Encode(e)
		}
	}
	{
		if s.Description.Set {
			e.FieldStart("description")
			s.Description.Encode(e)
		}
	}
	{
		if s.Dimensions.Set {
			e.FieldStart("dimensions")
			s.Dimensions.Encode(e)
		}
	}
	{
		if s.Characteristics != nil {
			e.FieldStart("characteristics")
			e.ArrStart()
			for _, elem := range s.Characteristics {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		e.FieldStart("sizes")
		e.ArrStart()
		for _, elem := range s.Sizes {
			elem.Encode(e)
		}
		e.ArrEnd()
	}
}

var jsonFieldsNameOfContentV2CardsUpdatePostReqItem = [8]string{
	0: "nmID",
	1: "vendorCode",
	2: "brand",
	3: "title",
	4: "description",
	5: "dimensions",
	6: "characteristics",
	7: "sizes",
}

// Decode decodes ContentV2CardsUpdatePostReqItem from json.
func (s *ContentV2CardsUpdatePostReqItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUpdatePostReqItem to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				v, err := d.Int()
				s.NmID = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "vendorCode":
			requiredBitSet[0] |= 1 << 1
			if err := func() error {
				v, err := d.Str()
				s.VendorCode = string(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"vendorCode\"")
			}
		case "brand":
			if err := func() error {
				s.Brand.Reset()
				if err := s.Brand.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"brand\"")
			}
		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 "description":
			if err := func() error {
				s.Description.Reset()
				if err := s.Description.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"description\"")
			}
		case "dimensions":
			if err := func() error {
				s.Dimensions.Reset()
				if err := s.Dimensions.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"dimensions\"")
			}
		case "characteristics":
			if err := func() error {
				s.Characteristics = make([]ContentV2CardsUpdatePostReqItemCharacteristicsItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2CardsUpdatePostReqItemCharacteristicsItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Characteristics = append(s.Characteristics, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"characteristics\"")
			}
		case "sizes":
			requiredBitSet[0] |= 1 << 7
			if err := func() error {
				s.Sizes = make([]ContentV2CardsUpdatePostReqItemSizesItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2CardsUpdatePostReqItemSizesItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Sizes = append(s.Sizes, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizes\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUpdatePostReqItem")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b10000011,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfContentV2CardsUpdatePostReqItem) {
					name = jsonFieldsNameOfContentV2CardsUpdatePostReqItem[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUpdatePostReqItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUpdatePostReqItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUpdatePostReqItemCharacteristicsItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUpdatePostReqItemCharacteristicsItem) encodeFields(e *jx.Encoder) {
	{
		if s.ID.Set {
			e.FieldStart("id")
			s.ID.Encode(e)
		}
	}
	{
		if len(s.Value) != 0 {
			e.FieldStart("value")
			e.Raw(s.Value)
		}
	}
}

var jsonFieldsNameOfContentV2CardsUpdatePostReqItemCharacteristicsItem = [2]string{
	0: "id",
	1: "value",
}

// Decode decodes ContentV2CardsUpdatePostReqItemCharacteristicsItem from json.
func (s *ContentV2CardsUpdatePostReqItemCharacteristicsItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUpdatePostReqItemCharacteristicsItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "id":
			if err := func() error {
				s.ID.Reset()
				if err := s.ID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		case "value":
			if err := func() error {
				v, err := d.RawAppend(nil)
				s.Value = jx.Raw(v)
				if 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 ContentV2CardsUpdatePostReqItemCharacteristicsItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUpdatePostReqItemCharacteristicsItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUpdatePostReqItemCharacteristicsItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUpdatePostReqItemDimensions) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUpdatePostReqItemDimensions) encodeFields(e *jx.Encoder) {
	{
		if s.Length.Set {
			e.FieldStart("length")
			s.Length.Encode(e)
		}
	}
	{
		if s.Width.Set {
			e.FieldStart("width")
			s.Width.Encode(e)
		}
	}
	{
		if s.Height.Set {
			e.FieldStart("height")
			s.Height.Encode(e)
		}
	}
	{
		if s.WeightBrutto.Set {
			e.FieldStart("weightBrutto")
			s.WeightBrutto.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsUpdatePostReqItemDimensions = [4]string{
	0: "length",
	1: "width",
	2: "height",
	3: "weightBrutto",
}

// Decode decodes ContentV2CardsUpdatePostReqItemDimensions from json.
func (s *ContentV2CardsUpdatePostReqItemDimensions) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUpdatePostReqItemDimensions to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "length":
			if err := func() error {
				s.Length.Reset()
				if err := s.Length.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"length\"")
			}
		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\"")
			}
		case "weightBrutto":
			if err := func() error {
				s.WeightBrutto.Reset()
				if err := s.WeightBrutto.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"weightBrutto\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUpdatePostReqItemDimensions")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUpdatePostReqItemDimensions) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUpdatePostReqItemDimensions) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUpdatePostReqItemSizesItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUpdatePostReqItemSizesItem) encodeFields(e *jx.Encoder) {
	{
		if s.ChrtID.Set {
			e.FieldStart("chrtID")
			s.ChrtID.Encode(e)
		}
	}
	{
		if s.TechSize.Set {
			e.FieldStart("techSize")
			s.TechSize.Encode(e)
		}
	}
	{
		if s.WbSize.Set {
			e.FieldStart("wbSize")
			s.WbSize.Encode(e)
		}
	}
	{
		if s.Skus != nil {
			e.FieldStart("skus")
			e.ArrStart()
			for _, elem := range s.Skus {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2CardsUpdatePostReqItemSizesItem = [4]string{
	0: "chrtID",
	1: "techSize",
	2: "wbSize",
	3: "skus",
}

// Decode decodes ContentV2CardsUpdatePostReqItemSizesItem from json.
func (s *ContentV2CardsUpdatePostReqItemSizesItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUpdatePostReqItemSizesItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "chrtID":
			if err := func() error {
				s.ChrtID.Reset()
				if err := s.ChrtID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"chrtID\"")
			}
		case "techSize":
			if err := func() error {
				s.TechSize.Reset()
				if err := s.TechSize.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"techSize\"")
			}
		case "wbSize":
			if err := func() error {
				s.WbSize.Reset()
				if err := s.WbSize.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"wbSize\"")
			}
		case "skus":
			if err := func() error {
				s.Skus = 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.Skus = append(s.Skus, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"skus\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUpdatePostReqItemSizesItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUpdatePostReqItemSizesItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUpdatePostReqItemSizesItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUpdatePostRequestEntityTooLarge) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUpdatePostRequestEntityTooLarge) encodeFields(e *jx.Encoder) {
	{
		if s.Title.Set {
			e.FieldStart("title")
			s.Title.Encode(e)
		}
	}
	{
		if s.Detail.Set {
			e.FieldStart("detail")
			s.Detail.Encode(e)
		}
	}
	{
		if s.Code.Set {
			e.FieldStart("code")
			s.Code.Encode(e)
		}
	}
	{
		if s.RequestId.Set {
			e.FieldStart("requestId")
			s.RequestId.Encode(e)
		}
	}
	{
		if s.Origin.Set {
			e.FieldStart("origin")
			s.Origin.Encode(e)
		}
	}
	{
		if s.Status.Set {
			e.FieldStart("status")
			s.Status.Encode(e)
		}
	}
	{
		if s.StatusText.Set {
			e.FieldStart("statusText")
			s.StatusText.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsUpdatePostRequestEntityTooLarge = [7]string{
	0: "title",
	1: "detail",
	2: "code",
	3: "requestId",
	4: "origin",
	5: "status",
	6: "statusText",
}

// Decode decodes ContentV2CardsUpdatePostRequestEntityTooLarge from json.
func (s *ContentV2CardsUpdatePostRequestEntityTooLarge) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUpdatePostRequestEntityTooLarge 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 "detail":
			if err := func() error {
				s.Detail.Reset()
				if err := s.Detail.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"detail\"")
			}
		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 "requestId":
			if err := func() error {
				s.RequestId.Reset()
				if err := s.RequestId.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"requestId\"")
			}
		case "origin":
			if err := func() error {
				s.Origin.Reset()
				if err := s.Origin.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"origin\"")
			}
		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\"")
			}
		case "statusText":
			if err := func() error {
				s.StatusText.Reset()
				if err := s.StatusText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"statusText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUpdatePostRequestEntityTooLarge")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUpdatePostRequestEntityTooLarge) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUpdatePostRequestEntityTooLarge) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadAddPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadAddPostReq) encodeFields(e *jx.Encoder) {
	{
		if s.ImtID.Set {
			e.FieldStart("imtID")
			s.ImtID.Encode(e)
		}
	}
	{
		if s.CardsToAdd != nil {
			e.FieldStart("cardsToAdd")
			e.ArrStart()
			for _, elem := range s.CardsToAdd {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadAddPostReq = [2]string{
	0: "imtID",
	1: "cardsToAdd",
}

// Decode decodes ContentV2CardsUploadAddPostReq from json.
func (s *ContentV2CardsUploadAddPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadAddPostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "imtID":
			if err := func() error {
				s.ImtID.Reset()
				if err := s.ImtID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"imtID\"")
			}
		case "cardsToAdd":
			if err := func() error {
				s.CardsToAdd = make([]ContentV2CardsUploadAddPostReqCardsToAddItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2CardsUploadAddPostReqCardsToAddItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.CardsToAdd = append(s.CardsToAdd, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"cardsToAdd\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUploadAddPostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadAddPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadAddPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItem) encodeFields(e *jx.Encoder) {
	{
		if s.Brand.Set {
			e.FieldStart("brand")
			s.Brand.Encode(e)
		}
	}
	{
		e.FieldStart("vendorCode")
		e.Str(s.VendorCode)
	}
	{
		if s.Title.Set {
			e.FieldStart("title")
			s.Title.Encode(e)
		}
	}
	{
		if s.Description.Set {
			e.FieldStart("description")
			s.Description.Encode(e)
		}
	}
	{
		if s.Dimensions.Set {
			e.FieldStart("dimensions")
			s.Dimensions.Encode(e)
		}
	}
	{
		if s.Sizes != nil {
			e.FieldStart("sizes")
			e.ArrStart()
			for _, elem := range s.Sizes {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Characteristics != nil {
			e.FieldStart("characteristics")
			e.ArrStart()
			for _, elem := range s.Characteristics {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadAddPostReqCardsToAddItem = [7]string{
	0: "brand",
	1: "vendorCode",
	2: "title",
	3: "description",
	4: "dimensions",
	5: "sizes",
	6: "characteristics",
}

// Decode decodes ContentV2CardsUploadAddPostReqCardsToAddItem from json.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadAddPostReqCardsToAddItem to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "brand":
			if err := func() error {
				s.Brand.Reset()
				if err := s.Brand.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"brand\"")
			}
		case "vendorCode":
			requiredBitSet[0] |= 1 << 1
			if err := func() error {
				v, err := d.Str()
				s.VendorCode = string(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"vendorCode\"")
			}
		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 "description":
			if err := func() error {
				s.Description.Reset()
				if err := s.Description.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"description\"")
			}
		case "dimensions":
			if err := func() error {
				s.Dimensions.Reset()
				if err := s.Dimensions.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"dimensions\"")
			}
		case "sizes":
			if err := func() error {
				s.Sizes = make([]ContentV2CardsUploadAddPostReqCardsToAddItemSizesItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2CardsUploadAddPostReqCardsToAddItemSizesItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Sizes = append(s.Sizes, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizes\"")
			}
		case "characteristics":
			if err := func() error {
				s.Characteristics = make([]ContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Characteristics = append(s.Characteristics, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"characteristics\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUploadAddPostReqCardsToAddItem")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000010,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfContentV2CardsUploadAddPostReqCardsToAddItem) {
					name = jsonFieldsNameOfContentV2CardsUploadAddPostReqCardsToAddItem[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("id")
		e.Int(s.ID)
	}
	{
		if len(s.Value) != 0 {
			e.FieldStart("value")
			e.Raw(s.Value)
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem = [2]string{
	0: "id",
	1: "value",
}

// Decode decodes ContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem from json.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "id":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				v, err := d.Int()
				s.ID = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		case "value":
			requiredBitSet[0] |= 1 << 1
			if err := func() error {
				v, err := d.RawAppend(nil)
				s.Value = jx.Raw(v)
				if 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 ContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000011,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem) {
					name = jsonFieldsNameOfContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemCharacteristicsItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemDimensions) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemDimensions) encodeFields(e *jx.Encoder) {
	{
		if s.Length.Set {
			e.FieldStart("length")
			s.Length.Encode(e)
		}
	}
	{
		if s.Width.Set {
			e.FieldStart("width")
			s.Width.Encode(e)
		}
	}
	{
		if s.Height.Set {
			e.FieldStart("height")
			s.Height.Encode(e)
		}
	}
	{
		if s.WeightBrutto.Set {
			e.FieldStart("weightBrutto")
			s.WeightBrutto.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadAddPostReqCardsToAddItemDimensions = [4]string{
	0: "length",
	1: "width",
	2: "height",
	3: "weightBrutto",
}

// Decode decodes ContentV2CardsUploadAddPostReqCardsToAddItemDimensions from json.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemDimensions) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadAddPostReqCardsToAddItemDimensions to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "length":
			if err := func() error {
				s.Length.Reset()
				if err := s.Length.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"length\"")
			}
		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\"")
			}
		case "weightBrutto":
			if err := func() error {
				s.WeightBrutto.Reset()
				if err := s.WeightBrutto.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"weightBrutto\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUploadAddPostReqCardsToAddItemDimensions")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemDimensions) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemDimensions) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemSizesItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemSizesItem) encodeFields(e *jx.Encoder) {
	{
		if s.TechSize.Set {
			e.FieldStart("techSize")
			s.TechSize.Encode(e)
		}
	}
	{
		if s.WbSize.Set {
			e.FieldStart("wbSize")
			s.WbSize.Encode(e)
		}
	}
	{
		if s.Price.Set {
			e.FieldStart("price")
			s.Price.Encode(e)
		}
	}
	{
		if s.Skus != nil {
			e.FieldStart("skus")
			e.ArrStart()
			for _, elem := range s.Skus {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadAddPostReqCardsToAddItemSizesItem = [4]string{
	0: "techSize",
	1: "wbSize",
	2: "price",
	3: "skus",
}

// Decode decodes ContentV2CardsUploadAddPostReqCardsToAddItemSizesItem from json.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemSizesItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadAddPostReqCardsToAddItemSizesItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "techSize":
			if err := func() error {
				s.TechSize.Reset()
				if err := s.TechSize.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"techSize\"")
			}
		case "wbSize":
			if err := func() error {
				s.WbSize.Reset()
				if err := s.WbSize.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"wbSize\"")
			}
		case "price":
			if err := func() error {
				s.Price.Reset()
				if err := s.Price.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"price\"")
			}
		case "skus":
			if err := func() error {
				s.Skus = 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.Skus = append(s.Skus, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"skus\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUploadAddPostReqCardsToAddItemSizesItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemSizesItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadAddPostReqCardsToAddItemSizesItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadAddPostRequestEntityTooLarge) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadAddPostRequestEntityTooLarge) encodeFields(e *jx.Encoder) {
	{
		if s.Title.Set {
			e.FieldStart("title")
			s.Title.Encode(e)
		}
	}
	{
		if s.Detail.Set {
			e.FieldStart("detail")
			s.Detail.Encode(e)
		}
	}
	{
		if s.Code.Set {
			e.FieldStart("code")
			s.Code.Encode(e)
		}
	}
	{
		if s.RequestId.Set {
			e.FieldStart("requestId")
			s.RequestId.Encode(e)
		}
	}
	{
		if s.Origin.Set {
			e.FieldStart("origin")
			s.Origin.Encode(e)
		}
	}
	{
		if s.Status.Set {
			e.FieldStart("status")
			s.Status.Encode(e)
		}
	}
	{
		if s.StatusText.Set {
			e.FieldStart("statusText")
			s.StatusText.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadAddPostRequestEntityTooLarge = [7]string{
	0: "title",
	1: "detail",
	2: "code",
	3: "requestId",
	4: "origin",
	5: "status",
	6: "statusText",
}

// Decode decodes ContentV2CardsUploadAddPostRequestEntityTooLarge from json.
func (s *ContentV2CardsUploadAddPostRequestEntityTooLarge) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadAddPostRequestEntityTooLarge 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 "detail":
			if err := func() error {
				s.Detail.Reset()
				if err := s.Detail.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"detail\"")
			}
		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 "requestId":
			if err := func() error {
				s.RequestId.Reset()
				if err := s.RequestId.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"requestId\"")
			}
		case "origin":
			if err := func() error {
				s.Origin.Reset()
				if err := s.Origin.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"origin\"")
			}
		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\"")
			}
		case "statusText":
			if err := func() error {
				s.StatusText.Reset()
				if err := s.StatusText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"statusText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUploadAddPostRequestEntityTooLarge")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadAddPostRequestEntityTooLarge) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadAddPostRequestEntityTooLarge) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadPostReqItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadPostReqItem) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("subjectID")
		e.Int(s.SubjectID)
	}
	{
		e.FieldStart("variants")
		e.ArrStart()
		for _, elem := range s.Variants {
			elem.Encode(e)
		}
		e.ArrEnd()
	}
}

var jsonFieldsNameOfContentV2CardsUploadPostReqItem = [2]string{
	0: "subjectID",
	1: "variants",
}

// Decode decodes ContentV2CardsUploadPostReqItem from json.
func (s *ContentV2CardsUploadPostReqItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadPostReqItem to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "subjectID":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				v, err := d.Int()
				s.SubjectID = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"subjectID\"")
			}
		case "variants":
			requiredBitSet[0] |= 1 << 1
			if err := func() error {
				s.Variants = make([]ContentV2CardsUploadPostReqItemVariantsItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2CardsUploadPostReqItemVariantsItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Variants = append(s.Variants, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"variants\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUploadPostReqItem")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000011,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfContentV2CardsUploadPostReqItem) {
					name = jsonFieldsNameOfContentV2CardsUploadPostReqItem[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadPostReqItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadPostReqItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadPostReqItemVariantsItem) encodeFields(e *jx.Encoder) {
	{
		if s.Brand.Set {
			e.FieldStart("brand")
			s.Brand.Encode(e)
		}
	}
	{
		if s.Title.Set {
			e.FieldStart("title")
			s.Title.Encode(e)
		}
	}
	{
		if s.Description.Set {
			e.FieldStart("description")
			s.Description.Encode(e)
		}
	}
	{
		e.FieldStart("vendorCode")
		e.Str(s.VendorCode)
	}
	{
		if s.Dimensions.Set {
			e.FieldStart("dimensions")
			s.Dimensions.Encode(e)
		}
	}
	{
		if s.Sizes != nil {
			e.FieldStart("sizes")
			e.ArrStart()
			for _, elem := range s.Sizes {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Characteristics != nil {
			e.FieldStart("characteristics")
			e.ArrStart()
			for _, elem := range s.Characteristics {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadPostReqItemVariantsItem = [7]string{
	0: "brand",
	1: "title",
	2: "description",
	3: "vendorCode",
	4: "dimensions",
	5: "sizes",
	6: "characteristics",
}

// Decode decodes ContentV2CardsUploadPostReqItemVariantsItem from json.
func (s *ContentV2CardsUploadPostReqItemVariantsItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadPostReqItemVariantsItem to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "brand":
			if err := func() error {
				s.Brand.Reset()
				if err := s.Brand.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"brand\"")
			}
		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 "description":
			if err := func() error {
				s.Description.Reset()
				if err := s.Description.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"description\"")
			}
		case "vendorCode":
			requiredBitSet[0] |= 1 << 3
			if err := func() error {
				v, err := d.Str()
				s.VendorCode = string(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"vendorCode\"")
			}
		case "dimensions":
			if err := func() error {
				s.Dimensions.Reset()
				if err := s.Dimensions.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"dimensions\"")
			}
		case "sizes":
			if err := func() error {
				s.Sizes = make([]ContentV2CardsUploadPostReqItemVariantsItemSizesItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2CardsUploadPostReqItemVariantsItemSizesItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Sizes = append(s.Sizes, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizes\"")
			}
		case "characteristics":
			if err := func() error {
				s.Characteristics = make([]ContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Characteristics = append(s.Characteristics, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"characteristics\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUploadPostReqItemVariantsItem")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00001000,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfContentV2CardsUploadPostReqItemVariantsItem) {
					name = jsonFieldsNameOfContentV2CardsUploadPostReqItemVariantsItem[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("id")
		e.Int(s.ID)
	}
	{
		if len(s.Value) != 0 {
			e.FieldStart("value")
			e.Raw(s.Value)
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem = [2]string{
	0: "id",
	1: "value",
}

// Decode decodes ContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem from json.
func (s *ContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "id":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				v, err := d.Int()
				s.ID = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		case "value":
			requiredBitSet[0] |= 1 << 1
			if err := func() error {
				v, err := d.RawAppend(nil)
				s.Value = jx.Raw(v)
				if 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 ContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000011,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem) {
					name = jsonFieldsNameOfContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItemCharacteristicsItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItemDimensions) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadPostReqItemVariantsItemDimensions) encodeFields(e *jx.Encoder) {
	{
		if s.Length.Set {
			e.FieldStart("length")
			s.Length.Encode(e)
		}
	}
	{
		if s.Width.Set {
			e.FieldStart("width")
			s.Width.Encode(e)
		}
	}
	{
		if s.Height.Set {
			e.FieldStart("height")
			s.Height.Encode(e)
		}
	}
	{
		if s.WeightBrutto.Set {
			e.FieldStart("weightBrutto")
			s.WeightBrutto.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadPostReqItemVariantsItemDimensions = [4]string{
	0: "length",
	1: "width",
	2: "height",
	3: "weightBrutto",
}

// Decode decodes ContentV2CardsUploadPostReqItemVariantsItemDimensions from json.
func (s *ContentV2CardsUploadPostReqItemVariantsItemDimensions) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadPostReqItemVariantsItemDimensions to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "length":
			if err := func() error {
				s.Length.Reset()
				if err := s.Length.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"length\"")
			}
		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\"")
			}
		case "weightBrutto":
			if err := func() error {
				s.WeightBrutto.Reset()
				if err := s.WeightBrutto.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"weightBrutto\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUploadPostReqItemVariantsItemDimensions")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItemDimensions) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItemDimensions) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItemSizesItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadPostReqItemVariantsItemSizesItem) encodeFields(e *jx.Encoder) {
	{
		if s.TechSize.Set {
			e.FieldStart("techSize")
			s.TechSize.Encode(e)
		}
	}
	{
		if s.WbSize.Set {
			e.FieldStart("wbSize")
			s.WbSize.Encode(e)
		}
	}
	{
		if s.Price.Set {
			e.FieldStart("price")
			s.Price.Encode(e)
		}
	}
	{
		if s.Skus != nil {
			e.FieldStart("skus")
			e.ArrStart()
			for _, elem := range s.Skus {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadPostReqItemVariantsItemSizesItem = [4]string{
	0: "techSize",
	1: "wbSize",
	2: "price",
	3: "skus",
}

// Decode decodes ContentV2CardsUploadPostReqItemVariantsItemSizesItem from json.
func (s *ContentV2CardsUploadPostReqItemVariantsItemSizesItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadPostReqItemVariantsItemSizesItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "techSize":
			if err := func() error {
				s.TechSize.Reset()
				if err := s.TechSize.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"techSize\"")
			}
		case "wbSize":
			if err := func() error {
				s.WbSize.Reset()
				if err := s.WbSize.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"wbSize\"")
			}
		case "price":
			if err := func() error {
				s.Price.Reset()
				if err := s.Price.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"price\"")
			}
		case "skus":
			if err := func() error {
				s.Skus = 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.Skus = append(s.Skus, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"skus\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUploadPostReqItemVariantsItemSizesItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItemSizesItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadPostReqItemVariantsItemSizesItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2CardsUploadPostRequestEntityTooLarge) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2CardsUploadPostRequestEntityTooLarge) encodeFields(e *jx.Encoder) {
	{
		if s.Title.Set {
			e.FieldStart("title")
			s.Title.Encode(e)
		}
	}
	{
		if s.Detail.Set {
			e.FieldStart("detail")
			s.Detail.Encode(e)
		}
	}
	{
		if s.Code.Set {
			e.FieldStart("code")
			s.Code.Encode(e)
		}
	}
	{
		if s.RequestId.Set {
			e.FieldStart("requestId")
			s.RequestId.Encode(e)
		}
	}
	{
		if s.Origin.Set {
			e.FieldStart("origin")
			s.Origin.Encode(e)
		}
	}
	{
		if s.Status.Set {
			e.FieldStart("status")
			s.Status.Encode(e)
		}
	}
	{
		if s.StatusText.Set {
			e.FieldStart("statusText")
			s.StatusText.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2CardsUploadPostRequestEntityTooLarge = [7]string{
	0: "title",
	1: "detail",
	2: "code",
	3: "requestId",
	4: "origin",
	5: "status",
	6: "statusText",
}

// Decode decodes ContentV2CardsUploadPostRequestEntityTooLarge from json.
func (s *ContentV2CardsUploadPostRequestEntityTooLarge) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2CardsUploadPostRequestEntityTooLarge 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 "detail":
			if err := func() error {
				s.Detail.Reset()
				if err := s.Detail.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"detail\"")
			}
		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 "requestId":
			if err := func() error {
				s.RequestId.Reset()
				if err := s.RequestId.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"requestId\"")
			}
		case "origin":
			if err := func() error {
				s.Origin.Reset()
				if err := s.Origin.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"origin\"")
			}
		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\"")
			}
		case "statusText":
			if err := func() error {
				s.StatusText.Reset()
				if err := s.StatusText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"statusText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2CardsUploadPostRequestEntityTooLarge")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2CardsUploadPostRequestEntityTooLarge) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2CardsUploadPostRequestEntityTooLarge) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2DirectoryColorsGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2DirectoryColorsGetOK) encodeFields(e *jx.Encoder) {
	{
		if len(s.Data) != 0 {
			e.FieldStart("data")
			e.Raw(s.Data)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2DirectoryColorsGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2DirectoryColorsGetOK from json.
func (s *ContentV2DirectoryColorsGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2DirectoryColorsGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				v, err := d.RawAppend(nil)
				s.Data = jx.Raw(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2DirectoryColorsGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2DirectoryColorsGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2DirectoryColorsGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2DirectoryCountriesGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2DirectoryCountriesGetOK) encodeFields(e *jx.Encoder) {
	{
		if len(s.Data) != 0 {
			e.FieldStart("data")
			e.Raw(s.Data)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2DirectoryCountriesGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2DirectoryCountriesGetOK from json.
func (s *ContentV2DirectoryCountriesGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2DirectoryCountriesGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				v, err := d.RawAppend(nil)
				s.Data = jx.Raw(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2DirectoryCountriesGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2DirectoryCountriesGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2DirectoryCountriesGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2DirectoryKindsGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2DirectoryKindsGetOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			e.ArrStart()
			for _, elem := range s.Data {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2DirectoryKindsGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2DirectoryKindsGetOK from json.
func (s *ContentV2DirectoryKindsGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2DirectoryKindsGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data = 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.Data = append(s.Data, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2DirectoryKindsGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2DirectoryKindsGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2DirectoryKindsGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2DirectorySeasonsGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2DirectorySeasonsGetOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			e.ArrStart()
			for _, elem := range s.Data {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2DirectorySeasonsGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2DirectorySeasonsGetOK from json.
func (s *ContentV2DirectorySeasonsGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2DirectorySeasonsGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data = 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.Data = append(s.Data, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2DirectorySeasonsGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2DirectorySeasonsGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2DirectorySeasonsGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2DirectoryTnvedGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2DirectoryTnvedGetOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			e.ArrStart()
			for _, elem := range s.Data {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2DirectoryTnvedGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2DirectoryTnvedGetOK from json.
func (s *ContentV2DirectoryTnvedGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2DirectoryTnvedGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data = make([]ContentV2DirectoryTnvedGetOKDataItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2DirectoryTnvedGetOKDataItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Data = append(s.Data, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2DirectoryTnvedGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2DirectoryTnvedGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2DirectoryTnvedGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2DirectoryTnvedGetOKDataItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2DirectoryTnvedGetOKDataItem) encodeFields(e *jx.Encoder) {
	{
		if s.Tnved.Set {
			e.FieldStart("tnved")
			s.Tnved.Encode(e)
		}
	}
	{
		if s.IsKiz.Set {
			e.FieldStart("isKiz")
			s.IsKiz.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2DirectoryTnvedGetOKDataItem = [2]string{
	0: "tnved",
	1: "isKiz",
}

// Decode decodes ContentV2DirectoryTnvedGetOKDataItem from json.
func (s *ContentV2DirectoryTnvedGetOKDataItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2DirectoryTnvedGetOKDataItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "tnved":
			if err := func() error {
				s.Tnved.Reset()
				if err := s.Tnved.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"tnved\"")
			}
		case "isKiz":
			if err := func() error {
				s.IsKiz.Reset()
				if err := s.IsKiz.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"isKiz\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2DirectoryTnvedGetOKDataItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2DirectoryTnvedGetOKDataItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2DirectoryTnvedGetOKDataItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2DirectoryVatGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2DirectoryVatGetOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			e.ArrStart()
			for _, elem := range s.Data {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2DirectoryVatGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2DirectoryVatGetOK from json.
func (s *ContentV2DirectoryVatGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2DirectoryVatGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data = 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.Data = append(s.Data, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2DirectoryVatGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2DirectoryVatGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2DirectoryVatGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostOK) encodeFields(e *jx.Encoder) {
	{
		if s.Cards != nil {
			e.FieldStart("cards")
			e.ArrStart()
			for _, elem := range s.Cards {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Cursor.Set {
			e.FieldStart("cursor")
			s.Cursor.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostOK = [2]string{
	0: "cards",
	1: "cursor",
}

// Decode decodes ContentV2GetCardsListPostOK from json.
func (s *ContentV2GetCardsListPostOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "cards":
			if err := func() error {
				s.Cards = make([]ContentV2GetCardsListPostOKCardsItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2GetCardsListPostOKCardsItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Cards = append(s.Cards, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"cards\"")
			}
		case "cursor":
			if err := func() error {
				s.Cursor.Reset()
				if err := s.Cursor.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"cursor\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostOKCardsItem) encodeFields(e *jx.Encoder) {
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
	{
		if s.ImtID.Set {
			e.FieldStart("imtID")
			s.ImtID.Encode(e)
		}
	}
	{
		if s.NmUUID.Set {
			e.FieldStart("nmUUID")
			s.NmUUID.Encode(e)
		}
	}
	{
		if s.SubjectID.Set {
			e.FieldStart("subjectID")
			s.SubjectID.Encode(e)
		}
	}
	{
		if s.SubjectName.Set {
			e.FieldStart("subjectName")
			s.SubjectName.Encode(e)
		}
	}
	{
		if s.VendorCode.Set {
			e.FieldStart("vendorCode")
			s.VendorCode.Encode(e)
		}
	}
	{
		if s.Brand.Set {
			e.FieldStart("brand")
			s.Brand.Encode(e)
		}
	}
	{
		if s.Title.Set {
			e.FieldStart("title")
			s.Title.Encode(e)
		}
	}
	{
		if s.Description.Set {
			e.FieldStart("description")
			s.Description.Encode(e)
		}
	}
	{
		if s.NeedKiz.Set {
			e.FieldStart("needKiz")
			s.NeedKiz.Encode(e)
		}
	}
	{
		if s.Photos != nil {
			e.FieldStart("photos")
			e.ArrStart()
			for _, elem := range s.Photos {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Video.Set {
			e.FieldStart("video")
			s.Video.Encode(e)
		}
	}
	{
		if s.Dimensions.Set {
			e.FieldStart("dimensions")
			s.Dimensions.Encode(e)
		}
	}
	{
		if s.Characteristics != nil {
			e.FieldStart("characteristics")
			e.ArrStart()
			for _, elem := range s.Characteristics {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Sizes != nil {
			e.FieldStart("sizes")
			e.ArrStart()
			for _, elem := range s.Sizes {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Tags != nil {
			e.FieldStart("tags")
			e.ArrStart()
			for _, elem := range s.Tags {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.CreatedAt.Set {
			e.FieldStart("createdAt")
			s.CreatedAt.Encode(e)
		}
	}
	{
		if s.UpdatedAt.Set {
			e.FieldStart("updatedAt")
			s.UpdatedAt.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostOKCardsItem = [18]string{
	0:  "nmID",
	1:  "imtID",
	2:  "nmUUID",
	3:  "subjectID",
	4:  "subjectName",
	5:  "vendorCode",
	6:  "brand",
	7:  "title",
	8:  "description",
	9:  "needKiz",
	10: "photos",
	11: "video",
	12: "dimensions",
	13: "characteristics",
	14: "sizes",
	15: "tags",
	16: "createdAt",
	17: "updatedAt",
}

// Decode decodes ContentV2GetCardsListPostOKCardsItem from json.
func (s *ContentV2GetCardsListPostOKCardsItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostOKCardsItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "imtID":
			if err := func() error {
				s.ImtID.Reset()
				if err := s.ImtID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"imtID\"")
			}
		case "nmUUID":
			if err := func() error {
				s.NmUUID.Reset()
				if err := s.NmUUID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmUUID\"")
			}
		case "subjectID":
			if err := func() error {
				s.SubjectID.Reset()
				if err := s.SubjectID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"subjectID\"")
			}
		case "subjectName":
			if err := func() error {
				s.SubjectName.Reset()
				if err := s.SubjectName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"subjectName\"")
			}
		case "vendorCode":
			if err := func() error {
				s.VendorCode.Reset()
				if err := s.VendorCode.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"vendorCode\"")
			}
		case "brand":
			if err := func() error {
				s.Brand.Reset()
				if err := s.Brand.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"brand\"")
			}
		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 "description":
			if err := func() error {
				s.Description.Reset()
				if err := s.Description.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"description\"")
			}
		case "needKiz":
			if err := func() error {
				s.NeedKiz.Reset()
				if err := s.NeedKiz.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"needKiz\"")
			}
		case "photos":
			if err := func() error {
				s.Photos = make([]ContentV2GetCardsListPostOKCardsItemPhotosItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2GetCardsListPostOKCardsItemPhotosItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Photos = append(s.Photos, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"photos\"")
			}
		case "video":
			if err := func() error {
				s.Video.Reset()
				if err := s.Video.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"video\"")
			}
		case "dimensions":
			if err := func() error {
				s.Dimensions.Reset()
				if err := s.Dimensions.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"dimensions\"")
			}
		case "characteristics":
			if err := func() error {
				s.Characteristics = make([]ContentV2GetCardsListPostOKCardsItemCharacteristicsItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2GetCardsListPostOKCardsItemCharacteristicsItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Characteristics = append(s.Characteristics, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"characteristics\"")
			}
		case "sizes":
			if err := func() error {
				s.Sizes = make([]ContentV2GetCardsListPostOKCardsItemSizesItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2GetCardsListPostOKCardsItemSizesItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Sizes = append(s.Sizes, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizes\"")
			}
		case "tags":
			if err := func() error {
				s.Tags = make([]ContentV2GetCardsListPostOKCardsItemTagsItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2GetCardsListPostOKCardsItemTagsItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Tags = append(s.Tags, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"tags\"")
			}
		case "createdAt":
			if err := func() error {
				s.CreatedAt.Reset()
				if err := s.CreatedAt.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"createdAt\"")
			}
		case "updatedAt":
			if err := func() error {
				s.UpdatedAt.Reset()
				if err := s.UpdatedAt.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"updatedAt\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostOKCardsItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostOKCardsItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItemCharacteristicsItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostOKCardsItemCharacteristicsItem) encodeFields(e *jx.Encoder) {
	{
		if s.ID.Set {
			e.FieldStart("id")
			s.ID.Encode(e)
		}
	}
	{
		if s.Name.Set {
			e.FieldStart("name")
			s.Name.Encode(e)
		}
	}
	{
		if len(s.Value) != 0 {
			e.FieldStart("value")
			e.Raw(s.Value)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostOKCardsItemCharacteristicsItem = [3]string{
	0: "id",
	1: "name",
	2: "value",
}

// Decode decodes ContentV2GetCardsListPostOKCardsItemCharacteristicsItem from json.
func (s *ContentV2GetCardsListPostOKCardsItemCharacteristicsItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostOKCardsItemCharacteristicsItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "id":
			if err := func() error {
				s.ID.Reset()
				if err := s.ID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		case "name":
			if err := func() error {
				s.Name.Reset()
				if err := s.Name.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"name\"")
			}
		case "value":
			if err := func() error {
				v, err := d.RawAppend(nil)
				s.Value = jx.Raw(v)
				if 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 ContentV2GetCardsListPostOKCardsItemCharacteristicsItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItemCharacteristicsItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostOKCardsItemCharacteristicsItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItemDimensions) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostOKCardsItemDimensions) encodeFields(e *jx.Encoder) {
	{
		if s.Length.Set {
			e.FieldStart("length")
			s.Length.Encode(e)
		}
	}
	{
		if s.Width.Set {
			e.FieldStart("width")
			s.Width.Encode(e)
		}
	}
	{
		if s.Height.Set {
			e.FieldStart("height")
			s.Height.Encode(e)
		}
	}
	{
		if s.WeightBrutto.Set {
			e.FieldStart("weightBrutto")
			s.WeightBrutto.Encode(e)
		}
	}
	{
		if s.IsValid.Set {
			e.FieldStart("isValid")
			s.IsValid.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostOKCardsItemDimensions = [5]string{
	0: "length",
	1: "width",
	2: "height",
	3: "weightBrutto",
	4: "isValid",
}

// Decode decodes ContentV2GetCardsListPostOKCardsItemDimensions from json.
func (s *ContentV2GetCardsListPostOKCardsItemDimensions) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostOKCardsItemDimensions to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "length":
			if err := func() error {
				s.Length.Reset()
				if err := s.Length.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"length\"")
			}
		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\"")
			}
		case "weightBrutto":
			if err := func() error {
				s.WeightBrutto.Reset()
				if err := s.WeightBrutto.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"weightBrutto\"")
			}
		case "isValid":
			if err := func() error {
				s.IsValid.Reset()
				if err := s.IsValid.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"isValid\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostOKCardsItemDimensions")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItemDimensions) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostOKCardsItemDimensions) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItemPhotosItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostOKCardsItemPhotosItem) encodeFields(e *jx.Encoder) {
	{
		if s.Big.Set {
			e.FieldStart("big")
			s.Big.Encode(e)
		}
	}
	{
		if s.C246x328.Set {
			e.FieldStart("c246x328")
			s.C246x328.Encode(e)
		}
	}
	{
		if s.C516x688.Set {
			e.FieldStart("c516x688")
			s.C516x688.Encode(e)
		}
	}
	{
		if s.Square.Set {
			e.FieldStart("square")
			s.Square.Encode(e)
		}
	}
	{
		if s.Tm.Set {
			e.FieldStart("tm")
			s.Tm.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostOKCardsItemPhotosItem = [5]string{
	0: "big",
	1: "c246x328",
	2: "c516x688",
	3: "square",
	4: "tm",
}

// Decode decodes ContentV2GetCardsListPostOKCardsItemPhotosItem from json.
func (s *ContentV2GetCardsListPostOKCardsItemPhotosItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostOKCardsItemPhotosItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "big":
			if err := func() error {
				s.Big.Reset()
				if err := s.Big.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"big\"")
			}
		case "c246x328":
			if err := func() error {
				s.C246x328.Reset()
				if err := s.C246x328.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"c246x328\"")
			}
		case "c516x688":
			if err := func() error {
				s.C516x688.Reset()
				if err := s.C516x688.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"c516x688\"")
			}
		case "square":
			if err := func() error {
				s.Square.Reset()
				if err := s.Square.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"square\"")
			}
		case "tm":
			if err := func() error {
				s.Tm.Reset()
				if err := s.Tm.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"tm\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostOKCardsItemPhotosItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItemPhotosItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostOKCardsItemPhotosItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItemSizesItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostOKCardsItemSizesItem) encodeFields(e *jx.Encoder) {
	{
		if s.ChrtID.Set {
			e.FieldStart("chrtID")
			s.ChrtID.Encode(e)
		}
	}
	{
		if s.TechSize.Set {
			e.FieldStart("techSize")
			s.TechSize.Encode(e)
		}
	}
	{
		if s.WbSize.Set {
			e.FieldStart("wbSize")
			s.WbSize.Encode(e)
		}
	}
	{
		if s.Skus != nil {
			e.FieldStart("skus")
			e.ArrStart()
			for _, elem := range s.Skus {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostOKCardsItemSizesItem = [4]string{
	0: "chrtID",
	1: "techSize",
	2: "wbSize",
	3: "skus",
}

// Decode decodes ContentV2GetCardsListPostOKCardsItemSizesItem from json.
func (s *ContentV2GetCardsListPostOKCardsItemSizesItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostOKCardsItemSizesItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "chrtID":
			if err := func() error {
				s.ChrtID.Reset()
				if err := s.ChrtID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"chrtID\"")
			}
		case "techSize":
			if err := func() error {
				s.TechSize.Reset()
				if err := s.TechSize.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"techSize\"")
			}
		case "wbSize":
			if err := func() error {
				s.WbSize.Reset()
				if err := s.WbSize.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"wbSize\"")
			}
		case "skus":
			if err := func() error {
				s.Skus = 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.Skus = append(s.Skus, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"skus\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostOKCardsItemSizesItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItemSizesItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostOKCardsItemSizesItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItemTagsItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostOKCardsItemTagsItem) encodeFields(e *jx.Encoder) {
	{
		if s.ID.Set {
			e.FieldStart("id")
			s.ID.Encode(e)
		}
	}
	{
		if s.Name.Set {
			e.FieldStart("name")
			s.Name.Encode(e)
		}
	}
	{
		if s.Color.Set {
			e.FieldStart("color")
			s.Color.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostOKCardsItemTagsItem = [3]string{
	0: "id",
	1: "name",
	2: "color",
}

// Decode decodes ContentV2GetCardsListPostOKCardsItemTagsItem from json.
func (s *ContentV2GetCardsListPostOKCardsItemTagsItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostOKCardsItemTagsItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "id":
			if err := func() error {
				s.ID.Reset()
				if err := s.ID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		case "name":
			if err := func() error {
				s.Name.Reset()
				if err := s.Name.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"name\"")
			}
		case "color":
			if err := func() error {
				s.Color.Reset()
				if err := s.Color.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"color\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostOKCardsItemTagsItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostOKCardsItemTagsItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostOKCardsItemTagsItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostOKCursor) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostOKCursor) encodeFields(e *jx.Encoder) {
	{
		if s.UpdatedAt.Set {
			e.FieldStart("updatedAt")
			s.UpdatedAt.Encode(e)
		}
	}
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
	{
		if s.Total.Set {
			e.FieldStart("total")
			s.Total.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostOKCursor = [3]string{
	0: "updatedAt",
	1: "nmID",
	2: "total",
}

// Decode decodes ContentV2GetCardsListPostOKCursor from json.
func (s *ContentV2GetCardsListPostOKCursor) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostOKCursor to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "updatedAt":
			if err := func() error {
				s.UpdatedAt.Reset()
				if err := s.UpdatedAt.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"updatedAt\"")
			}
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "total":
			if err := func() error {
				s.Total.Reset()
				if err := s.Total.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"total\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostOKCursor")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostOKCursor) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostOKCursor) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostReq) encodeFields(e *jx.Encoder) {
	{
		if s.Settings.Set {
			e.FieldStart("settings")
			s.Settings.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostReq = [1]string{
	0: "settings",
}

// Decode decodes ContentV2GetCardsListPostReq from json.
func (s *ContentV2GetCardsListPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "settings":
			if err := func() error {
				s.Settings.Reset()
				if err := s.Settings.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"settings\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostReqSettings) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostReqSettings) encodeFields(e *jx.Encoder) {
	{
		if s.Sort.Set {
			e.FieldStart("sort")
			s.Sort.Encode(e)
		}
	}
	{
		if s.Filter.Set {
			e.FieldStart("filter")
			s.Filter.Encode(e)
		}
	}
	{
		if s.Cursor.Set {
			e.FieldStart("cursor")
			s.Cursor.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostReqSettings = [3]string{
	0: "sort",
	1: "filter",
	2: "cursor",
}

// Decode decodes ContentV2GetCardsListPostReqSettings from json.
func (s *ContentV2GetCardsListPostReqSettings) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostReqSettings to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "sort":
			if err := func() error {
				s.Sort.Reset()
				if err := s.Sort.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sort\"")
			}
		case "filter":
			if err := func() error {
				s.Filter.Reset()
				if err := s.Filter.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"filter\"")
			}
		case "cursor":
			if err := func() error {
				s.Cursor.Reset()
				if err := s.Cursor.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"cursor\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostReqSettings")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostReqSettings) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostReqSettings) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostReqSettingsCursor) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostReqSettingsCursor) encodeFields(e *jx.Encoder) {
	{
		if s.Limit.Set {
			e.FieldStart("limit")
			s.Limit.Encode(e)
		}
	}
	{
		if s.UpdatedAt.Set {
			e.FieldStart("updatedAt")
			s.UpdatedAt.Encode(e)
		}
	}
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostReqSettingsCursor = [3]string{
	0: "limit",
	1: "updatedAt",
	2: "nmID",
}

// Decode decodes ContentV2GetCardsListPostReqSettingsCursor from json.
func (s *ContentV2GetCardsListPostReqSettingsCursor) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostReqSettingsCursor to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "limit":
			if err := func() error {
				s.Limit.Reset()
				if err := s.Limit.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"limit\"")
			}
		case "updatedAt":
			if err := func() error {
				s.UpdatedAt.Reset()
				if err := s.UpdatedAt.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"updatedAt\"")
			}
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostReqSettingsCursor")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostReqSettingsCursor) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostReqSettingsCursor) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostReqSettingsFilter) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostReqSettingsFilter) encodeFields(e *jx.Encoder) {
	{
		if s.WithPhoto.Set {
			e.FieldStart("withPhoto")
			s.WithPhoto.Encode(e)
		}
	}
	{
		if s.TextSearch.Set {
			e.FieldStart("textSearch")
			s.TextSearch.Encode(e)
		}
	}
	{
		if s.TagIDs != nil {
			e.FieldStart("tagIDs")
			e.ArrStart()
			for _, elem := range s.TagIDs {
				e.Int(elem)
			}
			e.ArrEnd()
		}
	}
	{
		if s.AllowedCategoriesOnly.Set {
			e.FieldStart("allowedCategoriesOnly")
			s.AllowedCategoriesOnly.Encode(e)
		}
	}
	{
		if s.ObjectIDs != nil {
			e.FieldStart("objectIDs")
			e.ArrStart()
			for _, elem := range s.ObjectIDs {
				e.Int(elem)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Brands != nil {
			e.FieldStart("brands")
			e.ArrStart()
			for _, elem := range s.Brands {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
	{
		if s.ImtID.Set {
			e.FieldStart("imtID")
			s.ImtID.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostReqSettingsFilter = [7]string{
	0: "withPhoto",
	1: "textSearch",
	2: "tagIDs",
	3: "allowedCategoriesOnly",
	4: "objectIDs",
	5: "brands",
	6: "imtID",
}

// Decode decodes ContentV2GetCardsListPostReqSettingsFilter from json.
func (s *ContentV2GetCardsListPostReqSettingsFilter) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostReqSettingsFilter to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "withPhoto":
			if err := func() error {
				s.WithPhoto.Reset()
				if err := s.WithPhoto.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"withPhoto\"")
			}
		case "textSearch":
			if err := func() error {
				s.TextSearch.Reset()
				if err := s.TextSearch.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"textSearch\"")
			}
		case "tagIDs":
			if err := func() error {
				s.TagIDs = make([]int, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem int
					v, err := d.Int()
					elem = int(v)
					if err != nil {
						return err
					}
					s.TagIDs = append(s.TagIDs, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"tagIDs\"")
			}
		case "allowedCategoriesOnly":
			if err := func() error {
				s.AllowedCategoriesOnly.Reset()
				if err := s.AllowedCategoriesOnly.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"allowedCategoriesOnly\"")
			}
		case "objectIDs":
			if err := func() error {
				s.ObjectIDs = make([]int, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem int
					v, err := d.Int()
					elem = int(v)
					if err != nil {
						return err
					}
					s.ObjectIDs = append(s.ObjectIDs, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"objectIDs\"")
			}
		case "brands":
			if err := func() error {
				s.Brands = 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.Brands = append(s.Brands, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"brands\"")
			}
		case "imtID":
			if err := func() error {
				s.ImtID.Reset()
				if err := s.ImtID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"imtID\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostReqSettingsFilter")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostReqSettingsFilter) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostReqSettingsFilter) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsListPostReqSettingsSort) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsListPostReqSettingsSort) encodeFields(e *jx.Encoder) {
	{
		if s.Ascending.Set {
			e.FieldStart("ascending")
			s.Ascending.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsListPostReqSettingsSort = [1]string{
	0: "ascending",
}

// Decode decodes ContentV2GetCardsListPostReqSettingsSort from json.
func (s *ContentV2GetCardsListPostReqSettingsSort) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsListPostReqSettingsSort to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "ascending":
			if err := func() error {
				s.Ascending.Reset()
				if err := s.Ascending.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"ascending\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsListPostReqSettingsSort")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsListPostReqSettingsSort) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsListPostReqSettingsSort) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostOK) encodeFields(e *jx.Encoder) {
	{
		if s.Cards != nil {
			e.FieldStart("cards")
			e.ArrStart()
			for _, elem := range s.Cards {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Cursor.Set {
			e.FieldStart("cursor")
			s.Cursor.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostOK = [2]string{
	0: "cards",
	1: "cursor",
}

// Decode decodes ContentV2GetCardsTrashPostOK from json.
func (s *ContentV2GetCardsTrashPostOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "cards":
			if err := func() error {
				s.Cards = make([]ContentV2GetCardsTrashPostOKCardsItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2GetCardsTrashPostOKCardsItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Cards = append(s.Cards, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"cards\"")
			}
		case "cursor":
			if err := func() error {
				s.Cursor.Reset()
				if err := s.Cursor.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"cursor\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostOKCardsItem) encodeFields(e *jx.Encoder) {
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
	{
		if s.VendorCode.Set {
			e.FieldStart("vendorCode")
			s.VendorCode.Encode(e)
		}
	}
	{
		if s.SubjectID.Set {
			e.FieldStart("subjectID")
			s.SubjectID.Encode(e)
		}
	}
	{
		if s.SubjectName.Set {
			e.FieldStart("subjectName")
			s.SubjectName.Encode(e)
		}
	}
	{
		if s.Photos != nil {
			e.FieldStart("photos")
			e.ArrStart()
			for _, elem := range s.Photos {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Video.Set {
			e.FieldStart("video")
			s.Video.Encode(e)
		}
	}
	{
		if s.Sizes != nil {
			e.FieldStart("sizes")
			e.ArrStart()
			for _, elem := range s.Sizes {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Dimensions.Set {
			e.FieldStart("dimensions")
			s.Dimensions.Encode(e)
		}
	}
	{
		if s.Characteristics != nil {
			e.FieldStart("characteristics")
			e.ArrStart()
			for _, elem := range s.Characteristics {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.CreatedAt.Set {
			e.FieldStart("createdAt")
			s.CreatedAt.Encode(e)
		}
	}
	{
		if s.TrashedAt.Set {
			e.FieldStart("trashedAt")
			s.TrashedAt.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostOKCardsItem = [11]string{
	0:  "nmID",
	1:  "vendorCode",
	2:  "subjectID",
	3:  "subjectName",
	4:  "photos",
	5:  "video",
	6:  "sizes",
	7:  "dimensions",
	8:  "characteristics",
	9:  "createdAt",
	10: "trashedAt",
}

// Decode decodes ContentV2GetCardsTrashPostOKCardsItem from json.
func (s *ContentV2GetCardsTrashPostOKCardsItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostOKCardsItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "vendorCode":
			if err := func() error {
				s.VendorCode.Reset()
				if err := s.VendorCode.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"vendorCode\"")
			}
		case "subjectID":
			if err := func() error {
				s.SubjectID.Reset()
				if err := s.SubjectID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"subjectID\"")
			}
		case "subjectName":
			if err := func() error {
				s.SubjectName.Reset()
				if err := s.SubjectName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"subjectName\"")
			}
		case "photos":
			if err := func() error {
				s.Photos = make([]ContentV2GetCardsTrashPostOKCardsItemPhotosItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2GetCardsTrashPostOKCardsItemPhotosItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Photos = append(s.Photos, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"photos\"")
			}
		case "video":
			if err := func() error {
				s.Video.Reset()
				if err := s.Video.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"video\"")
			}
		case "sizes":
			if err := func() error {
				s.Sizes = make([]ContentV2GetCardsTrashPostOKCardsItemSizesItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2GetCardsTrashPostOKCardsItemSizesItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Sizes = append(s.Sizes, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizes\"")
			}
		case "dimensions":
			if err := func() error {
				s.Dimensions.Reset()
				if err := s.Dimensions.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"dimensions\"")
			}
		case "characteristics":
			if err := func() error {
				s.Characteristics = make([]ContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Characteristics = append(s.Characteristics, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"characteristics\"")
			}
		case "createdAt":
			if err := func() error {
				s.CreatedAt.Reset()
				if err := s.CreatedAt.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"createdAt\"")
			}
		case "trashedAt":
			if err := func() error {
				s.TrashedAt.Reset()
				if err := s.TrashedAt.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"trashedAt\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostOKCardsItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem) encodeFields(e *jx.Encoder) {
	{
		if s.ID.Set {
			e.FieldStart("id")
			s.ID.Encode(e)
		}
	}
	{
		if s.Name.Set {
			e.FieldStart("name")
			s.Name.Encode(e)
		}
	}
	{
		if len(s.Value) != 0 {
			e.FieldStart("value")
			e.Raw(s.Value)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem = [3]string{
	0: "id",
	1: "name",
	2: "value",
}

// Decode decodes ContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem from json.
func (s *ContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "id":
			if err := func() error {
				s.ID.Reset()
				if err := s.ID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		case "name":
			if err := func() error {
				s.Name.Reset()
				if err := s.Name.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"name\"")
			}
		case "value":
			if err := func() error {
				v, err := d.RawAppend(nil)
				s.Value = jx.Raw(v)
				if 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 ContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemCharacteristicsItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemDimensions) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostOKCardsItemDimensions) encodeFields(e *jx.Encoder) {
	{
		if s.Length.Set {
			e.FieldStart("length")
			s.Length.Encode(e)
		}
	}
	{
		if s.Width.Set {
			e.FieldStart("width")
			s.Width.Encode(e)
		}
	}
	{
		if s.Height.Set {
			e.FieldStart("height")
			s.Height.Encode(e)
		}
	}
	{
		if s.WeightBrutto.Set {
			e.FieldStart("weightBrutto")
			s.WeightBrutto.Encode(e)
		}
	}
	{
		if s.IsValid.Set {
			e.FieldStart("isValid")
			s.IsValid.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostOKCardsItemDimensions = [5]string{
	0: "length",
	1: "width",
	2: "height",
	3: "weightBrutto",
	4: "isValid",
}

// Decode decodes ContentV2GetCardsTrashPostOKCardsItemDimensions from json.
func (s *ContentV2GetCardsTrashPostOKCardsItemDimensions) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostOKCardsItemDimensions to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "length":
			if err := func() error {
				s.Length.Reset()
				if err := s.Length.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"length\"")
			}
		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\"")
			}
		case "weightBrutto":
			if err := func() error {
				s.WeightBrutto.Reset()
				if err := s.WeightBrutto.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"weightBrutto\"")
			}
		case "isValid":
			if err := func() error {
				s.IsValid.Reset()
				if err := s.IsValid.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"isValid\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostOKCardsItemDimensions")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemDimensions) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemDimensions) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemPhotosItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostOKCardsItemPhotosItem) encodeFields(e *jx.Encoder) {
	{
		if s.Big.Set {
			e.FieldStart("big")
			s.Big.Encode(e)
		}
	}
	{
		if s.C246x328.Set {
			e.FieldStart("c246x328")
			s.C246x328.Encode(e)
		}
	}
	{
		if s.C516x688.Set {
			e.FieldStart("c516x688")
			s.C516x688.Encode(e)
		}
	}
	{
		if s.Square.Set {
			e.FieldStart("square")
			s.Square.Encode(e)
		}
	}
	{
		if s.Tm.Set {
			e.FieldStart("tm")
			s.Tm.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostOKCardsItemPhotosItem = [5]string{
	0: "big",
	1: "c246x328",
	2: "c516x688",
	3: "square",
	4: "tm",
}

// Decode decodes ContentV2GetCardsTrashPostOKCardsItemPhotosItem from json.
func (s *ContentV2GetCardsTrashPostOKCardsItemPhotosItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostOKCardsItemPhotosItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "big":
			if err := func() error {
				s.Big.Reset()
				if err := s.Big.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"big\"")
			}
		case "c246x328":
			if err := func() error {
				s.C246x328.Reset()
				if err := s.C246x328.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"c246x328\"")
			}
		case "c516x688":
			if err := func() error {
				s.C516x688.Reset()
				if err := s.C516x688.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"c516x688\"")
			}
		case "square":
			if err := func() error {
				s.Square.Reset()
				if err := s.Square.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"square\"")
			}
		case "tm":
			if err := func() error {
				s.Tm.Reset()
				if err := s.Tm.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"tm\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostOKCardsItemPhotosItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemPhotosItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemPhotosItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemSizesItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostOKCardsItemSizesItem) encodeFields(e *jx.Encoder) {
	{
		if s.ChrtID.Set {
			e.FieldStart("chrtID")
			s.ChrtID.Encode(e)
		}
	}
	{
		if s.TechSize.Set {
			e.FieldStart("techSize")
			s.TechSize.Encode(e)
		}
	}
	{
		if s.WbSize.Set {
			e.FieldStart("wbSize")
			s.WbSize.Encode(e)
		}
	}
	{
		if s.Skus != nil {
			e.FieldStart("skus")
			e.ArrStart()
			for _, elem := range s.Skus {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostOKCardsItemSizesItem = [4]string{
	0: "chrtID",
	1: "techSize",
	2: "wbSize",
	3: "skus",
}

// Decode decodes ContentV2GetCardsTrashPostOKCardsItemSizesItem from json.
func (s *ContentV2GetCardsTrashPostOKCardsItemSizesItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostOKCardsItemSizesItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "chrtID":
			if err := func() error {
				s.ChrtID.Reset()
				if err := s.ChrtID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"chrtID\"")
			}
		case "techSize":
			if err := func() error {
				s.TechSize.Reset()
				if err := s.TechSize.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"techSize\"")
			}
		case "wbSize":
			if err := func() error {
				s.WbSize.Reset()
				if err := s.WbSize.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"wbSize\"")
			}
		case "skus":
			if err := func() error {
				s.Skus = 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.Skus = append(s.Skus, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"skus\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostOKCardsItemSizesItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemSizesItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostOKCardsItemSizesItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCursor) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostOKCursor) encodeFields(e *jx.Encoder) {
	{
		if s.TrashedAt.Set {
			e.FieldStart("trashedAt")
			s.TrashedAt.Encode(e)
		}
	}
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
	{
		if s.Total.Set {
			e.FieldStart("total")
			s.Total.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostOKCursor = [3]string{
	0: "trashedAt",
	1: "nmID",
	2: "total",
}

// Decode decodes ContentV2GetCardsTrashPostOKCursor from json.
func (s *ContentV2GetCardsTrashPostOKCursor) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostOKCursor to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "trashedAt":
			if err := func() error {
				s.TrashedAt.Reset()
				if err := s.TrashedAt.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"trashedAt\"")
			}
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "total":
			if err := func() error {
				s.Total.Reset()
				if err := s.Total.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"total\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostOKCursor")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostOKCursor) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostOKCursor) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostReq) encodeFields(e *jx.Encoder) {
	{
		if s.Settings.Set {
			e.FieldStart("settings")
			s.Settings.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostReq = [1]string{
	0: "settings",
}

// Decode decodes ContentV2GetCardsTrashPostReq from json.
func (s *ContentV2GetCardsTrashPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "settings":
			if err := func() error {
				s.Settings.Reset()
				if err := s.Settings.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"settings\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostReqSettings) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostReqSettings) encodeFields(e *jx.Encoder) {
	{
		if s.Sort.Set {
			e.FieldStart("sort")
			s.Sort.Encode(e)
		}
	}
	{
		if s.Cursor.Set {
			e.FieldStart("cursor")
			s.Cursor.Encode(e)
		}
	}
	{
		if s.Filter.Set {
			e.FieldStart("filter")
			s.Filter.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostReqSettings = [3]string{
	0: "sort",
	1: "cursor",
	2: "filter",
}

// Decode decodes ContentV2GetCardsTrashPostReqSettings from json.
func (s *ContentV2GetCardsTrashPostReqSettings) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostReqSettings to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "sort":
			if err := func() error {
				s.Sort.Reset()
				if err := s.Sort.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sort\"")
			}
		case "cursor":
			if err := func() error {
				s.Cursor.Reset()
				if err := s.Cursor.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"cursor\"")
			}
		case "filter":
			if err := func() error {
				s.Filter.Reset()
				if err := s.Filter.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"filter\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostReqSettings")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostReqSettings) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostReqSettings) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostReqSettingsCursor) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostReqSettingsCursor) encodeFields(e *jx.Encoder) {
	{
		if s.Limit.Set {
			e.FieldStart("limit")
			s.Limit.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostReqSettingsCursor = [1]string{
	0: "limit",
}

// Decode decodes ContentV2GetCardsTrashPostReqSettingsCursor from json.
func (s *ContentV2GetCardsTrashPostReqSettingsCursor) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostReqSettingsCursor to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "limit":
			if err := func() error {
				s.Limit.Reset()
				if err := s.Limit.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"limit\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostReqSettingsCursor")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostReqSettingsCursor) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostReqSettingsCursor) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostReqSettingsFilter) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostReqSettingsFilter) encodeFields(e *jx.Encoder) {
	{
		if s.TextSearch.Set {
			e.FieldStart("textSearch")
			s.TextSearch.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostReqSettingsFilter = [1]string{
	0: "textSearch",
}

// Decode decodes ContentV2GetCardsTrashPostReqSettingsFilter from json.
func (s *ContentV2GetCardsTrashPostReqSettingsFilter) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostReqSettingsFilter to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "textSearch":
			if err := func() error {
				s.TextSearch.Reset()
				if err := s.TextSearch.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"textSearch\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostReqSettingsFilter")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostReqSettingsFilter) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostReqSettingsFilter) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2GetCardsTrashPostReqSettingsSort) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2GetCardsTrashPostReqSettingsSort) encodeFields(e *jx.Encoder) {
	{
		if s.Ascending.Set {
			e.FieldStart("ascending")
			s.Ascending.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2GetCardsTrashPostReqSettingsSort = [1]string{
	0: "ascending",
}

// Decode decodes ContentV2GetCardsTrashPostReqSettingsSort from json.
func (s *ContentV2GetCardsTrashPostReqSettingsSort) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2GetCardsTrashPostReqSettingsSort to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "ascending":
			if err := func() error {
				s.Ascending.Reset()
				if err := s.Ascending.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"ascending\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2GetCardsTrashPostReqSettingsSort")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2GetCardsTrashPostReqSettingsSort) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2GetCardsTrashPostReqSettingsSort) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2ObjectAllGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2ObjectAllGetOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			e.ArrStart()
			for _, elem := range s.Data {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2ObjectAllGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2ObjectAllGetOK from json.
func (s *ContentV2ObjectAllGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2ObjectAllGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data = make([]ContentV2ObjectAllGetOKDataItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2ObjectAllGetOKDataItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Data = append(s.Data, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2ObjectAllGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2ObjectAllGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2ObjectAllGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2ObjectAllGetOKDataItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2ObjectAllGetOKDataItem) encodeFields(e *jx.Encoder) {
	{
		if s.SubjectID.Set {
			e.FieldStart("subjectID")
			s.SubjectID.Encode(e)
		}
	}
	{
		if s.ParentID.Set {
			e.FieldStart("parentID")
			s.ParentID.Encode(e)
		}
	}
	{
		if s.SubjectName.Set {
			e.FieldStart("subjectName")
			s.SubjectName.Encode(e)
		}
	}
	{
		if s.ParentName.Set {
			e.FieldStart("parentName")
			s.ParentName.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2ObjectAllGetOKDataItem = [4]string{
	0: "subjectID",
	1: "parentID",
	2: "subjectName",
	3: "parentName",
}

// Decode decodes ContentV2ObjectAllGetOKDataItem from json.
func (s *ContentV2ObjectAllGetOKDataItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2ObjectAllGetOKDataItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "subjectID":
			if err := func() error {
				s.SubjectID.Reset()
				if err := s.SubjectID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"subjectID\"")
			}
		case "parentID":
			if err := func() error {
				s.ParentID.Reset()
				if err := s.ParentID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"parentID\"")
			}
		case "subjectName":
			if err := func() error {
				s.SubjectName.Reset()
				if err := s.SubjectName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"subjectName\"")
			}
		case "parentName":
			if err := func() error {
				s.ParentName.Reset()
				if err := s.ParentName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"parentName\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2ObjectAllGetOKDataItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2ObjectAllGetOKDataItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2ObjectAllGetOKDataItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2ObjectCharcsSubjectIdGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2ObjectCharcsSubjectIdGetOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			e.ArrStart()
			for _, elem := range s.Data {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2ObjectCharcsSubjectIdGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2ObjectCharcsSubjectIdGetOK from json.
func (s *ContentV2ObjectCharcsSubjectIdGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2ObjectCharcsSubjectIdGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data = make([]ContentV2ObjectCharcsSubjectIdGetOKDataItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem ContentV2ObjectCharcsSubjectIdGetOKDataItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Data = append(s.Data, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2ObjectCharcsSubjectIdGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2ObjectCharcsSubjectIdGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2ObjectCharcsSubjectIdGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2ObjectCharcsSubjectIdGetOKDataItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2ObjectCharcsSubjectIdGetOKDataItem) encodeFields(e *jx.Encoder) {
	{
		if s.CharcID.Set {
			e.FieldStart("charcID")
			s.CharcID.Encode(e)
		}
	}
	{
		if s.SubjectName.Set {
			e.FieldStart("subjectName")
			s.SubjectName.Encode(e)
		}
	}
	{
		if s.SubjectID.Set {
			e.FieldStart("subjectID")
			s.SubjectID.Encode(e)
		}
	}
	{
		if s.Name.Set {
			e.FieldStart("name")
			s.Name.Encode(e)
		}
	}
	{
		if s.Required.Set {
			e.FieldStart("required")
			s.Required.Encode(e)
		}
	}
	{
		if s.UnitName.Set {
			e.FieldStart("unitName")
			s.UnitName.Encode(e)
		}
	}
	{
		if s.MaxCount.Set {
			e.FieldStart("maxCount")
			s.MaxCount.Encode(e)
		}
	}
	{
		if s.Popular.Set {
			e.FieldStart("popular")
			s.Popular.Encode(e)
		}
	}
	{
		if s.CharcType.Set {
			e.FieldStart("charcType")
			s.CharcType.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2ObjectCharcsSubjectIdGetOKDataItem = [9]string{
	0: "charcID",
	1: "subjectName",
	2: "subjectID",
	3: "name",
	4: "required",
	5: "unitName",
	6: "maxCount",
	7: "popular",
	8: "charcType",
}

// Decode decodes ContentV2ObjectCharcsSubjectIdGetOKDataItem from json.
func (s *ContentV2ObjectCharcsSubjectIdGetOKDataItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2ObjectCharcsSubjectIdGetOKDataItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "charcID":
			if err := func() error {
				s.CharcID.Reset()
				if err := s.CharcID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"charcID\"")
			}
		case "subjectName":
			if err := func() error {
				s.SubjectName.Reset()
				if err := s.SubjectName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"subjectName\"")
			}
		case "subjectID":
			if err := func() error {
				s.SubjectID.Reset()
				if err := s.SubjectID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"subjectID\"")
			}
		case "name":
			if err := func() error {
				s.Name.Reset()
				if err := s.Name.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"name\"")
			}
		case "required":
			if err := func() error {
				s.Required.Reset()
				if err := s.Required.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"required\"")
			}
		case "unitName":
			if err := func() error {
				s.UnitName.Reset()
				if err := s.UnitName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"unitName\"")
			}
		case "maxCount":
			if err := func() error {
				s.MaxCount.Reset()
				if err := s.MaxCount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"maxCount\"")
			}
		case "popular":
			if err := func() error {
				s.Popular.Reset()
				if err := s.Popular.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"popular\"")
			}
		case "charcType":
			if err := func() error {
				s.CharcType.Reset()
				if err := s.CharcType.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"charcType\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2ObjectCharcsSubjectIdGetOKDataItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2ObjectCharcsSubjectIdGetOKDataItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2ObjectCharcsSubjectIdGetOKDataItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2ObjectParentAllGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2ObjectParentAllGetOK) encodeFields(e *jx.Encoder) {
	{
		if len(s.Data) != 0 {
			e.FieldStart("data")
			e.Raw(s.Data)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2ObjectParentAllGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2ObjectParentAllGetOK from json.
func (s *ContentV2ObjectParentAllGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2ObjectParentAllGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				v, err := d.RawAppend(nil)
				s.Data = jx.Raw(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2ObjectParentAllGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2ObjectParentAllGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2ObjectParentAllGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2TagNomenclatureLinkPostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2TagNomenclatureLinkPostReq) encodeFields(e *jx.Encoder) {
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
	{
		if s.TagsIDs != nil {
			e.FieldStart("tagsIDs")
			e.ArrStart()
			for _, elem := range s.TagsIDs {
				e.Int(elem)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV2TagNomenclatureLinkPostReq = [2]string{
	0: "nmID",
	1: "tagsIDs",
}

// Decode decodes ContentV2TagNomenclatureLinkPostReq from json.
func (s *ContentV2TagNomenclatureLinkPostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2TagNomenclatureLinkPostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "tagsIDs":
			if err := func() error {
				s.TagsIDs = make([]int, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem int
					v, err := d.Int()
					elem = int(v)
					if err != nil {
						return err
					}
					s.TagsIDs = append(s.TagsIDs, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"tagsIDs\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2TagNomenclatureLinkPostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2TagNomenclatureLinkPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2TagNomenclatureLinkPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV2TagsGetOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV2TagsGetOK) encodeFields(e *jx.Encoder) {
	{
		if len(s.Data) != 0 {
			e.FieldStart("data")
			e.Raw(s.Data)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV2TagsGetOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV2TagsGetOK from json.
func (s *ContentV2TagsGetOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV2TagsGetOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				v, err := d.RawAppend(nil)
				s.Data = jx.Raw(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV2TagsGetOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV2TagsGetOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV2TagsGetOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV3MediaFilePostApplicationJSONBadRequest as json.
func (s *ContentV3MediaFilePostApplicationJSONBadRequest) Encode(e *jx.Encoder) {
	unwrapped := (*MediaErrors)(s)

	unwrapped.Encode(e)
}

// Decode decodes ContentV3MediaFilePostApplicationJSONBadRequest from json.
func (s *ContentV3MediaFilePostApplicationJSONBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaFilePostApplicationJSONBadRequest to nil")
	}
	var unwrapped MediaErrors
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = ContentV3MediaFilePostApplicationJSONBadRequest(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaFilePostApplicationJSONBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaFilePostApplicationJSONBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV3MediaFilePostForbidden as json.
func (s *ContentV3MediaFilePostForbidden) Encode(e *jx.Encoder) {
	unwrapped := (*MediaErrors)(s)

	unwrapped.Encode(e)
}

// Decode decodes ContentV3MediaFilePostForbidden from json.
func (s *ContentV3MediaFilePostForbidden) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaFilePostForbidden to nil")
	}
	var unwrapped MediaErrors
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = ContentV3MediaFilePostForbidden(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaFilePostForbidden) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaFilePostForbidden) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV3MediaFilePostOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV3MediaFilePostOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV3MediaFilePostOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV3MediaFilePostOK from json.
func (s *ContentV3MediaFilePostOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaFilePostOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data = nil
				var elem ContentV3MediaFilePostOKData
				if err := elem.Decode(d); err != nil {
					return err
				}
				s.Data = &elem
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV3MediaFilePostOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaFilePostOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaFilePostOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV3MediaFilePostOKAdditionalErrors) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV3MediaFilePostOKAdditionalErrors) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfContentV3MediaFilePostOKAdditionalErrors = [0]string{}

// Decode decodes ContentV3MediaFilePostOKAdditionalErrors from json.
func (s *ContentV3MediaFilePostOKAdditionalErrors) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaFilePostOKAdditionalErrors to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ContentV3MediaFilePostOKAdditionalErrors")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaFilePostOKAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaFilePostOKAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV3MediaFilePostOKData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV3MediaFilePostOKData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfContentV3MediaFilePostOKData = [0]string{}

// Decode decodes ContentV3MediaFilePostOKData from json.
func (s *ContentV3MediaFilePostOKData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaFilePostOKData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ContentV3MediaFilePostOKData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaFilePostOKData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaFilePostOKData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV3MediaSavePostBadRequest as json.
func (s *ContentV3MediaSavePostBadRequest) Encode(e *jx.Encoder) {
	unwrapped := (*MediaErrors)(s)

	unwrapped.Encode(e)
}

// Decode decodes ContentV3MediaSavePostBadRequest from json.
func (s *ContentV3MediaSavePostBadRequest) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaSavePostBadRequest to nil")
	}
	var unwrapped MediaErrors
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = ContentV3MediaSavePostBadRequest(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaSavePostBadRequest) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaSavePostBadRequest) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV3MediaSavePostConflict as json.
func (s *ContentV3MediaSavePostConflict) Encode(e *jx.Encoder) {
	unwrapped := (*MediaErrors)(s)

	unwrapped.Encode(e)
}

// Decode decodes ContentV3MediaSavePostConflict from json.
func (s *ContentV3MediaSavePostConflict) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaSavePostConflict to nil")
	}
	var unwrapped MediaErrors
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = ContentV3MediaSavePostConflict(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaSavePostConflict) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaSavePostConflict) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV3MediaSavePostForbidden as json.
func (s *ContentV3MediaSavePostForbidden) Encode(e *jx.Encoder) {
	unwrapped := (*MediaErrors)(s)

	unwrapped.Encode(e)
}

// Decode decodes ContentV3MediaSavePostForbidden from json.
func (s *ContentV3MediaSavePostForbidden) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaSavePostForbidden to nil")
	}
	var unwrapped MediaErrors
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = ContentV3MediaSavePostForbidden(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaSavePostForbidden) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaSavePostForbidden) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV3MediaSavePostOK) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV3MediaSavePostOK) encodeFields(e *jx.Encoder) {
	{
		if s.Data != nil {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfContentV3MediaSavePostOK = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ContentV3MediaSavePostOK from json.
func (s *ContentV3MediaSavePostOK) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaSavePostOK to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data = nil
				var elem ContentV3MediaSavePostOKData
				if err := elem.Decode(d); err != nil {
					return err
				}
				s.Data = &elem
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV3MediaSavePostOK")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaSavePostOK) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaSavePostOK) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV3MediaSavePostOKAdditionalErrors) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV3MediaSavePostOKAdditionalErrors) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfContentV3MediaSavePostOKAdditionalErrors = [0]string{}

// Decode decodes ContentV3MediaSavePostOKAdditionalErrors from json.
func (s *ContentV3MediaSavePostOKAdditionalErrors) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaSavePostOKAdditionalErrors to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ContentV3MediaSavePostOKAdditionalErrors")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaSavePostOKAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaSavePostOKAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV3MediaSavePostOKData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV3MediaSavePostOKData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfContentV3MediaSavePostOKData = [0]string{}

// Decode decodes ContentV3MediaSavePostOKData from json.
func (s *ContentV3MediaSavePostOKData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaSavePostOKData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ContentV3MediaSavePostOKData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaSavePostOKData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaSavePostOKData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ContentV3MediaSavePostReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ContentV3MediaSavePostReq) encodeFields(e *jx.Encoder) {
	{
		if s.NmId.Set {
			e.FieldStart("nmId")
			s.NmId.Encode(e)
		}
	}
	{
		if s.Data != nil {
			e.FieldStart("data")
			e.ArrStart()
			for _, elem := range s.Data {
				e.Str(elem)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfContentV3MediaSavePostReq = [2]string{
	0: "nmId",
	1: "data",
}

// Decode decodes ContentV3MediaSavePostReq from json.
func (s *ContentV3MediaSavePostReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaSavePostReq to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmId":
			if err := func() error {
				s.NmId.Reset()
				if err := s.NmId.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmId\"")
			}
		case "data":
			if err := func() error {
				s.Data = 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.Data = append(s.Data, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ContentV3MediaSavePostReq")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaSavePostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaSavePostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV3MediaSavePostUnprocessableEntity as json.
func (s *ContentV3MediaSavePostUnprocessableEntity) Encode(e *jx.Encoder) {
	unwrapped := (*MediaErrors)(s)

	unwrapped.Encode(e)
}

// Decode decodes ContentV3MediaSavePostUnprocessableEntity from json.
func (s *ContentV3MediaSavePostUnprocessableEntity) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ContentV3MediaSavePostUnprocessableEntity to nil")
	}
	var unwrapped MediaErrors
	if err := func() error {
		if err := unwrapped.Decode(d); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = ContentV3MediaSavePostUnprocessableEntity(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ContentV3MediaSavePostUnprocessableEntity) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ContentV3MediaSavePostUnprocessableEntity) 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.Code.Set {
			e.FieldStart("code")
			s.Code.Encode(e)
		}
	}
	{
		if s.Message.Set {
			e.FieldStart("message")
			s.Message.Encode(e)
		}
	}
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
}

var jsonFieldsNameOfError = [3]string{
	0: "code",
	1: "message",
	2: "data",
}

// 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 "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 "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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 *ErrorData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ErrorData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfErrorData = [0]string{}

// Decode decodes ErrorData from json.
func (s *ErrorData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ErrorData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ErrorData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ErrorData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ErrorData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *Good) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *Good) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("nmID")
		e.Int(s.NmID)
	}
	{
		if s.Price.Set {
			e.FieldStart("price")
			s.Price.Encode(e)
		}
	}
	{
		if s.Discount.Set {
			e.FieldStart("discount")
			s.Discount.Encode(e)
		}
	}
}

var jsonFieldsNameOfGood = [3]string{
	0: "nmID",
	1: "price",
	2: "discount",
}

// Decode decodes Good from json.
func (s *Good) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode Good to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				v, err := d.Int()
				s.NmID = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "price":
			if err := func() error {
				s.Price.Reset()
				if err := s.Price.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"price\"")
			}
		case "discount":
			if err := func() error {
				s.Discount.Reset()
				if err := s.Discount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"discount\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode Good")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000001,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfGood) {
					name = jsonFieldsNameOfGood[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *Good) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *Good) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *GoodBufferHistory) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *GoodBufferHistory) encodeFields(e *jx.Encoder) {
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
	{
		if s.VendorCode.Set {
			e.FieldStart("vendorCode")
			s.VendorCode.Encode(e)
		}
	}
	{
		if s.SizeID.Set {
			e.FieldStart("sizeID")
			s.SizeID.Encode(e)
		}
	}
	{
		if s.TechSizeName.Set {
			e.FieldStart("techSizeName")
			s.TechSizeName.Encode(e)
		}
	}
	{
		if s.Price.Set {
			e.FieldStart("price")
			s.Price.Encode(e)
		}
	}
	{
		if s.CurrencyIsoCode4217.Set {
			e.FieldStart("currencyIsoCode4217")
			s.CurrencyIsoCode4217.Encode(e)
		}
	}
	{
		if s.Discount.Set {
			e.FieldStart("discount")
			s.Discount.Encode(e)
		}
	}
	{
		if s.ClubDiscount.Set {
			e.FieldStart("clubDiscount")
			s.ClubDiscount.Encode(e)
		}
	}
	{
		if s.Status.Set {
			e.FieldStart("status")
			s.Status.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfGoodBufferHistory = [10]string{
	0: "nmID",
	1: "vendorCode",
	2: "sizeID",
	3: "techSizeName",
	4: "price",
	5: "currencyIsoCode4217",
	6: "discount",
	7: "clubDiscount",
	8: "status",
	9: "errorText",
}

// Decode decodes GoodBufferHistory from json.
func (s *GoodBufferHistory) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode GoodBufferHistory to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "vendorCode":
			if err := func() error {
				s.VendorCode.Reset()
				if err := s.VendorCode.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"vendorCode\"")
			}
		case "sizeID":
			if err := func() error {
				s.SizeID.Reset()
				if err := s.SizeID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizeID\"")
			}
		case "techSizeName":
			if err := func() error {
				s.TechSizeName.Reset()
				if err := s.TechSizeName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"techSizeName\"")
			}
		case "price":
			if err := func() error {
				s.Price.Reset()
				if err := s.Price.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"price\"")
			}
		case "currencyIsoCode4217":
			if err := func() error {
				s.CurrencyIsoCode4217.Reset()
				if err := s.CurrencyIsoCode4217.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"currencyIsoCode4217\"")
			}
		case "discount":
			if err := func() error {
				s.Discount.Reset()
				if err := s.Discount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"discount\"")
			}
		case "clubDiscount":
			if err := func() error {
				s.ClubDiscount.Reset()
				if err := s.ClubDiscount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"clubDiscount\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode GoodBufferHistory")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *GoodBufferHistory) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *GoodBufferHistory) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *GoodHistory) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *GoodHistory) encodeFields(e *jx.Encoder) {
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
	{
		if s.VendorCode.Set {
			e.FieldStart("vendorCode")
			s.VendorCode.Encode(e)
		}
	}
	{
		if s.SizeID.Set {
			e.FieldStart("sizeID")
			s.SizeID.Encode(e)
		}
	}
	{
		if s.TechSizeName.Set {
			e.FieldStart("techSizeName")
			s.TechSizeName.Encode(e)
		}
	}
	{
		if s.Price.Set {
			e.FieldStart("price")
			s.Price.Encode(e)
		}
	}
	{
		if s.CurrencyIsoCode4217.Set {
			e.FieldStart("currencyIsoCode4217")
			s.CurrencyIsoCode4217.Encode(e)
		}
	}
	{
		if s.Discount.Set {
			e.FieldStart("discount")
			s.Discount.Encode(e)
		}
	}
	{
		if s.ClubDiscount.Set {
			e.FieldStart("clubDiscount")
			s.ClubDiscount.Encode(e)
		}
	}
	{
		if s.Status.Set {
			e.FieldStart("status")
			s.Status.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfGoodHistory = [10]string{
	0: "nmID",
	1: "vendorCode",
	2: "sizeID",
	3: "techSizeName",
	4: "price",
	5: "currencyIsoCode4217",
	6: "discount",
	7: "clubDiscount",
	8: "status",
	9: "errorText",
}

// Decode decodes GoodHistory from json.
func (s *GoodHistory) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode GoodHistory to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "vendorCode":
			if err := func() error {
				s.VendorCode.Reset()
				if err := s.VendorCode.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"vendorCode\"")
			}
		case "sizeID":
			if err := func() error {
				s.SizeID.Reset()
				if err := s.SizeID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizeID\"")
			}
		case "techSizeName":
			if err := func() error {
				s.TechSizeName.Reset()
				if err := s.TechSizeName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"techSizeName\"")
			}
		case "price":
			if err := func() error {
				s.Price.Reset()
				if err := s.Price.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"price\"")
			}
		case "currencyIsoCode4217":
			if err := func() error {
				s.CurrencyIsoCode4217.Reset()
				if err := s.CurrencyIsoCode4217.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"currencyIsoCode4217\"")
			}
		case "discount":
			if err := func() error {
				s.Discount.Reset()
				if err := s.Discount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"discount\"")
			}
		case "clubDiscount":
			if err := func() error {
				s.ClubDiscount.Reset()
				if err := s.ClubDiscount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"clubDiscount\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode GoodHistory")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *GoodHistory) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *GoodHistory) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes GoodStatus as json.
func (s GoodStatus) Encode(e *jx.Encoder) {
	unwrapped := int(s)

	e.Int(unwrapped)
}

// Decode decodes GoodStatus from json.
func (s *GoodStatus) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode GoodStatus to nil")
	}
	var unwrapped int
	if err := func() error {
		v, err := d.Int()
		unwrapped = int(v)
		if err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = GoodStatus(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s GoodStatus) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *GoodStatus) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes GoodStatusBuffer as json.
func (s GoodStatusBuffer) Encode(e *jx.Encoder) {
	unwrapped := int(s)

	e.Int(unwrapped)
}

// Decode decodes GoodStatusBuffer from json.
func (s *GoodStatusBuffer) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode GoodStatusBuffer to nil")
	}
	var unwrapped int
	if err := func() error {
		v, err := d.Int()
		unwrapped = int(v)
		if err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = GoodStatusBuffer(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s GoodStatusBuffer) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *GoodStatusBuffer) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes Goods as json.
func (s Goods) Encode(e *jx.Encoder) {
	unwrapped := []Good(s)
	if unwrapped == nil {
		e.ArrEmpty()
		return
	}
	if unwrapped != nil {
		e.ArrStart()
		for _, elem := range unwrapped {
			elem.Encode(e)
		}
		e.ArrEnd()
	}
}

// Decode decodes Goods from json.
func (s *Goods) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode Goods to nil")
	}
	var unwrapped []Good
	if err := func() error {
		unwrapped = make([]Good, 0)
		if err := d.Arr(func(d *jx.Decoder) error {
			var elem Good
			if err := elem.Decode(d); err != nil {
				return err
			}
			unwrapped = append(unwrapped, elem)
			return nil
		}); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = Goods(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s Goods) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *Goods) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *GoodsList) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *GoodsList) encodeFields(e *jx.Encoder) {
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
	{
		if s.VendorCode.Set {
			e.FieldStart("vendorCode")
			s.VendorCode.Encode(e)
		}
	}
	{
		if s.Sizes != nil {
			e.FieldStart("sizes")
			e.ArrStart()
			for _, elem := range s.Sizes {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
	{
		if s.CurrencyIsoCode4217.Set {
			e.FieldStart("currencyIsoCode4217")
			s.CurrencyIsoCode4217.Encode(e)
		}
	}
	{
		if s.Discount.Set {
			e.FieldStart("discount")
			s.Discount.Encode(e)
		}
	}
	{
		if s.ClubDiscount.Set {
			e.FieldStart("clubDiscount")
			s.ClubDiscount.Encode(e)
		}
	}
	{
		if s.EditableSizePrice.Set {
			e.FieldStart("editableSizePrice")
			s.EditableSizePrice.Encode(e)
		}
	}
}

var jsonFieldsNameOfGoodsList = [7]string{
	0: "nmID",
	1: "vendorCode",
	2: "sizes",
	3: "currencyIsoCode4217",
	4: "discount",
	5: "clubDiscount",
	6: "editableSizePrice",
}

// Decode decodes GoodsList from json.
func (s *GoodsList) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode GoodsList to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "vendorCode":
			if err := func() error {
				s.VendorCode.Reset()
				if err := s.VendorCode.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"vendorCode\"")
			}
		case "sizes":
			if err := func() error {
				s.Sizes = make([]GoodsListSizesItem, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem GoodsListSizesItem
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.Sizes = append(s.Sizes, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizes\"")
			}
		case "currencyIsoCode4217":
			if err := func() error {
				s.CurrencyIsoCode4217.Reset()
				if err := s.CurrencyIsoCode4217.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"currencyIsoCode4217\"")
			}
		case "discount":
			if err := func() error {
				s.Discount.Reset()
				if err := s.Discount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"discount\"")
			}
		case "clubDiscount":
			if err := func() error {
				s.ClubDiscount.Reset()
				if err := s.ClubDiscount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"clubDiscount\"")
			}
		case "editableSizePrice":
			if err := func() error {
				s.EditableSizePrice.Reset()
				if err := s.EditableSizePrice.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"editableSizePrice\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode GoodsList")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *GoodsList) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *GoodsList) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *GoodsListSizesItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *GoodsListSizesItem) encodeFields(e *jx.Encoder) {
	{
		if s.SizeID.Set {
			e.FieldStart("sizeID")
			s.SizeID.Encode(e)
		}
	}
	{
		if s.Price.Set {
			e.FieldStart("price")
			s.Price.Encode(e)
		}
	}
	{
		if s.DiscountedPrice.Set {
			e.FieldStart("discountedPrice")
			s.DiscountedPrice.Encode(e)
		}
	}
	{
		if s.ClubDiscountedPrice.Set {
			e.FieldStart("clubDiscountedPrice")
			s.ClubDiscountedPrice.Encode(e)
		}
	}
	{
		if s.TechSizeName.Set {
			e.FieldStart("techSizeName")
			s.TechSizeName.Encode(e)
		}
	}
}

var jsonFieldsNameOfGoodsListSizesItem = [5]string{
	0: "sizeID",
	1: "price",
	2: "discountedPrice",
	3: "clubDiscountedPrice",
	4: "techSizeName",
}

// Decode decodes GoodsListSizesItem from json.
func (s *GoodsListSizesItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode GoodsListSizesItem to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "sizeID":
			if err := func() error {
				s.SizeID.Reset()
				if err := s.SizeID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizeID\"")
			}
		case "price":
			if err := func() error {
				s.Price.Reset()
				if err := s.Price.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"price\"")
			}
		case "discountedPrice":
			if err := func() error {
				s.DiscountedPrice.Reset()
				if err := s.DiscountedPrice.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"discountedPrice\"")
			}
		case "clubDiscountedPrice":
			if err := func() error {
				s.ClubDiscountedPrice.Reset()
				if err := s.ClubDiscountedPrice.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"clubDiscountedPrice\"")
			}
		case "techSizeName":
			if err := func() error {
				s.TechSizeName.Reset()
				if err := s.TechSizeName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"techSizeName\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode GoodsListSizesItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *GoodsListSizesItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *GoodsListSizesItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *MediaErrors) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *MediaErrors) encodeFields(e *jx.Encoder) {
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
	{
		if s.Data != nil {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfMediaErrors = [4]string{
	0: "additionalErrors",
	1: "data",
	2: "error",
	3: "errorText",
}

// Decode decodes MediaErrors from json.
func (s *MediaErrors) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode MediaErrors to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		case "data":
			if err := func() error {
				s.Data = nil
				var elem MediaErrorsData
				if err := elem.Decode(d); err != nil {
					return err
				}
				s.Data = &elem
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode MediaErrors")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *MediaErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *MediaErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *MediaErrorsAdditionalErrors) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *MediaErrorsAdditionalErrors) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfMediaErrorsAdditionalErrors = [0]string{}

// Decode decodes MediaErrorsAdditionalErrors from json.
func (s *MediaErrorsAdditionalErrors) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode MediaErrorsAdditionalErrors to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode MediaErrorsAdditionalErrors")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *MediaErrorsAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *MediaErrorsAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *MediaErrorsData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *MediaErrorsData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfMediaErrorsData = [0]string{}

// Decode decodes MediaErrorsData from json.
func (s *MediaErrorsData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode MediaErrorsData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode MediaErrorsData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *MediaErrorsData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *MediaErrorsData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *Office) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *Office) encodeFields(e *jx.Encoder) {
	{
		if s.Address.Set {
			e.FieldStart("address")
			s.Address.Encode(e)
		}
	}
	{
		if s.Name.Set {
			e.FieldStart("name")
			s.Name.Encode(e)
		}
	}
	{
		if s.City.Set {
			e.FieldStart("city")
			s.City.Encode(e)
		}
	}
	{
		if s.ID.Set {
			e.FieldStart("id")
			s.ID.Encode(e)
		}
	}
	{
		if s.Longitude.Set {
			e.FieldStart("longitude")
			s.Longitude.Encode(e)
		}
	}
	{
		if s.Latitude.Set {
			e.FieldStart("latitude")
			s.Latitude.Encode(e)
		}
	}
	{
		if s.CargoType.Set {
			e.FieldStart("cargoType")
			s.CargoType.Encode(e)
		}
	}
	{
		if s.DeliveryType.Set {
			e.FieldStart("deliveryType")
			s.DeliveryType.Encode(e)
		}
	}
	{
		if s.Selected.Set {
			e.FieldStart("selected")
			s.Selected.Encode(e)
		}
	}
}

var jsonFieldsNameOfOffice = [9]string{
	0: "address",
	1: "name",
	2: "city",
	3: "id",
	4: "longitude",
	5: "latitude",
	6: "cargoType",
	7: "deliveryType",
	8: "selected",
}

// Decode decodes Office from json.
func (s *Office) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode Office to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "address":
			if err := func() error {
				s.Address.Reset()
				if err := s.Address.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"address\"")
			}
		case "name":
			if err := func() error {
				s.Name.Reset()
				if err := s.Name.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"name\"")
			}
		case "city":
			if err := func() error {
				s.City.Reset()
				if err := s.City.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"city\"")
			}
		case "id":
			if err := func() error {
				s.ID.Reset()
				if err := s.ID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		case "longitude":
			if err := func() error {
				s.Longitude.Reset()
				if err := s.Longitude.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"longitude\"")
			}
		case "latitude":
			if err := func() error {
				s.Latitude.Reset()
				if err := s.Latitude.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"latitude\"")
			}
		case "cargoType":
			if err := func() error {
				s.CargoType.Reset()
				if err := s.CargoType.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"cargoType\"")
			}
		case "deliveryType":
			if err := func() error {
				s.DeliveryType.Reset()
				if err := s.DeliveryType.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"deliveryType\"")
			}
		case "selected":
			if err := func() error {
				s.Selected.Reset()
				if err := s.Selected.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"selected\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode Office")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *Office) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *Office) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes OfficeCargoType as json.
func (s OfficeCargoType) Encode(e *jx.Encoder) {
	e.Int(int(s))
}

// Decode decodes OfficeCargoType from json.
func (s *OfficeCargoType) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode OfficeCargoType to nil")
	}
	v, err := d.Int()
	if err != nil {
		return err
	}
	*s = OfficeCargoType(v)

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OfficeCargoType) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OfficeCargoType) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes OfficeDeliveryType as json.
func (s OfficeDeliveryType) Encode(e *jx.Encoder) {
	e.Int(int(s))
}

// Decode decodes OfficeDeliveryType from json.
func (s *OfficeDeliveryType) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode OfficeDeliveryType to nil")
	}
	v, err := d.Int()
	if err != nil {
		return err
	}
	*s = OfficeDeliveryType(v)

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OfficeDeliveryType) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OfficeDeliveryType) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *APIV2BufferGoodsTaskGetBadRequestData as json.
func (o OptAPIV2BufferGoodsTaskGetBadRequestData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *APIV2BufferGoodsTaskGetBadRequestData from json.
func (o *OptAPIV2BufferGoodsTaskGetBadRequestData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptAPIV2BufferGoodsTaskGetBadRequestData to nil")
	}
	o.Set = true
	o.Value = new(APIV2BufferGoodsTaskGetBadRequestData)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptAPIV2BufferGoodsTaskGetBadRequestData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptAPIV2BufferGoodsTaskGetBadRequestData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *APIV2BufferTasksGetBadRequestData as json.
func (o OptAPIV2BufferTasksGetBadRequestData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *APIV2BufferTasksGetBadRequestData from json.
func (o *OptAPIV2BufferTasksGetBadRequestData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptAPIV2BufferTasksGetBadRequestData to nil")
	}
	o.Set = true
	o.Value = new(APIV2BufferTasksGetBadRequestData)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptAPIV2BufferTasksGetBadRequestData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptAPIV2BufferTasksGetBadRequestData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *APIV2HistoryGoodsTaskGetBadRequestData as json.
func (o OptAPIV2HistoryGoodsTaskGetBadRequestData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *APIV2HistoryGoodsTaskGetBadRequestData from json.
func (o *OptAPIV2HistoryGoodsTaskGetBadRequestData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptAPIV2HistoryGoodsTaskGetBadRequestData to nil")
	}
	o.Set = true
	o.Value = new(APIV2HistoryGoodsTaskGetBadRequestData)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptAPIV2HistoryGoodsTaskGetBadRequestData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptAPIV2HistoryGoodsTaskGetBadRequestData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *APIV2HistoryTasksGetBadRequestData as json.
func (o OptAPIV2HistoryTasksGetBadRequestData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *APIV2HistoryTasksGetBadRequestData from json.
func (o *OptAPIV2HistoryTasksGetBadRequestData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptAPIV2HistoryTasksGetBadRequestData to nil")
	}
	o.Set = true
	o.Value = new(APIV2HistoryTasksGetBadRequestData)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptAPIV2HistoryTasksGetBadRequestData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptAPIV2HistoryTasksGetBadRequestData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes APIV3StocksWarehouseIdPutReq as json.
func (o OptAPIV3StocksWarehouseIdPutReq) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes APIV3StocksWarehouseIdPutReq from json.
func (o *OptAPIV3StocksWarehouseIdPutReq) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptAPIV3StocksWarehouseIdPutReq to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptAPIV3StocksWarehouseIdPutReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptAPIV3StocksWarehouseIdPutReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes bool as json.
func (o OptBool) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	e.Bool(bool(o.Value))
}

// Decode decodes bool from json.
func (o *OptBool) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptBool to nil")
	}
	o.Set = true
	v, err := d.Bool()
	if err != nil {
		return err
	}
	o.Value = bool(v)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptBool) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptBool) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ContentV2CardsDeleteTrashPostOKAdditionalErrors as json.
func (o OptContentV2CardsDeleteTrashPostOKAdditionalErrors) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ContentV2CardsDeleteTrashPostOKAdditionalErrors from json.
func (o *OptContentV2CardsDeleteTrashPostOKAdditionalErrors) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2CardsDeleteTrashPostOKAdditionalErrors to nil")
	}
	o.Set = true
	o.Value = new(ContentV2CardsDeleteTrashPostOKAdditionalErrors)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2CardsDeleteTrashPostOKAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2CardsDeleteTrashPostOKAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ContentV2CardsDeleteTrashPostOKData as json.
func (o OptContentV2CardsDeleteTrashPostOKData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ContentV2CardsDeleteTrashPostOKData from json.
func (o *OptContentV2CardsDeleteTrashPostOKData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2CardsDeleteTrashPostOKData to nil")
	}
	o.Set = true
	o.Value = new(ContentV2CardsDeleteTrashPostOKData)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2CardsDeleteTrashPostOKData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2CardsDeleteTrashPostOKData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2CardsLimitsGetOKData as json.
func (o OptContentV2CardsLimitsGetOKData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2CardsLimitsGetOKData from json.
func (o *OptContentV2CardsLimitsGetOKData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2CardsLimitsGetOKData to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2CardsLimitsGetOKData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2CardsLimitsGetOKData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ContentV2CardsRecoverPostOKAdditionalErrors as json.
func (o OptContentV2CardsRecoverPostOKAdditionalErrors) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ContentV2CardsRecoverPostOKAdditionalErrors from json.
func (o *OptContentV2CardsRecoverPostOKAdditionalErrors) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2CardsRecoverPostOKAdditionalErrors to nil")
	}
	o.Set = true
	o.Value = new(ContentV2CardsRecoverPostOKAdditionalErrors)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2CardsRecoverPostOKAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2CardsRecoverPostOKAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ContentV2CardsRecoverPostOKData as json.
func (o OptContentV2CardsRecoverPostOKData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ContentV2CardsRecoverPostOKData from json.
func (o *OptContentV2CardsRecoverPostOKData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2CardsRecoverPostOKData to nil")
	}
	o.Set = true
	o.Value = new(ContentV2CardsRecoverPostOKData)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2CardsRecoverPostOKData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2CardsRecoverPostOKData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2CardsUpdatePostReqItemDimensions as json.
func (o OptContentV2CardsUpdatePostReqItemDimensions) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2CardsUpdatePostReqItemDimensions from json.
func (o *OptContentV2CardsUpdatePostReqItemDimensions) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2CardsUpdatePostReqItemDimensions to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2CardsUpdatePostReqItemDimensions) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2CardsUpdatePostReqItemDimensions) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2CardsUploadAddPostReq as json.
func (o OptContentV2CardsUploadAddPostReq) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2CardsUploadAddPostReq from json.
func (o *OptContentV2CardsUploadAddPostReq) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2CardsUploadAddPostReq to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2CardsUploadAddPostReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2CardsUploadAddPostReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2CardsUploadAddPostReqCardsToAddItemDimensions as json.
func (o OptContentV2CardsUploadAddPostReqCardsToAddItemDimensions) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2CardsUploadAddPostReqCardsToAddItemDimensions from json.
func (o *OptContentV2CardsUploadAddPostReqCardsToAddItemDimensions) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2CardsUploadAddPostReqCardsToAddItemDimensions to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2CardsUploadAddPostReqCardsToAddItemDimensions) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2CardsUploadAddPostReqCardsToAddItemDimensions) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2CardsUploadPostReqItemVariantsItemDimensions as json.
func (o OptContentV2CardsUploadPostReqItemVariantsItemDimensions) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2CardsUploadPostReqItemVariantsItemDimensions from json.
func (o *OptContentV2CardsUploadPostReqItemVariantsItemDimensions) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2CardsUploadPostReqItemVariantsItemDimensions to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2CardsUploadPostReqItemVariantsItemDimensions) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2CardsUploadPostReqItemVariantsItemDimensions) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsListPostOKCardsItemDimensions as json.
func (o OptContentV2GetCardsListPostOKCardsItemDimensions) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsListPostOKCardsItemDimensions from json.
func (o *OptContentV2GetCardsListPostOKCardsItemDimensions) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsListPostOKCardsItemDimensions to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsListPostOKCardsItemDimensions) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsListPostOKCardsItemDimensions) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsListPostOKCursor as json.
func (o OptContentV2GetCardsListPostOKCursor) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsListPostOKCursor from json.
func (o *OptContentV2GetCardsListPostOKCursor) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsListPostOKCursor to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsListPostOKCursor) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsListPostOKCursor) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsListPostReqSettings as json.
func (o OptContentV2GetCardsListPostReqSettings) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsListPostReqSettings from json.
func (o *OptContentV2GetCardsListPostReqSettings) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsListPostReqSettings to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsListPostReqSettings) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsListPostReqSettings) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsListPostReqSettingsCursor as json.
func (o OptContentV2GetCardsListPostReqSettingsCursor) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsListPostReqSettingsCursor from json.
func (o *OptContentV2GetCardsListPostReqSettingsCursor) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsListPostReqSettingsCursor to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsListPostReqSettingsCursor) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsListPostReqSettingsCursor) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsListPostReqSettingsFilter as json.
func (o OptContentV2GetCardsListPostReqSettingsFilter) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsListPostReqSettingsFilter from json.
func (o *OptContentV2GetCardsListPostReqSettingsFilter) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsListPostReqSettingsFilter to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsListPostReqSettingsFilter) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsListPostReqSettingsFilter) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsListPostReqSettingsSort as json.
func (o OptContentV2GetCardsListPostReqSettingsSort) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsListPostReqSettingsSort from json.
func (o *OptContentV2GetCardsListPostReqSettingsSort) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsListPostReqSettingsSort to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsListPostReqSettingsSort) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsListPostReqSettingsSort) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsTrashPostOKCardsItemDimensions as json.
func (o OptContentV2GetCardsTrashPostOKCardsItemDimensions) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsTrashPostOKCardsItemDimensions from json.
func (o *OptContentV2GetCardsTrashPostOKCardsItemDimensions) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsTrashPostOKCardsItemDimensions to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsTrashPostOKCardsItemDimensions) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsTrashPostOKCardsItemDimensions) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsTrashPostOKCursor as json.
func (o OptContentV2GetCardsTrashPostOKCursor) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsTrashPostOKCursor from json.
func (o *OptContentV2GetCardsTrashPostOKCursor) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsTrashPostOKCursor to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsTrashPostOKCursor) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsTrashPostOKCursor) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsTrashPostReqSettings as json.
func (o OptContentV2GetCardsTrashPostReqSettings) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsTrashPostReqSettings from json.
func (o *OptContentV2GetCardsTrashPostReqSettings) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsTrashPostReqSettings to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsTrashPostReqSettings) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsTrashPostReqSettings) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsTrashPostReqSettingsCursor as json.
func (o OptContentV2GetCardsTrashPostReqSettingsCursor) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsTrashPostReqSettingsCursor from json.
func (o *OptContentV2GetCardsTrashPostReqSettingsCursor) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsTrashPostReqSettingsCursor to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsTrashPostReqSettingsCursor) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsTrashPostReqSettingsCursor) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsTrashPostReqSettingsFilter as json.
func (o OptContentV2GetCardsTrashPostReqSettingsFilter) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsTrashPostReqSettingsFilter from json.
func (o *OptContentV2GetCardsTrashPostReqSettingsFilter) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsTrashPostReqSettingsFilter to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsTrashPostReqSettingsFilter) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsTrashPostReqSettingsFilter) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ContentV2GetCardsTrashPostReqSettingsSort as json.
func (o OptContentV2GetCardsTrashPostReqSettingsSort) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ContentV2GetCardsTrashPostReqSettingsSort from json.
func (o *OptContentV2GetCardsTrashPostReqSettingsSort) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV2GetCardsTrashPostReqSettingsSort to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV2GetCardsTrashPostReqSettingsSort) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV2GetCardsTrashPostReqSettingsSort) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ContentV3MediaFilePostOKAdditionalErrors as json.
func (o OptContentV3MediaFilePostOKAdditionalErrors) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ContentV3MediaFilePostOKAdditionalErrors from json.
func (o *OptContentV3MediaFilePostOKAdditionalErrors) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV3MediaFilePostOKAdditionalErrors to nil")
	}
	o.Set = true
	o.Value = new(ContentV3MediaFilePostOKAdditionalErrors)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV3MediaFilePostOKAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV3MediaFilePostOKAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ContentV3MediaSavePostOKAdditionalErrors as json.
func (o OptContentV3MediaSavePostOKAdditionalErrors) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ContentV3MediaSavePostOKAdditionalErrors from json.
func (o *OptContentV3MediaSavePostOKAdditionalErrors) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptContentV3MediaSavePostOKAdditionalErrors to nil")
	}
	o.Set = true
	o.Value = new(ContentV3MediaSavePostOKAdditionalErrors)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptContentV3MediaSavePostOKAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptContentV3MediaSavePostOKAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes time.Time as json.
func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time)) {
	if !o.Set {
		return
	}
	format(e, o.Value)
}

// Decode decodes time.Time from json.
func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptDateTime to nil")
	}
	o.Set = true
	v, err := format(d)
	if err != nil {
		return err
	}
	o.Value = v
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptDateTime) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e, json.EncodeDateTime)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptDateTime) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d, json.DecodeDateTime)
}

// Encode encodes *ErrorData as json.
func (o OptErrorData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ErrorData from json.
func (o *OptErrorData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptErrorData to nil")
	}
	o.Set = true
	o.Value = new(ErrorData)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptErrorData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptErrorData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes float32 as json.
func (o OptFloat32) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	e.Float32(float32(o.Value))
}

// Decode decodes float32 from json.
func (o *OptFloat32) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptFloat32 to nil")
	}
	o.Set = true
	v, err := d.Float32()
	if err != nil {
		return err
	}
	o.Value = float32(v)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptFloat32) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptFloat32) 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 GoodStatus as json.
func (o OptGoodStatus) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes GoodStatus from json.
func (o *OptGoodStatus) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptGoodStatus to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptGoodStatus) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptGoodStatus) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes GoodStatusBuffer as json.
func (o OptGoodStatusBuffer) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes GoodStatusBuffer from json.
func (o *OptGoodStatusBuffer) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptGoodStatusBuffer to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptGoodStatusBuffer) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptGoodStatusBuffer) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes int as json.
func (o OptInt) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	e.Int(int(o.Value))
}

// Decode decodes int from json.
func (o *OptInt) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptInt to nil")
	}
	o.Set = true
	v, err := d.Int()
	if err != nil {
		return err
	}
	o.Value = int(v)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptInt) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptInt) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes int64 as json.
func (o OptInt64) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	e.Int64(int64(o.Value))
}

// Decode decodes int64 from json.
func (o *OptInt64) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptInt64 to nil")
	}
	o.Set = true
	v, err := d.Int64()
	if err != nil {
		return err
	}
	o.Value = int64(v)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptInt64) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptInt64) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *MediaErrorsAdditionalErrors as json.
func (o OptMediaErrorsAdditionalErrors) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *MediaErrorsAdditionalErrors from json.
func (o *OptMediaErrorsAdditionalErrors) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptMediaErrorsAdditionalErrors to nil")
	}
	o.Set = true
	o.Value = new(MediaErrorsAdditionalErrors)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptMediaErrorsAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptMediaErrorsAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes int as json.
func (o OptNilInt) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	if o.Null {
		e.Null()
		return
	}
	e.Int(int(o.Value))
}

// Decode decodes int from json.
func (o *OptNilInt) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptNilInt to nil")
	}
	if d.Next() == jx.Null {
		if err := d.Null(); err != nil {
			return err
		}

		var v int
		o.Value = v
		o.Set = true
		o.Null = true
		return nil
	}
	o.Set = true
	o.Null = false
	v, err := d.Int()
	if err != nil {
		return err
	}
	o.Value = int(v)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptNilInt) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptNilInt) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ResponseBodyContentError400AdditionalErrors as json.
func (o OptNilResponseBodyContentError400AdditionalErrors) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	if o.Null {
		e.Null()
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ResponseBodyContentError400AdditionalErrors from json.
func (o *OptNilResponseBodyContentError400AdditionalErrors) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptNilResponseBodyContentError400AdditionalErrors to nil")
	}
	if d.Next() == jx.Null {
		if err := d.Null(); err != nil {
			return err
		}

		var v ResponseBodyContentError400AdditionalErrors
		o.Value = v
		o.Set = true
		o.Null = true
		return nil
	}
	o.Set = true
	o.Null = false
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptNilResponseBodyContentError400AdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptNilResponseBodyContentError400AdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ResponseContentError4AdditionalErrors as json.
func (o OptNilResponseContentError4AdditionalErrors) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	if o.Null {
		e.Null()
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ResponseContentError4AdditionalErrors from json.
func (o *OptNilResponseContentError4AdditionalErrors) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptNilResponseContentError4AdditionalErrors to nil")
	}
	if d.Next() == jx.Null {
		if err := d.Null(); err != nil {
			return err
		}

		var v ResponseContentError4AdditionalErrors
		o.Value = v
		o.Set = true
		o.Null = true
		return nil
	}
	o.Set = true
	o.Null = false
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptNilResponseContentError4AdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptNilResponseContentError4AdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ResponseQuarantineGoodsData as json.
func (o OptNilResponseQuarantineGoodsData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	if o.Null {
		e.Null()
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ResponseQuarantineGoodsData from json.
func (o *OptNilResponseQuarantineGoodsData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptNilResponseQuarantineGoodsData to nil")
	}
	if d.Next() == jx.Null {
		if err := d.Null(); err != nil {
			return err
		}

		var v ResponseQuarantineGoodsData
		o.Value = v
		o.Set = true
		o.Null = true
		return nil
	}
	o.Set = true
	o.Null = false
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptNilResponseQuarantineGoodsData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptNilResponseQuarantineGoodsData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes string as json.
func (o OptNilString) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	if o.Null {
		e.Null()
		return
	}
	e.Str(string(o.Value))
}

// Decode decodes string from json.
func (o *OptNilString) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptNilString to nil")
	}
	if d.Next() == jx.Null {
		if err := d.Null(); err != nil {
			return err
		}

		var v string
		o.Value = v
		o.Set = true
		o.Null = true
		return nil
	}
	o.Set = true
	o.Null = false
	v, err := d.Str()
	if err != nil {
		return err
	}
	o.Value = string(v)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptNilString) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptNilString) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes OfficeCargoType as json.
func (o OptOfficeCargoType) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	e.Int(int(o.Value))
}

// Decode decodes OfficeCargoType from json.
func (o *OptOfficeCargoType) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptOfficeCargoType to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptOfficeCargoType) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptOfficeCargoType) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes OfficeDeliveryType as json.
func (o OptOfficeDeliveryType) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	e.Int(int(o.Value))
}

// Decode decodes OfficeDeliveryType from json.
func (o *OptOfficeDeliveryType) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptOfficeDeliveryType to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptOfficeDeliveryType) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptOfficeDeliveryType) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes RequestAlreadyExistsErrorData as json.
func (o OptRequestAlreadyExistsErrorData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes RequestAlreadyExistsErrorData from json.
func (o *OptRequestAlreadyExistsErrorData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptRequestAlreadyExistsErrorData to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptRequestAlreadyExistsErrorData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptRequestAlreadyExistsErrorData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ResponseBodyContentError400Data as json.
func (o OptResponseBodyContentError400Data) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ResponseBodyContentError400Data from json.
func (o *OptResponseBodyContentError400Data) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseBodyContentError400Data to nil")
	}
	o.Set = true
	o.Value = new(ResponseBodyContentError400Data)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseBodyContentError400Data) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseBodyContentError400Data) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ResponseBodyContentError403Data as json.
func (o OptResponseBodyContentError403Data) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ResponseBodyContentError403Data from json.
func (o *OptResponseBodyContentError403Data) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseBodyContentError403Data to nil")
	}
	o.Set = true
	o.Value = new(ResponseBodyContentError403Data)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseBodyContentError403Data) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseBodyContentError403Data) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ResponseCardCreateAdditionalErrors as json.
func (o OptResponseCardCreateAdditionalErrors) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ResponseCardCreateAdditionalErrors from json.
func (o *OptResponseCardCreateAdditionalErrors) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseCardCreateAdditionalErrors to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseCardCreateAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseCardCreateAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ResponseCardCreateData as json.
func (o OptResponseCardCreateData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ResponseCardCreateData from json.
func (o *OptResponseCardCreateData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseCardCreateData to nil")
	}
	o.Set = true
	o.Value = new(ResponseCardCreateData)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseCardCreateData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseCardCreateData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ResponseContentError4Data as json.
func (o OptResponseContentError4Data) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ResponseContentError4Data from json.
func (o *OptResponseContentError4Data) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseContentError4Data to nil")
	}
	o.Set = true
	o.Value = new(ResponseContentError4Data)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseContentError4Data) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseContentError4Data) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ResponseContentError6Data as json.
func (o OptResponseContentError6Data) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ResponseContentError6Data from json.
func (o *OptResponseContentError6Data) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseContentError6Data to nil")
	}
	o.Set = true
	o.Value = new(ResponseContentError6Data)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseContentError6Data) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseContentError6Data) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *ResponseErrorData as json.
func (o OptResponseErrorData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *ResponseErrorData from json.
func (o *OptResponseErrorData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseErrorData to nil")
	}
	o.Set = true
	o.Value = new(ResponseErrorData)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseErrorData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseErrorData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ResponseGoodBufferHistoriesData as json.
func (o OptResponseGoodBufferHistoriesData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ResponseGoodBufferHistoriesData from json.
func (o *OptResponseGoodBufferHistoriesData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseGoodBufferHistoriesData to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseGoodBufferHistoriesData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseGoodBufferHistoriesData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ResponseGoodHistoriesData as json.
func (o OptResponseGoodHistoriesData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ResponseGoodHistoriesData from json.
func (o *OptResponseGoodHistoriesData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseGoodHistoriesData to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseGoodHistoriesData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseGoodHistoriesData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ResponseGoodsListsData as json.
func (o OptResponseGoodsListsData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ResponseGoodsListsData from json.
func (o *OptResponseGoodsListsData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseGoodsListsData to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseGoodsListsData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseGoodsListsData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ResponseSizeListsData as json.
func (o OptResponseSizeListsData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes ResponseSizeListsData from json.
func (o *OptResponseSizeListsData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptResponseSizeListsData to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptResponseSizeListsData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptResponseSizeListsData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes *StocksWarehouseErrorItemData as json.
func (o OptStocksWarehouseErrorItemData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes *StocksWarehouseErrorItemData from json.
func (o *OptStocksWarehouseErrorItemData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptStocksWarehouseErrorItemData to nil")
	}
	o.Set = true
	o.Value = new(StocksWarehouseErrorItemData)
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptStocksWarehouseErrorItemData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptStocksWarehouseErrorItemData) 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 TaskCreatedData as json.
func (o OptTaskCreatedData) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	o.Value.Encode(e)
}

// Decode decodes TaskCreatedData from json.
func (o *OptTaskCreatedData) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptTaskCreatedData to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptTaskCreatedData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptTaskCreatedData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes uuid.UUID as json.
func (o OptUUID) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	json.EncodeUUID(e, o.Value)
}

// Decode decodes uuid.UUID from json.
func (o *OptUUID) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptUUID to nil")
	}
	o.Set = true
	v, err := json.DecodeUUID(d)
	if err != nil {
		return err
	}
	o.Value = v
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptUUID) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptUUID) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes WarehouseCargoType as json.
func (o OptWarehouseCargoType) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	e.Int(int(o.Value))
}

// Decode decodes WarehouseCargoType from json.
func (o *OptWarehouseCargoType) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptWarehouseCargoType to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptWarehouseCargoType) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptWarehouseCargoType) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes WarehouseDeliveryType as json.
func (o OptWarehouseDeliveryType) Encode(e *jx.Encoder) {
	if !o.Set {
		return
	}
	e.Int(int(o.Value))
}

// Decode decodes WarehouseDeliveryType from json.
func (o *OptWarehouseDeliveryType) Decode(d *jx.Decoder) error {
	if o == nil {
		return errors.New("invalid: unable to decode OptWarehouseDeliveryType to nil")
	}
	o.Set = true
	if err := o.Value.Decode(d); err != nil {
		return err
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s OptWarehouseDeliveryType) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *OptWarehouseDeliveryType) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *QuarantineGoods) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *QuarantineGoods) encodeFields(e *jx.Encoder) {
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
	{
		if s.SizeID.Set {
			e.FieldStart("sizeID")
			s.SizeID.Encode(e)
		}
	}
	{
		if s.TechSizeName.Set {
			e.FieldStart("techSizeName")
			s.TechSizeName.Encode(e)
		}
	}
	{
		if s.CurrencyIsoCode4217.Set {
			e.FieldStart("currencyIsoCode4217")
			s.CurrencyIsoCode4217.Encode(e)
		}
	}
	{
		if s.NewPrice.Set {
			e.FieldStart("newPrice")
			s.NewPrice.Encode(e)
		}
	}
	{
		if s.OldPrice.Set {
			e.FieldStart("oldPrice")
			s.OldPrice.Encode(e)
		}
	}
	{
		if s.NewDiscount.Set {
			e.FieldStart("newDiscount")
			s.NewDiscount.Encode(e)
		}
	}
	{
		if s.OldDiscount.Set {
			e.FieldStart("oldDiscount")
			s.OldDiscount.Encode(e)
		}
	}
	{
		if s.PriceDiff.Set {
			e.FieldStart("priceDiff")
			s.PriceDiff.Encode(e)
		}
	}
}

var jsonFieldsNameOfQuarantineGoods = [9]string{
	0: "nmID",
	1: "sizeID",
	2: "techSizeName",
	3: "currencyIsoCode4217",
	4: "newPrice",
	5: "oldPrice",
	6: "newDiscount",
	7: "oldDiscount",
	8: "priceDiff",
}

// Decode decodes QuarantineGoods from json.
func (s *QuarantineGoods) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode QuarantineGoods to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "sizeID":
			if err := func() error {
				s.SizeID.Reset()
				if err := s.SizeID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizeID\"")
			}
		case "techSizeName":
			if err := func() error {
				s.TechSizeName.Reset()
				if err := s.TechSizeName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"techSizeName\"")
			}
		case "currencyIsoCode4217":
			if err := func() error {
				s.CurrencyIsoCode4217.Reset()
				if err := s.CurrencyIsoCode4217.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"currencyIsoCode4217\"")
			}
		case "newPrice":
			if err := func() error {
				s.NewPrice.Reset()
				if err := s.NewPrice.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"newPrice\"")
			}
		case "oldPrice":
			if err := func() error {
				s.OldPrice.Reset()
				if err := s.OldPrice.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"oldPrice\"")
			}
		case "newDiscount":
			if err := func() error {
				s.NewDiscount.Reset()
				if err := s.NewDiscount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"newDiscount\"")
			}
		case "oldDiscount":
			if err := func() error {
				s.OldDiscount.Reset()
				if err := s.OldDiscount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"oldDiscount\"")
			}
		case "priceDiff":
			if err := func() error {
				s.PriceDiff.Reset()
				if err := s.PriceDiff.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"priceDiff\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode QuarantineGoods")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *QuarantineGoods) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *QuarantineGoods) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *R401) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *R401) encodeFields(e *jx.Encoder) {
	{
		if s.Title.Set {
			e.FieldStart("title")
			s.Title.Encode(e)
		}
	}
	{
		if s.Detail.Set {
			e.FieldStart("detail")
			s.Detail.Encode(e)
		}
	}
	{
		if s.Code.Set {
			e.FieldStart("code")
			s.Code.Encode(e)
		}
	}
	{
		if s.RequestId.Set {
			e.FieldStart("requestId")
			s.RequestId.Encode(e)
		}
	}
	{
		if s.Origin.Set {
			e.FieldStart("origin")
			s.Origin.Encode(e)
		}
	}
	{
		if s.Status.Set {
			e.FieldStart("status")
			s.Status.Encode(e)
		}
	}
	{
		if s.StatusText.Set {
			e.FieldStart("statusText")
			s.StatusText.Encode(e)
		}
	}
	{
		if s.Timestamp.Set {
			e.FieldStart("timestamp")
			s.Timestamp.Encode(e, json.EncodeDateTime)
		}
	}
}

var jsonFieldsNameOfR401 = [8]string{
	0: "title",
	1: "detail",
	2: "code",
	3: "requestId",
	4: "origin",
	5: "status",
	6: "statusText",
	7: "timestamp",
}

// Decode decodes R401 from json.
func (s *R401) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode R401 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 "detail":
			if err := func() error {
				s.Detail.Reset()
				if err := s.Detail.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"detail\"")
			}
		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 "requestId":
			if err := func() error {
				s.RequestId.Reset()
				if err := s.RequestId.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"requestId\"")
			}
		case "origin":
			if err := func() error {
				s.Origin.Reset()
				if err := s.Origin.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"origin\"")
			}
		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\"")
			}
		case "statusText":
			if err := func() error {
				s.StatusText.Reset()
				if err := s.StatusText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"statusText\"")
			}
		case "timestamp":
			if err := func() error {
				s.Timestamp.Reset()
				if err := s.Timestamp.Decode(d, json.DecodeDateTime); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"timestamp\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode R401")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *R401) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *R401) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *R429) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *R429) encodeFields(e *jx.Encoder) {
	{
		if s.Title.Set {
			e.FieldStart("title")
			s.Title.Encode(e)
		}
	}
	{
		if s.Detail.Set {
			e.FieldStart("detail")
			s.Detail.Encode(e)
		}
	}
	{
		if s.Code.Set {
			e.FieldStart("code")
			s.Code.Encode(e)
		}
	}
	{
		if s.RequestId.Set {
			e.FieldStart("requestId")
			s.RequestId.Encode(e)
		}
	}
	{
		if s.Origin.Set {
			e.FieldStart("origin")
			s.Origin.Encode(e)
		}
	}
	{
		if s.Status.Set {
			e.FieldStart("status")
			s.Status.Encode(e)
		}
	}
	{
		if s.StatusText.Set {
			e.FieldStart("statusText")
			s.StatusText.Encode(e)
		}
	}
	{
		if s.Timestamp.Set {
			e.FieldStart("timestamp")
			s.Timestamp.Encode(e, json.EncodeDateTime)
		}
	}
}

var jsonFieldsNameOfR429 = [8]string{
	0: "title",
	1: "detail",
	2: "code",
	3: "requestId",
	4: "origin",
	5: "status",
	6: "statusText",
	7: "timestamp",
}

// Decode decodes R429 from json.
func (s *R429) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode R429 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 "detail":
			if err := func() error {
				s.Detail.Reset()
				if err := s.Detail.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"detail\"")
			}
		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 "requestId":
			if err := func() error {
				s.RequestId.Reset()
				if err := s.RequestId.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"requestId\"")
			}
		case "origin":
			if err := func() error {
				s.Origin.Reset()
				if err := s.Origin.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"origin\"")
			}
		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\"")
			}
		case "statusText":
			if err := func() error {
				s.StatusText.Reset()
				if err := s.StatusText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"statusText\"")
			}
		case "timestamp":
			if err := func() error {
				s.Timestamp.Reset()
				if err := s.Timestamp.Decode(d, json.DecodeDateTime); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"timestamp\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode R429")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *R429) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *R429) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *RequestAlreadyExistsError) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *RequestAlreadyExistsError) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfRequestAlreadyExistsError = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes RequestAlreadyExistsError from json.
func (s *RequestAlreadyExistsError) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode RequestAlreadyExistsError to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode RequestAlreadyExistsError")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *RequestAlreadyExistsError) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *RequestAlreadyExistsError) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *RequestAlreadyExistsErrorData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *RequestAlreadyExistsErrorData) encodeFields(e *jx.Encoder) {
	{
		if s.ID.Set {
			e.FieldStart("id")
			s.ID.Encode(e)
		}
	}
	{
		if s.AlreadyExists.Set {
			e.FieldStart("alreadyExists")
			s.AlreadyExists.Encode(e)
		}
	}
}

var jsonFieldsNameOfRequestAlreadyExistsErrorData = [2]string{
	0: "id",
	1: "alreadyExists",
}

// Decode decodes RequestAlreadyExistsErrorData from json.
func (s *RequestAlreadyExistsErrorData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode RequestAlreadyExistsErrorData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "id":
			if err := func() error {
				s.ID.Reset()
				if err := s.ID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		case "alreadyExists":
			if err := func() error {
				s.AlreadyExists.Reset()
				if err := s.AlreadyExists.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"alreadyExists\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode RequestAlreadyExistsErrorData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *RequestAlreadyExistsErrorData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *RequestAlreadyExistsErrorData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseBodyContentError400) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseBodyContentError400) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseBodyContentError400 = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ResponseBodyContentError400 from json.
func (s *ResponseBodyContentError400) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseBodyContentError400 to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseBodyContentError400")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseBodyContentError400) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseBodyContentError400) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseBodyContentError400AdditionalErrors) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseBodyContentError400AdditionalErrors) encodeFields(e *jx.Encoder) {
	{
		if s.MoveNmsToTrash.Set {
			e.FieldStart("MoveNmsToTrash")
			s.MoveNmsToTrash.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseBodyContentError400AdditionalErrors = [1]string{
	0: "MoveNmsToTrash",
}

// Decode decodes ResponseBodyContentError400AdditionalErrors from json.
func (s *ResponseBodyContentError400AdditionalErrors) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseBodyContentError400AdditionalErrors to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "MoveNmsToTrash":
			if err := func() error {
				s.MoveNmsToTrash.Reset()
				if err := s.MoveNmsToTrash.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"MoveNmsToTrash\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseBodyContentError400AdditionalErrors")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseBodyContentError400AdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseBodyContentError400AdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseBodyContentError400Data) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseBodyContentError400Data) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfResponseBodyContentError400Data = [0]string{}

// Decode decodes ResponseBodyContentError400Data from json.
func (s *ResponseBodyContentError400Data) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseBodyContentError400Data to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ResponseBodyContentError400Data")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseBodyContentError400Data) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseBodyContentError400Data) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseBodyContentError403) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseBodyContentError403) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseBodyContentError403 = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ResponseBodyContentError403 from json.
func (s *ResponseBodyContentError403) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseBodyContentError403 to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseBodyContentError403")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseBodyContentError403) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseBodyContentError403) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseBodyContentError403Data) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseBodyContentError403Data) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfResponseBodyContentError403Data = [0]string{}

// Decode decodes ResponseBodyContentError403Data from json.
func (s *ResponseBodyContentError403Data) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseBodyContentError403Data to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ResponseBodyContentError403Data")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseBodyContentError403Data) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseBodyContentError403Data) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseCardCreate) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseCardCreate) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseCardCreate = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ResponseCardCreate from json.
func (s *ResponseCardCreate) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseCardCreate to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseCardCreate")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseCardCreate) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseCardCreate) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes ResponseCardCreateAdditionalErrors as json.
func (s ResponseCardCreateAdditionalErrors) Encode(e *jx.Encoder) {
	switch s.Type {
	case NullResponseCardCreateAdditionalErrors:
		_ = s.Null
		e.Null()
	case ResponseCardCreateAdditionalErrors0ResponseCardCreateAdditionalErrors:
		s.ResponseCardCreateAdditionalErrors0.Encode(e)
	case StringResponseCardCreateAdditionalErrors:
		e.Str(s.String)
	}
}

// Decode decodes ResponseCardCreateAdditionalErrors from json.
func (s *ResponseCardCreateAdditionalErrors) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseCardCreateAdditionalErrors to nil")
	}
	// Sum type type_discriminator.
	switch t := d.Next(); t {
	case jx.Null:
		if err := d.Null(); err != nil {
			return err
		}
		s.Type = NullResponseCardCreateAdditionalErrors
	case jx.Object:
		if err := s.ResponseCardCreateAdditionalErrors0.Decode(d); err != nil {
			return err
		}
		s.Type = ResponseCardCreateAdditionalErrors0ResponseCardCreateAdditionalErrors
	case jx.String:
		v, err := d.Str()
		s.String = string(v)
		if err != nil {
			return err
		}
		s.Type = StringResponseCardCreateAdditionalErrors
	default:
		return errors.Errorf("unexpected json type %q", t)
	}
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s ResponseCardCreateAdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseCardCreateAdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseCardCreateAdditionalErrors0) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseCardCreateAdditionalErrors0) encodeFields(e *jx.Encoder) {
	{
		if s.String.Set {
			e.FieldStart("string")
			s.String.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseCardCreateAdditionalErrors0 = [1]string{
	0: "string",
}

// Decode decodes ResponseCardCreateAdditionalErrors0 from json.
func (s *ResponseCardCreateAdditionalErrors0) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseCardCreateAdditionalErrors0 to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "string":
			if err := func() error {
				s.String.Reset()
				if err := s.String.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"string\"")
			}
		default:
			return errors.Errorf("unexpected field %q", k)
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseCardCreateAdditionalErrors0")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseCardCreateAdditionalErrors0) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseCardCreateAdditionalErrors0) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseCardCreateData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseCardCreateData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfResponseCardCreateData = [0]string{}

// Decode decodes ResponseCardCreateData from json.
func (s *ResponseCardCreateData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseCardCreateData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ResponseCardCreateData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseCardCreateData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseCardCreateData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseContentError4) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseContentError4) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseContentError4 = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ResponseContentError4 from json.
func (s *ResponseContentError4) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseContentError4 to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseContentError4")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseContentError4) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseContentError4) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseContentError4AdditionalErrors) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseContentError4AdditionalErrors) encodeFields(e *jx.Encoder) {
	{
		if s.Description.Set {
			e.FieldStart("description")
			s.Description.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseContentError4AdditionalErrors = [1]string{
	0: "description",
}

// Decode decodes ResponseContentError4AdditionalErrors from json.
func (s *ResponseContentError4AdditionalErrors) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseContentError4AdditionalErrors to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "description":
			if err := func() error {
				s.Description.Reset()
				if err := s.Description.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"description\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseContentError4AdditionalErrors")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseContentError4AdditionalErrors) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseContentError4AdditionalErrors) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseContentError4Data) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseContentError4Data) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfResponseContentError4Data = [0]string{}

// Decode decodes ResponseContentError4Data from json.
func (s *ResponseContentError4Data) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseContentError4Data to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ResponseContentError4Data")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseContentError4Data) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseContentError4Data) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseContentError6) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseContentError6) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
	{
		if s.AdditionalErrors.Set {
			e.FieldStart("additionalErrors")
			s.AdditionalErrors.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseContentError6 = [4]string{
	0: "data",
	1: "error",
	2: "errorText",
	3: "additionalErrors",
}

// Decode decodes ResponseContentError6 from json.
func (s *ResponseContentError6) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseContentError6 to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		case "additionalErrors":
			if err := func() error {
				s.AdditionalErrors.Reset()
				if err := s.AdditionalErrors.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"additionalErrors\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseContentError6")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseContentError6) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseContentError6) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseContentError6Data) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseContentError6Data) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfResponseContentError6Data = [0]string{}

// Decode decodes ResponseContentError6Data from json.
func (s *ResponseContentError6Data) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseContentError6Data to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ResponseContentError6Data")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseContentError6Data) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseContentError6Data) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseError) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseError) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseError = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes ResponseError from json.
func (s *ResponseError) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseError to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseError")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseError) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseError) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseErrorData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseErrorData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfResponseErrorData = [0]string{}

// Decode decodes ResponseErrorData from json.
func (s *ResponseErrorData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseErrorData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode ResponseErrorData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseErrorData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseErrorData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseGoodBufferHistories) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseGoodBufferHistories) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseGoodBufferHistories = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes ResponseGoodBufferHistories from json.
func (s *ResponseGoodBufferHistories) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseGoodBufferHistories to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseGoodBufferHistories")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseGoodBufferHistories) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseGoodBufferHistories) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseGoodBufferHistoriesData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseGoodBufferHistoriesData) encodeFields(e *jx.Encoder) {
	{
		if s.UploadID.Set {
			e.FieldStart("uploadID")
			s.UploadID.Encode(e)
		}
	}
	{
		if s.BufferGoods != nil {
			e.FieldStart("bufferGoods")
			e.ArrStart()
			for _, elem := range s.BufferGoods {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfResponseGoodBufferHistoriesData = [2]string{
	0: "uploadID",
	1: "bufferGoods",
}

// Decode decodes ResponseGoodBufferHistoriesData from json.
func (s *ResponseGoodBufferHistoriesData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseGoodBufferHistoriesData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "uploadID":
			if err := func() error {
				s.UploadID.Reset()
				if err := s.UploadID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"uploadID\"")
			}
		case "bufferGoods":
			if err := func() error {
				s.BufferGoods = make([]GoodBufferHistory, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem GoodBufferHistory
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.BufferGoods = append(s.BufferGoods, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"bufferGoods\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseGoodBufferHistoriesData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseGoodBufferHistoriesData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseGoodBufferHistoriesData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseGoodHistories) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseGoodHistories) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseGoodHistories = [1]string{
	0: "data",
}

// Decode decodes ResponseGoodHistories from json.
func (s *ResponseGoodHistories) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseGoodHistories to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseGoodHistories")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseGoodHistories) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseGoodHistories) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseGoodHistoriesData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseGoodHistoriesData) encodeFields(e *jx.Encoder) {
	{
		if s.UploadID.Set {
			e.FieldStart("uploadID")
			s.UploadID.Encode(e)
		}
	}
	{
		if s.HistoryGoods != nil {
			e.FieldStart("historyGoods")
			e.ArrStart()
			for _, elem := range s.HistoryGoods {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfResponseGoodHistoriesData = [2]string{
	0: "uploadID",
	1: "historyGoods",
}

// Decode decodes ResponseGoodHistoriesData from json.
func (s *ResponseGoodHistoriesData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseGoodHistoriesData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "uploadID":
			if err := func() error {
				s.UploadID.Reset()
				if err := s.UploadID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"uploadID\"")
			}
		case "historyGoods":
			if err := func() error {
				s.HistoryGoods = make([]GoodHistory, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem GoodHistory
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.HistoryGoods = append(s.HistoryGoods, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"historyGoods\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseGoodHistoriesData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseGoodHistoriesData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseGoodHistoriesData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseGoodsLists) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseGoodsLists) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseGoodsLists = [1]string{
	0: "data",
}

// Decode decodes ResponseGoodsLists from json.
func (s *ResponseGoodsLists) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseGoodsLists to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseGoodsLists")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseGoodsLists) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseGoodsLists) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseGoodsListsData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseGoodsListsData) encodeFields(e *jx.Encoder) {
	{
		if s.ListGoods != nil {
			e.FieldStart("listGoods")
			e.ArrStart()
			for _, elem := range s.ListGoods {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfResponseGoodsListsData = [1]string{
	0: "listGoods",
}

// Decode decodes ResponseGoodsListsData from json.
func (s *ResponseGoodsListsData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseGoodsListsData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "listGoods":
			if err := func() error {
				s.ListGoods = make([]GoodsList, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem GoodsList
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.ListGoods = append(s.ListGoods, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"listGoods\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseGoodsListsData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseGoodsListsData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseGoodsListsData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseQuarantineGoods) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseQuarantineGoods) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseQuarantineGoods = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes ResponseQuarantineGoods from json.
func (s *ResponseQuarantineGoods) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseQuarantineGoods to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseQuarantineGoods")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseQuarantineGoods) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseQuarantineGoods) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseQuarantineGoodsData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseQuarantineGoodsData) encodeFields(e *jx.Encoder) {
	{
		if s.QuarantineGoods != nil {
			e.FieldStart("quarantineGoods")
			e.ArrStart()
			for _, elem := range s.QuarantineGoods {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfResponseQuarantineGoodsData = [1]string{
	0: "quarantineGoods",
}

// Decode decodes ResponseQuarantineGoodsData from json.
func (s *ResponseQuarantineGoodsData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseQuarantineGoodsData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "quarantineGoods":
			if err := func() error {
				s.QuarantineGoods = make([]QuarantineGoods, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem QuarantineGoods
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.QuarantineGoods = append(s.QuarantineGoods, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"quarantineGoods\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseQuarantineGoodsData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseQuarantineGoodsData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseQuarantineGoodsData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseSizeLists) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseSizeLists) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseSizeLists = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes ResponseSizeLists from json.
func (s *ResponseSizeLists) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseSizeLists to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseSizeLists")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseSizeLists) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseSizeLists) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseSizeListsData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseSizeListsData) encodeFields(e *jx.Encoder) {
	{
		if s.ListGoods != nil {
			e.FieldStart("listGoods")
			e.ArrStart()
			for _, elem := range s.ListGoods {
				elem.Encode(e)
			}
			e.ArrEnd()
		}
	}
}

var jsonFieldsNameOfResponseSizeListsData = [1]string{
	0: "listGoods",
}

// Decode decodes ResponseSizeListsData from json.
func (s *ResponseSizeListsData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseSizeListsData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "listGoods":
			if err := func() error {
				s.ListGoods = make([]SizeGood, 0)
				if err := d.Arr(func(d *jx.Decoder) error {
					var elem SizeGood
					if err := elem.Decode(d); err != nil {
						return err
					}
					s.ListGoods = append(s.ListGoods, elem)
					return nil
				}); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"listGoods\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseSizeListsData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseSizeListsData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseSizeListsData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseTaskBuffer) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseTaskBuffer) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("data")
		s.Data.Encode(e)
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseTaskBuffer = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes ResponseTaskBuffer from json.
func (s *ResponseTaskBuffer) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseTaskBuffer to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseTaskBuffer")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseTaskBuffer) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseTaskBuffer) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *ResponseTaskHistory) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *ResponseTaskHistory) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("data")
		s.Data.Encode(e)
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfResponseTaskHistory = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes ResponseTaskHistory from json.
func (s *ResponseTaskHistory) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode ResponseTaskHistory to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode ResponseTaskHistory")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *ResponseTaskHistory) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *ResponseTaskHistory) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *SizeGood) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *SizeGood) encodeFields(e *jx.Encoder) {
	{
		if s.NmID.Set {
			e.FieldStart("nmID")
			s.NmID.Encode(e)
		}
	}
	{
		if s.SizeID.Set {
			e.FieldStart("sizeID")
			s.SizeID.Encode(e)
		}
	}
	{
		if s.VendorCode.Set {
			e.FieldStart("vendorCode")
			s.VendorCode.Encode(e)
		}
	}
	{
		if s.Price.Set {
			e.FieldStart("price")
			s.Price.Encode(e)
		}
	}
	{
		if s.CurrencyIsoCode4217.Set {
			e.FieldStart("currencyIsoCode4217")
			s.CurrencyIsoCode4217.Encode(e)
		}
	}
	{
		if s.DiscountedPrice.Set {
			e.FieldStart("discountedPrice")
			s.DiscountedPrice.Encode(e)
		}
	}
	{
		if s.ClubDiscountedPrice.Set {
			e.FieldStart("clubDiscountedPrice")
			s.ClubDiscountedPrice.Encode(e)
		}
	}
	{
		if s.Discount.Set {
			e.FieldStart("discount")
			s.Discount.Encode(e)
		}
	}
	{
		if s.ClubDiscount.Set {
			e.FieldStart("clubDiscount")
			s.ClubDiscount.Encode(e)
		}
	}
	{
		if s.TechSizeName.Set {
			e.FieldStart("techSizeName")
			s.TechSizeName.Encode(e)
		}
	}
	{
		if s.EditableSizePrice.Set {
			e.FieldStart("editableSizePrice")
			s.EditableSizePrice.Encode(e)
		}
	}
}

var jsonFieldsNameOfSizeGood = [11]string{
	0:  "nmID",
	1:  "sizeID",
	2:  "vendorCode",
	3:  "price",
	4:  "currencyIsoCode4217",
	5:  "discountedPrice",
	6:  "clubDiscountedPrice",
	7:  "discount",
	8:  "clubDiscount",
	9:  "techSizeName",
	10: "editableSizePrice",
}

// Decode decodes SizeGood from json.
func (s *SizeGood) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode SizeGood to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			if err := func() error {
				s.NmID.Reset()
				if err := s.NmID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "sizeID":
			if err := func() error {
				s.SizeID.Reset()
				if err := s.SizeID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizeID\"")
			}
		case "vendorCode":
			if err := func() error {
				s.VendorCode.Reset()
				if err := s.VendorCode.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"vendorCode\"")
			}
		case "price":
			if err := func() error {
				s.Price.Reset()
				if err := s.Price.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"price\"")
			}
		case "currencyIsoCode4217":
			if err := func() error {
				s.CurrencyIsoCode4217.Reset()
				if err := s.CurrencyIsoCode4217.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"currencyIsoCode4217\"")
			}
		case "discountedPrice":
			if err := func() error {
				s.DiscountedPrice.Reset()
				if err := s.DiscountedPrice.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"discountedPrice\"")
			}
		case "clubDiscountedPrice":
			if err := func() error {
				s.ClubDiscountedPrice.Reset()
				if err := s.ClubDiscountedPrice.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"clubDiscountedPrice\"")
			}
		case "discount":
			if err := func() error {
				s.Discount.Reset()
				if err := s.Discount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"discount\"")
			}
		case "clubDiscount":
			if err := func() error {
				s.ClubDiscount.Reset()
				if err := s.ClubDiscount.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"clubDiscount\"")
			}
		case "techSizeName":
			if err := func() error {
				s.TechSizeName.Reset()
				if err := s.TechSizeName.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"techSizeName\"")
			}
		case "editableSizePrice":
			if err := func() error {
				s.EditableSizePrice.Reset()
				if err := s.EditableSizePrice.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"editableSizePrice\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode SizeGood")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *SizeGood) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *SizeGood) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *SizeGoodReq) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *SizeGoodReq) encodeFields(e *jx.Encoder) {
	{
		e.FieldStart("nmID")
		e.Int(s.NmID)
	}
	{
		e.FieldStart("sizeID")
		e.Int(s.SizeID)
	}
	{
		e.FieldStart("price")
		e.Int(s.Price)
	}
}

var jsonFieldsNameOfSizeGoodReq = [3]string{
	0: "nmID",
	1: "sizeID",
	2: "price",
}

// Decode decodes SizeGoodReq from json.
func (s *SizeGoodReq) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode SizeGoodReq to nil")
	}
	var requiredBitSet [1]uint8

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "nmID":
			requiredBitSet[0] |= 1 << 0
			if err := func() error {
				v, err := d.Int()
				s.NmID = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"nmID\"")
			}
		case "sizeID":
			requiredBitSet[0] |= 1 << 1
			if err := func() error {
				v, err := d.Int()
				s.SizeID = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"sizeID\"")
			}
		case "price":
			requiredBitSet[0] |= 1 << 2
			if err := func() error {
				v, err := d.Int()
				s.Price = int(v)
				if err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"price\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode SizeGoodReq")
	}
	// Validate required fields.
	var failures []validate.FieldError
	for i, mask := range [1]uint8{
		0b00000111,
	} {
		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
			// Mask only required fields and check equality to mask using XOR.
			//
			// If XOR result is not zero, result is not equal to expected, so some fields are missed.
			// Bits of fields which would be set are actually bits of missed fields.
			missed := bits.OnesCount8(result)
			for bitN := 0; bitN < missed; bitN++ {
				bitIdx := bits.TrailingZeros8(result)
				fieldIdx := i*8 + bitIdx
				var name string
				if fieldIdx < len(jsonFieldsNameOfSizeGoodReq) {
					name = jsonFieldsNameOfSizeGoodReq[fieldIdx]
				} else {
					name = strconv.Itoa(fieldIdx)
				}
				failures = append(failures, validate.FieldError{
					Name:  name,
					Error: validate.ErrFieldRequired,
				})
				// Reset bit.
				result &^= 1 << bitIdx
			}
		}
	}
	if len(failures) > 0 {
		return &validate.Error{Fields: failures}
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *SizeGoodReq) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *SizeGoodReq) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes SizeGoodsBody as json.
func (s SizeGoodsBody) Encode(e *jx.Encoder) {
	unwrapped := []SizeGoodReq(s)
	if unwrapped == nil {
		e.ArrEmpty()
		return
	}
	if unwrapped != nil {
		e.ArrStart()
		for _, elem := range unwrapped {
			elem.Encode(e)
		}
		e.ArrEnd()
	}
}

// Decode decodes SizeGoodsBody from json.
func (s *SizeGoodsBody) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode SizeGoodsBody to nil")
	}
	var unwrapped []SizeGoodReq
	if err := func() error {
		unwrapped = make([]SizeGoodReq, 0)
		if err := d.Arr(func(d *jx.Decoder) error {
			var elem SizeGoodReq
			if err := elem.Decode(d); err != nil {
				return err
			}
			unwrapped = append(unwrapped, elem)
			return nil
		}); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = SizeGoodsBody(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s SizeGoodsBody) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *SizeGoodsBody) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes StocksWarehouseError as json.
func (s StocksWarehouseError) Encode(e *jx.Encoder) {
	unwrapped := []StocksWarehouseErrorItem(s)

	e.ArrStart()
	for _, elem := range unwrapped {
		elem.Encode(e)
	}
	e.ArrEnd()
}

// Decode decodes StocksWarehouseError from json.
func (s *StocksWarehouseError) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode StocksWarehouseError to nil")
	}
	var unwrapped []StocksWarehouseErrorItem
	if err := func() error {
		unwrapped = make([]StocksWarehouseErrorItem, 0)
		if err := d.Arr(func(d *jx.Decoder) error {
			var elem StocksWarehouseErrorItem
			if err := elem.Decode(d); err != nil {
				return err
			}
			unwrapped = append(unwrapped, elem)
			return nil
		}); err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = StocksWarehouseError(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s StocksWarehouseError) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *StocksWarehouseError) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *StocksWarehouseErrorItem) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *StocksWarehouseErrorItem) encodeFields(e *jx.Encoder) {
	{
		if s.Code.Set {
			e.FieldStart("code")
			s.Code.Encode(e)
		}
	}
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Message.Set {
			e.FieldStart("message")
			s.Message.Encode(e)
		}
	}
}

var jsonFieldsNameOfStocksWarehouseErrorItem = [3]string{
	0: "code",
	1: "data",
	2: "message",
}

// Decode decodes StocksWarehouseErrorItem from json.
func (s *StocksWarehouseErrorItem) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode StocksWarehouseErrorItem 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 "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode StocksWarehouseErrorItem")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *StocksWarehouseErrorItem) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *StocksWarehouseErrorItem) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *StocksWarehouseErrorItemData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *StocksWarehouseErrorItemData) encodeFields(e *jx.Encoder) {
}

var jsonFieldsNameOfStocksWarehouseErrorItemData = [0]string{}

// Decode decodes StocksWarehouseErrorItemData from json.
func (s *StocksWarehouseErrorItemData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode StocksWarehouseErrorItemData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		default:
			return d.Skip()
		}
	}); err != nil {
		return errors.Wrap(err, "decode StocksWarehouseErrorItemData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *StocksWarehouseErrorItemData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *StocksWarehouseErrorItemData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes SupplierTaskMetadata as json.
func (s SupplierTaskMetadata) Encode(e *jx.Encoder) {
	unwrapped := jx.Raw(s)

	if len(unwrapped) != 0 {
		e.Raw(unwrapped)
	}
}

// Decode decodes SupplierTaskMetadata from json.
func (s *SupplierTaskMetadata) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode SupplierTaskMetadata to nil")
	}
	var unwrapped jx.Raw
	if err := func() error {
		v, err := d.RawAppend(nil)
		unwrapped = jx.Raw(v)
		if err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = SupplierTaskMetadata(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s SupplierTaskMetadata) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *SupplierTaskMetadata) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes SupplierTaskMetadataBuffer as json.
func (s SupplierTaskMetadataBuffer) Encode(e *jx.Encoder) {
	unwrapped := jx.Raw(s)

	if len(unwrapped) != 0 {
		e.Raw(unwrapped)
	}
}

// Decode decodes SupplierTaskMetadataBuffer from json.
func (s *SupplierTaskMetadataBuffer) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode SupplierTaskMetadataBuffer to nil")
	}
	var unwrapped jx.Raw
	if err := func() error {
		v, err := d.RawAppend(nil)
		unwrapped = jx.Raw(v)
		if err != nil {
			return err
		}
		return nil
	}(); err != nil {
		return errors.Wrap(err, "alias")
	}
	*s = SupplierTaskMetadataBuffer(unwrapped)
	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s SupplierTaskMetadataBuffer) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *SupplierTaskMetadataBuffer) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *TaskCreated) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *TaskCreated) encodeFields(e *jx.Encoder) {
	{
		if s.Data.Set {
			e.FieldStart("data")
			s.Data.Encode(e)
		}
	}
	{
		if s.Error.Set {
			e.FieldStart("error")
			s.Error.Encode(e)
		}
	}
	{
		if s.ErrorText.Set {
			e.FieldStart("errorText")
			s.ErrorText.Encode(e)
		}
	}
}

var jsonFieldsNameOfTaskCreated = [3]string{
	0: "data",
	1: "error",
	2: "errorText",
}

// Decode decodes TaskCreated from json.
func (s *TaskCreated) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode TaskCreated to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "data":
			if err := func() error {
				s.Data.Reset()
				if err := s.Data.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"data\"")
			}
		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\"")
			}
		case "errorText":
			if err := func() error {
				s.ErrorText.Reset()
				if err := s.ErrorText.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"errorText\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode TaskCreated")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *TaskCreated) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *TaskCreated) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *TaskCreatedData) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *TaskCreatedData) encodeFields(e *jx.Encoder) {
	{
		if s.ID.Set {
			e.FieldStart("id")
			s.ID.Encode(e)
		}
	}
	{
		if s.AlreadyExists.Set {
			e.FieldStart("alreadyExists")
			s.AlreadyExists.Encode(e)
		}
	}
}

var jsonFieldsNameOfTaskCreatedData = [2]string{
	0: "id",
	1: "alreadyExists",
}

// Decode decodes TaskCreatedData from json.
func (s *TaskCreatedData) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode TaskCreatedData to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "id":
			if err := func() error {
				s.ID.Reset()
				if err := s.ID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		case "alreadyExists":
			if err := func() error {
				s.AlreadyExists.Reset()
				if err := s.AlreadyExists.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"alreadyExists\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode TaskCreatedData")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *TaskCreatedData) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *TaskCreatedData) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode implements json.Marshaler.
func (s *Warehouse) Encode(e *jx.Encoder) {
	e.ObjStart()
	s.encodeFields(e)
	e.ObjEnd()
}

// encodeFields encodes fields.
func (s *Warehouse) encodeFields(e *jx.Encoder) {
	{
		if s.Name.Set {
			e.FieldStart("name")
			s.Name.Encode(e)
		}
	}
	{
		if s.OfficeId.Set {
			e.FieldStart("officeId")
			s.OfficeId.Encode(e)
		}
	}
	{
		if s.ID.Set {
			e.FieldStart("id")
			s.ID.Encode(e)
		}
	}
	{
		if s.CargoType.Set {
			e.FieldStart("cargoType")
			s.CargoType.Encode(e)
		}
	}
	{
		if s.DeliveryType.Set {
			e.FieldStart("deliveryType")
			s.DeliveryType.Encode(e)
		}
	}
}

var jsonFieldsNameOfWarehouse = [5]string{
	0: "name",
	1: "officeId",
	2: "id",
	3: "cargoType",
	4: "deliveryType",
}

// Decode decodes Warehouse from json.
func (s *Warehouse) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode Warehouse to nil")
	}

	if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
		switch string(k) {
		case "name":
			if err := func() error {
				s.Name.Reset()
				if err := s.Name.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"name\"")
			}
		case "officeId":
			if err := func() error {
				s.OfficeId.Reset()
				if err := s.OfficeId.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"officeId\"")
			}
		case "id":
			if err := func() error {
				s.ID.Reset()
				if err := s.ID.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"id\"")
			}
		case "cargoType":
			if err := func() error {
				s.CargoType.Reset()
				if err := s.CargoType.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"cargoType\"")
			}
		case "deliveryType":
			if err := func() error {
				s.DeliveryType.Reset()
				if err := s.DeliveryType.Decode(d); err != nil {
					return err
				}
				return nil
			}(); err != nil {
				return errors.Wrap(err, "decode field \"deliveryType\"")
			}
		default:
			return d.Skip()
		}
		return nil
	}); err != nil {
		return errors.Wrap(err, "decode Warehouse")
	}

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s *Warehouse) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *Warehouse) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes WarehouseCargoType as json.
func (s WarehouseCargoType) Encode(e *jx.Encoder) {
	e.Int(int(s))
}

// Decode decodes WarehouseCargoType from json.
func (s *WarehouseCargoType) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode WarehouseCargoType to nil")
	}
	v, err := d.Int()
	if err != nil {
		return err
	}
	*s = WarehouseCargoType(v)

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s WarehouseCargoType) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *WarehouseCargoType) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}

// Encode encodes WarehouseDeliveryType as json.
func (s WarehouseDeliveryType) Encode(e *jx.Encoder) {
	e.Int(int(s))
}

// Decode decodes WarehouseDeliveryType from json.
func (s *WarehouseDeliveryType) Decode(d *jx.Decoder) error {
	if s == nil {
		return errors.New("invalid: unable to decode WarehouseDeliveryType to nil")
	}
	v, err := d.Int()
	if err != nil {
		return err
	}
	*s = WarehouseDeliveryType(v)

	return nil
}

// MarshalJSON implements stdjson.Marshaler.
func (s WarehouseDeliveryType) MarshalJSON() ([]byte, error) {
	e := jx.Encoder{}
	s.Encode(&e)
	return e.Bytes(), nil
}

// UnmarshalJSON implements stdjson.Unmarshaler.
func (s *WarehouseDeliveryType) UnmarshalJSON(data []byte) error {
	d := jx.DecodeBytes(data)
	return s.Decode(d)
}
