...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package entries
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
34 "github.com/sigstore/rekor/pkg/generated/models"
35 )
36
37
38
39
40
41
42
43 func NewSearchLogQueryParams() *SearchLogQueryParams {
44 return &SearchLogQueryParams{
45 timeout: cr.DefaultTimeout,
46 }
47 }
48
49
50
51 func NewSearchLogQueryParamsWithTimeout(timeout time.Duration) *SearchLogQueryParams {
52 return &SearchLogQueryParams{
53 timeout: timeout,
54 }
55 }
56
57
58
59 func NewSearchLogQueryParamsWithContext(ctx context.Context) *SearchLogQueryParams {
60 return &SearchLogQueryParams{
61 Context: ctx,
62 }
63 }
64
65
66
67 func NewSearchLogQueryParamsWithHTTPClient(client *http.Client) *SearchLogQueryParams {
68 return &SearchLogQueryParams{
69 HTTPClient: client,
70 }
71 }
72
73
80 type SearchLogQueryParams struct {
81
82
83 Entry *models.SearchLogQuery
84
85 timeout time.Duration
86 Context context.Context
87 HTTPClient *http.Client
88 }
89
90
91
92
93 func (o *SearchLogQueryParams) WithDefaults() *SearchLogQueryParams {
94 o.SetDefaults()
95 return o
96 }
97
98
99
100
101 func (o *SearchLogQueryParams) SetDefaults() {
102
103 }
104
105
106 func (o *SearchLogQueryParams) WithTimeout(timeout time.Duration) *SearchLogQueryParams {
107 o.SetTimeout(timeout)
108 return o
109 }
110
111
112 func (o *SearchLogQueryParams) SetTimeout(timeout time.Duration) {
113 o.timeout = timeout
114 }
115
116
117 func (o *SearchLogQueryParams) WithContext(ctx context.Context) *SearchLogQueryParams {
118 o.SetContext(ctx)
119 return o
120 }
121
122
123 func (o *SearchLogQueryParams) SetContext(ctx context.Context) {
124 o.Context = ctx
125 }
126
127
128 func (o *SearchLogQueryParams) WithHTTPClient(client *http.Client) *SearchLogQueryParams {
129 o.SetHTTPClient(client)
130 return o
131 }
132
133
134 func (o *SearchLogQueryParams) SetHTTPClient(client *http.Client) {
135 o.HTTPClient = client
136 }
137
138
139 func (o *SearchLogQueryParams) WithEntry(entry *models.SearchLogQuery) *SearchLogQueryParams {
140 o.SetEntry(entry)
141 return o
142 }
143
144
145 func (o *SearchLogQueryParams) SetEntry(entry *models.SearchLogQuery) {
146 o.Entry = entry
147 }
148
149
150 func (o *SearchLogQueryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
151
152 if err := r.SetTimeout(o.timeout); err != nil {
153 return err
154 }
155 var res []error
156 if o.Entry != nil {
157 if err := r.SetBodyParam(o.Entry); err != nil {
158 return err
159 }
160 }
161
162 if len(res) > 0 {
163 return errors.CompositeValidationError(res...)
164 }
165 return nil
166 }
167
View as plain text