-
Notifications
You must be signed in to change notification settings - Fork 80
/
data_asset.go
240 lines (199 loc) · 7.68 KB
/
data_asset.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
// Copyright (c) 2016, 2018, 2021, 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 Service APIs to perform common extract, load, and transform (ETL) tasks.
//
package dataintegration
import (
"encoding/json"
"github.com/oracle/oci-go-sdk/v41/common"
)
// DataAsset Represents a data source in the Data Integration service.
type DataAsset interface {
// Generated key that can be used in API calls to identify data asset.
GetKey() *string
// The model version of an object.
GetModelVersion() *string
// Free form text without any restriction on permitted characters. Name can have letters, numbers, and special characters. The value is editable and is restricted to 1000 characters.
GetName() *string
// User-defined description of the data asset.
GetDescription() *string
// The status of an object that can be set to value 1 for shallow references across objects, other values reserved.
GetObjectStatus() *int
// Value can only contain upper case letters, underscore, and numbers. It should begin with upper case letter or underscore. The value can be modified.
GetIdentifier() *string
// The external key for the object.
GetExternalKey() *string
// Additional properties for the data asset.
GetAssetProperties() map[string]string
GetNativeTypeSystem() *TypeSystem
// The version of the object that is used to track changes in the object instance.
GetObjectVersion() *int
GetParentRef() *ParentReference
GetMetadata() *ObjectMetadata
// A key map. If provided, key is replaced with generated key. This structure provides mapping between user provided key and generated key.
GetKeyMap() map[string]string
}
type dataasset struct {
JsonData []byte
Key *string `mandatory:"false" json:"key"`
ModelVersion *string `mandatory:"false" json:"modelVersion"`
Name *string `mandatory:"false" json:"name"`
Description *string `mandatory:"false" json:"description"`
ObjectStatus *int `mandatory:"false" json:"objectStatus"`
Identifier *string `mandatory:"false" json:"identifier"`
ExternalKey *string `mandatory:"false" json:"externalKey"`
AssetProperties map[string]string `mandatory:"false" json:"assetProperties"`
NativeTypeSystem *TypeSystem `mandatory:"false" json:"nativeTypeSystem"`
ObjectVersion *int `mandatory:"false" json:"objectVersion"`
ParentRef *ParentReference `mandatory:"false" json:"parentRef"`
Metadata *ObjectMetadata `mandatory:"false" json:"metadata"`
KeyMap map[string]string `mandatory:"false" json:"keyMap"`
ModelType string `json:"modelType"`
}
// UnmarshalJSON unmarshals json
func (m *dataasset) UnmarshalJSON(data []byte) error {
m.JsonData = data
type Unmarshalerdataasset dataasset
s := struct {
Model Unmarshalerdataasset
}{}
err := json.Unmarshal(data, &s.Model)
if err != nil {
return err
}
m.Key = s.Model.Key
m.ModelVersion = s.Model.ModelVersion
m.Name = s.Model.Name
m.Description = s.Model.Description
m.ObjectStatus = s.Model.ObjectStatus
m.Identifier = s.Model.Identifier
m.ExternalKey = s.Model.ExternalKey
m.AssetProperties = s.Model.AssetProperties
m.NativeTypeSystem = s.Model.NativeTypeSystem
m.ObjectVersion = s.Model.ObjectVersion
m.ParentRef = s.Model.ParentRef
m.Metadata = s.Model.Metadata
m.KeyMap = s.Model.KeyMap
m.ModelType = s.Model.ModelType
return err
}
// UnmarshalPolymorphicJSON unmarshals polymorphic json
func (m *dataasset) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) {
if data == nil || string(data) == "null" {
return nil, nil
}
var err error
switch m.ModelType {
case "GENERIC_JDBC_DATA_ASSET":
mm := DataAssetFromJdbc{}
err = json.Unmarshal(data, &mm)
return mm, err
case "ORACLE_DATA_ASSET":
mm := DataAssetFromOracleDetails{}
err = json.Unmarshal(data, &mm)
return mm, err
case "ORACLE_ADWC_DATA_ASSET":
mm := DataAssetFromAdwcDetails{}
err = json.Unmarshal(data, &mm)
return mm, err
case "ORACLE_OBJECT_STORAGE_DATA_ASSET":
mm := DataAssetFromObjectStorageDetails{}
err = json.Unmarshal(data, &mm)
return mm, err
case "ORACLE_ATP_DATA_ASSET":
mm := DataAssetFromAtpDetails{}
err = json.Unmarshal(data, &mm)
return mm, err
case "MYSQL_DATA_ASSET":
mm := DataAssetFromMySql{}
err = json.Unmarshal(data, &mm)
return mm, err
default:
return *m, nil
}
}
//GetKey returns Key
func (m dataasset) GetKey() *string {
return m.Key
}
//GetModelVersion returns ModelVersion
func (m dataasset) GetModelVersion() *string {
return m.ModelVersion
}
//GetName returns Name
func (m dataasset) GetName() *string {
return m.Name
}
//GetDescription returns Description
func (m dataasset) GetDescription() *string {
return m.Description
}
//GetObjectStatus returns ObjectStatus
func (m dataasset) GetObjectStatus() *int {
return m.ObjectStatus
}
//GetIdentifier returns Identifier
func (m dataasset) GetIdentifier() *string {
return m.Identifier
}
//GetExternalKey returns ExternalKey
func (m dataasset) GetExternalKey() *string {
return m.ExternalKey
}
//GetAssetProperties returns AssetProperties
func (m dataasset) GetAssetProperties() map[string]string {
return m.AssetProperties
}
//GetNativeTypeSystem returns NativeTypeSystem
func (m dataasset) GetNativeTypeSystem() *TypeSystem {
return m.NativeTypeSystem
}
//GetObjectVersion returns ObjectVersion
func (m dataasset) GetObjectVersion() *int {
return m.ObjectVersion
}
//GetParentRef returns ParentRef
func (m dataasset) GetParentRef() *ParentReference {
return m.ParentRef
}
//GetMetadata returns Metadata
func (m dataasset) GetMetadata() *ObjectMetadata {
return m.Metadata
}
//GetKeyMap returns KeyMap
func (m dataasset) GetKeyMap() map[string]string {
return m.KeyMap
}
func (m dataasset) String() string {
return common.PointerString(m)
}
// DataAssetModelTypeEnum Enum with underlying type: string
type DataAssetModelTypeEnum string
// Set of constants representing the allowable values for DataAssetModelTypeEnum
const (
DataAssetModelTypeOracleDataAsset DataAssetModelTypeEnum = "ORACLE_DATA_ASSET"
DataAssetModelTypeOracleObjectStorageDataAsset DataAssetModelTypeEnum = "ORACLE_OBJECT_STORAGE_DATA_ASSET"
DataAssetModelTypeOracleAtpDataAsset DataAssetModelTypeEnum = "ORACLE_ATP_DATA_ASSET"
DataAssetModelTypeOracleAdwcDataAsset DataAssetModelTypeEnum = "ORACLE_ADWC_DATA_ASSET"
DataAssetModelTypeMysqlDataAsset DataAssetModelTypeEnum = "MYSQL_DATA_ASSET"
DataAssetModelTypeGenericJdbcDataAsset DataAssetModelTypeEnum = "GENERIC_JDBC_DATA_ASSET"
)
var mappingDataAssetModelType = map[string]DataAssetModelTypeEnum{
"ORACLE_DATA_ASSET": DataAssetModelTypeOracleDataAsset,
"ORACLE_OBJECT_STORAGE_DATA_ASSET": DataAssetModelTypeOracleObjectStorageDataAsset,
"ORACLE_ATP_DATA_ASSET": DataAssetModelTypeOracleAtpDataAsset,
"ORACLE_ADWC_DATA_ASSET": DataAssetModelTypeOracleAdwcDataAsset,
"MYSQL_DATA_ASSET": DataAssetModelTypeMysqlDataAsset,
"GENERIC_JDBC_DATA_ASSET": DataAssetModelTypeGenericJdbcDataAsset,
}
// GetDataAssetModelTypeEnumValues Enumerates the set of values for DataAssetModelTypeEnum
func GetDataAssetModelTypeEnumValues() []DataAssetModelTypeEnum {
values := make([]DataAssetModelTypeEnum, 0)
for _, v := range mappingDataAssetModelType {
values = append(values, v)
}
return values
}