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// DynamicInputField The type representing the dynamic field concept. Dynamic fields have a dynamic type handler to define how to generate the field.
18type DynamicInputField 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	ConfigValues *ConfigValues `mandatory:"false" json:"configValues"`
29
30	// The status of an object that can be set to value 1 for shallow references across objects, other values reserved.
31	ObjectStatus *int `mandatory:"false" json:"objectStatus"`
32
33	// 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
34	Name *string `mandatory:"false" json:"name"`
35
36	// Detailed description for the object.
37	Description *string `mandatory:"false" json:"description"`
38
39	Type BaseType `mandatory:"false" json:"type"`
40
41	// Labels are keywords or labels that you can add to data assets, dataflows etc. You can define your own labels and use them to categorize content.
42	Labels []string `mandatory:"false" json:"labels"`
43}
44
45//GetKey returns Key
46func (m DynamicInputField) GetKey() *string {
47	return m.Key
48}
49
50//GetModelVersion returns ModelVersion
51func (m DynamicInputField) GetModelVersion() *string {
52	return m.ModelVersion
53}
54
55//GetParentRef returns ParentRef
56func (m DynamicInputField) GetParentRef() *ParentReference {
57	return m.ParentRef
58}
59
60//GetConfigValues returns ConfigValues
61func (m DynamicInputField) GetConfigValues() *ConfigValues {
62	return m.ConfigValues
63}
64
65//GetObjectStatus returns ObjectStatus
66func (m DynamicInputField) GetObjectStatus() *int {
67	return m.ObjectStatus
68}
69
70//GetName returns Name
71func (m DynamicInputField) GetName() *string {
72	return m.Name
73}
74
75//GetDescription returns Description
76func (m DynamicInputField) GetDescription() *string {
77	return m.Description
78}
79
80func (m DynamicInputField) String() string {
81	return common.PointerString(m)
82}
83
84// MarshalJSON marshals to json representation
85func (m DynamicInputField) MarshalJSON() (buff []byte, e error) {
86	type MarshalTypeDynamicInputField DynamicInputField
87	s := struct {
88		DiscriminatorParam string `json:"modelType"`
89		MarshalTypeDynamicInputField
90	}{
91		"DYNAMIC_INPUT_FIELD",
92		(MarshalTypeDynamicInputField)(m),
93	}
94
95	return json.Marshal(&s)
96}
97
98// UnmarshalJSON unmarshals from json
99func (m *DynamicInputField) UnmarshalJSON(data []byte) (e error) {
100	model := struct {
101		Key          *string          `json:"key"`
102		ModelVersion *string          `json:"modelVersion"`
103		ParentRef    *ParentReference `json:"parentRef"`
104		ConfigValues *ConfigValues    `json:"configValues"`
105		ObjectStatus *int             `json:"objectStatus"`
106		Name         *string          `json:"name"`
107		Description  *string          `json:"description"`
108		Type         basetype         `json:"type"`
109		Labels       []string         `json:"labels"`
110	}{}
111
112	e = json.Unmarshal(data, &model)
113	if e != nil {
114		return
115	}
116	var nn interface{}
117	m.Key = model.Key
118
119	m.ModelVersion = model.ModelVersion
120
121	m.ParentRef = model.ParentRef
122
123	m.ConfigValues = model.ConfigValues
124
125	m.ObjectStatus = model.ObjectStatus
126
127	m.Name = model.Name
128
129	m.Description = model.Description
130
131	nn, e = model.Type.UnmarshalPolymorphicJSON(model.Type.JsonData)
132	if e != nil {
133		return
134	}
135	if nn != nil {
136		m.Type = nn.(BaseType)
137	} else {
138		m.Type = nil
139	}
140
141	m.Labels = make([]string, len(model.Labels))
142	for i, n := range model.Labels {
143		m.Labels[i] = n
144	}
145
146	return
147}
148