/
user_summary.go
356 lines (298 loc) · 15 KB
/
user_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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
// 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.
// Data Safe API
//
// APIs for using Oracle Data Safe.
//
package datasafe
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// UserSummary The summary of information about the database user. It includes details such as user type, account status,
// last login time, user creation time, authentication type, user profile, and time and date of the last password change.
// It also contains the user category derived from these user details, as well as granted privileges.
type UserSummary struct {
// The unique user key. This is a system-generated identifier. Use ListUsers to get the user key for a user.
Key *string `mandatory:"true" json:"key"`
// The database user name.
UserName *string `mandatory:"true" json:"userName"`
// The OCID of the target database.
TargetId *string `mandatory:"true" json:"targetId"`
// The user category based on the privileges and other details of the user.
UserCategory UserSummaryUserCategoryEnum `mandatory:"false" json:"userCategory,omitempty"`
// The status of the user account.
AccountStatus UserSummaryAccountStatusEnum `mandatory:"false" json:"accountStatus,omitempty"`
// The date and time the user last logged in, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339).
TimeLastLogin *common.SDKTime `mandatory:"false" json:"timeLastLogin"`
// The date and time the user was created in the database, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339).
TimeUserCreated *common.SDKTime `mandatory:"false" json:"timeUserCreated"`
// The user authentication method.
AuthenticationType UserSummaryAuthenticationTypeEnum `mandatory:"false" json:"authenticationType,omitempty"`
// The user profile name.
UserProfile *string `mandatory:"false" json:"userProfile"`
// The date and time the user password was last changed, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339).
TimePasswordChanged *common.SDKTime `mandatory:"false" json:"timePasswordChanged"`
// The user type, which can be a combination of the following:
// 'Admin Privileged': The user has administrative privileges.
// 'Application': The user is an Oracle E-Business Suite Applications (EBS) or Fusion Applications (FA) user.
// 'Privileged': The user is a privileged user.
// 'Schema': The user is EXPIRED & LOCKED / EXPIRED / LOCKED, or a schema-only account (authentication type is NONE).
// 'Non-privileged': The user is a non-privileged user.
UserTypes []UserSummaryUserTypesEnum `mandatory:"false" json:"userTypes,omitempty"`
// The admin roles granted to the user.
AdminRoles []UserSummaryAdminRolesEnum `mandatory:"false" json:"adminRoles,omitempty"`
// Indicates whether the user has access to all the schemas.
AreAllSchemasAccessible *bool `mandatory:"false" json:"areAllSchemasAccessible"`
// The list of database schemas current user can access.
SchemaList []string `mandatory:"false" json:"schemaList"`
}
func (m UserSummary) 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 UserSummary) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingUserSummaryUserCategoryEnum(string(m.UserCategory)); !ok && m.UserCategory != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for UserCategory: %s. Supported values are: %s.", m.UserCategory, strings.Join(GetUserSummaryUserCategoryEnumStringValues(), ",")))
}
if _, ok := GetMappingUserSummaryAccountStatusEnum(string(m.AccountStatus)); !ok && m.AccountStatus != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AccountStatus: %s. Supported values are: %s.", m.AccountStatus, strings.Join(GetUserSummaryAccountStatusEnumStringValues(), ",")))
}
if _, ok := GetMappingUserSummaryAuthenticationTypeEnum(string(m.AuthenticationType)); !ok && m.AuthenticationType != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AuthenticationType: %s. Supported values are: %s.", m.AuthenticationType, strings.Join(GetUserSummaryAuthenticationTypeEnumStringValues(), ",")))
}
for _, val := range m.UserTypes {
if _, ok := GetMappingUserSummaryUserTypesEnum(string(val)); !ok && val != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for UserTypes: %s. Supported values are: %s.", val, strings.Join(GetUserSummaryUserTypesEnumStringValues(), ",")))
}
}
for _, val := range m.AdminRoles {
if _, ok := GetMappingUserSummaryAdminRolesEnum(string(val)); !ok && val != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AdminRoles: %s. Supported values are: %s.", val, strings.Join(GetUserSummaryAdminRolesEnumStringValues(), ",")))
}
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// UserSummaryUserCategoryEnum Enum with underlying type: string
type UserSummaryUserCategoryEnum string
// Set of constants representing the allowable values for UserSummaryUserCategoryEnum
const (
UserSummaryUserCategoryCritical UserSummaryUserCategoryEnum = "CRITICAL"
UserSummaryUserCategoryHigh UserSummaryUserCategoryEnum = "HIGH"
UserSummaryUserCategoryMedium UserSummaryUserCategoryEnum = "MEDIUM"
UserSummaryUserCategoryLow UserSummaryUserCategoryEnum = "LOW"
)
var mappingUserSummaryUserCategoryEnum = map[string]UserSummaryUserCategoryEnum{
"CRITICAL": UserSummaryUserCategoryCritical,
"HIGH": UserSummaryUserCategoryHigh,
"MEDIUM": UserSummaryUserCategoryMedium,
"LOW": UserSummaryUserCategoryLow,
}
var mappingUserSummaryUserCategoryEnumLowerCase = map[string]UserSummaryUserCategoryEnum{
"critical": UserSummaryUserCategoryCritical,
"high": UserSummaryUserCategoryHigh,
"medium": UserSummaryUserCategoryMedium,
"low": UserSummaryUserCategoryLow,
}
// GetUserSummaryUserCategoryEnumValues Enumerates the set of values for UserSummaryUserCategoryEnum
func GetUserSummaryUserCategoryEnumValues() []UserSummaryUserCategoryEnum {
values := make([]UserSummaryUserCategoryEnum, 0)
for _, v := range mappingUserSummaryUserCategoryEnum {
values = append(values, v)
}
return values
}
// GetUserSummaryUserCategoryEnumStringValues Enumerates the set of values in String for UserSummaryUserCategoryEnum
func GetUserSummaryUserCategoryEnumStringValues() []string {
return []string{
"CRITICAL",
"HIGH",
"MEDIUM",
"LOW",
}
}
// GetMappingUserSummaryUserCategoryEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingUserSummaryUserCategoryEnum(val string) (UserSummaryUserCategoryEnum, bool) {
enum, ok := mappingUserSummaryUserCategoryEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// UserSummaryAccountStatusEnum Enum with underlying type: string
type UserSummaryAccountStatusEnum string
// Set of constants representing the allowable values for UserSummaryAccountStatusEnum
const (
UserSummaryAccountStatusOpen UserSummaryAccountStatusEnum = "OPEN"
UserSummaryAccountStatusLocked UserSummaryAccountStatusEnum = "LOCKED"
UserSummaryAccountStatusExpired UserSummaryAccountStatusEnum = "EXPIRED"
UserSummaryAccountStatusExpiredAndLocked UserSummaryAccountStatusEnum = "EXPIRED_AND_LOCKED"
UserSummaryAccountStatusNone UserSummaryAccountStatusEnum = "NONE"
)
var mappingUserSummaryAccountStatusEnum = map[string]UserSummaryAccountStatusEnum{
"OPEN": UserSummaryAccountStatusOpen,
"LOCKED": UserSummaryAccountStatusLocked,
"EXPIRED": UserSummaryAccountStatusExpired,
"EXPIRED_AND_LOCKED": UserSummaryAccountStatusExpiredAndLocked,
"NONE": UserSummaryAccountStatusNone,
}
var mappingUserSummaryAccountStatusEnumLowerCase = map[string]UserSummaryAccountStatusEnum{
"open": UserSummaryAccountStatusOpen,
"locked": UserSummaryAccountStatusLocked,
"expired": UserSummaryAccountStatusExpired,
"expired_and_locked": UserSummaryAccountStatusExpiredAndLocked,
"none": UserSummaryAccountStatusNone,
}
// GetUserSummaryAccountStatusEnumValues Enumerates the set of values for UserSummaryAccountStatusEnum
func GetUserSummaryAccountStatusEnumValues() []UserSummaryAccountStatusEnum {
values := make([]UserSummaryAccountStatusEnum, 0)
for _, v := range mappingUserSummaryAccountStatusEnum {
values = append(values, v)
}
return values
}
// GetUserSummaryAccountStatusEnumStringValues Enumerates the set of values in String for UserSummaryAccountStatusEnum
func GetUserSummaryAccountStatusEnumStringValues() []string {
return []string{
"OPEN",
"LOCKED",
"EXPIRED",
"EXPIRED_AND_LOCKED",
"NONE",
}
}
// GetMappingUserSummaryAccountStatusEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingUserSummaryAccountStatusEnum(val string) (UserSummaryAccountStatusEnum, bool) {
enum, ok := mappingUserSummaryAccountStatusEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// UserSummaryAuthenticationTypeEnum Enum with underlying type: string
type UserSummaryAuthenticationTypeEnum string
// Set of constants representing the allowable values for UserSummaryAuthenticationTypeEnum
const (
UserSummaryAuthenticationTypePassword UserSummaryAuthenticationTypeEnum = "PASSWORD"
UserSummaryAuthenticationTypeNone UserSummaryAuthenticationTypeEnum = "NONE"
)
var mappingUserSummaryAuthenticationTypeEnum = map[string]UserSummaryAuthenticationTypeEnum{
"PASSWORD": UserSummaryAuthenticationTypePassword,
"NONE": UserSummaryAuthenticationTypeNone,
}
var mappingUserSummaryAuthenticationTypeEnumLowerCase = map[string]UserSummaryAuthenticationTypeEnum{
"password": UserSummaryAuthenticationTypePassword,
"none": UserSummaryAuthenticationTypeNone,
}
// GetUserSummaryAuthenticationTypeEnumValues Enumerates the set of values for UserSummaryAuthenticationTypeEnum
func GetUserSummaryAuthenticationTypeEnumValues() []UserSummaryAuthenticationTypeEnum {
values := make([]UserSummaryAuthenticationTypeEnum, 0)
for _, v := range mappingUserSummaryAuthenticationTypeEnum {
values = append(values, v)
}
return values
}
// GetUserSummaryAuthenticationTypeEnumStringValues Enumerates the set of values in String for UserSummaryAuthenticationTypeEnum
func GetUserSummaryAuthenticationTypeEnumStringValues() []string {
return []string{
"PASSWORD",
"NONE",
}
}
// GetMappingUserSummaryAuthenticationTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingUserSummaryAuthenticationTypeEnum(val string) (UserSummaryAuthenticationTypeEnum, bool) {
enum, ok := mappingUserSummaryAuthenticationTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// UserSummaryUserTypesEnum Enum with underlying type: string
type UserSummaryUserTypesEnum string
// Set of constants representing the allowable values for UserSummaryUserTypesEnum
const (
UserSummaryUserTypesAdminPrivileged UserSummaryUserTypesEnum = "ADMIN_PRIVILEGED"
UserSummaryUserTypesApplication UserSummaryUserTypesEnum = "APPLICATION"
UserSummaryUserTypesPrivileged UserSummaryUserTypesEnum = "PRIVILEGED"
UserSummaryUserTypesSchema UserSummaryUserTypesEnum = "SCHEMA"
UserSummaryUserTypesNonPrivileged UserSummaryUserTypesEnum = "NON_PRIVILEGED"
)
var mappingUserSummaryUserTypesEnum = map[string]UserSummaryUserTypesEnum{
"ADMIN_PRIVILEGED": UserSummaryUserTypesAdminPrivileged,
"APPLICATION": UserSummaryUserTypesApplication,
"PRIVILEGED": UserSummaryUserTypesPrivileged,
"SCHEMA": UserSummaryUserTypesSchema,
"NON_PRIVILEGED": UserSummaryUserTypesNonPrivileged,
}
var mappingUserSummaryUserTypesEnumLowerCase = map[string]UserSummaryUserTypesEnum{
"admin_privileged": UserSummaryUserTypesAdminPrivileged,
"application": UserSummaryUserTypesApplication,
"privileged": UserSummaryUserTypesPrivileged,
"schema": UserSummaryUserTypesSchema,
"non_privileged": UserSummaryUserTypesNonPrivileged,
}
// GetUserSummaryUserTypesEnumValues Enumerates the set of values for UserSummaryUserTypesEnum
func GetUserSummaryUserTypesEnumValues() []UserSummaryUserTypesEnum {
values := make([]UserSummaryUserTypesEnum, 0)
for _, v := range mappingUserSummaryUserTypesEnum {
values = append(values, v)
}
return values
}
// GetUserSummaryUserTypesEnumStringValues Enumerates the set of values in String for UserSummaryUserTypesEnum
func GetUserSummaryUserTypesEnumStringValues() []string {
return []string{
"ADMIN_PRIVILEGED",
"APPLICATION",
"PRIVILEGED",
"SCHEMA",
"NON_PRIVILEGED",
}
}
// GetMappingUserSummaryUserTypesEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingUserSummaryUserTypesEnum(val string) (UserSummaryUserTypesEnum, bool) {
enum, ok := mappingUserSummaryUserTypesEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// UserSummaryAdminRolesEnum Enum with underlying type: string
type UserSummaryAdminRolesEnum string
// Set of constants representing the allowable values for UserSummaryAdminRolesEnum
const (
UserSummaryAdminRolesPdbDba UserSummaryAdminRolesEnum = "PDB_DBA"
UserSummaryAdminRolesDba UserSummaryAdminRolesEnum = "DBA"
UserSummaryAdminRolesDvAdmin UserSummaryAdminRolesEnum = "DV_ADMIN"
UserSummaryAdminRolesAuditAdmin UserSummaryAdminRolesEnum = "AUDIT_ADMIN"
)
var mappingUserSummaryAdminRolesEnum = map[string]UserSummaryAdminRolesEnum{
"PDB_DBA": UserSummaryAdminRolesPdbDba,
"DBA": UserSummaryAdminRolesDba,
"DV_ADMIN": UserSummaryAdminRolesDvAdmin,
"AUDIT_ADMIN": UserSummaryAdminRolesAuditAdmin,
}
var mappingUserSummaryAdminRolesEnumLowerCase = map[string]UserSummaryAdminRolesEnum{
"pdb_dba": UserSummaryAdminRolesPdbDba,
"dba": UserSummaryAdminRolesDba,
"dv_admin": UserSummaryAdminRolesDvAdmin,
"audit_admin": UserSummaryAdminRolesAuditAdmin,
}
// GetUserSummaryAdminRolesEnumValues Enumerates the set of values for UserSummaryAdminRolesEnum
func GetUserSummaryAdminRolesEnumValues() []UserSummaryAdminRolesEnum {
values := make([]UserSummaryAdminRolesEnum, 0)
for _, v := range mappingUserSummaryAdminRolesEnum {
values = append(values, v)
}
return values
}
// GetUserSummaryAdminRolesEnumStringValues Enumerates the set of values in String for UserSummaryAdminRolesEnum
func GetUserSummaryAdminRolesEnumStringValues() []string {
return []string{
"PDB_DBA",
"DBA",
"DV_ADMIN",
"AUDIT_ADMIN",
}
}
// GetMappingUserSummaryAdminRolesEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingUserSummaryAdminRolesEnum(val string) (UserSummaryAdminRolesEnum, bool) {
enum, ok := mappingUserSummaryAdminRolesEnumLowerCase[strings.ToLower(val)]
return enum, ok
}