...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package pubkey
20
21
22
23
24 import (
25 "fmt"
26 "io"
27
28 "github.com/go-openapi/runtime"
29 "github.com/go-openapi/strfmt"
30
31 "github.com/sigstore/rekor/pkg/generated/models"
32 )
33
34
35 type GetPublicKeyReader struct {
36 formats strfmt.Registry
37 }
38
39
40 func (o *GetPublicKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
41 switch response.Code() {
42 case 200:
43 result := NewGetPublicKeyOK()
44 if err := result.readResponse(response, consumer, o.formats); err != nil {
45 return nil, err
46 }
47 return result, nil
48 default:
49 result := NewGetPublicKeyDefault(response.Code())
50 if err := result.readResponse(response, consumer, o.formats); err != nil {
51 return nil, err
52 }
53 if response.Code()/100 == 2 {
54 return result, nil
55 }
56 return nil, result
57 }
58 }
59
60
61 func NewGetPublicKeyOK() *GetPublicKeyOK {
62 return &GetPublicKeyOK{}
63 }
64
65
70 type GetPublicKeyOK struct {
71 Payload string
72 }
73
74
75 func (o *GetPublicKeyOK) IsSuccess() bool {
76 return true
77 }
78
79
80 func (o *GetPublicKeyOK) IsRedirect() bool {
81 return false
82 }
83
84
85 func (o *GetPublicKeyOK) IsClientError() bool {
86 return false
87 }
88
89
90 func (o *GetPublicKeyOK) IsServerError() bool {
91 return false
92 }
93
94
95 func (o *GetPublicKeyOK) IsCode(code int) bool {
96 return code == 200
97 }
98
99
100 func (o *GetPublicKeyOK) Code() int {
101 return 200
102 }
103
104 func (o *GetPublicKeyOK) Error() string {
105 return fmt.Sprintf("[GET /api/v1/log/publicKey][%d] getPublicKeyOK %+v", 200, o.Payload)
106 }
107
108 func (o *GetPublicKeyOK) String() string {
109 return fmt.Sprintf("[GET /api/v1/log/publicKey][%d] getPublicKeyOK %+v", 200, o.Payload)
110 }
111
112 func (o *GetPublicKeyOK) GetPayload() string {
113 return o.Payload
114 }
115
116 func (o *GetPublicKeyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
117
118
119 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
120 return err
121 }
122
123 return nil
124 }
125
126
127 func NewGetPublicKeyDefault(code int) *GetPublicKeyDefault {
128 return &GetPublicKeyDefault{
129 _statusCode: code,
130 }
131 }
132
133
138 type GetPublicKeyDefault struct {
139 _statusCode int
140
141 Payload *models.Error
142 }
143
144
145 func (o *GetPublicKeyDefault) IsSuccess() bool {
146 return o._statusCode/100 == 2
147 }
148
149
150 func (o *GetPublicKeyDefault) IsRedirect() bool {
151 return o._statusCode/100 == 3
152 }
153
154
155 func (o *GetPublicKeyDefault) IsClientError() bool {
156 return o._statusCode/100 == 4
157 }
158
159
160 func (o *GetPublicKeyDefault) IsServerError() bool {
161 return o._statusCode/100 == 5
162 }
163
164
165 func (o *GetPublicKeyDefault) IsCode(code int) bool {
166 return o._statusCode == code
167 }
168
169
170 func (o *GetPublicKeyDefault) Code() int {
171 return o._statusCode
172 }
173
174 func (o *GetPublicKeyDefault) Error() string {
175 return fmt.Sprintf("[GET /api/v1/log/publicKey][%d] getPublicKey default %+v", o._statusCode, o.Payload)
176 }
177
178 func (o *GetPublicKeyDefault) String() string {
179 return fmt.Sprintf("[GET /api/v1/log/publicKey][%d] getPublicKey default %+v", o._statusCode, o.Payload)
180 }
181
182 func (o *GetPublicKeyDefault) GetPayload() *models.Error {
183 return o.Payload
184 }
185
186 func (o *GetPublicKeyDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
187
188 o.Payload = new(models.Error)
189
190
191 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
192 return err
193 }
194
195 return nil
196 }
197
View as plain text