-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema_mutator_gen.go
256 lines (210 loc) · 6.08 KB
/
schema_mutator_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
package openapi
// This file was automatically generated.
// DO NOT EDIT MANUALLY. All changes will be lost
import "log"
var _ = log.Printf
// SchemaMutator is used to build an instance of Schema. The user must
// call `Do()` after providing all the necessary information to
// the new instance of Schema with new values
type SchemaMutator struct {
proxy *schema
target *schema
}
// Do finalizes the matuation process for Schema and returns the result
func (b *SchemaMutator) Do() error {
*b.target = *b.proxy
return nil
}
// MutateSchema creates a new mutator object for Schema
func MutateSchema(v Schema) *SchemaMutator {
return &SchemaMutator{
target: v.(*schema),
proxy: v.Clone().(*schema),
}
}
// Name sets the Name field for object Schema.
func (b *SchemaMutator) Name(v string) *SchemaMutator {
b.proxy.name = v
return b
}
// Title sets the Title field for object Schema.
func (b *SchemaMutator) Title(v string) *SchemaMutator {
b.proxy.title = v
return b
}
// MultipleOf sets the MultipleOf field for object Schema.
func (b *SchemaMutator) MultipleOf(v float64) *SchemaMutator {
b.proxy.multipleOf = v
return b
}
// Maximum sets the Maximum field for object Schema.
func (b *SchemaMutator) Maximum(v float64) *SchemaMutator {
b.proxy.maximum = v
return b
}
// ExclusiveMaximum sets the ExclusiveMaximum field for object Schema.
func (b *SchemaMutator) ExclusiveMaximum(v float64) *SchemaMutator {
b.proxy.exclusiveMaximum = v
return b
}
// Minimum sets the Minimum field for object Schema.
func (b *SchemaMutator) Minimum(v float64) *SchemaMutator {
b.proxy.minimum = v
return b
}
// ExclusiveMinimum sets the ExclusiveMinimum field for object Schema.
func (b *SchemaMutator) ExclusiveMinimum(v float64) *SchemaMutator {
b.proxy.exclusiveMinimum = v
return b
}
// MaxLength sets the MaxLength field for object Schema.
func (b *SchemaMutator) MaxLength(v int) *SchemaMutator {
b.proxy.maxLength = v
return b
}
// MinLength sets the MinLength field for object Schema.
func (b *SchemaMutator) MinLength(v int) *SchemaMutator {
b.proxy.minLength = v
return b
}
// Pattern sets the Pattern field for object Schema.
func (b *SchemaMutator) Pattern(v string) *SchemaMutator {
b.proxy.pattern = v
return b
}
// MaxItems sets the MaxItems field for object Schema.
func (b *SchemaMutator) MaxItems(v int) *SchemaMutator {
b.proxy.maxItems = v
return b
}
// MinItems sets the MinItems field for object Schema.
func (b *SchemaMutator) MinItems(v int) *SchemaMutator {
b.proxy.minItems = v
return b
}
// UniqueItems sets the UniqueItems field for object Schema.
func (b *SchemaMutator) UniqueItems(v bool) *SchemaMutator {
b.proxy.uniqueItems = v
return b
}
// MaxProperties sets the MaxProperties field for object Schema.
func (b *SchemaMutator) MaxProperties(v int) *SchemaMutator {
b.proxy.maxProperties = v
return b
}
// MinProperties sets the MinProperties field for object Schema.
func (b *SchemaMutator) MinProperties(v int) *SchemaMutator {
b.proxy.minProperties = v
return b
}
func (b *SchemaMutator) ClearRequired() *SchemaMutator {
b.proxy.required.Clear()
return b
}
func (b *SchemaMutator) Required(value string) *SchemaMutator {
b.proxy.required = append(b.proxy.required, value)
return b
}
func (b *SchemaMutator) ClearEnum() *SchemaMutator {
b.proxy.enum.Clear()
return b
}
func (b *SchemaMutator) Enum(value interface{}) *SchemaMutator {
b.proxy.enum = append(b.proxy.enum, value)
return b
}
// Type sets the Type field for object Schema.
func (b *SchemaMutator) Type(v PrimitiveType) *SchemaMutator {
b.proxy.typ = v
return b
}
func (b *SchemaMutator) ClearAllOf() *SchemaMutator {
b.proxy.allOf.Clear()
return b
}
func (b *SchemaMutator) AllOf(value Schema) *SchemaMutator {
b.proxy.allOf = append(b.proxy.allOf, value)
return b
}
func (b *SchemaMutator) ClearOneOf() *SchemaMutator {
b.proxy.oneOf.Clear()
return b
}
func (b *SchemaMutator) OneOf(value Schema) *SchemaMutator {
b.proxy.oneOf = append(b.proxy.oneOf, value)
return b
}
func (b *SchemaMutator) ClearAnyOf() *SchemaMutator {
b.proxy.anyOf.Clear()
return b
}
func (b *SchemaMutator) AnyOf(value Schema) *SchemaMutator {
b.proxy.anyOf = append(b.proxy.anyOf, value)
return b
}
// Not sets the Not field for object Schema.
func (b *SchemaMutator) Not(v Schema) *SchemaMutator {
b.proxy.not = v
return b
}
// Items sets the Items field for object Schema.
func (b *SchemaMutator) Items(v Schema) *SchemaMutator {
b.proxy.items = v
return b
}
func (b *SchemaMutator) ClearProperties() *SchemaMutator {
b.proxy.properties.Clear()
return b
}
func (b *SchemaMutator) Property(key SchemaMapKey, value Schema) *SchemaMutator {
if b.proxy.properties == nil {
b.proxy.properties = SchemaMap{}
}
b.proxy.properties[key] = value
return b
}
// Format sets the Format field for object Schema.
func (b *SchemaMutator) Format(v string) *SchemaMutator {
b.proxy.format = v
return b
}
// Default sets the Default field for object Schema.
func (b *SchemaMutator) Default(v interface{}) *SchemaMutator {
b.proxy.defaultValue = v
return b
}
// Nullable sets the Nullable field for object Schema.
func (b *SchemaMutator) Nullable(v bool) *SchemaMutator {
b.proxy.nullable = v
return b
}
// Discriminator sets the Discriminator field for object Schema.
func (b *SchemaMutator) Discriminator(v Discriminator) *SchemaMutator {
b.proxy.discriminator = v
return b
}
// ReadOnly sets the ReadOnly field for object Schema.
func (b *SchemaMutator) ReadOnly(v bool) *SchemaMutator {
b.proxy.readOnly = v
return b
}
// WriteOnly sets the WriteOnly field for object Schema.
func (b *SchemaMutator) WriteOnly(v bool) *SchemaMutator {
b.proxy.writeOnly = v
return b
}
// ExternalDocs sets the ExternalDocs field for object Schema.
func (b *SchemaMutator) ExternalDocs(v ExternalDocumentation) *SchemaMutator {
b.proxy.externalDocs = v
return b
}
// Example sets the Example field for object Schema.
func (b *SchemaMutator) Example(v interface{}) *SchemaMutator {
b.proxy.example = v
return b
}
// Deprecated sets the Deprecated field for object Schema.
func (b *SchemaMutator) Deprecated(v bool) *SchemaMutator {
b.proxy.deprecated = v
return b
}