blob: fe8a8774151f608b9849728d96ee79160d949d49 [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// NewDcimDeviceTypesListParams creates a new DcimDeviceTypesListParams object
37// with the default values initialized.
38func NewDcimDeviceTypesListParams() *DcimDeviceTypesListParams {
39 var ()
40 return &DcimDeviceTypesListParams{
41
42 timeout: cr.DefaultTimeout,
43 }
44}
45
46// NewDcimDeviceTypesListParamsWithTimeout creates a new DcimDeviceTypesListParams object
47// with the default values initialized, and the ability to set a timeout on a request
48func NewDcimDeviceTypesListParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesListParams {
49 var ()
50 return &DcimDeviceTypesListParams{
51
52 timeout: timeout,
53 }
54}
55
56// NewDcimDeviceTypesListParamsWithContext creates a new DcimDeviceTypesListParams object
57// with the default values initialized, and the ability to set a context for a request
58func NewDcimDeviceTypesListParamsWithContext(ctx context.Context) *DcimDeviceTypesListParams {
59 var ()
60 return &DcimDeviceTypesListParams{
61
62 Context: ctx,
63 }
64}
65
66// NewDcimDeviceTypesListParamsWithHTTPClient creates a new DcimDeviceTypesListParams object
67// with the default values initialized, and the ability to set a custom HTTPClient for a request
68func NewDcimDeviceTypesListParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesListParams {
69 var ()
70 return &DcimDeviceTypesListParams{
71 HTTPClient: client,
72 }
73}
74
75/*DcimDeviceTypesListParams contains all the parameters to send to the API endpoint
76for the dcim device types list operation typically these are written to a http.Request
77*/
78type DcimDeviceTypesListParams struct {
79
80 /*IDIn
81 Multiple values may be separated by commas.
82
83 */
84 IDIn *string
85 /*IsConsoleServer*/
86 IsConsoleServer *string
87 /*IsFullDepth*/
88 IsFullDepth *string
89 /*IsNetworkDevice*/
90 IsNetworkDevice *string
91 /*IsPdu*/
92 IsPdu *string
93 /*Limit
94 Number of results to return per page.
95
96 */
97 Limit *int64
98 /*Manufacturer*/
99 Manufacturer *string
100 /*ManufacturerID*/
101 ManufacturerID *string
102 /*Model*/
103 Model *string
104 /*Offset
105 The initial index from which to return the results.
106
107 */
108 Offset *int64
109 /*PartNumber*/
110 PartNumber *string
111 /*Q*/
112 Q *string
113 /*Slug*/
114 Slug *string
115 /*SubdeviceRole*/
116 SubdeviceRole *string
117 /*UHeight*/
118 UHeight *float64
119
120 timeout time.Duration
121 Context context.Context
122 HTTPClient *http.Client
123}
124
125// WithTimeout adds the timeout to the dcim device types list params
126func (o *DcimDeviceTypesListParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesListParams {
127 o.SetTimeout(timeout)
128 return o
129}
130
131// SetTimeout adds the timeout to the dcim device types list params
132func (o *DcimDeviceTypesListParams) SetTimeout(timeout time.Duration) {
133 o.timeout = timeout
134}
135
136// WithContext adds the context to the dcim device types list params
137func (o *DcimDeviceTypesListParams) WithContext(ctx context.Context) *DcimDeviceTypesListParams {
138 o.SetContext(ctx)
139 return o
140}
141
142// SetContext adds the context to the dcim device types list params
143func (o *DcimDeviceTypesListParams) SetContext(ctx context.Context) {
144 o.Context = ctx
145}
146
147// WithHTTPClient adds the HTTPClient to the dcim device types list params
148func (o *DcimDeviceTypesListParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesListParams {
149 o.SetHTTPClient(client)
150 return o
151}
152
153// SetHTTPClient adds the HTTPClient to the dcim device types list params
154func (o *DcimDeviceTypesListParams) SetHTTPClient(client *http.Client) {
155 o.HTTPClient = client
156}
157
158// WithIDIn adds the iDIn to the dcim device types list params
159func (o *DcimDeviceTypesListParams) WithIDIn(iDIn *string) *DcimDeviceTypesListParams {
160 o.SetIDIn(iDIn)
161 return o
162}
163
164// SetIDIn adds the idIn to the dcim device types list params
165func (o *DcimDeviceTypesListParams) SetIDIn(iDIn *string) {
166 o.IDIn = iDIn
167}
168
169// WithIsConsoleServer adds the isConsoleServer to the dcim device types list params
170func (o *DcimDeviceTypesListParams) WithIsConsoleServer(isConsoleServer *string) *DcimDeviceTypesListParams {
171 o.SetIsConsoleServer(isConsoleServer)
172 return o
173}
174
175// SetIsConsoleServer adds the isConsoleServer to the dcim device types list params
176func (o *DcimDeviceTypesListParams) SetIsConsoleServer(isConsoleServer *string) {
177 o.IsConsoleServer = isConsoleServer
178}
179
180// WithIsFullDepth adds the isFullDepth to the dcim device types list params
181func (o *DcimDeviceTypesListParams) WithIsFullDepth(isFullDepth *string) *DcimDeviceTypesListParams {
182 o.SetIsFullDepth(isFullDepth)
183 return o
184}
185
186// SetIsFullDepth adds the isFullDepth to the dcim device types list params
187func (o *DcimDeviceTypesListParams) SetIsFullDepth(isFullDepth *string) {
188 o.IsFullDepth = isFullDepth
189}
190
191// WithIsNetworkDevice adds the isNetworkDevice to the dcim device types list params
192func (o *DcimDeviceTypesListParams) WithIsNetworkDevice(isNetworkDevice *string) *DcimDeviceTypesListParams {
193 o.SetIsNetworkDevice(isNetworkDevice)
194 return o
195}
196
197// SetIsNetworkDevice adds the isNetworkDevice to the dcim device types list params
198func (o *DcimDeviceTypesListParams) SetIsNetworkDevice(isNetworkDevice *string) {
199 o.IsNetworkDevice = isNetworkDevice
200}
201
202// WithIsPdu adds the isPdu to the dcim device types list params
203func (o *DcimDeviceTypesListParams) WithIsPdu(isPdu *string) *DcimDeviceTypesListParams {
204 o.SetIsPdu(isPdu)
205 return o
206}
207
208// SetIsPdu adds the isPdu to the dcim device types list params
209func (o *DcimDeviceTypesListParams) SetIsPdu(isPdu *string) {
210 o.IsPdu = isPdu
211}
212
213// WithLimit adds the limit to the dcim device types list params
214func (o *DcimDeviceTypesListParams) WithLimit(limit *int64) *DcimDeviceTypesListParams {
215 o.SetLimit(limit)
216 return o
217}
218
219// SetLimit adds the limit to the dcim device types list params
220func (o *DcimDeviceTypesListParams) SetLimit(limit *int64) {
221 o.Limit = limit
222}
223
224// WithManufacturer adds the manufacturer to the dcim device types list params
225func (o *DcimDeviceTypesListParams) WithManufacturer(manufacturer *string) *DcimDeviceTypesListParams {
226 o.SetManufacturer(manufacturer)
227 return o
228}
229
230// SetManufacturer adds the manufacturer to the dcim device types list params
231func (o *DcimDeviceTypesListParams) SetManufacturer(manufacturer *string) {
232 o.Manufacturer = manufacturer
233}
234
235// WithManufacturerID adds the manufacturerID to the dcim device types list params
236func (o *DcimDeviceTypesListParams) WithManufacturerID(manufacturerID *string) *DcimDeviceTypesListParams {
237 o.SetManufacturerID(manufacturerID)
238 return o
239}
240
241// SetManufacturerID adds the manufacturerId to the dcim device types list params
242func (o *DcimDeviceTypesListParams) SetManufacturerID(manufacturerID *string) {
243 o.ManufacturerID = manufacturerID
244}
245
246// WithModel adds the model to the dcim device types list params
247func (o *DcimDeviceTypesListParams) WithModel(model *string) *DcimDeviceTypesListParams {
248 o.SetModel(model)
249 return o
250}
251
252// SetModel adds the model to the dcim device types list params
253func (o *DcimDeviceTypesListParams) SetModel(model *string) {
254 o.Model = model
255}
256
257// WithOffset adds the offset to the dcim device types list params
258func (o *DcimDeviceTypesListParams) WithOffset(offset *int64) *DcimDeviceTypesListParams {
259 o.SetOffset(offset)
260 return o
261}
262
263// SetOffset adds the offset to the dcim device types list params
264func (o *DcimDeviceTypesListParams) SetOffset(offset *int64) {
265 o.Offset = offset
266}
267
268// WithPartNumber adds the partNumber to the dcim device types list params
269func (o *DcimDeviceTypesListParams) WithPartNumber(partNumber *string) *DcimDeviceTypesListParams {
270 o.SetPartNumber(partNumber)
271 return o
272}
273
274// SetPartNumber adds the partNumber to the dcim device types list params
275func (o *DcimDeviceTypesListParams) SetPartNumber(partNumber *string) {
276 o.PartNumber = partNumber
277}
278
279// WithQ adds the q to the dcim device types list params
280func (o *DcimDeviceTypesListParams) WithQ(q *string) *DcimDeviceTypesListParams {
281 o.SetQ(q)
282 return o
283}
284
285// SetQ adds the q to the dcim device types list params
286func (o *DcimDeviceTypesListParams) SetQ(q *string) {
287 o.Q = q
288}
289
290// WithSlug adds the slug to the dcim device types list params
291func (o *DcimDeviceTypesListParams) WithSlug(slug *string) *DcimDeviceTypesListParams {
292 o.SetSlug(slug)
293 return o
294}
295
296// SetSlug adds the slug to the dcim device types list params
297func (o *DcimDeviceTypesListParams) SetSlug(slug *string) {
298 o.Slug = slug
299}
300
301// WithSubdeviceRole adds the subdeviceRole to the dcim device types list params
302func (o *DcimDeviceTypesListParams) WithSubdeviceRole(subdeviceRole *string) *DcimDeviceTypesListParams {
303 o.SetSubdeviceRole(subdeviceRole)
304 return o
305}
306
307// SetSubdeviceRole adds the subdeviceRole to the dcim device types list params
308func (o *DcimDeviceTypesListParams) SetSubdeviceRole(subdeviceRole *string) {
309 o.SubdeviceRole = subdeviceRole
310}
311
312// WithUHeight adds the uHeight to the dcim device types list params
313func (o *DcimDeviceTypesListParams) WithUHeight(uHeight *float64) *DcimDeviceTypesListParams {
314 o.SetUHeight(uHeight)
315 return o
316}
317
318// SetUHeight adds the uHeight to the dcim device types list params
319func (o *DcimDeviceTypesListParams) SetUHeight(uHeight *float64) {
320 o.UHeight = uHeight
321}
322
323// WriteToRequest writes these params to a swagger request
324func (o *DcimDeviceTypesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
325
326 if err := r.SetTimeout(o.timeout); err != nil {
327 return err
328 }
329 var res []error
330
331 if o.IDIn != nil {
332
333 // query param id__in
334 var qrIDIn string
335 if o.IDIn != nil {
336 qrIDIn = *o.IDIn
337 }
338 qIDIn := qrIDIn
339 if qIDIn != "" {
340 if err := r.SetQueryParam("id__in", qIDIn); err != nil {
341 return err
342 }
343 }
344
345 }
346
347 if o.IsConsoleServer != nil {
348
349 // query param is_console_server
350 var qrIsConsoleServer string
351 if o.IsConsoleServer != nil {
352 qrIsConsoleServer = *o.IsConsoleServer
353 }
354 qIsConsoleServer := qrIsConsoleServer
355 if qIsConsoleServer != "" {
356 if err := r.SetQueryParam("is_console_server", qIsConsoleServer); err != nil {
357 return err
358 }
359 }
360
361 }
362
363 if o.IsFullDepth != nil {
364
365 // query param is_full_depth
366 var qrIsFullDepth string
367 if o.IsFullDepth != nil {
368 qrIsFullDepth = *o.IsFullDepth
369 }
370 qIsFullDepth := qrIsFullDepth
371 if qIsFullDepth != "" {
372 if err := r.SetQueryParam("is_full_depth", qIsFullDepth); err != nil {
373 return err
374 }
375 }
376
377 }
378
379 if o.IsNetworkDevice != nil {
380
381 // query param is_network_device
382 var qrIsNetworkDevice string
383 if o.IsNetworkDevice != nil {
384 qrIsNetworkDevice = *o.IsNetworkDevice
385 }
386 qIsNetworkDevice := qrIsNetworkDevice
387 if qIsNetworkDevice != "" {
388 if err := r.SetQueryParam("is_network_device", qIsNetworkDevice); err != nil {
389 return err
390 }
391 }
392
393 }
394
395 if o.IsPdu != nil {
396
397 // query param is_pdu
398 var qrIsPdu string
399 if o.IsPdu != nil {
400 qrIsPdu = *o.IsPdu
401 }
402 qIsPdu := qrIsPdu
403 if qIsPdu != "" {
404 if err := r.SetQueryParam("is_pdu", qIsPdu); err != nil {
405 return err
406 }
407 }
408
409 }
410
411 if o.Limit != nil {
412
413 // query param limit
414 var qrLimit int64
415 if o.Limit != nil {
416 qrLimit = *o.Limit
417 }
418 qLimit := swag.FormatInt64(qrLimit)
419 if qLimit != "" {
420 if err := r.SetQueryParam("limit", qLimit); err != nil {
421 return err
422 }
423 }
424
425 }
426
427 if o.Manufacturer != nil {
428
429 // query param manufacturer
430 var qrManufacturer string
431 if o.Manufacturer != nil {
432 qrManufacturer = *o.Manufacturer
433 }
434 qManufacturer := qrManufacturer
435 if qManufacturer != "" {
436 if err := r.SetQueryParam("manufacturer", qManufacturer); err != nil {
437 return err
438 }
439 }
440
441 }
442
443 if o.ManufacturerID != nil {
444
445 // query param manufacturer_id
446 var qrManufacturerID string
447 if o.ManufacturerID != nil {
448 qrManufacturerID = *o.ManufacturerID
449 }
450 qManufacturerID := qrManufacturerID
451 if qManufacturerID != "" {
452 if err := r.SetQueryParam("manufacturer_id", qManufacturerID); err != nil {
453 return err
454 }
455 }
456
457 }
458
459 if o.Model != nil {
460
461 // query param model
462 var qrModel string
463 if o.Model != nil {
464 qrModel = *o.Model
465 }
466 qModel := qrModel
467 if qModel != "" {
468 if err := r.SetQueryParam("model", qModel); err != nil {
469 return err
470 }
471 }
472
473 }
474
475 if o.Offset != nil {
476
477 // query param offset
478 var qrOffset int64
479 if o.Offset != nil {
480 qrOffset = *o.Offset
481 }
482 qOffset := swag.FormatInt64(qrOffset)
483 if qOffset != "" {
484 if err := r.SetQueryParam("offset", qOffset); err != nil {
485 return err
486 }
487 }
488
489 }
490
491 if o.PartNumber != nil {
492
493 // query param part_number
494 var qrPartNumber string
495 if o.PartNumber != nil {
496 qrPartNumber = *o.PartNumber
497 }
498 qPartNumber := qrPartNumber
499 if qPartNumber != "" {
500 if err := r.SetQueryParam("part_number", qPartNumber); err != nil {
501 return err
502 }
503 }
504
505 }
506
507 if o.Q != nil {
508
509 // query param q
510 var qrQ string
511 if o.Q != nil {
512 qrQ = *o.Q
513 }
514 qQ := qrQ
515 if qQ != "" {
516 if err := r.SetQueryParam("q", qQ); err != nil {
517 return err
518 }
519 }
520
521 }
522
523 if o.Slug != nil {
524
525 // query param slug
526 var qrSlug string
527 if o.Slug != nil {
528 qrSlug = *o.Slug
529 }
530 qSlug := qrSlug
531 if qSlug != "" {
532 if err := r.SetQueryParam("slug", qSlug); err != nil {
533 return err
534 }
535 }
536
537 }
538
539 if o.SubdeviceRole != nil {
540
541 // query param subdevice_role
542 var qrSubdeviceRole string
543 if o.SubdeviceRole != nil {
544 qrSubdeviceRole = *o.SubdeviceRole
545 }
546 qSubdeviceRole := qrSubdeviceRole
547 if qSubdeviceRole != "" {
548 if err := r.SetQueryParam("subdevice_role", qSubdeviceRole); err != nil {
549 return err
550 }
551 }
552
553 }
554
555 if o.UHeight != nil {
556
557 // query param u_height
558 var qrUHeight float64
559 if o.UHeight != nil {
560 qrUHeight = *o.UHeight
561 }
562 qUHeight := swag.FormatFloat64(qrUHeight)
563 if qUHeight != "" {
564 if err := r.SetQueryParam("u_height", qUHeight); err != nil {
565 return err
566 }
567 }
568
569 }
570
571 if len(res) > 0 {
572 return errors.CompositeValidationError(res...)
573 }
574 return nil
575}