...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package silence
18
19
20
21
22 import (
23 "net/http"
24
25 "github.com/go-openapi/runtime"
26 )
27
28
29 const PostSilencesOKCode int = 200
30
31
36 type PostSilencesOK struct {
37
38
41 Payload *PostSilencesOKBody `json:"body,omitempty"`
42 }
43
44
45 func NewPostSilencesOK() *PostSilencesOK {
46
47 return &PostSilencesOK{}
48 }
49
50
51 func (o *PostSilencesOK) WithPayload(payload *PostSilencesOKBody) *PostSilencesOK {
52 o.Payload = payload
53 return o
54 }
55
56
57 func (o *PostSilencesOK) SetPayload(payload *PostSilencesOKBody) {
58 o.Payload = payload
59 }
60
61
62 func (o *PostSilencesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
63
64 rw.WriteHeader(200)
65 if o.Payload != nil {
66 payload := o.Payload
67 if err := producer.Produce(rw, payload); err != nil {
68 panic(err)
69 }
70 }
71 }
72
73
74 const PostSilencesBadRequestCode int = 400
75
76
81 type PostSilencesBadRequest struct {
82
83
86 Payload string `json:"body,omitempty"`
87 }
88
89
90 func NewPostSilencesBadRequest() *PostSilencesBadRequest {
91
92 return &PostSilencesBadRequest{}
93 }
94
95
96 func (o *PostSilencesBadRequest) WithPayload(payload string) *PostSilencesBadRequest {
97 o.Payload = payload
98 return o
99 }
100
101
102 func (o *PostSilencesBadRequest) SetPayload(payload string) {
103 o.Payload = payload
104 }
105
106
107 func (o *PostSilencesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
108
109 rw.WriteHeader(400)
110 payload := o.Payload
111 if err := producer.Produce(rw, payload); err != nil {
112 panic(err)
113 }
114 }
115
116
117 const PostSilencesNotFoundCode int = 404
118
119
124 type PostSilencesNotFound struct {
125
126
129 Payload string `json:"body,omitempty"`
130 }
131
132
133 func NewPostSilencesNotFound() *PostSilencesNotFound {
134
135 return &PostSilencesNotFound{}
136 }
137
138
139 func (o *PostSilencesNotFound) WithPayload(payload string) *PostSilencesNotFound {
140 o.Payload = payload
141 return o
142 }
143
144
145 func (o *PostSilencesNotFound) SetPayload(payload string) {
146 o.Payload = payload
147 }
148
149
150 func (o *PostSilencesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
151
152 rw.WriteHeader(404)
153 payload := o.Payload
154 if err := producer.Produce(rw, payload); err != nil {
155 panic(err)
156 }
157 }
158
View as plain text