...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package tlog
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 GetLogInfoReader struct {
36 formats strfmt.Registry
37 }
38
39
40 func (o *GetLogInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
41 switch response.Code() {
42 case 200:
43 result := NewGetLogInfoOK()
44 if err := result.readResponse(response, consumer, o.formats); err != nil {
45 return nil, err
46 }
47 return result, nil
48 default:
49 result := NewGetLogInfoDefault(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 NewGetLogInfoOK() *GetLogInfoOK {
62 return &GetLogInfoOK{}
63 }
64
65
70 type GetLogInfoOK struct {
71 Payload *models.LogInfo
72 }
73
74
75 func (o *GetLogInfoOK) IsSuccess() bool {
76 return true
77 }
78
79
80 func (o *GetLogInfoOK) IsRedirect() bool {
81 return false
82 }
83
84
85 func (o *GetLogInfoOK) IsClientError() bool {
86 return false
87 }
88
89
90 func (o *GetLogInfoOK) IsServerError() bool {
91 return false
92 }
93
94
95 func (o *GetLogInfoOK) IsCode(code int) bool {
96 return code == 200
97 }
98
99
100 func (o *GetLogInfoOK) Code() int {
101 return 200
102 }
103
104 func (o *GetLogInfoOK) Error() string {
105 return fmt.Sprintf("[GET /api/v1/log][%d] getLogInfoOK %+v", 200, o.Payload)
106 }
107
108 func (o *GetLogInfoOK) String() string {
109 return fmt.Sprintf("[GET /api/v1/log][%d] getLogInfoOK %+v", 200, o.Payload)
110 }
111
112 func (o *GetLogInfoOK) GetPayload() *models.LogInfo {
113 return o.Payload
114 }
115
116 func (o *GetLogInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
117
118 o.Payload = new(models.LogInfo)
119
120
121 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
122 return err
123 }
124
125 return nil
126 }
127
128
129 func NewGetLogInfoDefault(code int) *GetLogInfoDefault {
130 return &GetLogInfoDefault{
131 _statusCode: code,
132 }
133 }
134
135
140 type GetLogInfoDefault struct {
141 _statusCode int
142
143 Payload *models.Error
144 }
145
146
147 func (o *GetLogInfoDefault) IsSuccess() bool {
148 return o._statusCode/100 == 2
149 }
150
151
152 func (o *GetLogInfoDefault) IsRedirect() bool {
153 return o._statusCode/100 == 3
154 }
155
156
157 func (o *GetLogInfoDefault) IsClientError() bool {
158 return o._statusCode/100 == 4
159 }
160
161
162 func (o *GetLogInfoDefault) IsServerError() bool {
163 return o._statusCode/100 == 5
164 }
165
166
167 func (o *GetLogInfoDefault) IsCode(code int) bool {
168 return o._statusCode == code
169 }
170
171
172 func (o *GetLogInfoDefault) Code() int {
173 return o._statusCode
174 }
175
176 func (o *GetLogInfoDefault) Error() string {
177 return fmt.Sprintf("[GET /api/v1/log][%d] getLogInfo default %+v", o._statusCode, o.Payload)
178 }
179
180 func (o *GetLogInfoDefault) String() string {
181 return fmt.Sprintf("[GET /api/v1/log][%d] getLogInfo default %+v", o._statusCode, o.Payload)
182 }
183
184 func (o *GetLogInfoDefault) GetPayload() *models.Error {
185 return o.Payload
186 }
187
188 func (o *GetLogInfoDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
189
190 o.Payload = new(models.Error)
191
192
193 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
194 return err
195 }
196
197 return nil
198 }
199
View as plain text