forked from nftstorage/go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_pin_status.go
86 lines (69 loc) · 1.65 KB
/
model_pin_status.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
/*
* NFT Storage API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package nftstorage
import (
"encoding/json"
"fmt"
)
// PinStatus the model 'PinStatus'
type PinStatus string
// List of PinStatus
const (
QUEUED PinStatus = "queued"
PINNING PinStatus = "pinning"
PINNED PinStatus = "pinned"
FAILED PinStatus = "failed"
)
func (v *PinStatus) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := PinStatus(value)
for _, existing := range []PinStatus{ "queued", "pinning", "pinned", "failed", } {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid PinStatus", value)
}
// Ptr returns reference to PinStatus value
func (v PinStatus) Ptr() *PinStatus {
return &v
}
type NullablePinStatus struct {
value *PinStatus
isSet bool
}
func (v NullablePinStatus) Get() *PinStatus {
return v.value
}
func (v *NullablePinStatus) Set(val *PinStatus) {
v.value = val
v.isSet = true
}
func (v NullablePinStatus) IsSet() bool {
return v.isSet
}
func (v *NullablePinStatus) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePinStatus(val *PinStatus) *NullablePinStatus {
return &NullablePinStatus{value: val, isSet: true}
}
func (v NullablePinStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePinStatus) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}