/
model_contract.go
430 lines (363 loc) · 9.97 KB
/
model_contract.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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
/*
MultiBaas API
MultiBaas's REST APIv0.
API version: 0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package multibaas
import (
"encoding/json"
)
// checks if the Contract type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Contract{}
// Contract A returned contract.
type Contract struct {
// A label.
Label string `json:"label"`
// The name of the contract.
ContractName string `json:"contractName"`
// The contract version.
Version string `json:"version"`
// The smart-contract bytecode.
Bin *string `json:"bin,omitempty"`
// The contract raw ABI JSON string.
RawAbi string `json:"rawAbi"`
// The user documentation JSON string.
UserDoc string `json:"userDoc"`
// The developer documentation JSON string.
DeveloperDoc string `json:"developerDoc"`
// The contract metadata JSON string.
Metadata *string `json:"metadata,omitempty"`
IsFavorite *bool `json:"isFavorite,omitempty"`
Abi ContractABI `json:"abi"`
// List of the contract instances.
Instances []ContractInstance `json:"instances,omitempty"`
}
// NewContract instantiates a new Contract object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewContract(label string, contractName string, version string, rawAbi string, userDoc string, developerDoc string, abi ContractABI) *Contract {
this := Contract{}
this.Label = label
this.ContractName = contractName
this.Version = version
this.RawAbi = rawAbi
this.UserDoc = userDoc
this.DeveloperDoc = developerDoc
this.Abi = abi
return &this
}
// NewContractWithDefaults instantiates a new Contract object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewContractWithDefaults() *Contract {
this := Contract{}
return &this
}
// GetLabel returns the Label field value
func (o *Contract) GetLabel() string {
if o == nil {
var ret string
return ret
}
return o.Label
}
// GetLabelOk returns a tuple with the Label field value
// and a boolean to check if the value has been set.
func (o *Contract) GetLabelOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Label, true
}
// SetLabel sets field value
func (o *Contract) SetLabel(v string) {
o.Label = v
}
// GetContractName returns the ContractName field value
func (o *Contract) GetContractName() string {
if o == nil {
var ret string
return ret
}
return o.ContractName
}
// GetContractNameOk returns a tuple with the ContractName field value
// and a boolean to check if the value has been set.
func (o *Contract) GetContractNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ContractName, true
}
// SetContractName sets field value
func (o *Contract) SetContractName(v string) {
o.ContractName = v
}
// GetVersion returns the Version field value
func (o *Contract) GetVersion() string {
if o == nil {
var ret string
return ret
}
return o.Version
}
// GetVersionOk returns a tuple with the Version field value
// and a boolean to check if the value has been set.
func (o *Contract) GetVersionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Version, true
}
// SetVersion sets field value
func (o *Contract) SetVersion(v string) {
o.Version = v
}
// GetBin returns the Bin field value if set, zero value otherwise.
func (o *Contract) GetBin() string {
if o == nil || IsNil(o.Bin) {
var ret string
return ret
}
return *o.Bin
}
// GetBinOk returns a tuple with the Bin field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Contract) GetBinOk() (*string, bool) {
if o == nil || IsNil(o.Bin) {
return nil, false
}
return o.Bin, true
}
// HasBin returns a boolean if a field has been set.
func (o *Contract) HasBin() bool {
if o != nil && !IsNil(o.Bin) {
return true
}
return false
}
// SetBin gets a reference to the given string and assigns it to the Bin field.
func (o *Contract) SetBin(v string) {
o.Bin = &v
}
// GetRawAbi returns the RawAbi field value
func (o *Contract) GetRawAbi() string {
if o == nil {
var ret string
return ret
}
return o.RawAbi
}
// GetRawAbiOk returns a tuple with the RawAbi field value
// and a boolean to check if the value has been set.
func (o *Contract) GetRawAbiOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RawAbi, true
}
// SetRawAbi sets field value
func (o *Contract) SetRawAbi(v string) {
o.RawAbi = v
}
// GetUserDoc returns the UserDoc field value
func (o *Contract) GetUserDoc() string {
if o == nil {
var ret string
return ret
}
return o.UserDoc
}
// GetUserDocOk returns a tuple with the UserDoc field value
// and a boolean to check if the value has been set.
func (o *Contract) GetUserDocOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.UserDoc, true
}
// SetUserDoc sets field value
func (o *Contract) SetUserDoc(v string) {
o.UserDoc = v
}
// GetDeveloperDoc returns the DeveloperDoc field value
func (o *Contract) GetDeveloperDoc() string {
if o == nil {
var ret string
return ret
}
return o.DeveloperDoc
}
// GetDeveloperDocOk returns a tuple with the DeveloperDoc field value
// and a boolean to check if the value has been set.
func (o *Contract) GetDeveloperDocOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.DeveloperDoc, true
}
// SetDeveloperDoc sets field value
func (o *Contract) SetDeveloperDoc(v string) {
o.DeveloperDoc = v
}
// GetMetadata returns the Metadata field value if set, zero value otherwise.
func (o *Contract) GetMetadata() string {
if o == nil || IsNil(o.Metadata) {
var ret string
return ret
}
return *o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Contract) GetMetadataOk() (*string, bool) {
if o == nil || IsNil(o.Metadata) {
return nil, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *Contract) HasMetadata() bool {
if o != nil && !IsNil(o.Metadata) {
return true
}
return false
}
// SetMetadata gets a reference to the given string and assigns it to the Metadata field.
func (o *Contract) SetMetadata(v string) {
o.Metadata = &v
}
// GetIsFavorite returns the IsFavorite field value if set, zero value otherwise.
func (o *Contract) GetIsFavorite() bool {
if o == nil || IsNil(o.IsFavorite) {
var ret bool
return ret
}
return *o.IsFavorite
}
// GetIsFavoriteOk returns a tuple with the IsFavorite field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Contract) GetIsFavoriteOk() (*bool, bool) {
if o == nil || IsNil(o.IsFavorite) {
return nil, false
}
return o.IsFavorite, true
}
// HasIsFavorite returns a boolean if a field has been set.
func (o *Contract) HasIsFavorite() bool {
if o != nil && !IsNil(o.IsFavorite) {
return true
}
return false
}
// SetIsFavorite gets a reference to the given bool and assigns it to the IsFavorite field.
func (o *Contract) SetIsFavorite(v bool) {
o.IsFavorite = &v
}
// GetAbi returns the Abi field value
func (o *Contract) GetAbi() ContractABI {
if o == nil {
var ret ContractABI
return ret
}
return o.Abi
}
// GetAbiOk returns a tuple with the Abi field value
// and a boolean to check if the value has been set.
func (o *Contract) GetAbiOk() (*ContractABI, bool) {
if o == nil {
return nil, false
}
return &o.Abi, true
}
// SetAbi sets field value
func (o *Contract) SetAbi(v ContractABI) {
o.Abi = v
}
// GetInstances returns the Instances field value if set, zero value otherwise.
func (o *Contract) GetInstances() []ContractInstance {
if o == nil || IsNil(o.Instances) {
var ret []ContractInstance
return ret
}
return o.Instances
}
// GetInstancesOk returns a tuple with the Instances field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Contract) GetInstancesOk() ([]ContractInstance, bool) {
if o == nil || IsNil(o.Instances) {
return nil, false
}
return o.Instances, true
}
// HasInstances returns a boolean if a field has been set.
func (o *Contract) HasInstances() bool {
if o != nil && !IsNil(o.Instances) {
return true
}
return false
}
// SetInstances gets a reference to the given []ContractInstance and assigns it to the Instances field.
func (o *Contract) SetInstances(v []ContractInstance) {
o.Instances = v
}
func (o Contract) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Contract) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["label"] = o.Label
toSerialize["contractName"] = o.ContractName
toSerialize["version"] = o.Version
if !IsNil(o.Bin) {
toSerialize["bin"] = o.Bin
}
toSerialize["rawAbi"] = o.RawAbi
toSerialize["userDoc"] = o.UserDoc
toSerialize["developerDoc"] = o.DeveloperDoc
if !IsNil(o.Metadata) {
toSerialize["metadata"] = o.Metadata
}
if !IsNil(o.IsFavorite) {
toSerialize["isFavorite"] = o.IsFavorite
}
toSerialize["abi"] = o.Abi
if !IsNil(o.Instances) {
toSerialize["instances"] = o.Instances
}
return toSerialize, nil
}
type NullableContract struct {
value *Contract
isSet bool
}
func (v NullableContract) Get() *Contract {
return v.value
}
func (v *NullableContract) Set(val *Contract) {
v.value = val
v.isSet = true
}
func (v NullableContract) IsSet() bool {
return v.isSet
}
func (v *NullableContract) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableContract(val *Contract) *NullableContract {
return &NullableContract{value: val, isSet: true}
}
func (v NullableContract) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableContract) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}