-
Notifications
You must be signed in to change notification settings - Fork 12
/
datastore_get_custom_ranking_by_data_id_param.go
128 lines (97 loc) · 4.42 KB
/
datastore_get_custom_ranking_by_data_id_param.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Package types implements all the types used by the DataStore protocol
package types
import (
"fmt"
"strings"
"github.com/PretendoNetwork/nex-go/v2/types"
)
// DataStoreGetCustomRankingByDataIDParam is a type within the DataStore protocol
type DataStoreGetCustomRankingByDataIDParam struct {
types.Structure
ApplicationID *types.PrimitiveU32
DataIDList *types.List[*types.PrimitiveU64]
ResultOption *types.PrimitiveU8
}
// WriteTo writes the DataStoreGetCustomRankingByDataIDParam to the given writable
func (dsgcrbdidp *DataStoreGetCustomRankingByDataIDParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()
dsgcrbdidp.ApplicationID.WriteTo(contentWritable)
dsgcrbdidp.DataIDList.WriteTo(contentWritable)
dsgcrbdidp.ResultOption.WriteTo(contentWritable)
content := contentWritable.Bytes()
dsgcrbdidp.WriteHeaderTo(writable, uint32(len(content)))
writable.Write(content)
}
// ExtractFrom extracts the DataStoreGetCustomRankingByDataIDParam from the given readable
func (dsgcrbdidp *DataStoreGetCustomRankingByDataIDParam) ExtractFrom(readable types.Readable) error {
var err error
err = dsgcrbdidp.ExtractHeaderFrom(readable)
if err != nil {
return fmt.Errorf("Failed to extract DataStoreGetCustomRankingByDataIDParam header. %s", err.Error())
}
err = dsgcrbdidp.ApplicationID.ExtractFrom(readable)
if err != nil {
return fmt.Errorf("Failed to extract DataStoreGetCustomRankingByDataIDParam.ApplicationID. %s", err.Error())
}
err = dsgcrbdidp.DataIDList.ExtractFrom(readable)
if err != nil {
return fmt.Errorf("Failed to extract DataStoreGetCustomRankingByDataIDParam.DataIDList. %s", err.Error())
}
err = dsgcrbdidp.ResultOption.ExtractFrom(readable)
if err != nil {
return fmt.Errorf("Failed to extract DataStoreGetCustomRankingByDataIDParam.ResultOption. %s", err.Error())
}
return nil
}
// Copy returns a new copied instance of DataStoreGetCustomRankingByDataIDParam
func (dsgcrbdidp *DataStoreGetCustomRankingByDataIDParam) Copy() types.RVType {
copied := NewDataStoreGetCustomRankingByDataIDParam()
copied.StructureVersion = dsgcrbdidp.StructureVersion
copied.ApplicationID = dsgcrbdidp.ApplicationID.Copy().(*types.PrimitiveU32)
copied.DataIDList = dsgcrbdidp.DataIDList.Copy().(*types.List[*types.PrimitiveU64])
copied.ResultOption = dsgcrbdidp.ResultOption.Copy().(*types.PrimitiveU8)
return copied
}
// Equals checks if the given DataStoreGetCustomRankingByDataIDParam contains the same data as the current DataStoreGetCustomRankingByDataIDParam
func (dsgcrbdidp *DataStoreGetCustomRankingByDataIDParam) Equals(o types.RVType) bool {
if _, ok := o.(*DataStoreGetCustomRankingByDataIDParam); !ok {
return false
}
other := o.(*DataStoreGetCustomRankingByDataIDParam)
if dsgcrbdidp.StructureVersion != other.StructureVersion {
return false
}
if !dsgcrbdidp.ApplicationID.Equals(other.ApplicationID) {
return false
}
if !dsgcrbdidp.DataIDList.Equals(other.DataIDList) {
return false
}
return dsgcrbdidp.ResultOption.Equals(other.ResultOption)
}
// String returns the string representation of the DataStoreGetCustomRankingByDataIDParam
func (dsgcrbdidp *DataStoreGetCustomRankingByDataIDParam) String() string {
return dsgcrbdidp.FormatToString(0)
}
// FormatToString pretty-prints the DataStoreGetCustomRankingByDataIDParam using the provided indentation level
func (dsgcrbdidp *DataStoreGetCustomRankingByDataIDParam) FormatToString(indentationLevel int) string {
indentationValues := strings.Repeat("\t", indentationLevel+1)
indentationEnd := strings.Repeat("\t", indentationLevel)
var b strings.Builder
b.WriteString("DataStoreGetCustomRankingByDataIDParam{\n")
b.WriteString(fmt.Sprintf("%sApplicationID: %s,\n", indentationValues, dsgcrbdidp.ApplicationID))
b.WriteString(fmt.Sprintf("%sDataIDList: %s,\n", indentationValues, dsgcrbdidp.DataIDList))
b.WriteString(fmt.Sprintf("%sResultOption: %s,\n", indentationValues, dsgcrbdidp.ResultOption))
b.WriteString(fmt.Sprintf("%s}", indentationEnd))
return b.String()
}
// NewDataStoreGetCustomRankingByDataIDParam returns a new DataStoreGetCustomRankingByDataIDParam
func NewDataStoreGetCustomRankingByDataIDParam() *DataStoreGetCustomRankingByDataIDParam {
dsgcrbdidp := &DataStoreGetCustomRankingByDataIDParam{
ApplicationID: types.NewPrimitiveU32(0),
DataIDList: types.NewList[*types.PrimitiveU64](),
ResultOption: types.NewPrimitiveU8(0),
}
dsgcrbdidp.DataIDList.Type = types.NewPrimitiveU64(0)
return dsgcrbdidp
}