-
Notifications
You must be signed in to change notification settings - Fork 80
/
create_tablespace_details.go
426 lines (339 loc) · 19.4 KB
/
create_tablespace_details.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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
// 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 monitor and manage resources such as
// Oracle Databases, MySQL Databases, and External Database Systems.
// For more information, see Database Management (https://docs.cloud.oracle.com/iaas/database-management/home.htm).
//
package databasemanagement
import (
"encoding/json"
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// CreateTablespaceDetails The details required to create a tablespace.
// It takes either credentialDetails or databaseCredential. It's recommended to provide databaseCredential
type CreateTablespaceDetails struct {
// The name of the tablespace. It must be unique within a database.
Name *string `mandatory:"true" json:"name"`
CredentialDetails TablespaceAdminCredentialDetails `mandatory:"false" json:"credentialDetails"`
DatabaseCredential DatabaseCredentialDetails `mandatory:"false" json:"databaseCredential"`
// The type of tablespace.
Type CreateTablespaceDetailsTypeEnum `mandatory:"false" json:"type,omitempty"`
// Specifies whether the tablespace is a bigfile or smallfile tablespace.
// A bigfile tablespace contains only one data file or temp file, which can contain up to approximately 4 billion (232) blocks.
// A smallfile tablespace is a traditional Oracle tablespace, which can contain 1022 data files or temp files, each of which can contain up to approximately 4 million (222) blocks.
IsBigfile *bool `mandatory:"false" json:"isBigfile"`
// The list of data files or temp files created for the tablespace.
DataFiles []string `mandatory:"false" json:"dataFiles"`
// The number of data files or temp files created for the tablespace. This is for Oracle Managed Files only.
FileCount *int `mandatory:"false" json:"fileCount"`
// The size of each data file or temp file.
FileSize *TablespaceStorageSize `mandatory:"false" json:"fileSize"`
// Specifies whether Oracle can reuse the data file or temp file. Reuse is only allowed when the file name is provided.
IsReusable *bool `mandatory:"false" json:"isReusable"`
// Specifies whether the data file or temp file can be extended automatically.
IsAutoExtensible *bool `mandatory:"false" json:"isAutoExtensible"`
// The size of the next increment of disk space to be allocated automatically when more extents are required.
AutoExtendNextSize *TablespaceStorageSize `mandatory:"false" json:"autoExtendNextSize"`
// The maximum disk space allowed for automatic extension of the data files or temp files.
AutoExtendMaxSize *TablespaceStorageSize `mandatory:"false" json:"autoExtendMaxSize"`
// Specifies whether the disk space of the data file or temp file can be limited.
IsMaxSizeUnlimited *bool `mandatory:"false" json:"isMaxSizeUnlimited"`
// Block size for the tablespace.
BlockSizeInKilobytes *int `mandatory:"false" json:"blockSizeInKilobytes"`
// Indicates whether the tablespace is encrypted.
IsEncrypted *bool `mandatory:"false" json:"isEncrypted"`
// The name of the encryption algorithm to be used for tablespace encryption.
EncryptionAlgorithm *string `mandatory:"false" json:"encryptionAlgorithm"`
// The default compression of data for all tables created in the tablespace.
DefaultCompress CreateTablespaceDetailsDefaultCompressEnum `mandatory:"false" json:"defaultCompress,omitempty"`
// The status of the tablespace.
Status CreateTablespaceDetailsStatusEnum `mandatory:"false" json:"status,omitempty"`
// Specifies how the extents of the tablespace should be managed.
ExtentManagement CreateTablespaceDetailsExtentManagementEnum `mandatory:"false" json:"extentManagement,omitempty"`
// The size of the extent when the tablespace is managed with uniform extents of a specific size.
ExtentUniformSize *TablespaceStorageSize `mandatory:"false" json:"extentUniformSize"`
// Specifies whether tablespace segment management should be automatic or manual.
SegmentManagement CreateTablespaceDetailsSegmentManagementEnum `mandatory:"false" json:"segmentManagement,omitempty"`
// Specifies whether the tablespace is the default tablespace.
IsDefault *bool `mandatory:"false" json:"isDefault"`
}
func (m CreateTablespaceDetails) 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 CreateTablespaceDetails) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingCreateTablespaceDetailsTypeEnum(string(m.Type)); !ok && m.Type != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetCreateTablespaceDetailsTypeEnumStringValues(), ",")))
}
if _, ok := GetMappingCreateTablespaceDetailsDefaultCompressEnum(string(m.DefaultCompress)); !ok && m.DefaultCompress != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DefaultCompress: %s. Supported values are: %s.", m.DefaultCompress, strings.Join(GetCreateTablespaceDetailsDefaultCompressEnumStringValues(), ",")))
}
if _, ok := GetMappingCreateTablespaceDetailsStatusEnum(string(m.Status)); !ok && m.Status != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetCreateTablespaceDetailsStatusEnumStringValues(), ",")))
}
if _, ok := GetMappingCreateTablespaceDetailsExtentManagementEnum(string(m.ExtentManagement)); !ok && m.ExtentManagement != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ExtentManagement: %s. Supported values are: %s.", m.ExtentManagement, strings.Join(GetCreateTablespaceDetailsExtentManagementEnumStringValues(), ",")))
}
if _, ok := GetMappingCreateTablespaceDetailsSegmentManagementEnum(string(m.SegmentManagement)); !ok && m.SegmentManagement != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SegmentManagement: %s. Supported values are: %s.", m.SegmentManagement, strings.Join(GetCreateTablespaceDetailsSegmentManagementEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// UnmarshalJSON unmarshals from json
func (m *CreateTablespaceDetails) UnmarshalJSON(data []byte) (e error) {
model := struct {
CredentialDetails tablespaceadmincredentialdetails `json:"credentialDetails"`
DatabaseCredential databasecredentialdetails `json:"databaseCredential"`
Type CreateTablespaceDetailsTypeEnum `json:"type"`
IsBigfile *bool `json:"isBigfile"`
DataFiles []string `json:"dataFiles"`
FileCount *int `json:"fileCount"`
FileSize *TablespaceStorageSize `json:"fileSize"`
IsReusable *bool `json:"isReusable"`
IsAutoExtensible *bool `json:"isAutoExtensible"`
AutoExtendNextSize *TablespaceStorageSize `json:"autoExtendNextSize"`
AutoExtendMaxSize *TablespaceStorageSize `json:"autoExtendMaxSize"`
IsMaxSizeUnlimited *bool `json:"isMaxSizeUnlimited"`
BlockSizeInKilobytes *int `json:"blockSizeInKilobytes"`
IsEncrypted *bool `json:"isEncrypted"`
EncryptionAlgorithm *string `json:"encryptionAlgorithm"`
DefaultCompress CreateTablespaceDetailsDefaultCompressEnum `json:"defaultCompress"`
Status CreateTablespaceDetailsStatusEnum `json:"status"`
ExtentManagement CreateTablespaceDetailsExtentManagementEnum `json:"extentManagement"`
ExtentUniformSize *TablespaceStorageSize `json:"extentUniformSize"`
SegmentManagement CreateTablespaceDetailsSegmentManagementEnum `json:"segmentManagement"`
IsDefault *bool `json:"isDefault"`
Name *string `json:"name"`
}{}
e = json.Unmarshal(data, &model)
if e != nil {
return
}
var nn interface{}
nn, e = model.CredentialDetails.UnmarshalPolymorphicJSON(model.CredentialDetails.JsonData)
if e != nil {
return
}
if nn != nil {
m.CredentialDetails = nn.(TablespaceAdminCredentialDetails)
} else {
m.CredentialDetails = nil
}
nn, e = model.DatabaseCredential.UnmarshalPolymorphicJSON(model.DatabaseCredential.JsonData)
if e != nil {
return
}
if nn != nil {
m.DatabaseCredential = nn.(DatabaseCredentialDetails)
} else {
m.DatabaseCredential = nil
}
m.Type = model.Type
m.IsBigfile = model.IsBigfile
m.DataFiles = make([]string, len(model.DataFiles))
copy(m.DataFiles, model.DataFiles)
m.FileCount = model.FileCount
m.FileSize = model.FileSize
m.IsReusable = model.IsReusable
m.IsAutoExtensible = model.IsAutoExtensible
m.AutoExtendNextSize = model.AutoExtendNextSize
m.AutoExtendMaxSize = model.AutoExtendMaxSize
m.IsMaxSizeUnlimited = model.IsMaxSizeUnlimited
m.BlockSizeInKilobytes = model.BlockSizeInKilobytes
m.IsEncrypted = model.IsEncrypted
m.EncryptionAlgorithm = model.EncryptionAlgorithm
m.DefaultCompress = model.DefaultCompress
m.Status = model.Status
m.ExtentManagement = model.ExtentManagement
m.ExtentUniformSize = model.ExtentUniformSize
m.SegmentManagement = model.SegmentManagement
m.IsDefault = model.IsDefault
m.Name = model.Name
return
}
// CreateTablespaceDetailsTypeEnum Enum with underlying type: string
type CreateTablespaceDetailsTypeEnum string
// Set of constants representing the allowable values for CreateTablespaceDetailsTypeEnum
const (
CreateTablespaceDetailsTypePermanent CreateTablespaceDetailsTypeEnum = "PERMANENT"
CreateTablespaceDetailsTypeTemporary CreateTablespaceDetailsTypeEnum = "TEMPORARY"
)
var mappingCreateTablespaceDetailsTypeEnum = map[string]CreateTablespaceDetailsTypeEnum{
"PERMANENT": CreateTablespaceDetailsTypePermanent,
"TEMPORARY": CreateTablespaceDetailsTypeTemporary,
}
var mappingCreateTablespaceDetailsTypeEnumLowerCase = map[string]CreateTablespaceDetailsTypeEnum{
"permanent": CreateTablespaceDetailsTypePermanent,
"temporary": CreateTablespaceDetailsTypeTemporary,
}
// GetCreateTablespaceDetailsTypeEnumValues Enumerates the set of values for CreateTablespaceDetailsTypeEnum
func GetCreateTablespaceDetailsTypeEnumValues() []CreateTablespaceDetailsTypeEnum {
values := make([]CreateTablespaceDetailsTypeEnum, 0)
for _, v := range mappingCreateTablespaceDetailsTypeEnum {
values = append(values, v)
}
return values
}
// GetCreateTablespaceDetailsTypeEnumStringValues Enumerates the set of values in String for CreateTablespaceDetailsTypeEnum
func GetCreateTablespaceDetailsTypeEnumStringValues() []string {
return []string{
"PERMANENT",
"TEMPORARY",
}
}
// GetMappingCreateTablespaceDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingCreateTablespaceDetailsTypeEnum(val string) (CreateTablespaceDetailsTypeEnum, bool) {
enum, ok := mappingCreateTablespaceDetailsTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// CreateTablespaceDetailsDefaultCompressEnum Enum with underlying type: string
type CreateTablespaceDetailsDefaultCompressEnum string
// Set of constants representing the allowable values for CreateTablespaceDetailsDefaultCompressEnum
const (
CreateTablespaceDetailsDefaultCompressNoCompress CreateTablespaceDetailsDefaultCompressEnum = "NO_COMPRESS"
CreateTablespaceDetailsDefaultCompressBasicCompress CreateTablespaceDetailsDefaultCompressEnum = "BASIC_COMPRESS"
)
var mappingCreateTablespaceDetailsDefaultCompressEnum = map[string]CreateTablespaceDetailsDefaultCompressEnum{
"NO_COMPRESS": CreateTablespaceDetailsDefaultCompressNoCompress,
"BASIC_COMPRESS": CreateTablespaceDetailsDefaultCompressBasicCompress,
}
var mappingCreateTablespaceDetailsDefaultCompressEnumLowerCase = map[string]CreateTablespaceDetailsDefaultCompressEnum{
"no_compress": CreateTablespaceDetailsDefaultCompressNoCompress,
"basic_compress": CreateTablespaceDetailsDefaultCompressBasicCompress,
}
// GetCreateTablespaceDetailsDefaultCompressEnumValues Enumerates the set of values for CreateTablespaceDetailsDefaultCompressEnum
func GetCreateTablespaceDetailsDefaultCompressEnumValues() []CreateTablespaceDetailsDefaultCompressEnum {
values := make([]CreateTablespaceDetailsDefaultCompressEnum, 0)
for _, v := range mappingCreateTablespaceDetailsDefaultCompressEnum {
values = append(values, v)
}
return values
}
// GetCreateTablespaceDetailsDefaultCompressEnumStringValues Enumerates the set of values in String for CreateTablespaceDetailsDefaultCompressEnum
func GetCreateTablespaceDetailsDefaultCompressEnumStringValues() []string {
return []string{
"NO_COMPRESS",
"BASIC_COMPRESS",
}
}
// GetMappingCreateTablespaceDetailsDefaultCompressEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingCreateTablespaceDetailsDefaultCompressEnum(val string) (CreateTablespaceDetailsDefaultCompressEnum, bool) {
enum, ok := mappingCreateTablespaceDetailsDefaultCompressEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// CreateTablespaceDetailsStatusEnum Enum with underlying type: string
type CreateTablespaceDetailsStatusEnum string
// Set of constants representing the allowable values for CreateTablespaceDetailsStatusEnum
const (
CreateTablespaceDetailsStatusOnly CreateTablespaceDetailsStatusEnum = "READ_ONLY"
CreateTablespaceDetailsStatusWrite CreateTablespaceDetailsStatusEnum = "READ_WRITE"
)
var mappingCreateTablespaceDetailsStatusEnum = map[string]CreateTablespaceDetailsStatusEnum{
"READ_ONLY": CreateTablespaceDetailsStatusOnly,
"READ_WRITE": CreateTablespaceDetailsStatusWrite,
}
var mappingCreateTablespaceDetailsStatusEnumLowerCase = map[string]CreateTablespaceDetailsStatusEnum{
"read_only": CreateTablespaceDetailsStatusOnly,
"read_write": CreateTablespaceDetailsStatusWrite,
}
// GetCreateTablespaceDetailsStatusEnumValues Enumerates the set of values for CreateTablespaceDetailsStatusEnum
func GetCreateTablespaceDetailsStatusEnumValues() []CreateTablespaceDetailsStatusEnum {
values := make([]CreateTablespaceDetailsStatusEnum, 0)
for _, v := range mappingCreateTablespaceDetailsStatusEnum {
values = append(values, v)
}
return values
}
// GetCreateTablespaceDetailsStatusEnumStringValues Enumerates the set of values in String for CreateTablespaceDetailsStatusEnum
func GetCreateTablespaceDetailsStatusEnumStringValues() []string {
return []string{
"READ_ONLY",
"READ_WRITE",
}
}
// GetMappingCreateTablespaceDetailsStatusEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingCreateTablespaceDetailsStatusEnum(val string) (CreateTablespaceDetailsStatusEnum, bool) {
enum, ok := mappingCreateTablespaceDetailsStatusEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// CreateTablespaceDetailsExtentManagementEnum Enum with underlying type: string
type CreateTablespaceDetailsExtentManagementEnum string
// Set of constants representing the allowable values for CreateTablespaceDetailsExtentManagementEnum
const (
CreateTablespaceDetailsExtentManagementAutoallocate CreateTablespaceDetailsExtentManagementEnum = "AUTOALLOCATE"
CreateTablespaceDetailsExtentManagementUniform CreateTablespaceDetailsExtentManagementEnum = "UNIFORM"
)
var mappingCreateTablespaceDetailsExtentManagementEnum = map[string]CreateTablespaceDetailsExtentManagementEnum{
"AUTOALLOCATE": CreateTablespaceDetailsExtentManagementAutoallocate,
"UNIFORM": CreateTablespaceDetailsExtentManagementUniform,
}
var mappingCreateTablespaceDetailsExtentManagementEnumLowerCase = map[string]CreateTablespaceDetailsExtentManagementEnum{
"autoallocate": CreateTablespaceDetailsExtentManagementAutoallocate,
"uniform": CreateTablespaceDetailsExtentManagementUniform,
}
// GetCreateTablespaceDetailsExtentManagementEnumValues Enumerates the set of values for CreateTablespaceDetailsExtentManagementEnum
func GetCreateTablespaceDetailsExtentManagementEnumValues() []CreateTablespaceDetailsExtentManagementEnum {
values := make([]CreateTablespaceDetailsExtentManagementEnum, 0)
for _, v := range mappingCreateTablespaceDetailsExtentManagementEnum {
values = append(values, v)
}
return values
}
// GetCreateTablespaceDetailsExtentManagementEnumStringValues Enumerates the set of values in String for CreateTablespaceDetailsExtentManagementEnum
func GetCreateTablespaceDetailsExtentManagementEnumStringValues() []string {
return []string{
"AUTOALLOCATE",
"UNIFORM",
}
}
// GetMappingCreateTablespaceDetailsExtentManagementEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingCreateTablespaceDetailsExtentManagementEnum(val string) (CreateTablespaceDetailsExtentManagementEnum, bool) {
enum, ok := mappingCreateTablespaceDetailsExtentManagementEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// CreateTablespaceDetailsSegmentManagementEnum Enum with underlying type: string
type CreateTablespaceDetailsSegmentManagementEnum string
// Set of constants representing the allowable values for CreateTablespaceDetailsSegmentManagementEnum
const (
CreateTablespaceDetailsSegmentManagementAuto CreateTablespaceDetailsSegmentManagementEnum = "AUTO"
CreateTablespaceDetailsSegmentManagementManual CreateTablespaceDetailsSegmentManagementEnum = "MANUAL"
)
var mappingCreateTablespaceDetailsSegmentManagementEnum = map[string]CreateTablespaceDetailsSegmentManagementEnum{
"AUTO": CreateTablespaceDetailsSegmentManagementAuto,
"MANUAL": CreateTablespaceDetailsSegmentManagementManual,
}
var mappingCreateTablespaceDetailsSegmentManagementEnumLowerCase = map[string]CreateTablespaceDetailsSegmentManagementEnum{
"auto": CreateTablespaceDetailsSegmentManagementAuto,
"manual": CreateTablespaceDetailsSegmentManagementManual,
}
// GetCreateTablespaceDetailsSegmentManagementEnumValues Enumerates the set of values for CreateTablespaceDetailsSegmentManagementEnum
func GetCreateTablespaceDetailsSegmentManagementEnumValues() []CreateTablespaceDetailsSegmentManagementEnum {
values := make([]CreateTablespaceDetailsSegmentManagementEnum, 0)
for _, v := range mappingCreateTablespaceDetailsSegmentManagementEnum {
values = append(values, v)
}
return values
}
// GetCreateTablespaceDetailsSegmentManagementEnumStringValues Enumerates the set of values in String for CreateTablespaceDetailsSegmentManagementEnum
func GetCreateTablespaceDetailsSegmentManagementEnumStringValues() []string {
return []string{
"AUTO",
"MANUAL",
}
}
// GetMappingCreateTablespaceDetailsSegmentManagementEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingCreateTablespaceDetailsSegmentManagementEnum(val string) (CreateTablespaceDetailsSegmentManagementEnum, bool) {
enum, ok := mappingCreateTablespaceDetailsSegmentManagementEnumLowerCase[strings.ToLower(val)]
return enum, ok
}