1// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates.  All rights reserved.
2// 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.
3// Code generated. DO NOT EDIT.
4
5// Data Integration API
6//
7// Use the Data Integration Service APIs to perform common extract, load, and transform (ETL) tasks.
8//
9
10package dataintegration
11
12import (
13	"encoding/json"
14	"github.com/oracle/oci-go-sdk/common"
15)
16
17// ConfiguredType A ConfiguraedType represents a type that has built-in configuration to the type itself. An example is a SSN type whose basic type is VARCHAR, but the type itself also has a built-in configuration like length=10
18type ConfiguredType struct {
19
20	// The key of the object.
21	Key *string `mandatory:"false" json:"key"`
22
23	// The model version of an object.
24	ModelVersion *string `mandatory:"false" json:"modelVersion"`
25
26	ParentRef *ParentReference `mandatory:"false" json:"parentRef"`
27
28	// Free form text without any restriction on permitted characters. Name can have letters, numbers, and special characters. The value can be edited by the user and it is restricted to 1000 characters
29	Name *string `mandatory:"false" json:"name"`
30
31	// The status of an object that can be set to value 1 for shallow references across objects, other values reserved.
32	ObjectStatus *int `mandatory:"false" json:"objectStatus"`
33
34	// Detailed description for the object.
35	Description *string `mandatory:"false" json:"description"`
36
37	WrappedType BaseType `mandatory:"false" json:"wrappedType"`
38
39	ConfigValues *ConfigValues `mandatory:"false" json:"configValues"`
40
41	ConfigDefinition *ConfigDefinition `mandatory:"false" json:"configDefinition"`
42}
43
44//GetKey returns Key
45func (m ConfiguredType) GetKey() *string {
46	return m.Key
47}
48
49//GetModelVersion returns ModelVersion
50func (m ConfiguredType) GetModelVersion() *string {
51	return m.ModelVersion
52}
53
54//GetParentRef returns ParentRef
55func (m ConfiguredType) GetParentRef() *ParentReference {
56	return m.ParentRef
57}
58
59//GetName returns Name
60func (m ConfiguredType) GetName() *string {
61	return m.Name
62}
63
64//GetObjectStatus returns ObjectStatus
65func (m ConfiguredType) GetObjectStatus() *int {
66	return m.ObjectStatus
67}
68
69//GetDescription returns Description
70func (m ConfiguredType) GetDescription() *string {
71	return m.Description
72}
73
74func (m ConfiguredType) String() string {
75	return common.PointerString(m)
76}
77
78// MarshalJSON marshals to json representation
79func (m ConfiguredType) MarshalJSON() (buff []byte, e error) {
80	type MarshalTypeConfiguredType ConfiguredType
81	s := struct {
82		DiscriminatorParam string `json:"modelType"`
83		MarshalTypeConfiguredType
84	}{
85		"CONFIGURED_TYPE",
86		(MarshalTypeConfiguredType)(m),
87	}
88
89	return json.Marshal(&s)
90}
91
92// UnmarshalJSON unmarshals from json
93func (m *ConfiguredType) UnmarshalJSON(data []byte) (e error) {
94	model := struct {
95		Key              *string           `json:"key"`
96		ModelVersion     *string           `json:"modelVersion"`
97		ParentRef        *ParentReference  `json:"parentRef"`
98		Name             *string           `json:"name"`
99		ObjectStatus     *int              `json:"objectStatus"`
100		Description      *string           `json:"description"`
101		WrappedType      basetype          `json:"wrappedType"`
102		ConfigValues     *ConfigValues     `json:"configValues"`
103		ConfigDefinition *ConfigDefinition `json:"configDefinition"`
104	}{}
105
106	e = json.Unmarshal(data, &model)
107	if e != nil {
108		return
109	}
110	var nn interface{}
111	m.Key = model.Key
112
113	m.ModelVersion = model.ModelVersion
114
115	m.ParentRef = model.ParentRef
116
117	m.Name = model.Name
118
119	m.ObjectStatus = model.ObjectStatus
120
121	m.Description = model.Description
122
123	nn, e = model.WrappedType.UnmarshalPolymorphicJSON(model.WrappedType.JsonData)
124	if e != nil {
125		return
126	}
127	if nn != nil {
128		m.WrappedType = nn.(BaseType)
129	} else {
130		m.WrappedType = nil
131	}
132
133	m.ConfigValues = model.ConfigValues
134
135	m.ConfigDefinition = model.ConfigDefinition
136
137	return
138}
139