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// Shape The shape object.
18type Shape 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
42//GetKey returns Key
43func (m Shape) GetKey() *string {
44	return m.Key
45}
46
47//GetModelVersion returns ModelVersion
48func (m Shape) GetModelVersion() *string {
49	return m.ModelVersion
50}
51
52//GetParentRef returns ParentRef
53func (m Shape) GetParentRef() *ParentReference {
54	return m.ParentRef
55}
56
57//GetConfigValues returns ConfigValues
58func (m Shape) GetConfigValues() *ConfigValues {
59	return m.ConfigValues
60}
61
62//GetObjectStatus returns ObjectStatus
63func (m Shape) GetObjectStatus() *int {
64	return m.ObjectStatus
65}
66
67//GetName returns Name
68func (m Shape) GetName() *string {
69	return m.Name
70}
71
72//GetDescription returns Description
73func (m Shape) GetDescription() *string {
74	return m.Description
75}
76
77func (m Shape) String() string {
78	return common.PointerString(m)
79}
80
81// MarshalJSON marshals to json representation
82func (m Shape) MarshalJSON() (buff []byte, e error) {
83	type MarshalTypeShape Shape
84	s := struct {
85		DiscriminatorParam string `json:"modelType"`
86		MarshalTypeShape
87	}{
88		"SHAPE",
89		(MarshalTypeShape)(m),
90	}
91
92	return json.Marshal(&s)
93}
94
95// UnmarshalJSON unmarshals from json
96func (m *Shape) UnmarshalJSON(data []byte) (e error) {
97	model := struct {
98		Key          *string          `json:"key"`
99		ModelVersion *string          `json:"modelVersion"`
100		ParentRef    *ParentReference `json:"parentRef"`
101		ConfigValues *ConfigValues    `json:"configValues"`
102		ObjectStatus *int             `json:"objectStatus"`
103		Name         *string          `json:"name"`
104		Description  *string          `json:"description"`
105		Type         basetype         `json:"type"`
106	}{}
107
108	e = json.Unmarshal(data, &model)
109	if e != nil {
110		return
111	}
112	var nn interface{}
113	m.Key = model.Key
114
115	m.ModelVersion = model.ModelVersion
116
117	m.ParentRef = model.ParentRef
118
119	m.ConfigValues = model.ConfigValues
120
121	m.ObjectStatus = model.ObjectStatus
122
123	m.Name = model.Name
124
125	m.Description = model.Description
126
127	nn, e = model.Type.UnmarshalPolymorphicJSON(model.Type.JsonData)
128	if e != nil {
129		return
130	}
131	if nn != nil {
132		m.Type = nn.(BaseType)
133	} else {
134		m.Type = nil
135	}
136
137	return
138}
139