...
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 "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
35
36
37
38
39
40
41 func NewGetPublicKeyParams() *GetPublicKeyParams {
42 return &GetPublicKeyParams{
43 timeout: cr.DefaultTimeout,
44 }
45 }
46
47
48
49 func NewGetPublicKeyParamsWithTimeout(timeout time.Duration) *GetPublicKeyParams {
50 return &GetPublicKeyParams{
51 timeout: timeout,
52 }
53 }
54
55
56
57 func NewGetPublicKeyParamsWithContext(ctx context.Context) *GetPublicKeyParams {
58 return &GetPublicKeyParams{
59 Context: ctx,
60 }
61 }
62
63
64
65 func NewGetPublicKeyParamsWithHTTPClient(client *http.Client) *GetPublicKeyParams {
66 return &GetPublicKeyParams{
67 HTTPClient: client,
68 }
69 }
70
71
78 type GetPublicKeyParams struct {
79
80
84 TreeID *string
85
86 timeout time.Duration
87 Context context.Context
88 HTTPClient *http.Client
89 }
90
91
92
93
94 func (o *GetPublicKeyParams) WithDefaults() *GetPublicKeyParams {
95 o.SetDefaults()
96 return o
97 }
98
99
100
101
102 func (o *GetPublicKeyParams) SetDefaults() {
103
104 }
105
106
107 func (o *GetPublicKeyParams) WithTimeout(timeout time.Duration) *GetPublicKeyParams {
108 o.SetTimeout(timeout)
109 return o
110 }
111
112
113 func (o *GetPublicKeyParams) SetTimeout(timeout time.Duration) {
114 o.timeout = timeout
115 }
116
117
118 func (o *GetPublicKeyParams) WithContext(ctx context.Context) *GetPublicKeyParams {
119 o.SetContext(ctx)
120 return o
121 }
122
123
124 func (o *GetPublicKeyParams) SetContext(ctx context.Context) {
125 o.Context = ctx
126 }
127
128
129 func (o *GetPublicKeyParams) WithHTTPClient(client *http.Client) *GetPublicKeyParams {
130 o.SetHTTPClient(client)
131 return o
132 }
133
134
135 func (o *GetPublicKeyParams) SetHTTPClient(client *http.Client) {
136 o.HTTPClient = client
137 }
138
139
140 func (o *GetPublicKeyParams) WithTreeID(treeID *string) *GetPublicKeyParams {
141 o.SetTreeID(treeID)
142 return o
143 }
144
145
146 func (o *GetPublicKeyParams) SetTreeID(treeID *string) {
147 o.TreeID = treeID
148 }
149
150
151 func (o *GetPublicKeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
152
153 if err := r.SetTimeout(o.timeout); err != nil {
154 return err
155 }
156 var res []error
157
158 if o.TreeID != nil {
159
160
161 var qrTreeID string
162
163 if o.TreeID != nil {
164 qrTreeID = *o.TreeID
165 }
166 qTreeID := qrTreeID
167 if qTreeID != "" {
168
169 if err := r.SetQueryParam("treeID", qTreeID); err != nil {
170 return err
171 }
172 }
173 }
174
175 if len(res) > 0 {
176 return errors.CompositeValidationError(res...)
177 }
178 return nil
179 }
180
View as plain text