...
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 "context"
26 "net/http"
27 "time"
28
29 "github.com/go-openapi/errors"
30 "github.com/go-openapi/runtime"
31 cr "github.com/go-openapi/runtime/client"
32 "github.com/go-openapi/strfmt"
33 "github.com/go-openapi/swag"
34 )
35
36
37
38
39
40
41
42 func NewGetLogProofParams() *GetLogProofParams {
43 return &GetLogProofParams{
44 timeout: cr.DefaultTimeout,
45 }
46 }
47
48
49
50 func NewGetLogProofParamsWithTimeout(timeout time.Duration) *GetLogProofParams {
51 return &GetLogProofParams{
52 timeout: timeout,
53 }
54 }
55
56
57
58 func NewGetLogProofParamsWithContext(ctx context.Context) *GetLogProofParams {
59 return &GetLogProofParams{
60 Context: ctx,
61 }
62 }
63
64
65
66 func NewGetLogProofParamsWithHTTPClient(client *http.Client) *GetLogProofParams {
67 return &GetLogProofParams{
68 HTTPClient: client,
69 }
70 }
71
72
79 type GetLogProofParams struct {
80
81
88 FirstSize *int64
89
90
94 LastSize int64
95
96
100 TreeID *string
101
102 timeout time.Duration
103 Context context.Context
104 HTTPClient *http.Client
105 }
106
107
108
109
110 func (o *GetLogProofParams) WithDefaults() *GetLogProofParams {
111 o.SetDefaults()
112 return o
113 }
114
115
116
117
118 func (o *GetLogProofParams) SetDefaults() {
119 var (
120 firstSizeDefault = int64(1)
121 )
122
123 val := GetLogProofParams{
124 FirstSize: &firstSizeDefault,
125 }
126
127 val.timeout = o.timeout
128 val.Context = o.Context
129 val.HTTPClient = o.HTTPClient
130 *o = val
131 }
132
133
134 func (o *GetLogProofParams) WithTimeout(timeout time.Duration) *GetLogProofParams {
135 o.SetTimeout(timeout)
136 return o
137 }
138
139
140 func (o *GetLogProofParams) SetTimeout(timeout time.Duration) {
141 o.timeout = timeout
142 }
143
144
145 func (o *GetLogProofParams) WithContext(ctx context.Context) *GetLogProofParams {
146 o.SetContext(ctx)
147 return o
148 }
149
150
151 func (o *GetLogProofParams) SetContext(ctx context.Context) {
152 o.Context = ctx
153 }
154
155
156 func (o *GetLogProofParams) WithHTTPClient(client *http.Client) *GetLogProofParams {
157 o.SetHTTPClient(client)
158 return o
159 }
160
161
162 func (o *GetLogProofParams) SetHTTPClient(client *http.Client) {
163 o.HTTPClient = client
164 }
165
166
167 func (o *GetLogProofParams) WithFirstSize(firstSize *int64) *GetLogProofParams {
168 o.SetFirstSize(firstSize)
169 return o
170 }
171
172
173 func (o *GetLogProofParams) SetFirstSize(firstSize *int64) {
174 o.FirstSize = firstSize
175 }
176
177
178 func (o *GetLogProofParams) WithLastSize(lastSize int64) *GetLogProofParams {
179 o.SetLastSize(lastSize)
180 return o
181 }
182
183
184 func (o *GetLogProofParams) SetLastSize(lastSize int64) {
185 o.LastSize = lastSize
186 }
187
188
189 func (o *GetLogProofParams) WithTreeID(treeID *string) *GetLogProofParams {
190 o.SetTreeID(treeID)
191 return o
192 }
193
194
195 func (o *GetLogProofParams) SetTreeID(treeID *string) {
196 o.TreeID = treeID
197 }
198
199
200 func (o *GetLogProofParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
201
202 if err := r.SetTimeout(o.timeout); err != nil {
203 return err
204 }
205 var res []error
206
207 if o.FirstSize != nil {
208
209
210 var qrFirstSize int64
211
212 if o.FirstSize != nil {
213 qrFirstSize = *o.FirstSize
214 }
215 qFirstSize := swag.FormatInt64(qrFirstSize)
216 if qFirstSize != "" {
217
218 if err := r.SetQueryParam("firstSize", qFirstSize); err != nil {
219 return err
220 }
221 }
222 }
223
224
225 qrLastSize := o.LastSize
226 qLastSize := swag.FormatInt64(qrLastSize)
227 if qLastSize != "" {
228
229 if err := r.SetQueryParam("lastSize", qLastSize); err != nil {
230 return err
231 }
232 }
233
234 if o.TreeID != nil {
235
236
237 var qrTreeID string
238
239 if o.TreeID != nil {
240 qrTreeID = *o.TreeID
241 }
242 qTreeID := qrTreeID
243 if qTreeID != "" {
244
245 if err := r.SetQueryParam("treeID", qTreeID); err != nil {
246 return err
247 }
248 }
249 }
250
251 if len(res) > 0 {
252 return errors.CompositeValidationError(res...)
253 }
254 return nil
255 }
256
View as plain text