2 Copyright 2017 The Kubernetes Authors.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
19 import "k8s.io/apimachinery/pkg/runtime"
21 // TODO: Update this after a tag is created for interface fields in DeepCopy
22 func (in *JSONSchemaProps) DeepCopy() *JSONSchemaProps {
26 out := new(JSONSchemaProps)
30 if in.Default != nil {
31 defaultJSON := JSON(runtime.DeepCopyJSONValue(*(in.Default)))
32 out.Default = &(defaultJSON)
37 if in.Example != nil {
38 exampleJSON := JSON(runtime.DeepCopyJSONValue(*(in.Example)))
39 out.Example = &(exampleJSON)
45 in, out := &in.Ref, &out.Ref
54 if in.Maximum != nil {
55 in, out := &in.Maximum, &out.Maximum
64 if in.Minimum != nil {
65 in, out := &in.Minimum, &out.Minimum
74 if in.MaxLength != nil {
75 in, out := &in.MaxLength, &out.MaxLength
84 if in.MinLength != nil {
85 in, out := &in.MinLength, &out.MinLength
93 if in.MaxItems != nil {
94 in, out := &in.MaxItems, &out.MaxItems
103 if in.MinItems != nil {
104 in, out := &in.MinItems, &out.MinItems
113 if in.MultipleOf != nil {
114 in, out := &in.MultipleOf, &out.MultipleOf
124 out.Enum = make([]JSON, len(in.Enum))
125 for i := range in.Enum {
126 out.Enum[i] = runtime.DeepCopyJSONValue(in.Enum[i])
130 if in.MaxProperties != nil {
131 in, out := &in.MaxProperties, &out.MaxProperties
140 if in.MinProperties != nil {
141 in, out := &in.MinProperties, &out.MinProperties
150 if in.Required != nil {
151 in, out := &in.Required, &out.Required
152 *out = make([]string, len(*in))
157 in, out := &in.Items, &out.Items
161 *out = new(JSONSchemaPropsOrArray)
162 (*in).DeepCopyInto(*out)
167 in, out := &in.AllOf, &out.AllOf
168 *out = make([]JSONSchemaProps, len(*in))
170 (*in)[i].DeepCopyInto(&(*out)[i])
175 in, out := &in.OneOf, &out.OneOf
176 *out = make([]JSONSchemaProps, len(*in))
178 (*in)[i].DeepCopyInto(&(*out)[i])
182 in, out := &in.AnyOf, &out.AnyOf
183 *out = make([]JSONSchemaProps, len(*in))
185 (*in)[i].DeepCopyInto(&(*out)[i])
190 in, out := &in.Not, &out.Not
194 *out = new(JSONSchemaProps)
195 (*in).DeepCopyInto(*out)
199 if in.Properties != nil {
200 in, out := &in.Properties, &out.Properties
201 *out = make(map[string]JSONSchemaProps, len(*in))
202 for key, val := range *in {
203 (*out)[key] = *val.DeepCopy()
207 if in.AdditionalProperties != nil {
208 in, out := &in.AdditionalProperties, &out.AdditionalProperties
212 *out = new(JSONSchemaPropsOrBool)
213 (*in).DeepCopyInto(*out)
217 if in.PatternProperties != nil {
218 in, out := &in.PatternProperties, &out.PatternProperties
219 *out = make(map[string]JSONSchemaProps, len(*in))
220 for key, val := range *in {
221 (*out)[key] = *val.DeepCopy()
225 if in.Dependencies != nil {
226 in, out := &in.Dependencies, &out.Dependencies
227 *out = make(JSONSchemaDependencies, len(*in))
228 for key, val := range *in {
229 (*out)[key] = *val.DeepCopy()
233 if in.AdditionalItems != nil {
234 in, out := &in.AdditionalItems, &out.AdditionalItems
238 *out = new(JSONSchemaPropsOrBool)
239 (*in).DeepCopyInto(*out)
243 if in.Definitions != nil {
244 in, out := &in.Definitions, &out.Definitions
245 *out = make(JSONSchemaDefinitions, len(*in))
246 for key, val := range *in {
247 (*out)[key] = *val.DeepCopy()
251 if in.ExternalDocs != nil {
252 in, out := &in.ExternalDocs, &out.ExternalDocs
256 *out = new(ExternalDocumentation)
257 (*in).DeepCopyInto(*out)