blob: 63185cfcaa026535c222e2519a880e84425c173c [file] [log] [blame]
Serge Bazanskicc25bdf2018-10-25 14:02:58 +02001// Code generated by go-swagger; DO NOT EDIT.
2
3// Copyright 2018 The go-netbox Authors.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17package dcim
18
19// This file was generated by the swagger tool.
20// Editing this file might prove futile when you re-run the swagger generate command
21
22import (
23 "net/http"
24 "time"
25
26 "golang.org/x/net/context"
27
28 "github.com/go-openapi/errors"
29 "github.com/go-openapi/runtime"
30 cr "github.com/go-openapi/runtime/client"
31 "github.com/go-openapi/swag"
32
33 strfmt "github.com/go-openapi/strfmt"
34)
35
36// NewDcimConsoleConnectionsListParams creates a new DcimConsoleConnectionsListParams object
37// with the default values initialized.
38func NewDcimConsoleConnectionsListParams() *DcimConsoleConnectionsListParams {
39 var ()
40 return &DcimConsoleConnectionsListParams{
41
42 timeout: cr.DefaultTimeout,
43 }
44}
45
46// NewDcimConsoleConnectionsListParamsWithTimeout creates a new DcimConsoleConnectionsListParams object
47// with the default values initialized, and the ability to set a timeout on a request
48func NewDcimConsoleConnectionsListParamsWithTimeout(timeout time.Duration) *DcimConsoleConnectionsListParams {
49 var ()
50 return &DcimConsoleConnectionsListParams{
51
52 timeout: timeout,
53 }
54}
55
56// NewDcimConsoleConnectionsListParamsWithContext creates a new DcimConsoleConnectionsListParams object
57// with the default values initialized, and the ability to set a context for a request
58func NewDcimConsoleConnectionsListParamsWithContext(ctx context.Context) *DcimConsoleConnectionsListParams {
59 var ()
60 return &DcimConsoleConnectionsListParams{
61
62 Context: ctx,
63 }
64}
65
66// NewDcimConsoleConnectionsListParamsWithHTTPClient creates a new DcimConsoleConnectionsListParams object
67// with the default values initialized, and the ability to set a custom HTTPClient for a request
68func NewDcimConsoleConnectionsListParamsWithHTTPClient(client *http.Client) *DcimConsoleConnectionsListParams {
69 var ()
70 return &DcimConsoleConnectionsListParams{
71 HTTPClient: client,
72 }
73}
74
75/*DcimConsoleConnectionsListParams contains all the parameters to send to the API endpoint
76for the dcim console connections list operation typically these are written to a http.Request
77*/
78type DcimConsoleConnectionsListParams struct {
79
80 /*ConnectionStatus*/
81 ConnectionStatus *string
82 /*Device*/
83 Device *string
84 /*Limit
85 Number of results to return per page.
86
87 */
88 Limit *int64
89 /*Name*/
90 Name *string
91 /*Offset
92 The initial index from which to return the results.
93
94 */
95 Offset *int64
96 /*Site*/
97 Site *string
98
99 timeout time.Duration
100 Context context.Context
101 HTTPClient *http.Client
102}
103
104// WithTimeout adds the timeout to the dcim console connections list params
105func (o *DcimConsoleConnectionsListParams) WithTimeout(timeout time.Duration) *DcimConsoleConnectionsListParams {
106 o.SetTimeout(timeout)
107 return o
108}
109
110// SetTimeout adds the timeout to the dcim console connections list params
111func (o *DcimConsoleConnectionsListParams) SetTimeout(timeout time.Duration) {
112 o.timeout = timeout
113}
114
115// WithContext adds the context to the dcim console connections list params
116func (o *DcimConsoleConnectionsListParams) WithContext(ctx context.Context) *DcimConsoleConnectionsListParams {
117 o.SetContext(ctx)
118 return o
119}
120
121// SetContext adds the context to the dcim console connections list params
122func (o *DcimConsoleConnectionsListParams) SetContext(ctx context.Context) {
123 o.Context = ctx
124}
125
126// WithHTTPClient adds the HTTPClient to the dcim console connections list params
127func (o *DcimConsoleConnectionsListParams) WithHTTPClient(client *http.Client) *DcimConsoleConnectionsListParams {
128 o.SetHTTPClient(client)
129 return o
130}
131
132// SetHTTPClient adds the HTTPClient to the dcim console connections list params
133func (o *DcimConsoleConnectionsListParams) SetHTTPClient(client *http.Client) {
134 o.HTTPClient = client
135}
136
137// WithConnectionStatus adds the connectionStatus to the dcim console connections list params
138func (o *DcimConsoleConnectionsListParams) WithConnectionStatus(connectionStatus *string) *DcimConsoleConnectionsListParams {
139 o.SetConnectionStatus(connectionStatus)
140 return o
141}
142
143// SetConnectionStatus adds the connectionStatus to the dcim console connections list params
144func (o *DcimConsoleConnectionsListParams) SetConnectionStatus(connectionStatus *string) {
145 o.ConnectionStatus = connectionStatus
146}
147
148// WithDevice adds the device to the dcim console connections list params
149func (o *DcimConsoleConnectionsListParams) WithDevice(device *string) *DcimConsoleConnectionsListParams {
150 o.SetDevice(device)
151 return o
152}
153
154// SetDevice adds the device to the dcim console connections list params
155func (o *DcimConsoleConnectionsListParams) SetDevice(device *string) {
156 o.Device = device
157}
158
159// WithLimit adds the limit to the dcim console connections list params
160func (o *DcimConsoleConnectionsListParams) WithLimit(limit *int64) *DcimConsoleConnectionsListParams {
161 o.SetLimit(limit)
162 return o
163}
164
165// SetLimit adds the limit to the dcim console connections list params
166func (o *DcimConsoleConnectionsListParams) SetLimit(limit *int64) {
167 o.Limit = limit
168}
169
170// WithName adds the name to the dcim console connections list params
171func (o *DcimConsoleConnectionsListParams) WithName(name *string) *DcimConsoleConnectionsListParams {
172 o.SetName(name)
173 return o
174}
175
176// SetName adds the name to the dcim console connections list params
177func (o *DcimConsoleConnectionsListParams) SetName(name *string) {
178 o.Name = name
179}
180
181// WithOffset adds the offset to the dcim console connections list params
182func (o *DcimConsoleConnectionsListParams) WithOffset(offset *int64) *DcimConsoleConnectionsListParams {
183 o.SetOffset(offset)
184 return o
185}
186
187// SetOffset adds the offset to the dcim console connections list params
188func (o *DcimConsoleConnectionsListParams) SetOffset(offset *int64) {
189 o.Offset = offset
190}
191
192// WithSite adds the site to the dcim console connections list params
193func (o *DcimConsoleConnectionsListParams) WithSite(site *string) *DcimConsoleConnectionsListParams {
194 o.SetSite(site)
195 return o
196}
197
198// SetSite adds the site to the dcim console connections list params
199func (o *DcimConsoleConnectionsListParams) SetSite(site *string) {
200 o.Site = site
201}
202
203// WriteToRequest writes these params to a swagger request
204func (o *DcimConsoleConnectionsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
205
206 if err := r.SetTimeout(o.timeout); err != nil {
207 return err
208 }
209 var res []error
210
211 if o.ConnectionStatus != nil {
212
213 // query param connection_status
214 var qrConnectionStatus string
215 if o.ConnectionStatus != nil {
216 qrConnectionStatus = *o.ConnectionStatus
217 }
218 qConnectionStatus := qrConnectionStatus
219 if qConnectionStatus != "" {
220 if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil {
221 return err
222 }
223 }
224
225 }
226
227 if o.Device != nil {
228
229 // query param device
230 var qrDevice string
231 if o.Device != nil {
232 qrDevice = *o.Device
233 }
234 qDevice := qrDevice
235 if qDevice != "" {
236 if err := r.SetQueryParam("device", qDevice); err != nil {
237 return err
238 }
239 }
240
241 }
242
243 if o.Limit != nil {
244
245 // query param limit
246 var qrLimit int64
247 if o.Limit != nil {
248 qrLimit = *o.Limit
249 }
250 qLimit := swag.FormatInt64(qrLimit)
251 if qLimit != "" {
252 if err := r.SetQueryParam("limit", qLimit); err != nil {
253 return err
254 }
255 }
256
257 }
258
259 if o.Name != nil {
260
261 // query param name
262 var qrName string
263 if o.Name != nil {
264 qrName = *o.Name
265 }
266 qName := qrName
267 if qName != "" {
268 if err := r.SetQueryParam("name", qName); err != nil {
269 return err
270 }
271 }
272
273 }
274
275 if o.Offset != nil {
276
277 // query param offset
278 var qrOffset int64
279 if o.Offset != nil {
280 qrOffset = *o.Offset
281 }
282 qOffset := swag.FormatInt64(qrOffset)
283 if qOffset != "" {
284 if err := r.SetQueryParam("offset", qOffset); err != nil {
285 return err
286 }
287 }
288
289 }
290
291 if o.Site != nil {
292
293 // query param site
294 var qrSite string
295 if o.Site != nil {
296 qrSite = *o.Site
297 }
298 qSite := qrSite
299 if qSite != "" {
300 if err := r.SetQueryParam("site", qSite); err != nil {
301 return err
302 }
303 }
304
305 }
306
307 if len(res) > 0 {
308 return errors.CompositeValidationError(res...)
309 }
310 return nil
311}