Code refactoring for bpa operator
[icn.git] / cmd / bpa-operator / vendor / k8s.io / apiextensions-apiserver / pkg / apis / apiextensions / types_jsonschema.go
1 /*
2 Copyright 2017 The Kubernetes Authors.
3
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
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
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.
15 */
16
17 package apiextensions
18
19 // JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/).
20 type JSONSchemaProps struct {
21         ID                   string
22         Schema               JSONSchemaURL
23         Ref                  *string
24         Description          string
25         Type                 string
26         Format               string
27         Title                string
28         Default              *JSON
29         Maximum              *float64
30         ExclusiveMaximum     bool
31         Minimum              *float64
32         ExclusiveMinimum     bool
33         MaxLength            *int64
34         MinLength            *int64
35         Pattern              string
36         MaxItems             *int64
37         MinItems             *int64
38         UniqueItems          bool
39         MultipleOf           *float64
40         Enum                 []JSON
41         MaxProperties        *int64
42         MinProperties        *int64
43         Required             []string
44         Items                *JSONSchemaPropsOrArray
45         AllOf                []JSONSchemaProps
46         OneOf                []JSONSchemaProps
47         AnyOf                []JSONSchemaProps
48         Not                  *JSONSchemaProps
49         Properties           map[string]JSONSchemaProps
50         AdditionalProperties *JSONSchemaPropsOrBool
51         PatternProperties    map[string]JSONSchemaProps
52         Dependencies         JSONSchemaDependencies
53         AdditionalItems      *JSONSchemaPropsOrBool
54         Definitions          JSONSchemaDefinitions
55         ExternalDocs         *ExternalDocumentation
56         Example              *JSON
57 }
58
59 // JSON represents any valid JSON value.
60 // These types are supported: bool, int64, float64, string, []interface{}, map[string]interface{} and nil.
61 type JSON interface{}
62
63 // JSONSchemaURL represents a schema url.
64 type JSONSchemaURL string
65
66 // JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps
67 // or an array of JSONSchemaProps. Mainly here for serialization purposes.
68 type JSONSchemaPropsOrArray struct {
69         Schema      *JSONSchemaProps
70         JSONSchemas []JSONSchemaProps
71 }
72
73 // JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value.
74 // Defaults to true for the boolean property.
75 type JSONSchemaPropsOrBool struct {
76         Allows bool
77         Schema *JSONSchemaProps
78 }
79
80 // JSONSchemaDependencies represent a dependencies property.
81 type JSONSchemaDependencies map[string]JSONSchemaPropsOrStringArray
82
83 // JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array.
84 type JSONSchemaPropsOrStringArray struct {
85         Schema   *JSONSchemaProps
86         Property []string
87 }
88
89 // JSONSchemaDefinitions contains the models explicitly defined in this spec.
90 type JSONSchemaDefinitions map[string]JSONSchemaProps
91
92 // ExternalDocumentation allows referencing an external resource for extended documentation.
93 type ExternalDocumentation struct {
94         Description string
95         URL         string
96 }