...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package index
20
21
22
23
24 import (
25 "net/http"
26
27 "github.com/go-openapi/runtime"
28
29 "github.com/sigstore/rekor/pkg/generated/models"
30 )
31
32
33 const SearchIndexOKCode int = 200
34
35
40 type SearchIndexOK struct {
41
42
45 Payload []string `json:"body,omitempty"`
46 }
47
48
49 func NewSearchIndexOK() *SearchIndexOK {
50
51 return &SearchIndexOK{}
52 }
53
54
55 func (o *SearchIndexOK) WithPayload(payload []string) *SearchIndexOK {
56 o.Payload = payload
57 return o
58 }
59
60
61 func (o *SearchIndexOK) SetPayload(payload []string) {
62 o.Payload = payload
63 }
64
65
66 func (o *SearchIndexOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
67
68 rw.WriteHeader(200)
69 payload := o.Payload
70 if payload == nil {
71
72 payload = make([]string, 0, 50)
73 }
74
75 if err := producer.Produce(rw, payload); err != nil {
76 panic(err)
77 }
78 }
79
80
81 const SearchIndexBadRequestCode int = 400
82
83
88 type SearchIndexBadRequest struct {
89
90
93 Payload *models.Error `json:"body,omitempty"`
94 }
95
96
97 func NewSearchIndexBadRequest() *SearchIndexBadRequest {
98
99 return &SearchIndexBadRequest{}
100 }
101
102
103 func (o *SearchIndexBadRequest) WithPayload(payload *models.Error) *SearchIndexBadRequest {
104 o.Payload = payload
105 return o
106 }
107
108
109 func (o *SearchIndexBadRequest) SetPayload(payload *models.Error) {
110 o.Payload = payload
111 }
112
113
114 func (o *SearchIndexBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
115
116 rw.WriteHeader(400)
117 if o.Payload != nil {
118 payload := o.Payload
119 if err := producer.Produce(rw, payload); err != nil {
120 panic(err)
121 }
122 }
123 }
124
125
130 type SearchIndexDefault struct {
131 _statusCode int
132
133
136 Payload *models.Error `json:"body,omitempty"`
137 }
138
139
140 func NewSearchIndexDefault(code int) *SearchIndexDefault {
141 if code <= 0 {
142 code = 500
143 }
144
145 return &SearchIndexDefault{
146 _statusCode: code,
147 }
148 }
149
150
151 func (o *SearchIndexDefault) WithStatusCode(code int) *SearchIndexDefault {
152 o._statusCode = code
153 return o
154 }
155
156
157 func (o *SearchIndexDefault) SetStatusCode(code int) {
158 o._statusCode = code
159 }
160
161
162 func (o *SearchIndexDefault) WithPayload(payload *models.Error) *SearchIndexDefault {
163 o.Payload = payload
164 return o
165 }
166
167
168 func (o *SearchIndexDefault) SetPayload(payload *models.Error) {
169 o.Payload = payload
170 }
171
172
173 func (o *SearchIndexDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
174
175 rw.WriteHeader(o._statusCode)
176 if o.Payload != nil {
177 payload := o.Payload
178 if err := producer.Produce(rw, payload); err != nil {
179 panic(err)
180 }
181 }
182 }
183
View as plain text