This commit is contained in:
@@ -426,14 +426,49 @@ func (s *Map) encodeFields(e *jx.Encoder) {
|
||||
e.FieldStart("Date")
|
||||
e.Int64(s.Date)
|
||||
}
|
||||
{
|
||||
e.FieldStart("CreatedAt")
|
||||
e.Int64(s.CreatedAt)
|
||||
}
|
||||
{
|
||||
e.FieldStart("UpdatedAt")
|
||||
e.Int64(s.UpdatedAt)
|
||||
}
|
||||
{
|
||||
e.FieldStart("Submitter")
|
||||
e.UInt64(s.Submitter)
|
||||
}
|
||||
{
|
||||
e.FieldStart("Thumbnail")
|
||||
e.UInt64(s.Thumbnail)
|
||||
}
|
||||
{
|
||||
e.FieldStart("AssetVersion")
|
||||
e.UInt64(s.AssetVersion)
|
||||
}
|
||||
{
|
||||
e.FieldStart("LoadCount")
|
||||
e.UInt32(s.LoadCount)
|
||||
}
|
||||
{
|
||||
e.FieldStart("Modes")
|
||||
e.UInt32(s.Modes)
|
||||
}
|
||||
}
|
||||
|
||||
var jsonFieldsNameOfMap = [5]string{
|
||||
0: "ID",
|
||||
1: "DisplayName",
|
||||
2: "Creator",
|
||||
3: "GameID",
|
||||
4: "Date",
|
||||
var jsonFieldsNameOfMap = [12]string{
|
||||
0: "ID",
|
||||
1: "DisplayName",
|
||||
2: "Creator",
|
||||
3: "GameID",
|
||||
4: "Date",
|
||||
5: "CreatedAt",
|
||||
6: "UpdatedAt",
|
||||
7: "Submitter",
|
||||
8: "Thumbnail",
|
||||
9: "AssetVersion",
|
||||
10: "LoadCount",
|
||||
11: "Modes",
|
||||
}
|
||||
|
||||
// Decode decodes Map from json.
|
||||
@@ -441,7 +476,7 @@ func (s *Map) Decode(d *jx.Decoder) error {
|
||||
if s == nil {
|
||||
return errors.New("invalid: unable to decode Map to nil")
|
||||
}
|
||||
var requiredBitSet [1]uint8
|
||||
var requiredBitSet [2]uint8
|
||||
|
||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||
switch string(k) {
|
||||
@@ -505,6 +540,90 @@ func (s *Map) Decode(d *jx.Decoder) error {
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"Date\"")
|
||||
}
|
||||
case "CreatedAt":
|
||||
requiredBitSet[0] |= 1 << 5
|
||||
if err := func() error {
|
||||
v, err := d.Int64()
|
||||
s.CreatedAt = int64(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"CreatedAt\"")
|
||||
}
|
||||
case "UpdatedAt":
|
||||
requiredBitSet[0] |= 1 << 6
|
||||
if err := func() error {
|
||||
v, err := d.Int64()
|
||||
s.UpdatedAt = int64(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"UpdatedAt\"")
|
||||
}
|
||||
case "Submitter":
|
||||
requiredBitSet[0] |= 1 << 7
|
||||
if err := func() error {
|
||||
v, err := d.UInt64()
|
||||
s.Submitter = uint64(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"Submitter\"")
|
||||
}
|
||||
case "Thumbnail":
|
||||
requiredBitSet[1] |= 1 << 0
|
||||
if err := func() error {
|
||||
v, err := d.UInt64()
|
||||
s.Thumbnail = uint64(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"Thumbnail\"")
|
||||
}
|
||||
case "AssetVersion":
|
||||
requiredBitSet[1] |= 1 << 1
|
||||
if err := func() error {
|
||||
v, err := d.UInt64()
|
||||
s.AssetVersion = uint64(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"AssetVersion\"")
|
||||
}
|
||||
case "LoadCount":
|
||||
requiredBitSet[1] |= 1 << 2
|
||||
if err := func() error {
|
||||
v, err := d.UInt32()
|
||||
s.LoadCount = uint32(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"LoadCount\"")
|
||||
}
|
||||
case "Modes":
|
||||
requiredBitSet[1] |= 1 << 3
|
||||
if err := func() error {
|
||||
v, err := d.UInt32()
|
||||
s.Modes = uint32(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "decode field \"Modes\"")
|
||||
}
|
||||
default:
|
||||
return d.Skip()
|
||||
}
|
||||
@@ -514,8 +633,9 @@ func (s *Map) Decode(d *jx.Decoder) error {
|
||||
}
|
||||
// Validate required fields.
|
||||
var failures []validate.FieldError
|
||||
for i, mask := range [1]uint8{
|
||||
0b00011111,
|
||||
for i, mask := range [2]uint8{
|
||||
0b11111111,
|
||||
0b00001111,
|
||||
} {
|
||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||
// Mask only required fields and check equality to mask using XOR.
|
||||
|
||||
@@ -320,11 +320,18 @@ func (s *ErrorStatusCode) SetResponse(val Error) {
|
||||
|
||||
// Ref: #/components/schemas/Map
|
||||
type Map struct {
|
||||
ID int64 `json:"ID"`
|
||||
DisplayName string `json:"DisplayName"`
|
||||
Creator string `json:"Creator"`
|
||||
GameID int32 `json:"GameID"`
|
||||
Date int64 `json:"Date"`
|
||||
ID int64 `json:"ID"`
|
||||
DisplayName string `json:"DisplayName"`
|
||||
Creator string `json:"Creator"`
|
||||
GameID int32 `json:"GameID"`
|
||||
Date int64 `json:"Date"`
|
||||
CreatedAt int64 `json:"CreatedAt"`
|
||||
UpdatedAt int64 `json:"UpdatedAt"`
|
||||
Submitter uint64 `json:"Submitter"`
|
||||
Thumbnail uint64 `json:"Thumbnail"`
|
||||
AssetVersion uint64 `json:"AssetVersion"`
|
||||
LoadCount uint32 `json:"LoadCount"`
|
||||
Modes uint32 `json:"Modes"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
@@ -352,6 +359,41 @@ func (s *Map) GetDate() int64 {
|
||||
return s.Date
|
||||
}
|
||||
|
||||
// GetCreatedAt returns the value of CreatedAt.
|
||||
func (s *Map) GetCreatedAt() int64 {
|
||||
return s.CreatedAt
|
||||
}
|
||||
|
||||
// GetUpdatedAt returns the value of UpdatedAt.
|
||||
func (s *Map) GetUpdatedAt() int64 {
|
||||
return s.UpdatedAt
|
||||
}
|
||||
|
||||
// GetSubmitter returns the value of Submitter.
|
||||
func (s *Map) GetSubmitter() uint64 {
|
||||
return s.Submitter
|
||||
}
|
||||
|
||||
// GetThumbnail returns the value of Thumbnail.
|
||||
func (s *Map) GetThumbnail() uint64 {
|
||||
return s.Thumbnail
|
||||
}
|
||||
|
||||
// GetAssetVersion returns the value of AssetVersion.
|
||||
func (s *Map) GetAssetVersion() uint64 {
|
||||
return s.AssetVersion
|
||||
}
|
||||
|
||||
// GetLoadCount returns the value of LoadCount.
|
||||
func (s *Map) GetLoadCount() uint32 {
|
||||
return s.LoadCount
|
||||
}
|
||||
|
||||
// GetModes returns the value of Modes.
|
||||
func (s *Map) GetModes() uint32 {
|
||||
return s.Modes
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *Map) SetID(val int64) {
|
||||
s.ID = val
|
||||
@@ -377,6 +419,41 @@ func (s *Map) SetDate(val int64) {
|
||||
s.Date = val
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the value of CreatedAt.
|
||||
func (s *Map) SetCreatedAt(val int64) {
|
||||
s.CreatedAt = val
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the value of UpdatedAt.
|
||||
func (s *Map) SetUpdatedAt(val int64) {
|
||||
s.UpdatedAt = val
|
||||
}
|
||||
|
||||
// SetSubmitter sets the value of Submitter.
|
||||
func (s *Map) SetSubmitter(val uint64) {
|
||||
s.Submitter = val
|
||||
}
|
||||
|
||||
// SetThumbnail sets the value of Thumbnail.
|
||||
func (s *Map) SetThumbnail(val uint64) {
|
||||
s.Thumbnail = val
|
||||
}
|
||||
|
||||
// SetAssetVersion sets the value of AssetVersion.
|
||||
func (s *Map) SetAssetVersion(val uint64) {
|
||||
s.AssetVersion = val
|
||||
}
|
||||
|
||||
// SetLoadCount sets the value of LoadCount.
|
||||
func (s *Map) SetLoadCount(val uint32) {
|
||||
s.LoadCount = val
|
||||
}
|
||||
|
||||
// SetModes sets the value of Modes.
|
||||
func (s *Map) SetModes(val uint32) {
|
||||
s.Modes = val
|
||||
}
|
||||
|
||||
// Ref: #/components/schemas/Mapfix
|
||||
type Mapfix struct {
|
||||
ID int64 `json:"ID"`
|
||||
|
||||
Reference in New Issue
Block a user