-
Notifications
You must be signed in to change notification settings - Fork 2
/
media_type_mutator_gen.go
76 lines (61 loc) · 1.77 KB
/
media_type_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
package openapi
// This file was automatically generated.
// DO NOT EDIT MANUALLY. All changes will be lost
import "log"
var _ = log.Printf
// MediaTypeMutator is used to build an instance of MediaType. The user must
// call `Do()` after providing all the necessary information to
// the new instance of MediaType with new values
type MediaTypeMutator struct {
proxy *mediaType
target *mediaType
}
// Do finalizes the matuation process for MediaType and returns the result
func (b *MediaTypeMutator) Do() error {
*b.target = *b.proxy
return nil
}
// MutateMediaType creates a new mutator object for MediaType
func MutateMediaType(v MediaType) *MediaTypeMutator {
return &MediaTypeMutator{
target: v.(*mediaType),
proxy: v.Clone().(*mediaType),
}
}
// Name sets the Name field for object MediaType.
func (b *MediaTypeMutator) Name(v string) *MediaTypeMutator {
b.proxy.name = v
return b
}
// Mime sets the Mime field for object MediaType.
func (b *MediaTypeMutator) Mime(v string) *MediaTypeMutator {
b.proxy.mime = v
return b
}
// Schema sets the Schema field for object MediaType.
func (b *MediaTypeMutator) Schema(v Schema) *MediaTypeMutator {
b.proxy.schema = v
return b
}
func (b *MediaTypeMutator) ClearExamples() *MediaTypeMutator {
b.proxy.examples.Clear()
return b
}
func (b *MediaTypeMutator) Example(key ExampleMapKey, value Example) *MediaTypeMutator {
if b.proxy.examples == nil {
b.proxy.examples = ExampleMap{}
}
b.proxy.examples[key] = value
return b
}
func (b *MediaTypeMutator) ClearEncoding() *MediaTypeMutator {
b.proxy.encoding.Clear()
return b
}
func (b *MediaTypeMutator) Encoding(key EncodingMapKey, value Encoding) *MediaTypeMutator {
if b.proxy.encoding == nil {
b.proxy.encoding = EncodingMap{}
}
b.proxy.encoding[key] = value
return b
}