-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_v3_couchbase_services.go
More file actions
118 lines (96 loc) · 2.93 KB
/
model_v3_couchbase_services.go
File metadata and controls
118 lines (96 loc) · 2.93 KB
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
/*
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"
)
// V3CouchbaseServices the model 'V3CouchbaseServices'
type V3CouchbaseServices string
// List of v3CouchbaseServices
const (
V3COUCHBASESERVICES_DATA V3CouchbaseServices = "data"
V3COUCHBASESERVICES_INDEX V3CouchbaseServices = "index"
V3COUCHBASESERVICES_QUERY V3CouchbaseServices = "query"
V3COUCHBASESERVICES_SEARCH V3CouchbaseServices = "search"
V3COUCHBASESERVICES_EVENTING V3CouchbaseServices = "eventing"
V3COUCHBASESERVICES_ANALYTICS V3CouchbaseServices = "analytics"
)
var allowedV3CouchbaseServicesEnumValues = []V3CouchbaseServices{
"data",
"index",
"query",
"search",
"eventing",
"analytics",
}
func (v *V3CouchbaseServices) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := V3CouchbaseServices(value)
for _, existing := range allowedV3CouchbaseServicesEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid V3CouchbaseServices", value)
}
// NewV3CouchbaseServicesFromValue returns a pointer to a valid V3CouchbaseServices
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewV3CouchbaseServicesFromValue(v string) (*V3CouchbaseServices, error) {
ev := V3CouchbaseServices(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for V3CouchbaseServices: valid values are %v", v, allowedV3CouchbaseServicesEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v V3CouchbaseServices) IsValid() bool {
for _, existing := range allowedV3CouchbaseServicesEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to v3CouchbaseServices value
func (v V3CouchbaseServices) Ptr() *V3CouchbaseServices {
return &v
}
type NullableV3CouchbaseServices struct {
value *V3CouchbaseServices
isSet bool
}
func (v NullableV3CouchbaseServices) Get() *V3CouchbaseServices {
return v.value
}
func (v *NullableV3CouchbaseServices) Set(val *V3CouchbaseServices) {
v.value = val
v.isSet = true
}
func (v NullableV3CouchbaseServices) IsSet() bool {
return v.isSet
}
func (v *NullableV3CouchbaseServices) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableV3CouchbaseServices(val *V3CouchbaseServices) *NullableV3CouchbaseServices {
return &NullableV3CouchbaseServices{value: val, isSet: true}
}
func (v NullableV3CouchbaseServices) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableV3CouchbaseServices) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}