-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_aws_regions.go
More file actions
134 lines (112 loc) · 3.12 KB
/
model_aws_regions.go
File metadata and controls
134 lines (112 loc) · 3.12 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
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"
)
// AwsRegions the model 'AwsRegions'
type AwsRegions string
// List of awsRegions
const (
AWSREGIONS_US_EAST_1 AwsRegions = "us-east-1"
AWSREGIONS_US_EAST_2 AwsRegions = "us-east-2"
AWSREGIONS_US_WEST_2 AwsRegions = "us-west-2"
AWSREGIONS_EU_WEST_1 AwsRegions = "eu-west-1"
AWSREGIONS_EU_CENTRAL_1 AwsRegions = "eu-central-1"
AWSREGIONS_EU_WEST_2 AwsRegions = "eu-west-2"
AWSREGIONS_EU_WEST_3 AwsRegions = "eu-west-3"
AWSREGIONS_EU_NORTH_1 AwsRegions = "eu-north-1"
AWSREGIONS_AP_SOUTHEAST_1 AwsRegions = "ap-southeast-1"
AWSREGIONS_AP_NORTHEAST_1 AwsRegions = "ap-northeast-1"
AWSREGIONS_AP_SOUTHEAST_2 AwsRegions = "ap-southeast-2"
AWSREGIONS_AP_NORTHEAST_2 AwsRegions = "ap-northeast-2"
AWSREGIONS_AP_SOUTH_1 AwsRegions = "ap-south-1"
AWSREGIONS_CA_CENTRAL_1 AwsRegions = "ca-central-1"
)
var allowedAwsRegionsEnumValues = []AwsRegions{
"us-east-1",
"us-east-2",
"us-west-2",
"eu-west-1",
"eu-central-1",
"eu-west-2",
"eu-west-3",
"eu-north-1",
"ap-southeast-1",
"ap-northeast-1",
"ap-southeast-2",
"ap-northeast-2",
"ap-south-1",
"ca-central-1",
}
func (v *AwsRegions) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := AwsRegions(value)
for _, existing := range allowedAwsRegionsEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid AwsRegions", value)
}
// NewAwsRegionsFromValue returns a pointer to a valid AwsRegions
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewAwsRegionsFromValue(v string) (*AwsRegions, error) {
ev := AwsRegions(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for AwsRegions: valid values are %v", v, allowedAwsRegionsEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v AwsRegions) IsValid() bool {
for _, existing := range allowedAwsRegionsEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to awsRegions value
func (v AwsRegions) Ptr() *AwsRegions {
return &v
}
type NullableAwsRegions struct {
value *AwsRegions
isSet bool
}
func (v NullableAwsRegions) Get() *AwsRegions {
return v.value
}
func (v *NullableAwsRegions) Set(val *AwsRegions) {
v.value = val
v.isSet = true
}
func (v NullableAwsRegions) IsSet() bool {
return v.isSet
}
func (v *NullableAwsRegions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAwsRegions(val *AwsRegions) *NullableAwsRegions {
return &NullableAwsRegions{value: val, isSet: true}
}
func (v NullableAwsRegions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAwsRegions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}