-
Notifications
You must be signed in to change notification settings - Fork 80
/
spm_evolve_task_parameters.go
163 lines (135 loc) · 8.31 KB
/
spm_evolve_task_parameters.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
// 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 (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// SpmEvolveTaskParameters The set of parameters used in an SPM evolve task.
type SpmEvolveTaskParameters struct {
// Determines which sources to search for additional plans.
AlternatePlanSources []SpmEvolveTaskParametersAlternatePlanSourcesEnum `mandatory:"false" json:"alternatePlanSources,omitempty"`
// Determines which alternative plans should be loaded.
AlternatePlanBaselines []SpmEvolveTaskParametersAlternatePlanBaselinesEnum `mandatory:"false" json:"alternatePlanBaselines,omitempty"`
// Specifies the maximum number of plans to load in total (that is, not
// the limit for each SQL statement). A value of zero indicates `UNLIMITED`
// number of plans.
AlternatePlanLimit *int `mandatory:"false" json:"alternatePlanLimit"`
// Specifies whether to accept recommended plans automatically.
ArePlansAutoAccepted *bool `mandatory:"false" json:"arePlansAutoAccepted"`
// The global time limit in seconds. This is the total time allowed for the task.
AllowedTimeLimit *int `mandatory:"false" json:"allowedTimeLimit"`
}
func (m SpmEvolveTaskParameters) 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 SpmEvolveTaskParameters) ValidateEnumValue() (bool, error) {
errMessage := []string{}
for _, val := range m.AlternatePlanSources {
if _, ok := GetMappingSpmEvolveTaskParametersAlternatePlanSourcesEnum(string(val)); !ok && val != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AlternatePlanSources: %s. Supported values are: %s.", val, strings.Join(GetSpmEvolveTaskParametersAlternatePlanSourcesEnumStringValues(), ",")))
}
}
for _, val := range m.AlternatePlanBaselines {
if _, ok := GetMappingSpmEvolveTaskParametersAlternatePlanBaselinesEnum(string(val)); !ok && val != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AlternatePlanBaselines: %s. Supported values are: %s.", val, strings.Join(GetSpmEvolveTaskParametersAlternatePlanBaselinesEnumStringValues(), ",")))
}
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// SpmEvolveTaskParametersAlternatePlanSourcesEnum Enum with underlying type: string
type SpmEvolveTaskParametersAlternatePlanSourcesEnum string
// Set of constants representing the allowable values for SpmEvolveTaskParametersAlternatePlanSourcesEnum
const (
SpmEvolveTaskParametersAlternatePlanSourcesAuto SpmEvolveTaskParametersAlternatePlanSourcesEnum = "AUTO"
SpmEvolveTaskParametersAlternatePlanSourcesAutomaticWorkloadRepository SpmEvolveTaskParametersAlternatePlanSourcesEnum = "AUTOMATIC_WORKLOAD_REPOSITORY"
SpmEvolveTaskParametersAlternatePlanSourcesCursorCache SpmEvolveTaskParametersAlternatePlanSourcesEnum = "CURSOR_CACHE"
SpmEvolveTaskParametersAlternatePlanSourcesSqlTuningSet SpmEvolveTaskParametersAlternatePlanSourcesEnum = "SQL_TUNING_SET"
)
var mappingSpmEvolveTaskParametersAlternatePlanSourcesEnum = map[string]SpmEvolveTaskParametersAlternatePlanSourcesEnum{
"AUTO": SpmEvolveTaskParametersAlternatePlanSourcesAuto,
"AUTOMATIC_WORKLOAD_REPOSITORY": SpmEvolveTaskParametersAlternatePlanSourcesAutomaticWorkloadRepository,
"CURSOR_CACHE": SpmEvolveTaskParametersAlternatePlanSourcesCursorCache,
"SQL_TUNING_SET": SpmEvolveTaskParametersAlternatePlanSourcesSqlTuningSet,
}
var mappingSpmEvolveTaskParametersAlternatePlanSourcesEnumLowerCase = map[string]SpmEvolveTaskParametersAlternatePlanSourcesEnum{
"auto": SpmEvolveTaskParametersAlternatePlanSourcesAuto,
"automatic_workload_repository": SpmEvolveTaskParametersAlternatePlanSourcesAutomaticWorkloadRepository,
"cursor_cache": SpmEvolveTaskParametersAlternatePlanSourcesCursorCache,
"sql_tuning_set": SpmEvolveTaskParametersAlternatePlanSourcesSqlTuningSet,
}
// GetSpmEvolveTaskParametersAlternatePlanSourcesEnumValues Enumerates the set of values for SpmEvolveTaskParametersAlternatePlanSourcesEnum
func GetSpmEvolveTaskParametersAlternatePlanSourcesEnumValues() []SpmEvolveTaskParametersAlternatePlanSourcesEnum {
values := make([]SpmEvolveTaskParametersAlternatePlanSourcesEnum, 0)
for _, v := range mappingSpmEvolveTaskParametersAlternatePlanSourcesEnum {
values = append(values, v)
}
return values
}
// GetSpmEvolveTaskParametersAlternatePlanSourcesEnumStringValues Enumerates the set of values in String for SpmEvolveTaskParametersAlternatePlanSourcesEnum
func GetSpmEvolveTaskParametersAlternatePlanSourcesEnumStringValues() []string {
return []string{
"AUTO",
"AUTOMATIC_WORKLOAD_REPOSITORY",
"CURSOR_CACHE",
"SQL_TUNING_SET",
}
}
// GetMappingSpmEvolveTaskParametersAlternatePlanSourcesEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingSpmEvolveTaskParametersAlternatePlanSourcesEnum(val string) (SpmEvolveTaskParametersAlternatePlanSourcesEnum, bool) {
enum, ok := mappingSpmEvolveTaskParametersAlternatePlanSourcesEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// SpmEvolveTaskParametersAlternatePlanBaselinesEnum Enum with underlying type: string
type SpmEvolveTaskParametersAlternatePlanBaselinesEnum string
// Set of constants representing the allowable values for SpmEvolveTaskParametersAlternatePlanBaselinesEnum
const (
SpmEvolveTaskParametersAlternatePlanBaselinesAuto SpmEvolveTaskParametersAlternatePlanBaselinesEnum = "AUTO"
SpmEvolveTaskParametersAlternatePlanBaselinesExisting SpmEvolveTaskParametersAlternatePlanBaselinesEnum = "EXISTING"
SpmEvolveTaskParametersAlternatePlanBaselinesNew SpmEvolveTaskParametersAlternatePlanBaselinesEnum = "NEW"
)
var mappingSpmEvolveTaskParametersAlternatePlanBaselinesEnum = map[string]SpmEvolveTaskParametersAlternatePlanBaselinesEnum{
"AUTO": SpmEvolveTaskParametersAlternatePlanBaselinesAuto,
"EXISTING": SpmEvolveTaskParametersAlternatePlanBaselinesExisting,
"NEW": SpmEvolveTaskParametersAlternatePlanBaselinesNew,
}
var mappingSpmEvolveTaskParametersAlternatePlanBaselinesEnumLowerCase = map[string]SpmEvolveTaskParametersAlternatePlanBaselinesEnum{
"auto": SpmEvolveTaskParametersAlternatePlanBaselinesAuto,
"existing": SpmEvolveTaskParametersAlternatePlanBaselinesExisting,
"new": SpmEvolveTaskParametersAlternatePlanBaselinesNew,
}
// GetSpmEvolveTaskParametersAlternatePlanBaselinesEnumValues Enumerates the set of values for SpmEvolveTaskParametersAlternatePlanBaselinesEnum
func GetSpmEvolveTaskParametersAlternatePlanBaselinesEnumValues() []SpmEvolveTaskParametersAlternatePlanBaselinesEnum {
values := make([]SpmEvolveTaskParametersAlternatePlanBaselinesEnum, 0)
for _, v := range mappingSpmEvolveTaskParametersAlternatePlanBaselinesEnum {
values = append(values, v)
}
return values
}
// GetSpmEvolveTaskParametersAlternatePlanBaselinesEnumStringValues Enumerates the set of values in String for SpmEvolveTaskParametersAlternatePlanBaselinesEnum
func GetSpmEvolveTaskParametersAlternatePlanBaselinesEnumStringValues() []string {
return []string{
"AUTO",
"EXISTING",
"NEW",
}
}
// GetMappingSpmEvolveTaskParametersAlternatePlanBaselinesEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingSpmEvolveTaskParametersAlternatePlanBaselinesEnum(val string) (SpmEvolveTaskParametersAlternatePlanBaselinesEnum, bool) {
enum, ok := mappingSpmEvolveTaskParametersAlternatePlanBaselinesEnumLowerCase[strings.ToLower(val)]
return enum, ok
}