This repository has been archived by the owner on Nov 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
operations_row.go
305 lines (217 loc) · 6.37 KB
/
operations_row.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// OperationsRow operations row
// swagger:model OperationsRow
type OperationsRow struct {
// amount
Amount int64 `json:"amount,omitempty"`
// balance
Balance int64 `json:"balance,omitempty"`
// ballot
Ballot string `json:"ballot,omitempty"`
// block hash
// Required: true
BlockHash *string `json:"blockHash"`
// block level
// Required: true
BlockLevel *int64 `json:"blockLevel"`
// claimed amount
ClaimedAmount int64 `json:"claimedAmount,omitempty"`
// confirmations
// Required: true
Confirmations *int64 `json:"confirmations"`
// consumed gas
ConsumedGas int64 `json:"consumedGas,omitempty"`
// counter
Counter int64 `json:"counter,omitempty"`
// cycle
Cycle int64 `json:"cycle,omitempty"`
// delegatable
Delegatable bool `json:"delegatable,omitempty"`
// delegate
Delegate string `json:"delegate,omitempty"`
// delegate name
DelegateName string `json:"delegateName,omitempty"`
// delegation amount
DelegationAmount int64 `json:"delegationAmount,omitempty"`
// destination
Destination string `json:"destination,omitempty"`
// destination name
DestinationName string `json:"destinationName,omitempty"`
// double operation details
DoubleOperationDetails *DoubleOperationDetails `json:"doubleOperationDetails,omitempty"`
// endorsement deposit
EndorsementDeposit int64 `json:"endorsementDeposit,omitempty"`
// endorsement reward
EndorsementReward int64 `json:"endorsementReward,omitempty"`
// entrypoint
Entrypoint string `json:"entrypoint,omitempty"`
// fee
Fee int64 `json:"fee,omitempty"`
// gas limit
GasLimit int64 `json:"gasLimit,omitempty"`
// kind
// Required: true
Kind *string `json:"kind"`
// level
Level int64 `json:"level,omitempty"`
// manager pubkey
ManagerPubkey string `json:"managerPubkey,omitempty"`
// nonce
Nonce string `json:"nonce,omitempty"`
// operation group hash
// Required: true
OperationGroupHash *string `json:"operationGroupHash"`
// operation Id
// Required: true
OperationID *int64 `json:"operationId"`
// originated contracts
OriginatedContracts string `json:"originatedContracts,omitempty"`
// paid storage size diff
PaidStorageSizeDiff int64 `json:"paidStorageSizeDiff,omitempty"`
// parameters
Parameters string `json:"parameters,omitempty"`
// pkh
Pkh string `json:"pkh,omitempty"`
// proposal
Proposal string `json:"proposal,omitempty"`
// public key
PublicKey string `json:"publicKey,omitempty"`
// reward
Reward int64 `json:"reward,omitempty"`
// script
Script string `json:"script,omitempty"`
// secret
Secret string `json:"secret,omitempty"`
// slots
Slots string `json:"slots,omitempty"`
// source
Source string `json:"source,omitempty"`
// source name
SourceName string `json:"sourceName,omitempty"`
// spendable
Spendable bool `json:"spendable,omitempty"`
// status
Status string `json:"status,omitempty"`
// storage
Storage string `json:"storage,omitempty"`
// storage limit
StorageLimit int64 `json:"storageLimit,omitempty"`
// storage size
StorageSize int64 `json:"storageSize,omitempty"`
// timestamp
// Required: true
Timestamp *int64 `json:"timestamp"`
}
// Validate validates this operations row
func (m *OperationsRow) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateBlockHash(formats); err != nil {
res = append(res, err)
}
if err := m.validateBlockLevel(formats); err != nil {
res = append(res, err)
}
if err := m.validateConfirmations(formats); err != nil {
res = append(res, err)
}
if err := m.validateDoubleOperationDetails(formats); err != nil {
res = append(res, err)
}
if err := m.validateKind(formats); err != nil {
res = append(res, err)
}
if err := m.validateOperationGroupHash(formats); err != nil {
res = append(res, err)
}
if err := m.validateOperationID(formats); err != nil {
res = append(res, err)
}
if err := m.validateTimestamp(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OperationsRow) validateBlockHash(formats strfmt.Registry) error {
if err := validate.Required("blockHash", "body", m.BlockHash); err != nil {
return err
}
return nil
}
func (m *OperationsRow) validateBlockLevel(formats strfmt.Registry) error {
if err := validate.Required("blockLevel", "body", m.BlockLevel); err != nil {
return err
}
return nil
}
func (m *OperationsRow) validateConfirmations(formats strfmt.Registry) error {
if err := validate.Required("confirmations", "body", m.Confirmations); err != nil {
return err
}
return nil
}
func (m *OperationsRow) validateDoubleOperationDetails(formats strfmt.Registry) error {
if swag.IsZero(m.DoubleOperationDetails) { // not required
return nil
}
if m.DoubleOperationDetails != nil {
if err := m.DoubleOperationDetails.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("doubleOperationDetails")
}
return err
}
}
return nil
}
func (m *OperationsRow) validateKind(formats strfmt.Registry) error {
if err := validate.Required("kind", "body", m.Kind); err != nil {
return err
}
return nil
}
func (m *OperationsRow) validateOperationGroupHash(formats strfmt.Registry) error {
if err := validate.Required("operationGroupHash", "body", m.OperationGroupHash); err != nil {
return err
}
return nil
}
func (m *OperationsRow) validateOperationID(formats strfmt.Registry) error {
if err := validate.Required("operationId", "body", m.OperationID); err != nil {
return err
}
return nil
}
func (m *OperationsRow) validateTimestamp(formats strfmt.Registry) error {
if err := validate.Required("timestamp", "body", m.Timestamp); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *OperationsRow) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperationsRow) UnmarshalBinary(b []byte) error {
var res OperationsRow
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}