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// Parameter Parameters are created and assigned values that can be deferred to execution/runtime.
18type Parameter 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	// The default value of the parameter.
42	DefaultValue *interface{} `mandatory:"false" json:"defaultValue"`
43
44	// The default value of the parameter which can be an object in DIS, such as a data entity.
45	RootObjectDefaultValue *interface{} `mandatory:"false" json:"rootObjectDefaultValue"`
46
47	// Whether the parameter is input value.
48	IsInput *bool `mandatory:"false" json:"isInput"`
49
50	// Whether the parameter is output value.
51	IsOutput *bool `mandatory:"false" json:"isOutput"`
52
53	// The name of the object type.
54	TypeName *string `mandatory:"false" json:"typeName"`
55
56	// The output aggregation type
57	OutputAggregationType ParameterOutputAggregationTypeEnum `mandatory:"false" json:"outputAggregationType,omitempty"`
58}
59
60//GetKey returns Key
61func (m Parameter) GetKey() *string {
62	return m.Key
63}
64
65//GetModelVersion returns ModelVersion
66func (m Parameter) GetModelVersion() *string {
67	return m.ModelVersion
68}
69
70//GetParentRef returns ParentRef
71func (m Parameter) GetParentRef() *ParentReference {
72	return m.ParentRef
73}
74
75//GetConfigValues returns ConfigValues
76func (m Parameter) GetConfigValues() *ConfigValues {
77	return m.ConfigValues
78}
79
80//GetObjectStatus returns ObjectStatus
81func (m Parameter) GetObjectStatus() *int {
82	return m.ObjectStatus
83}
84
85//GetName returns Name
86func (m Parameter) GetName() *string {
87	return m.Name
88}
89
90//GetDescription returns Description
91func (m Parameter) GetDescription() *string {
92	return m.Description
93}
94
95func (m Parameter) String() string {
96	return common.PointerString(m)
97}
98
99// MarshalJSON marshals to json representation
100func (m Parameter) MarshalJSON() (buff []byte, e error) {
101	type MarshalTypeParameter Parameter
102	s := struct {
103		DiscriminatorParam string `json:"modelType"`
104		MarshalTypeParameter
105	}{
106		"PARAMETER",
107		(MarshalTypeParameter)(m),
108	}
109
110	return json.Marshal(&s)
111}
112
113// UnmarshalJSON unmarshals from json
114func (m *Parameter) UnmarshalJSON(data []byte) (e error) {
115	model := struct {
116		Key                    *string                            `json:"key"`
117		ModelVersion           *string                            `json:"modelVersion"`
118		ParentRef              *ParentReference                   `json:"parentRef"`
119		ConfigValues           *ConfigValues                      `json:"configValues"`
120		ObjectStatus           *int                               `json:"objectStatus"`
121		Name                   *string                            `json:"name"`
122		Description            *string                            `json:"description"`
123		Type                   basetype                           `json:"type"`
124		DefaultValue           *interface{}                       `json:"defaultValue"`
125		RootObjectDefaultValue *interface{}                       `json:"rootObjectDefaultValue"`
126		IsInput                *bool                              `json:"isInput"`
127		IsOutput               *bool                              `json:"isOutput"`
128		OutputAggregationType  ParameterOutputAggregationTypeEnum `json:"outputAggregationType"`
129		TypeName               *string                            `json:"typeName"`
130	}{}
131
132	e = json.Unmarshal(data, &model)
133	if e != nil {
134		return
135	}
136	var nn interface{}
137	m.Key = model.Key
138
139	m.ModelVersion = model.ModelVersion
140
141	m.ParentRef = model.ParentRef
142
143	m.ConfigValues = model.ConfigValues
144
145	m.ObjectStatus = model.ObjectStatus
146
147	m.Name = model.Name
148
149	m.Description = model.Description
150
151	nn, e = model.Type.UnmarshalPolymorphicJSON(model.Type.JsonData)
152	if e != nil {
153		return
154	}
155	if nn != nil {
156		m.Type = nn.(BaseType)
157	} else {
158		m.Type = nil
159	}
160
161	m.DefaultValue = model.DefaultValue
162
163	m.RootObjectDefaultValue = model.RootObjectDefaultValue
164
165	m.IsInput = model.IsInput
166
167	m.IsOutput = model.IsOutput
168
169	m.OutputAggregationType = model.OutputAggregationType
170
171	m.TypeName = model.TypeName
172
173	return
174}
175
176// ParameterOutputAggregationTypeEnum Enum with underlying type: string
177type ParameterOutputAggregationTypeEnum string
178
179// Set of constants representing the allowable values for ParameterOutputAggregationTypeEnum
180const (
181	ParameterOutputAggregationTypeMin   ParameterOutputAggregationTypeEnum = "MIN"
182	ParameterOutputAggregationTypeMax   ParameterOutputAggregationTypeEnum = "MAX"
183	ParameterOutputAggregationTypeCount ParameterOutputAggregationTypeEnum = "COUNT"
184	ParameterOutputAggregationTypeSum   ParameterOutputAggregationTypeEnum = "SUM"
185)
186
187var mappingParameterOutputAggregationType = map[string]ParameterOutputAggregationTypeEnum{
188	"MIN":   ParameterOutputAggregationTypeMin,
189	"MAX":   ParameterOutputAggregationTypeMax,
190	"COUNT": ParameterOutputAggregationTypeCount,
191	"SUM":   ParameterOutputAggregationTypeSum,
192}
193
194// GetParameterOutputAggregationTypeEnumValues Enumerates the set of values for ParameterOutputAggregationTypeEnum
195func GetParameterOutputAggregationTypeEnumValues() []ParameterOutputAggregationTypeEnum {
196	values := make([]ParameterOutputAggregationTypeEnum, 0)
197	for _, v := range mappingParameterOutputAggregationType {
198		values = append(values, v)
199	}
200	return values
201}
202