-
Notifications
You must be signed in to change notification settings - Fork 2
/
response_mutator_gen.go
84 lines (67 loc) · 1.88 KB
/
response_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
package openapi
// This file was automatically generated.
// DO NOT EDIT MANUALLY. All changes will be lost
import "log"
var _ = log.Printf
// ResponseMutator is used to build an instance of Response. The user must
// call `Do()` after providing all the necessary information to
// the new instance of Response with new values
type ResponseMutator struct {
proxy *response
target *response
}
// Do finalizes the matuation process for Response and returns the result
func (b *ResponseMutator) Do() error {
*b.target = *b.proxy
return nil
}
// MutateResponse creates a new mutator object for Response
func MutateResponse(v Response) *ResponseMutator {
return &ResponseMutator{
target: v.(*response),
proxy: v.Clone().(*response),
}
}
// Name sets the Name field for object Response.
func (b *ResponseMutator) Name(v string) *ResponseMutator {
b.proxy.name = v
return b
}
// Description sets the Description field for object Response.
func (b *ResponseMutator) Description(v string) *ResponseMutator {
b.proxy.description = v
return b
}
func (b *ResponseMutator) ClearHeaders() *ResponseMutator {
b.proxy.headers.Clear()
return b
}
func (b *ResponseMutator) Header(key HeaderMapKey, value Header) *ResponseMutator {
if b.proxy.headers == nil {
b.proxy.headers = HeaderMap{}
}
b.proxy.headers[key] = value
return b
}
func (b *ResponseMutator) ClearContent() *ResponseMutator {
b.proxy.content.Clear()
return b
}
func (b *ResponseMutator) Content(key MediaTypeMapKey, value MediaType) *ResponseMutator {
if b.proxy.content == nil {
b.proxy.content = MediaTypeMap{}
}
b.proxy.content[key] = value
return b
}
func (b *ResponseMutator) ClearLinks() *ResponseMutator {
b.proxy.links.Clear()
return b
}
func (b *ResponseMutator) Link(key LinkMapKey, value Link) *ResponseMutator {
if b.proxy.links == nil {
b.proxy.links = LinkMap{}
}
b.proxy.links[key] = value
return b
}