/
role_summary.go
283 lines (235 loc) · 11 KB
/
role_summary.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.
// Database Management API
//
// Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics
// for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and
// running a SQL job on a Managed Database or Managed Database Group.
//
package databasemanagement
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// RoleSummary A summary of each role.
type RoleSummary struct {
// The name of the role granted to the user.
Name *string `mandatory:"false" json:"name"`
// Indicates whether the role is granted with the ADMIN OPTION (YES) or not (NO).
AdminOption RoleSummaryAdminOptionEnum `mandatory:"false" json:"adminOption,omitempty"`
// Indicates whether the role is granted with the DELEGATE OPTION (YES) or not (NO).
DelegateOption RoleSummaryDelegateOptionEnum `mandatory:"false" json:"delegateOption,omitempty"`
// Indicates whether the role is designated as a DEFAULT ROLE for the user (YES) or not (NO).
DefaultRole RoleSummaryDefaultRoleEnum `mandatory:"false" json:"defaultRole,omitempty"`
// Indicates how the role was granted. Possible values:
// YES if the role is granted commonly (CONTAINER=ALL is used)
// NO if the role is granted locally (CONTAINER=ALL is not used)
Common RoleSummaryCommonEnum `mandatory:"false" json:"common,omitempty"`
// Indicates whether the granted role is inherited from another container (YES) or not (NO).
Inherited RoleSummaryInheritedEnum `mandatory:"false" json:"inherited,omitempty"`
}
func (m RoleSummary) String() string {
return common.PointerString(m)
}
// ValidateEnumValue returns an error when providing an unsupported enum value
// This function is being called during constructing API request process
// Not recommended for calling this function directly
func (m RoleSummary) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingRoleSummaryAdminOptionEnum(string(m.AdminOption)); !ok && m.AdminOption != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AdminOption: %s. Supported values are: %s.", m.AdminOption, strings.Join(GetRoleSummaryAdminOptionEnumStringValues(), ",")))
}
if _, ok := GetMappingRoleSummaryDelegateOptionEnum(string(m.DelegateOption)); !ok && m.DelegateOption != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DelegateOption: %s. Supported values are: %s.", m.DelegateOption, strings.Join(GetRoleSummaryDelegateOptionEnumStringValues(), ",")))
}
if _, ok := GetMappingRoleSummaryDefaultRoleEnum(string(m.DefaultRole)); !ok && m.DefaultRole != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DefaultRole: %s. Supported values are: %s.", m.DefaultRole, strings.Join(GetRoleSummaryDefaultRoleEnumStringValues(), ",")))
}
if _, ok := GetMappingRoleSummaryCommonEnum(string(m.Common)); !ok && m.Common != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Common: %s. Supported values are: %s.", m.Common, strings.Join(GetRoleSummaryCommonEnumStringValues(), ",")))
}
if _, ok := GetMappingRoleSummaryInheritedEnum(string(m.Inherited)); !ok && m.Inherited != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Inherited: %s. Supported values are: %s.", m.Inherited, strings.Join(GetRoleSummaryInheritedEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// RoleSummaryAdminOptionEnum Enum with underlying type: string
type RoleSummaryAdminOptionEnum string
// Set of constants representing the allowable values for RoleSummaryAdminOptionEnum
const (
RoleSummaryAdminOptionYes RoleSummaryAdminOptionEnum = "YES"
RoleSummaryAdminOptionNo RoleSummaryAdminOptionEnum = "NO"
)
var mappingRoleSummaryAdminOptionEnum = map[string]RoleSummaryAdminOptionEnum{
"YES": RoleSummaryAdminOptionYes,
"NO": RoleSummaryAdminOptionNo,
}
var mappingRoleSummaryAdminOptionEnumLowerCase = map[string]RoleSummaryAdminOptionEnum{
"yes": RoleSummaryAdminOptionYes,
"no": RoleSummaryAdminOptionNo,
}
// GetRoleSummaryAdminOptionEnumValues Enumerates the set of values for RoleSummaryAdminOptionEnum
func GetRoleSummaryAdminOptionEnumValues() []RoleSummaryAdminOptionEnum {
values := make([]RoleSummaryAdminOptionEnum, 0)
for _, v := range mappingRoleSummaryAdminOptionEnum {
values = append(values, v)
}
return values
}
// GetRoleSummaryAdminOptionEnumStringValues Enumerates the set of values in String for RoleSummaryAdminOptionEnum
func GetRoleSummaryAdminOptionEnumStringValues() []string {
return []string{
"YES",
"NO",
}
}
// GetMappingRoleSummaryAdminOptionEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingRoleSummaryAdminOptionEnum(val string) (RoleSummaryAdminOptionEnum, bool) {
enum, ok := mappingRoleSummaryAdminOptionEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// RoleSummaryDelegateOptionEnum Enum with underlying type: string
type RoleSummaryDelegateOptionEnum string
// Set of constants representing the allowable values for RoleSummaryDelegateOptionEnum
const (
RoleSummaryDelegateOptionYes RoleSummaryDelegateOptionEnum = "YES"
RoleSummaryDelegateOptionNo RoleSummaryDelegateOptionEnum = "NO"
)
var mappingRoleSummaryDelegateOptionEnum = map[string]RoleSummaryDelegateOptionEnum{
"YES": RoleSummaryDelegateOptionYes,
"NO": RoleSummaryDelegateOptionNo,
}
var mappingRoleSummaryDelegateOptionEnumLowerCase = map[string]RoleSummaryDelegateOptionEnum{
"yes": RoleSummaryDelegateOptionYes,
"no": RoleSummaryDelegateOptionNo,
}
// GetRoleSummaryDelegateOptionEnumValues Enumerates the set of values for RoleSummaryDelegateOptionEnum
func GetRoleSummaryDelegateOptionEnumValues() []RoleSummaryDelegateOptionEnum {
values := make([]RoleSummaryDelegateOptionEnum, 0)
for _, v := range mappingRoleSummaryDelegateOptionEnum {
values = append(values, v)
}
return values
}
// GetRoleSummaryDelegateOptionEnumStringValues Enumerates the set of values in String for RoleSummaryDelegateOptionEnum
func GetRoleSummaryDelegateOptionEnumStringValues() []string {
return []string{
"YES",
"NO",
}
}
// GetMappingRoleSummaryDelegateOptionEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingRoleSummaryDelegateOptionEnum(val string) (RoleSummaryDelegateOptionEnum, bool) {
enum, ok := mappingRoleSummaryDelegateOptionEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// RoleSummaryDefaultRoleEnum Enum with underlying type: string
type RoleSummaryDefaultRoleEnum string
// Set of constants representing the allowable values for RoleSummaryDefaultRoleEnum
const (
RoleSummaryDefaultRoleYes RoleSummaryDefaultRoleEnum = "YES"
RoleSummaryDefaultRoleNo RoleSummaryDefaultRoleEnum = "NO"
)
var mappingRoleSummaryDefaultRoleEnum = map[string]RoleSummaryDefaultRoleEnum{
"YES": RoleSummaryDefaultRoleYes,
"NO": RoleSummaryDefaultRoleNo,
}
var mappingRoleSummaryDefaultRoleEnumLowerCase = map[string]RoleSummaryDefaultRoleEnum{
"yes": RoleSummaryDefaultRoleYes,
"no": RoleSummaryDefaultRoleNo,
}
// GetRoleSummaryDefaultRoleEnumValues Enumerates the set of values for RoleSummaryDefaultRoleEnum
func GetRoleSummaryDefaultRoleEnumValues() []RoleSummaryDefaultRoleEnum {
values := make([]RoleSummaryDefaultRoleEnum, 0)
for _, v := range mappingRoleSummaryDefaultRoleEnum {
values = append(values, v)
}
return values
}
// GetRoleSummaryDefaultRoleEnumStringValues Enumerates the set of values in String for RoleSummaryDefaultRoleEnum
func GetRoleSummaryDefaultRoleEnumStringValues() []string {
return []string{
"YES",
"NO",
}
}
// GetMappingRoleSummaryDefaultRoleEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingRoleSummaryDefaultRoleEnum(val string) (RoleSummaryDefaultRoleEnum, bool) {
enum, ok := mappingRoleSummaryDefaultRoleEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// RoleSummaryCommonEnum Enum with underlying type: string
type RoleSummaryCommonEnum string
// Set of constants representing the allowable values for RoleSummaryCommonEnum
const (
RoleSummaryCommonYes RoleSummaryCommonEnum = "YES"
RoleSummaryCommonNo RoleSummaryCommonEnum = "NO"
)
var mappingRoleSummaryCommonEnum = map[string]RoleSummaryCommonEnum{
"YES": RoleSummaryCommonYes,
"NO": RoleSummaryCommonNo,
}
var mappingRoleSummaryCommonEnumLowerCase = map[string]RoleSummaryCommonEnum{
"yes": RoleSummaryCommonYes,
"no": RoleSummaryCommonNo,
}
// GetRoleSummaryCommonEnumValues Enumerates the set of values for RoleSummaryCommonEnum
func GetRoleSummaryCommonEnumValues() []RoleSummaryCommonEnum {
values := make([]RoleSummaryCommonEnum, 0)
for _, v := range mappingRoleSummaryCommonEnum {
values = append(values, v)
}
return values
}
// GetRoleSummaryCommonEnumStringValues Enumerates the set of values in String for RoleSummaryCommonEnum
func GetRoleSummaryCommonEnumStringValues() []string {
return []string{
"YES",
"NO",
}
}
// GetMappingRoleSummaryCommonEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingRoleSummaryCommonEnum(val string) (RoleSummaryCommonEnum, bool) {
enum, ok := mappingRoleSummaryCommonEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// RoleSummaryInheritedEnum Enum with underlying type: string
type RoleSummaryInheritedEnum string
// Set of constants representing the allowable values for RoleSummaryInheritedEnum
const (
RoleSummaryInheritedYes RoleSummaryInheritedEnum = "YES"
RoleSummaryInheritedNo RoleSummaryInheritedEnum = "NO"
)
var mappingRoleSummaryInheritedEnum = map[string]RoleSummaryInheritedEnum{
"YES": RoleSummaryInheritedYes,
"NO": RoleSummaryInheritedNo,
}
var mappingRoleSummaryInheritedEnumLowerCase = map[string]RoleSummaryInheritedEnum{
"yes": RoleSummaryInheritedYes,
"no": RoleSummaryInheritedNo,
}
// GetRoleSummaryInheritedEnumValues Enumerates the set of values for RoleSummaryInheritedEnum
func GetRoleSummaryInheritedEnumValues() []RoleSummaryInheritedEnum {
values := make([]RoleSummaryInheritedEnum, 0)
for _, v := range mappingRoleSummaryInheritedEnum {
values = append(values, v)
}
return values
}
// GetRoleSummaryInheritedEnumStringValues Enumerates the set of values in String for RoleSummaryInheritedEnum
func GetRoleSummaryInheritedEnumStringValues() []string {
return []string{
"YES",
"NO",
}
}
// GetMappingRoleSummaryInheritedEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingRoleSummaryInheritedEnum(val string) (RoleSummaryInheritedEnum, bool) {
enum, ok := mappingRoleSummaryInheritedEnumLowerCase[strings.ToLower(val)]
return enum, ok
}