-
Notifications
You must be signed in to change notification settings - Fork 80
/
sql_endpoint.go
217 lines (158 loc) · 9.33 KB
/
sql_endpoint.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
// 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 Flow API
//
// Use the Data Flow APIs to run any Apache Spark application at any scale without deploying or managing any infrastructure.
//
package dataflow
import (
"encoding/json"
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// SqlEndpoint The description of a SQL Endpoint.
type SqlEndpoint struct {
// The provision identifier that is immutable on creation.
Id *string `mandatory:"true" json:"id"`
// The SQL Endpoint name, which can be changed.
DisplayName *string `mandatory:"true" json:"displayName"`
// The OCID of a compartment.
CompartmentId *string `mandatory:"true" json:"compartmentId"`
// The version of SQL Endpoint.
SqlEndpointVersion *string `mandatory:"true" json:"sqlEndpointVersion"`
// The shape of the SQL Endpoint driver instance.
DriverShape *string `mandatory:"true" json:"driverShape"`
// The shape of the SQL Endpoint executor instance.
ExecutorShape *string `mandatory:"true" json:"executorShape"`
// The minimum number of executors.
MinExecutorCount *int `mandatory:"true" json:"minExecutorCount"`
// The maximum number of executors.
MaxExecutorCount *int `mandatory:"true" json:"maxExecutorCount"`
// The OCID of OCI Hive Metastore.
MetastoreId *string `mandatory:"true" json:"metastoreId"`
// The OCID of OCI Lake.
LakeId *string `mandatory:"true" json:"lakeId"`
// The warehouse bucket URI. It is a Oracle Cloud Infrastructure Object Storage bucket URI as defined here https://docs.oracle.com/en/cloud/paas/atp-cloud/atpud/object-storage-uris.html
WarehouseBucketUri *string `mandatory:"true" json:"warehouseBucketUri"`
// The description of the SQL Endpoint.
Description *string `mandatory:"true" json:"description"`
// The JDBC URL field. For example, jdbc:spark://{serviceFQDN}:443/default;SparkServerType=DFI
JdbcEndpointUrl *string `mandatory:"false" json:"jdbcEndpointUrl"`
// The time the Sql Endpoint was created. An RFC3339 formatted datetime string.
TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
// The time the Sql Endpoint was updated. An RFC3339 formatted datetime string.
TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"`
// The current state of the Sql Endpoint.
LifecycleState SqlEndpointLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"`
// A message describing the reason why the resource is in it's current state. Helps bubble up errors in state changes. For example, it can be used to provide actionable information for a resource in the Failed state.
StateMessage *string `mandatory:"false" json:"stateMessage"`
DriverShapeConfig *ShapeConfig `mandatory:"false" json:"driverShapeConfig"`
ExecutorShapeConfig *ShapeConfig `mandatory:"false" json:"executorShapeConfig"`
// This token is used by Splat, and indicates that the service accepts the request, and that the request is currently being processed.
LastAcceptedRequestToken *string `mandatory:"false" json:"lastAcceptedRequestToken"`
// Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
// For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
// Example: `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
// Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
// Example: `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces.
// For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
// Example: `{orcl-cloud: {free-tier-retain: true}}`
SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"`
// The Spark configuration passed to the running process.
// See https://spark.apache.org/docs/latest/configuration.html#available-properties.
// Example: { "spark.app.name" : "My App Name", "spark.shuffle.io.maxRetries" : "4" }
// Note: Not all Spark properties are permitted to be set. Attempting to set a property that is
// not allowed to be overwritten will cause a 400 status to be returned.
SparkAdvancedConfigurations map[string]string `mandatory:"false" json:"sparkAdvancedConfigurations"`
NetworkConfiguration SqlEndpointNetworkConfiguration `mandatory:"false" json:"networkConfiguration"`
}
func (m SqlEndpoint) 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 SqlEndpoint) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingSqlEndpointLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetSqlEndpointLifecycleStateEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// UnmarshalJSON unmarshals from json
func (m *SqlEndpoint) UnmarshalJSON(data []byte) (e error) {
model := struct {
JdbcEndpointUrl *string `json:"jdbcEndpointUrl"`
TimeCreated *common.SDKTime `json:"timeCreated"`
TimeUpdated *common.SDKTime `json:"timeUpdated"`
LifecycleState SqlEndpointLifecycleStateEnum `json:"lifecycleState"`
StateMessage *string `json:"stateMessage"`
DriverShapeConfig *ShapeConfig `json:"driverShapeConfig"`
ExecutorShapeConfig *ShapeConfig `json:"executorShapeConfig"`
LastAcceptedRequestToken *string `json:"lastAcceptedRequestToken"`
FreeformTags map[string]string `json:"freeformTags"`
DefinedTags map[string]map[string]interface{} `json:"definedTags"`
SystemTags map[string]map[string]interface{} `json:"systemTags"`
SparkAdvancedConfigurations map[string]string `json:"sparkAdvancedConfigurations"`
NetworkConfiguration sqlendpointnetworkconfiguration `json:"networkConfiguration"`
Id *string `json:"id"`
DisplayName *string `json:"displayName"`
CompartmentId *string `json:"compartmentId"`
SqlEndpointVersion *string `json:"sqlEndpointVersion"`
DriverShape *string `json:"driverShape"`
ExecutorShape *string `json:"executorShape"`
MinExecutorCount *int `json:"minExecutorCount"`
MaxExecutorCount *int `json:"maxExecutorCount"`
MetastoreId *string `json:"metastoreId"`
LakeId *string `json:"lakeId"`
WarehouseBucketUri *string `json:"warehouseBucketUri"`
Description *string `json:"description"`
}{}
e = json.Unmarshal(data, &model)
if e != nil {
return
}
var nn interface{}
m.JdbcEndpointUrl = model.JdbcEndpointUrl
m.TimeCreated = model.TimeCreated
m.TimeUpdated = model.TimeUpdated
m.LifecycleState = model.LifecycleState
m.StateMessage = model.StateMessage
m.DriverShapeConfig = model.DriverShapeConfig
m.ExecutorShapeConfig = model.ExecutorShapeConfig
m.LastAcceptedRequestToken = model.LastAcceptedRequestToken
m.FreeformTags = model.FreeformTags
m.DefinedTags = model.DefinedTags
m.SystemTags = model.SystemTags
m.SparkAdvancedConfigurations = model.SparkAdvancedConfigurations
nn, e = model.NetworkConfiguration.UnmarshalPolymorphicJSON(model.NetworkConfiguration.JsonData)
if e != nil {
return
}
if nn != nil {
m.NetworkConfiguration = nn.(SqlEndpointNetworkConfiguration)
} else {
m.NetworkConfiguration = nil
}
m.Id = model.Id
m.DisplayName = model.DisplayName
m.CompartmentId = model.CompartmentId
m.SqlEndpointVersion = model.SqlEndpointVersion
m.DriverShape = model.DriverShape
m.ExecutorShape = model.ExecutorShape
m.MinExecutorCount = model.MinExecutorCount
m.MaxExecutorCount = model.MaxExecutorCount
m.MetastoreId = model.MetastoreId
m.LakeId = model.LakeId
m.WarehouseBucketUri = model.WarehouseBucketUri
m.Description = model.Description
return
}