-
Notifications
You must be signed in to change notification settings - Fork 82
/
integration_instance.go
411 lines (330 loc) · 18.2 KB
/
integration_instance.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
// Copyright (c) 2016, 2018, 2022, 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.
// Oracle Integration API
//
// Oracle Integration API.
//
package integration
import (
"encoding/json"
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// IntegrationInstance Description of Integration Instance.
type IntegrationInstance struct {
// Unique identifier that is immutable on creation.
Id *string `mandatory:"true" json:"id"`
// Integration Instance Identifier, can be renamed.
DisplayName *string `mandatory:"true" json:"displayName"`
// Compartment Identifier.
CompartmentId *string `mandatory:"true" json:"compartmentId"`
// Standard or Enterprise type,
// Oracle Integration Generation 2 uses ENTERPRISE and STANDARD,
// Oracle Integration 3 uses ENTERPRISEX and STANDARDX
IntegrationInstanceType IntegrationInstanceIntegrationInstanceTypeEnum `mandatory:"true" json:"integrationInstanceType"`
// Bring your own license.
IsByol *bool `mandatory:"true" json:"isByol"`
// The Integration Instance URL.
InstanceUrl *string `mandatory:"true" json:"instanceUrl"`
// The number of configured message packs (if any)
MessagePacks *int `mandatory:"true" json:"messagePacks"`
// The time the the IntegrationInstance was created. An RFC3339 formatted datetime string.
TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
// The time the IntegrationInstance was updated. An RFC3339 formatted datetime string.
TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"`
// The current state of the integration instance.
LifecycleState IntegrationInstanceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"`
// An message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
StateMessage *string `mandatory:"false" json:"stateMessage"`
// Simple key-value pair that is applied without any predefined name,
// type or scope. Exists for cross-compatibility only.
// Example: `{"bar-key": "value"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
// Usage of predefined tag keys. These predefined keys are scoped to
// namespaces.
// Example: `{"foo-namespace": {"bar-key": "value"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// The file server is enabled or not.
IsFileServerEnabled *bool `mandatory:"false" json:"isFileServerEnabled"`
// VisualBuilder is enabled or not.
IsVisualBuilderEnabled *bool `mandatory:"false" json:"isVisualBuilderEnabled"`
CustomEndpoint *CustomEndpointDetails `mandatory:"false" json:"customEndpoint"`
// A list of alternate custom endpoints used for the integration instance URL.
AlternateCustomEndpoints []CustomEndpointDetails `mandatory:"false" json:"alternateCustomEndpoints"`
// The entitlement used for billing purposes.
ConsumptionModel IntegrationInstanceConsumptionModelEnum `mandatory:"false" json:"consumptionModel,omitempty"`
NetworkEndpointDetails NetworkEndpointDetails `mandatory:"false" json:"networkEndpointDetails"`
IdcsInfo *IdcsInfoDetails `mandatory:"false" json:"idcsInfo"`
// A list of associated attachments to other services
Attachments []AttachmentDetails `mandatory:"false" json:"attachments"`
// Shape
Shape IntegrationInstanceShapeEnum `mandatory:"false" json:"shape,omitempty"`
}
func (m IntegrationInstance) 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 IntegrationInstance) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingIntegrationInstanceIntegrationInstanceTypeEnum(string(m.IntegrationInstanceType)); !ok && m.IntegrationInstanceType != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for IntegrationInstanceType: %s. Supported values are: %s.", m.IntegrationInstanceType, strings.Join(GetIntegrationInstanceIntegrationInstanceTypeEnumStringValues(), ",")))
}
if _, ok := GetMappingIntegrationInstanceLifecycleStateEnum(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(GetIntegrationInstanceLifecycleStateEnumStringValues(), ",")))
}
if _, ok := GetMappingIntegrationInstanceConsumptionModelEnum(string(m.ConsumptionModel)); !ok && m.ConsumptionModel != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConsumptionModel: %s. Supported values are: %s.", m.ConsumptionModel, strings.Join(GetIntegrationInstanceConsumptionModelEnumStringValues(), ",")))
}
if _, ok := GetMappingIntegrationInstanceShapeEnum(string(m.Shape)); !ok && m.Shape != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Shape: %s. Supported values are: %s.", m.Shape, strings.Join(GetIntegrationInstanceShapeEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// UnmarshalJSON unmarshals from json
func (m *IntegrationInstance) UnmarshalJSON(data []byte) (e error) {
model := struct {
TimeCreated *common.SDKTime `json:"timeCreated"`
TimeUpdated *common.SDKTime `json:"timeUpdated"`
LifecycleState IntegrationInstanceLifecycleStateEnum `json:"lifecycleState"`
StateMessage *string `json:"stateMessage"`
FreeformTags map[string]string `json:"freeformTags"`
DefinedTags map[string]map[string]interface{} `json:"definedTags"`
IsFileServerEnabled *bool `json:"isFileServerEnabled"`
IsVisualBuilderEnabled *bool `json:"isVisualBuilderEnabled"`
CustomEndpoint *CustomEndpointDetails `json:"customEndpoint"`
AlternateCustomEndpoints []CustomEndpointDetails `json:"alternateCustomEndpoints"`
ConsumptionModel IntegrationInstanceConsumptionModelEnum `json:"consumptionModel"`
NetworkEndpointDetails networkendpointdetails `json:"networkEndpointDetails"`
IdcsInfo *IdcsInfoDetails `json:"idcsInfo"`
Attachments []AttachmentDetails `json:"attachments"`
Shape IntegrationInstanceShapeEnum `json:"shape"`
Id *string `json:"id"`
DisplayName *string `json:"displayName"`
CompartmentId *string `json:"compartmentId"`
IntegrationInstanceType IntegrationInstanceIntegrationInstanceTypeEnum `json:"integrationInstanceType"`
IsByol *bool `json:"isByol"`
InstanceUrl *string `json:"instanceUrl"`
MessagePacks *int `json:"messagePacks"`
}{}
e = json.Unmarshal(data, &model)
if e != nil {
return
}
var nn interface{}
m.TimeCreated = model.TimeCreated
m.TimeUpdated = model.TimeUpdated
m.LifecycleState = model.LifecycleState
m.StateMessage = model.StateMessage
m.FreeformTags = model.FreeformTags
m.DefinedTags = model.DefinedTags
m.IsFileServerEnabled = model.IsFileServerEnabled
m.IsVisualBuilderEnabled = model.IsVisualBuilderEnabled
m.CustomEndpoint = model.CustomEndpoint
m.AlternateCustomEndpoints = make([]CustomEndpointDetails, len(model.AlternateCustomEndpoints))
for i, n := range model.AlternateCustomEndpoints {
m.AlternateCustomEndpoints[i] = n
}
m.ConsumptionModel = model.ConsumptionModel
nn, e = model.NetworkEndpointDetails.UnmarshalPolymorphicJSON(model.NetworkEndpointDetails.JsonData)
if e != nil {
return
}
if nn != nil {
m.NetworkEndpointDetails = nn.(NetworkEndpointDetails)
} else {
m.NetworkEndpointDetails = nil
}
m.IdcsInfo = model.IdcsInfo
m.Attachments = make([]AttachmentDetails, len(model.Attachments))
for i, n := range model.Attachments {
m.Attachments[i] = n
}
m.Shape = model.Shape
m.Id = model.Id
m.DisplayName = model.DisplayName
m.CompartmentId = model.CompartmentId
m.IntegrationInstanceType = model.IntegrationInstanceType
m.IsByol = model.IsByol
m.InstanceUrl = model.InstanceUrl
m.MessagePacks = model.MessagePacks
return
}
// IntegrationInstanceIntegrationInstanceTypeEnum Enum with underlying type: string
type IntegrationInstanceIntegrationInstanceTypeEnum string
// Set of constants representing the allowable values for IntegrationInstanceIntegrationInstanceTypeEnum
const (
IntegrationInstanceIntegrationInstanceTypeStandard IntegrationInstanceIntegrationInstanceTypeEnum = "STANDARD"
IntegrationInstanceIntegrationInstanceTypeEnterprise IntegrationInstanceIntegrationInstanceTypeEnum = "ENTERPRISE"
IntegrationInstanceIntegrationInstanceTypeStandardx IntegrationInstanceIntegrationInstanceTypeEnum = "STANDARDX"
IntegrationInstanceIntegrationInstanceTypeEnterprisex IntegrationInstanceIntegrationInstanceTypeEnum = "ENTERPRISEX"
)
var mappingIntegrationInstanceIntegrationInstanceTypeEnum = map[string]IntegrationInstanceIntegrationInstanceTypeEnum{
"STANDARD": IntegrationInstanceIntegrationInstanceTypeStandard,
"ENTERPRISE": IntegrationInstanceIntegrationInstanceTypeEnterprise,
"STANDARDX": IntegrationInstanceIntegrationInstanceTypeStandardx,
"ENTERPRISEX": IntegrationInstanceIntegrationInstanceTypeEnterprisex,
}
var mappingIntegrationInstanceIntegrationInstanceTypeEnumLowerCase = map[string]IntegrationInstanceIntegrationInstanceTypeEnum{
"standard": IntegrationInstanceIntegrationInstanceTypeStandard,
"enterprise": IntegrationInstanceIntegrationInstanceTypeEnterprise,
"standardx": IntegrationInstanceIntegrationInstanceTypeStandardx,
"enterprisex": IntegrationInstanceIntegrationInstanceTypeEnterprisex,
}
// GetIntegrationInstanceIntegrationInstanceTypeEnumValues Enumerates the set of values for IntegrationInstanceIntegrationInstanceTypeEnum
func GetIntegrationInstanceIntegrationInstanceTypeEnumValues() []IntegrationInstanceIntegrationInstanceTypeEnum {
values := make([]IntegrationInstanceIntegrationInstanceTypeEnum, 0)
for _, v := range mappingIntegrationInstanceIntegrationInstanceTypeEnum {
values = append(values, v)
}
return values
}
// GetIntegrationInstanceIntegrationInstanceTypeEnumStringValues Enumerates the set of values in String for IntegrationInstanceIntegrationInstanceTypeEnum
func GetIntegrationInstanceIntegrationInstanceTypeEnumStringValues() []string {
return []string{
"STANDARD",
"ENTERPRISE",
"STANDARDX",
"ENTERPRISEX",
}
}
// GetMappingIntegrationInstanceIntegrationInstanceTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingIntegrationInstanceIntegrationInstanceTypeEnum(val string) (IntegrationInstanceIntegrationInstanceTypeEnum, bool) {
enum, ok := mappingIntegrationInstanceIntegrationInstanceTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// IntegrationInstanceLifecycleStateEnum Enum with underlying type: string
type IntegrationInstanceLifecycleStateEnum string
// Set of constants representing the allowable values for IntegrationInstanceLifecycleStateEnum
const (
IntegrationInstanceLifecycleStateCreating IntegrationInstanceLifecycleStateEnum = "CREATING"
IntegrationInstanceLifecycleStateUpdating IntegrationInstanceLifecycleStateEnum = "UPDATING"
IntegrationInstanceLifecycleStateActive IntegrationInstanceLifecycleStateEnum = "ACTIVE"
IntegrationInstanceLifecycleStateInactive IntegrationInstanceLifecycleStateEnum = "INACTIVE"
IntegrationInstanceLifecycleStateDeleting IntegrationInstanceLifecycleStateEnum = "DELETING"
IntegrationInstanceLifecycleStateDeleted IntegrationInstanceLifecycleStateEnum = "DELETED"
IntegrationInstanceLifecycleStateFailed IntegrationInstanceLifecycleStateEnum = "FAILED"
)
var mappingIntegrationInstanceLifecycleStateEnum = map[string]IntegrationInstanceLifecycleStateEnum{
"CREATING": IntegrationInstanceLifecycleStateCreating,
"UPDATING": IntegrationInstanceLifecycleStateUpdating,
"ACTIVE": IntegrationInstanceLifecycleStateActive,
"INACTIVE": IntegrationInstanceLifecycleStateInactive,
"DELETING": IntegrationInstanceLifecycleStateDeleting,
"DELETED": IntegrationInstanceLifecycleStateDeleted,
"FAILED": IntegrationInstanceLifecycleStateFailed,
}
var mappingIntegrationInstanceLifecycleStateEnumLowerCase = map[string]IntegrationInstanceLifecycleStateEnum{
"creating": IntegrationInstanceLifecycleStateCreating,
"updating": IntegrationInstanceLifecycleStateUpdating,
"active": IntegrationInstanceLifecycleStateActive,
"inactive": IntegrationInstanceLifecycleStateInactive,
"deleting": IntegrationInstanceLifecycleStateDeleting,
"deleted": IntegrationInstanceLifecycleStateDeleted,
"failed": IntegrationInstanceLifecycleStateFailed,
}
// GetIntegrationInstanceLifecycleStateEnumValues Enumerates the set of values for IntegrationInstanceLifecycleStateEnum
func GetIntegrationInstanceLifecycleStateEnumValues() []IntegrationInstanceLifecycleStateEnum {
values := make([]IntegrationInstanceLifecycleStateEnum, 0)
for _, v := range mappingIntegrationInstanceLifecycleStateEnum {
values = append(values, v)
}
return values
}
// GetIntegrationInstanceLifecycleStateEnumStringValues Enumerates the set of values in String for IntegrationInstanceLifecycleStateEnum
func GetIntegrationInstanceLifecycleStateEnumStringValues() []string {
return []string{
"CREATING",
"UPDATING",
"ACTIVE",
"INACTIVE",
"DELETING",
"DELETED",
"FAILED",
}
}
// GetMappingIntegrationInstanceLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingIntegrationInstanceLifecycleStateEnum(val string) (IntegrationInstanceLifecycleStateEnum, bool) {
enum, ok := mappingIntegrationInstanceLifecycleStateEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// IntegrationInstanceConsumptionModelEnum Enum with underlying type: string
type IntegrationInstanceConsumptionModelEnum string
// Set of constants representing the allowable values for IntegrationInstanceConsumptionModelEnum
const (
IntegrationInstanceConsumptionModelUcm IntegrationInstanceConsumptionModelEnum = "UCM"
IntegrationInstanceConsumptionModelGov IntegrationInstanceConsumptionModelEnum = "GOV"
IntegrationInstanceConsumptionModelOic4saas IntegrationInstanceConsumptionModelEnum = "OIC4SAAS"
)
var mappingIntegrationInstanceConsumptionModelEnum = map[string]IntegrationInstanceConsumptionModelEnum{
"UCM": IntegrationInstanceConsumptionModelUcm,
"GOV": IntegrationInstanceConsumptionModelGov,
"OIC4SAAS": IntegrationInstanceConsumptionModelOic4saas,
}
var mappingIntegrationInstanceConsumptionModelEnumLowerCase = map[string]IntegrationInstanceConsumptionModelEnum{
"ucm": IntegrationInstanceConsumptionModelUcm,
"gov": IntegrationInstanceConsumptionModelGov,
"oic4saas": IntegrationInstanceConsumptionModelOic4saas,
}
// GetIntegrationInstanceConsumptionModelEnumValues Enumerates the set of values for IntegrationInstanceConsumptionModelEnum
func GetIntegrationInstanceConsumptionModelEnumValues() []IntegrationInstanceConsumptionModelEnum {
values := make([]IntegrationInstanceConsumptionModelEnum, 0)
for _, v := range mappingIntegrationInstanceConsumptionModelEnum {
values = append(values, v)
}
return values
}
// GetIntegrationInstanceConsumptionModelEnumStringValues Enumerates the set of values in String for IntegrationInstanceConsumptionModelEnum
func GetIntegrationInstanceConsumptionModelEnumStringValues() []string {
return []string{
"UCM",
"GOV",
"OIC4SAAS",
}
}
// GetMappingIntegrationInstanceConsumptionModelEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingIntegrationInstanceConsumptionModelEnum(val string) (IntegrationInstanceConsumptionModelEnum, bool) {
enum, ok := mappingIntegrationInstanceConsumptionModelEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// IntegrationInstanceShapeEnum Enum with underlying type: string
type IntegrationInstanceShapeEnum string
// Set of constants representing the allowable values for IntegrationInstanceShapeEnum
const (
IntegrationInstanceShapeDevelopment IntegrationInstanceShapeEnum = "DEVELOPMENT"
IntegrationInstanceShapeProduction IntegrationInstanceShapeEnum = "PRODUCTION"
)
var mappingIntegrationInstanceShapeEnum = map[string]IntegrationInstanceShapeEnum{
"DEVELOPMENT": IntegrationInstanceShapeDevelopment,
"PRODUCTION": IntegrationInstanceShapeProduction,
}
var mappingIntegrationInstanceShapeEnumLowerCase = map[string]IntegrationInstanceShapeEnum{
"development": IntegrationInstanceShapeDevelopment,
"production": IntegrationInstanceShapeProduction,
}
// GetIntegrationInstanceShapeEnumValues Enumerates the set of values for IntegrationInstanceShapeEnum
func GetIntegrationInstanceShapeEnumValues() []IntegrationInstanceShapeEnum {
values := make([]IntegrationInstanceShapeEnum, 0)
for _, v := range mappingIntegrationInstanceShapeEnum {
values = append(values, v)
}
return values
}
// GetIntegrationInstanceShapeEnumStringValues Enumerates the set of values in String for IntegrationInstanceShapeEnum
func GetIntegrationInstanceShapeEnumStringValues() []string {
return []string{
"DEVELOPMENT",
"PRODUCTION",
}
}
// GetMappingIntegrationInstanceShapeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingIntegrationInstanceShapeEnum(val string) (IntegrationInstanceShapeEnum, bool) {
enum, ok := mappingIntegrationInstanceShapeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}