-
Notifications
You must be signed in to change notification settings - Fork 80
/
resize_data_file_details.go
166 lines (132 loc) · 6.37 KB
/
resize_data_file_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
// 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"
)
// ResizeDataFileDetails The details required to resize a data file or temp file within the tablespace.
// It takes either credentialDetails or databaseCredential. It's recommended to provide databaseCredential
type ResizeDataFileDetails struct {
// Specifies whether the file is a data file or temp file.
FileType ResizeDataFileDetailsFileTypeEnum `mandatory:"true" json:"fileType"`
// Name of the data file or temp file to be resized.
DataFile *string `mandatory:"true" json:"dataFile"`
CredentialDetails TablespaceAdminCredentialDetails `mandatory:"false" json:"credentialDetails"`
DatabaseCredential DatabaseCredentialDetails `mandatory:"false" json:"databaseCredential"`
// The new size of the data file or temp file.
FileSize *TablespaceStorageSize `mandatory:"false" json:"fileSize"`
// 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"`
}
func (m ResizeDataFileDetails) 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 ResizeDataFileDetails) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingResizeDataFileDetailsFileTypeEnum(string(m.FileType)); !ok && m.FileType != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FileType: %s. Supported values are: %s.", m.FileType, strings.Join(GetResizeDataFileDetailsFileTypeEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// UnmarshalJSON unmarshals from json
func (m *ResizeDataFileDetails) UnmarshalJSON(data []byte) (e error) {
model := struct {
CredentialDetails tablespaceadmincredentialdetails `json:"credentialDetails"`
DatabaseCredential databasecredentialdetails `json:"databaseCredential"`
FileSize *TablespaceStorageSize `json:"fileSize"`
IsAutoExtensible *bool `json:"isAutoExtensible"`
AutoExtendNextSize *TablespaceStorageSize `json:"autoExtendNextSize"`
AutoExtendMaxSize *TablespaceStorageSize `json:"autoExtendMaxSize"`
IsMaxSizeUnlimited *bool `json:"isMaxSizeUnlimited"`
FileType ResizeDataFileDetailsFileTypeEnum `json:"fileType"`
DataFile *string `json:"dataFile"`
}{}
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.FileSize = model.FileSize
m.IsAutoExtensible = model.IsAutoExtensible
m.AutoExtendNextSize = model.AutoExtendNextSize
m.AutoExtendMaxSize = model.AutoExtendMaxSize
m.IsMaxSizeUnlimited = model.IsMaxSizeUnlimited
m.FileType = model.FileType
m.DataFile = model.DataFile
return
}
// ResizeDataFileDetailsFileTypeEnum Enum with underlying type: string
type ResizeDataFileDetailsFileTypeEnum string
// Set of constants representing the allowable values for ResizeDataFileDetailsFileTypeEnum
const (
ResizeDataFileDetailsFileTypeDatafile ResizeDataFileDetailsFileTypeEnum = "DATAFILE"
ResizeDataFileDetailsFileTypeTempfile ResizeDataFileDetailsFileTypeEnum = "TEMPFILE"
)
var mappingResizeDataFileDetailsFileTypeEnum = map[string]ResizeDataFileDetailsFileTypeEnum{
"DATAFILE": ResizeDataFileDetailsFileTypeDatafile,
"TEMPFILE": ResizeDataFileDetailsFileTypeTempfile,
}
var mappingResizeDataFileDetailsFileTypeEnumLowerCase = map[string]ResizeDataFileDetailsFileTypeEnum{
"datafile": ResizeDataFileDetailsFileTypeDatafile,
"tempfile": ResizeDataFileDetailsFileTypeTempfile,
}
// GetResizeDataFileDetailsFileTypeEnumValues Enumerates the set of values for ResizeDataFileDetailsFileTypeEnum
func GetResizeDataFileDetailsFileTypeEnumValues() []ResizeDataFileDetailsFileTypeEnum {
values := make([]ResizeDataFileDetailsFileTypeEnum, 0)
for _, v := range mappingResizeDataFileDetailsFileTypeEnum {
values = append(values, v)
}
return values
}
// GetResizeDataFileDetailsFileTypeEnumStringValues Enumerates the set of values in String for ResizeDataFileDetailsFileTypeEnum
func GetResizeDataFileDetailsFileTypeEnumStringValues() []string {
return []string{
"DATAFILE",
"TEMPFILE",
}
}
// GetMappingResizeDataFileDetailsFileTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingResizeDataFileDetailsFileTypeEnum(val string) (ResizeDataFileDetailsFileTypeEnum, bool) {
enum, ok := mappingResizeDataFileDetailsFileTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}