-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_cluster_status.go
138 lines (116 loc) · 4.73 KB
/
model_cluster_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
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
/*
Couchbase Public API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 2.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package couchbasecapella
import (
"encoding/json"
"fmt"
)
// ClusterStatus * `draft` - indicates that all fields under database model are mutable. * `needs_deploy` - indicates that the new configuration changes have not been applied to the cluster * `job_scheduled` - indicates that the new configuration changes have been scheduled to be applied. * `deploying` - indicates that database is currently being deployed/new configurations being applied. * `deploy_failed` - indicates that the last deployment failed. * `deploy_succeeded` - indicates that the last deployment succeeded. * `ready` - indicates that the database is ready. * `destroying` - indicates that the database is being destroyed. * `destroy_failed` - indicates that the database destroy job failed. * `destroy_succeeded` - indicates that the database destroy job succeeded. * `metrics_failed` - indicates that the database is not serving metrics. * `preflight_started` - indicates a preflight check has started on the database * `preflight_failed` - indicates a preflight check has failed on the database * `preflight_succeeded` - indicates a preflight check has succeeded on the database * `management_blocked` - indicates the IAM credentiald for the cloud hosting the databse have been deleted. * `upgrading` - indicates the database is being upgrading.
type ClusterStatus string
// List of clusterStatus
const (
CLUSTERSTATUS_DRAFT ClusterStatus = "draft"
CLUSTERSTATUS_NEEDS_DEPLOY ClusterStatus = "needs_deploy"
CLUSTERSTATUS_JOB_SCHEDULED ClusterStatus = "job_scheduled"
CLUSTERSTATUS_DEPLOYING ClusterStatus = "deploying"
CLUSTERSTATUS_DEPLOY_FAILED ClusterStatus = "deploy_failed"
CLUSTERSTATUS_DEPLOY_SUCCEEDED ClusterStatus = "deploy_succeeded"
CLUSTERSTATUS_READY ClusterStatus = "ready"
CLUSTERSTATUS_DESTROYING ClusterStatus = "destroying"
CLUSTERSTATUS_DESTROY_FAILED ClusterStatus = "destroy_failed"
CLUSTERSTATUS_DESTROY_SUCCEEDED ClusterStatus = "destroy_succeeded"
CLUSTERSTATUS_METRICS_FAILED ClusterStatus = "metrics_failed"
CLUSTERSTATUS_PREFLIGHT_STARTED ClusterStatus = "preflight_started"
CLUSTERSTATUS_PREFLIGHT_FAILED ClusterStatus = "preflight_failed"
CLUSTERSTATUS_PREFLIGHT_SUCCEEDED ClusterStatus = "preflight_succeeded"
CLUSTERSTATUS_MANAGEMENT_BLOCKED ClusterStatus = "management_blocked"
CLUSTERSTATUS_UPGRADING ClusterStatus = "upgrading"
)
var allowedClusterStatusEnumValues = []ClusterStatus{
"draft",
"needs_deploy",
"job_scheduled",
"deploying",
"deploy_failed",
"deploy_succeeded",
"ready",
"destroying",
"destroy_failed",
"destroy_succeeded",
"metrics_failed",
"preflight_started",
"preflight_failed",
"preflight_succeeded",
"management_blocked",
"upgrading",
}
func (v *ClusterStatus) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ClusterStatus(value)
for _, existing := range allowedClusterStatusEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ClusterStatus", value)
}
// NewClusterStatusFromValue returns a pointer to a valid ClusterStatus
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewClusterStatusFromValue(v string) (*ClusterStatus, error) {
ev := ClusterStatus(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ClusterStatus: valid values are %v", v, allowedClusterStatusEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ClusterStatus) IsValid() bool {
for _, existing := range allowedClusterStatusEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to clusterStatus value
func (v ClusterStatus) Ptr() *ClusterStatus {
return &v
}
type NullableClusterStatus struct {
value *ClusterStatus
isSet bool
}
func (v NullableClusterStatus) Get() *ClusterStatus {
return v.value
}
func (v *NullableClusterStatus) Set(val *ClusterStatus) {
v.value = val
v.isSet = true
}
func (v NullableClusterStatus) IsSet() bool {
return v.isSet
}
func (v *NullableClusterStatus) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableClusterStatus(val *ClusterStatus) *NullableClusterStatus {
return &NullableClusterStatus{value: val, isSet: true}
}
func (v NullableClusterStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableClusterStatus) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}