...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package alert
18
19
20
21
22 import (
23 "net/http"
24
25 "github.com/go-openapi/runtime"
26
27 "github.com/prometheus/alertmanager/api/v2/models"
28 )
29
30
31 const GetAlertsOKCode int = 200
32
33
38 type GetAlertsOK struct {
39
40
43 Payload models.GettableAlerts `json:"body,omitempty"`
44 }
45
46
47 func NewGetAlertsOK() *GetAlertsOK {
48
49 return &GetAlertsOK{}
50 }
51
52
53 func (o *GetAlertsOK) WithPayload(payload models.GettableAlerts) *GetAlertsOK {
54 o.Payload = payload
55 return o
56 }
57
58
59 func (o *GetAlertsOK) SetPayload(payload models.GettableAlerts) {
60 o.Payload = payload
61 }
62
63
64 func (o *GetAlertsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
65
66 rw.WriteHeader(200)
67 payload := o.Payload
68 if payload == nil {
69
70 payload = models.GettableAlerts{}
71 }
72
73 if err := producer.Produce(rw, payload); err != nil {
74 panic(err)
75 }
76 }
77
78
79 const GetAlertsBadRequestCode int = 400
80
81
86 type GetAlertsBadRequest struct {
87
88
91 Payload string `json:"body,omitempty"`
92 }
93
94
95 func NewGetAlertsBadRequest() *GetAlertsBadRequest {
96
97 return &GetAlertsBadRequest{}
98 }
99
100
101 func (o *GetAlertsBadRequest) WithPayload(payload string) *GetAlertsBadRequest {
102 o.Payload = payload
103 return o
104 }
105
106
107 func (o *GetAlertsBadRequest) SetPayload(payload string) {
108 o.Payload = payload
109 }
110
111
112 func (o *GetAlertsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
113
114 rw.WriteHeader(400)
115 payload := o.Payload
116 if err := producer.Produce(rw, payload); err != nil {
117 panic(err)
118 }
119 }
120
121
122 const GetAlertsInternalServerErrorCode int = 500
123
124
129 type GetAlertsInternalServerError struct {
130
131
134 Payload string `json:"body,omitempty"`
135 }
136
137
138 func NewGetAlertsInternalServerError() *GetAlertsInternalServerError {
139
140 return &GetAlertsInternalServerError{}
141 }
142
143
144 func (o *GetAlertsInternalServerError) WithPayload(payload string) *GetAlertsInternalServerError {
145 o.Payload = payload
146 return o
147 }
148
149
150 func (o *GetAlertsInternalServerError) SetPayload(payload string) {
151 o.Payload = payload
152 }
153
154
155 func (o *GetAlertsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
156
157 rw.WriteHeader(500)
158 payload := o.Payload
159 if err := producer.Produce(rw, payload); err != nil {
160 panic(err)
161 }
162 }
163
View as plain text