-
Notifications
You must be signed in to change notification settings - Fork 80
/
reference.go
163 lines (139 loc) · 7.28 KB
/
reference.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, 2023, 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 Integration API
//
// Use the Data Integration API to organize your data integration projects, create data flows, pipelines and tasks, and then publish, schedule, and run tasks that extract, transform, and load data. For more information, see Data Integration (https://docs.oracle.com/iaas/data-integration/home.htm).
//
package dataintegration
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// Reference Reference contains application configuration information.
type Reference struct {
// The reference's key, key of the object that is being used by a published object or its dependents.
Key *string `mandatory:"false" json:"key"`
// The name of reference object.
Name *string `mandatory:"false" json:"name"`
// The identifier of reference object.
Identifier *string `mandatory:"false" json:"identifier"`
// The identifier path of reference object.
IdentifierPath *string `mandatory:"false" json:"identifierPath"`
// The description of reference object.
Description *string `mandatory:"false" json:"description"`
// The type of reference object.
Type ReferenceTypeEnum `mandatory:"false" json:"type,omitempty"`
// The new reference object to use instead of the original reference. For example, this can be a data asset reference.
TargetObject *interface{} `mandatory:"false" json:"targetObject"`
// The application key of the reference object.
ApplicationKey *string `mandatory:"false" json:"applicationKey"`
// List of published objects where this is used.
UsedBy []ReferenceUsedBy `mandatory:"false" json:"usedBy"`
// List of references that are dependent on this reference.
ChildReferences []ChildReference `mandatory:"false" json:"childReferences"`
}
func (m Reference) 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 Reference) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingReferenceTypeEnum(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(GetReferenceTypeEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// ReferenceTypeEnum Enum with underlying type: string
type ReferenceTypeEnum string
// Set of constants representing the allowable values for ReferenceTypeEnum
const (
ReferenceTypeOracleDataAsset ReferenceTypeEnum = "ORACLE_DATA_ASSET"
ReferenceTypeOracleObjectStorageDataAsset ReferenceTypeEnum = "ORACLE_OBJECT_STORAGE_DATA_ASSET"
ReferenceTypeOracleAtpDataAsset ReferenceTypeEnum = "ORACLE_ATP_DATA_ASSET"
ReferenceTypeOracleAdwcDataAsset ReferenceTypeEnum = "ORACLE_ADWC_DATA_ASSET"
ReferenceTypeMysqlDataAsset ReferenceTypeEnum = "MYSQL_DATA_ASSET"
ReferenceTypeGenericJdbcDataAsset ReferenceTypeEnum = "GENERIC_JDBC_DATA_ASSET"
ReferenceTypeFusionAppDataAsset ReferenceTypeEnum = "FUSION_APP_DATA_ASSET"
ReferenceTypeAmazonS3DataAsset ReferenceTypeEnum = "AMAZON_S3_DATA_ASSET"
ReferenceTypeSchema ReferenceTypeEnum = "SCHEMA"
ReferenceTypeIntegrationTask ReferenceTypeEnum = "INTEGRATION_TASK"
ReferenceTypeDataLoaderTask ReferenceTypeEnum = "DATA_LOADER_TASK"
ReferenceTypeSqlTask ReferenceTypeEnum = "SQL_TASK"
ReferenceTypeOciDataflowTask ReferenceTypeEnum = "OCI_DATAFLOW_TASK"
ReferenceTypePipelineTask ReferenceTypeEnum = "PIPELINE_TASK"
ReferenceTypeRestTask ReferenceTypeEnum = "REST_TASK"
)
var mappingReferenceTypeEnum = map[string]ReferenceTypeEnum{
"ORACLE_DATA_ASSET": ReferenceTypeOracleDataAsset,
"ORACLE_OBJECT_STORAGE_DATA_ASSET": ReferenceTypeOracleObjectStorageDataAsset,
"ORACLE_ATP_DATA_ASSET": ReferenceTypeOracleAtpDataAsset,
"ORACLE_ADWC_DATA_ASSET": ReferenceTypeOracleAdwcDataAsset,
"MYSQL_DATA_ASSET": ReferenceTypeMysqlDataAsset,
"GENERIC_JDBC_DATA_ASSET": ReferenceTypeGenericJdbcDataAsset,
"FUSION_APP_DATA_ASSET": ReferenceTypeFusionAppDataAsset,
"AMAZON_S3_DATA_ASSET": ReferenceTypeAmazonS3DataAsset,
"SCHEMA": ReferenceTypeSchema,
"INTEGRATION_TASK": ReferenceTypeIntegrationTask,
"DATA_LOADER_TASK": ReferenceTypeDataLoaderTask,
"SQL_TASK": ReferenceTypeSqlTask,
"OCI_DATAFLOW_TASK": ReferenceTypeOciDataflowTask,
"PIPELINE_TASK": ReferenceTypePipelineTask,
"REST_TASK": ReferenceTypeRestTask,
}
var mappingReferenceTypeEnumLowerCase = map[string]ReferenceTypeEnum{
"oracle_data_asset": ReferenceTypeOracleDataAsset,
"oracle_object_storage_data_asset": ReferenceTypeOracleObjectStorageDataAsset,
"oracle_atp_data_asset": ReferenceTypeOracleAtpDataAsset,
"oracle_adwc_data_asset": ReferenceTypeOracleAdwcDataAsset,
"mysql_data_asset": ReferenceTypeMysqlDataAsset,
"generic_jdbc_data_asset": ReferenceTypeGenericJdbcDataAsset,
"fusion_app_data_asset": ReferenceTypeFusionAppDataAsset,
"amazon_s3_data_asset": ReferenceTypeAmazonS3DataAsset,
"schema": ReferenceTypeSchema,
"integration_task": ReferenceTypeIntegrationTask,
"data_loader_task": ReferenceTypeDataLoaderTask,
"sql_task": ReferenceTypeSqlTask,
"oci_dataflow_task": ReferenceTypeOciDataflowTask,
"pipeline_task": ReferenceTypePipelineTask,
"rest_task": ReferenceTypeRestTask,
}
// GetReferenceTypeEnumValues Enumerates the set of values for ReferenceTypeEnum
func GetReferenceTypeEnumValues() []ReferenceTypeEnum {
values := make([]ReferenceTypeEnum, 0)
for _, v := range mappingReferenceTypeEnum {
values = append(values, v)
}
return values
}
// GetReferenceTypeEnumStringValues Enumerates the set of values in String for ReferenceTypeEnum
func GetReferenceTypeEnumStringValues() []string {
return []string{
"ORACLE_DATA_ASSET",
"ORACLE_OBJECT_STORAGE_DATA_ASSET",
"ORACLE_ATP_DATA_ASSET",
"ORACLE_ADWC_DATA_ASSET",
"MYSQL_DATA_ASSET",
"GENERIC_JDBC_DATA_ASSET",
"FUSION_APP_DATA_ASSET",
"AMAZON_S3_DATA_ASSET",
"SCHEMA",
"INTEGRATION_TASK",
"DATA_LOADER_TASK",
"SQL_TASK",
"OCI_DATAFLOW_TASK",
"PIPELINE_TASK",
"REST_TASK",
}
}
// GetMappingReferenceTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingReferenceTypeEnum(val string) (ReferenceTypeEnum, bool) {
enum, ok := mappingReferenceTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}