forked from opalsecurity/opal-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_resource_type_enum.go
162 lines (140 loc) · 4.85 KB
/
model_resource_type_enum.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
/*
Opal API
Your Home For Developer Resources.
API version: 1.0
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package opal
import (
"encoding/json"
"fmt"
)
// ResourceTypeEnum The type of the resource.
type ResourceTypeEnum string
// List of ResourceTypeEnum
const (
RESOURCETYPEENUM_AWS_EC2_INSTANCE ResourceTypeEnum = "AWS_EC2_INSTANCE"
RESOURCETYPEENUM_AWS_EKS_CLUSTER ResourceTypeEnum = "AWS_EKS_CLUSTER"
RESOURCETYPEENUM_AWS_IAM_ROLE ResourceTypeEnum = "AWS_IAM_ROLE"
RESOURCETYPEENUM_AWS_RDS_MYSQL_INSTANCE ResourceTypeEnum = "AWS_RDS_MYSQL_INSTANCE"
RESOURCETYPEENUM_AWS_RDS_POSTGRES_INSTANCE ResourceTypeEnum = "AWS_RDS_POSTGRES_INSTANCE"
RESOURCETYPEENUM_CUSTOM ResourceTypeEnum = "CUSTOM"
RESOURCETYPEENUM_GCP_BUCKET ResourceTypeEnum = "GCP_BUCKET"
RESOURCETYPEENUM_GCP_CLOUD_SQL_MYSQL_INSTANCE ResourceTypeEnum = "GCP_CLOUD_SQL_MYSQL_INSTANCE"
RESOURCETYPEENUM_GCP_CLOUD_SQL_POSTGRES_INSTANCE ResourceTypeEnum = "GCP_CLOUD_SQL_POSTGRES_INSTANCE"
RESOURCETYPEENUM_GCP_COMPUTE_INSTANCE ResourceTypeEnum = "GCP_COMPUTE_INSTANCE"
RESOURCETYPEENUM_GCP_FOLDER ResourceTypeEnum = "GCP_FOLDER"
RESOURCETYPEENUM_GCP_GKE_CLUSTER ResourceTypeEnum = "GCP_GKE_CLUSTER"
RESOURCETYPEENUM_GCP_PROJECT ResourceTypeEnum = "GCP_PROJECT"
RESOURCETYPEENUM_GIT_HUB_REPO ResourceTypeEnum = "GIT_HUB_REPO"
RESOURCETYPEENUM_GOOGLE_WORKSPACE_ROLE ResourceTypeEnum = "GOOGLE_WORKSPACE_ROLE"
RESOURCETYPEENUM_MARIADB_INSTANCE ResourceTypeEnum = "MARIADB_INSTANCE"
RESOURCETYPEENUM_MONGO_ATLAS_INSTANCE ResourceTypeEnum = "MONGO_ATLAS_INSTANCE"
RESOURCETYPEENUM_MONGO_INSTANCE ResourceTypeEnum = "MONGO_INSTANCE"
RESOURCETYPEENUM_MYSQL_INSTANCE ResourceTypeEnum = "MYSQL_INSTANCE"
RESOURCETYPEENUM_OKTA_APP ResourceTypeEnum = "OKTA_APP"
RESOURCETYPEENUM_OKTA_ROLE ResourceTypeEnum = "OKTA_ROLE"
RESOURCETYPEENUM_OPAL_ROLE ResourceTypeEnum = "OPAL_ROLE"
RESOURCETYPEENUM_PAGERDUTY_ROLE ResourceTypeEnum = "PAGERDUTY_ROLE"
RESOURCETYPEENUM_SALESFORCE_PERMISSION_SET ResourceTypeEnum = "SALESFORCE_PERMISSION_SET"
RESOURCETYPEENUM_SALESFORCE_PROFILE ResourceTypeEnum = "SALESFORCE_PROFILE"
RESOURCETYPEENUM_SALESFORCE_ROLE ResourceTypeEnum = "SALESFORCE_ROLE"
RESOURCETYPEENUM_WORKDAY_ROLE ResourceTypeEnum = "WORKDAY_ROLE"
)
// All allowed values of ResourceTypeEnum enum
var AllowedResourceTypeEnumEnumValues = []ResourceTypeEnum{
"AWS_EC2_INSTANCE",
"AWS_EKS_CLUSTER",
"AWS_IAM_ROLE",
"AWS_RDS_MYSQL_INSTANCE",
"AWS_RDS_POSTGRES_INSTANCE",
"CUSTOM",
"GCP_BUCKET",
"GCP_CLOUD_SQL_MYSQL_INSTANCE",
"GCP_CLOUD_SQL_POSTGRES_INSTANCE",
"GCP_COMPUTE_INSTANCE",
"GCP_FOLDER",
"GCP_GKE_CLUSTER",
"GCP_PROJECT",
"GIT_HUB_REPO",
"GOOGLE_WORKSPACE_ROLE",
"MARIADB_INSTANCE",
"MONGO_ATLAS_INSTANCE",
"MONGO_INSTANCE",
"MYSQL_INSTANCE",
"OKTA_APP",
"OKTA_ROLE",
"OPAL_ROLE",
"PAGERDUTY_ROLE",
"SALESFORCE_PERMISSION_SET",
"SALESFORCE_PROFILE",
"SALESFORCE_ROLE",
"WORKDAY_ROLE",
}
func (v *ResourceTypeEnum) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ResourceTypeEnum(value)
for _, existing := range AllowedResourceTypeEnumEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ResourceTypeEnum", value)
}
// NewResourceTypeEnumFromValue returns a pointer to a valid ResourceTypeEnum
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewResourceTypeEnumFromValue(v string) (*ResourceTypeEnum, error) {
ev := ResourceTypeEnum(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ResourceTypeEnum: valid values are %v", v, AllowedResourceTypeEnumEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ResourceTypeEnum) IsValid() bool {
for _, existing := range AllowedResourceTypeEnumEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ResourceTypeEnum value
func (v ResourceTypeEnum) Ptr() *ResourceTypeEnum {
return &v
}
type NullableResourceTypeEnum struct {
value *ResourceTypeEnum
isSet bool
}
func (v NullableResourceTypeEnum) Get() *ResourceTypeEnum {
return v.value
}
func (v *NullableResourceTypeEnum) Set(val *ResourceTypeEnum) {
v.value = val
v.isSet = true
}
func (v NullableResourceTypeEnum) IsSet() bool {
return v.isSet
}
func (v *NullableResourceTypeEnum) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableResourceTypeEnum(val *ResourceTypeEnum) *NullableResourceTypeEnum {
return &NullableResourceTypeEnum{value: val, isSet: true}
}
func (v NullableResourceTypeEnum) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableResourceTypeEnum) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}