blob: c28c053ac8526c6f962d23dd89ea6a800896bf36 [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// NewDcimRacksListParams creates a new DcimRacksListParams object
37// with the default values initialized.
38func NewDcimRacksListParams() *DcimRacksListParams {
39 var ()
40 return &DcimRacksListParams{
41
42 timeout: cr.DefaultTimeout,
43 }
44}
45
46// NewDcimRacksListParamsWithTimeout creates a new DcimRacksListParams object
47// with the default values initialized, and the ability to set a timeout on a request
48func NewDcimRacksListParamsWithTimeout(timeout time.Duration) *DcimRacksListParams {
49 var ()
50 return &DcimRacksListParams{
51
52 timeout: timeout,
53 }
54}
55
56// NewDcimRacksListParamsWithContext creates a new DcimRacksListParams object
57// with the default values initialized, and the ability to set a context for a request
58func NewDcimRacksListParamsWithContext(ctx context.Context) *DcimRacksListParams {
59 var ()
60 return &DcimRacksListParams{
61
62 Context: ctx,
63 }
64}
65
66// NewDcimRacksListParamsWithHTTPClient creates a new DcimRacksListParams object
67// with the default values initialized, and the ability to set a custom HTTPClient for a request
68func NewDcimRacksListParamsWithHTTPClient(client *http.Client) *DcimRacksListParams {
69 var ()
70 return &DcimRacksListParams{
71 HTTPClient: client,
72 }
73}
74
75/*DcimRacksListParams contains all the parameters to send to the API endpoint
76for the dcim racks list operation typically these are written to a http.Request
77*/
78type DcimRacksListParams struct {
79
80 /*DescUnits*/
81 DescUnits *string
82 /*FacilityID*/
83 FacilityID *string
84 /*Group*/
85 Group *string
86 /*GroupID*/
87 GroupID *string
88 /*IDIn
89 Multiple values may be separated by commas.
90
91 */
92 IDIn *string
93 /*Limit
94 Number of results to return per page.
95
96 */
97 Limit *int64
98 /*Name*/
99 Name *string
100 /*Offset
101 The initial index from which to return the results.
102
103 */
104 Offset *int64
105 /*Q*/
106 Q *string
107 /*Role*/
108 Role *string
109 /*RoleID*/
110 RoleID *string
111 /*Serial*/
112 Serial *string
113 /*Site*/
114 Site *string
115 /*SiteID*/
116 SiteID *string
117 /*Tenant*/
118 Tenant *string
119 /*TenantID*/
120 TenantID *string
121 /*Type*/
122 Type *string
123 /*UHeight*/
124 UHeight *float64
125 /*Width*/
126 Width *string
127
128 timeout time.Duration
129 Context context.Context
130 HTTPClient *http.Client
131}
132
133// WithTimeout adds the timeout to the dcim racks list params
134func (o *DcimRacksListParams) WithTimeout(timeout time.Duration) *DcimRacksListParams {
135 o.SetTimeout(timeout)
136 return o
137}
138
139// SetTimeout adds the timeout to the dcim racks list params
140func (o *DcimRacksListParams) SetTimeout(timeout time.Duration) {
141 o.timeout = timeout
142}
143
144// WithContext adds the context to the dcim racks list params
145func (o *DcimRacksListParams) WithContext(ctx context.Context) *DcimRacksListParams {
146 o.SetContext(ctx)
147 return o
148}
149
150// SetContext adds the context to the dcim racks list params
151func (o *DcimRacksListParams) SetContext(ctx context.Context) {
152 o.Context = ctx
153}
154
155// WithHTTPClient adds the HTTPClient to the dcim racks list params
156func (o *DcimRacksListParams) WithHTTPClient(client *http.Client) *DcimRacksListParams {
157 o.SetHTTPClient(client)
158 return o
159}
160
161// SetHTTPClient adds the HTTPClient to the dcim racks list params
162func (o *DcimRacksListParams) SetHTTPClient(client *http.Client) {
163 o.HTTPClient = client
164}
165
166// WithDescUnits adds the descUnits to the dcim racks list params
167func (o *DcimRacksListParams) WithDescUnits(descUnits *string) *DcimRacksListParams {
168 o.SetDescUnits(descUnits)
169 return o
170}
171
172// SetDescUnits adds the descUnits to the dcim racks list params
173func (o *DcimRacksListParams) SetDescUnits(descUnits *string) {
174 o.DescUnits = descUnits
175}
176
177// WithFacilityID adds the facilityID to the dcim racks list params
178func (o *DcimRacksListParams) WithFacilityID(facilityID *string) *DcimRacksListParams {
179 o.SetFacilityID(facilityID)
180 return o
181}
182
183// SetFacilityID adds the facilityId to the dcim racks list params
184func (o *DcimRacksListParams) SetFacilityID(facilityID *string) {
185 o.FacilityID = facilityID
186}
187
188// WithGroup adds the group to the dcim racks list params
189func (o *DcimRacksListParams) WithGroup(group *string) *DcimRacksListParams {
190 o.SetGroup(group)
191 return o
192}
193
194// SetGroup adds the group to the dcim racks list params
195func (o *DcimRacksListParams) SetGroup(group *string) {
196 o.Group = group
197}
198
199// WithGroupID adds the groupID to the dcim racks list params
200func (o *DcimRacksListParams) WithGroupID(groupID *string) *DcimRacksListParams {
201 o.SetGroupID(groupID)
202 return o
203}
204
205// SetGroupID adds the groupId to the dcim racks list params
206func (o *DcimRacksListParams) SetGroupID(groupID *string) {
207 o.GroupID = groupID
208}
209
210// WithIDIn adds the iDIn to the dcim racks list params
211func (o *DcimRacksListParams) WithIDIn(iDIn *string) *DcimRacksListParams {
212 o.SetIDIn(iDIn)
213 return o
214}
215
216// SetIDIn adds the idIn to the dcim racks list params
217func (o *DcimRacksListParams) SetIDIn(iDIn *string) {
218 o.IDIn = iDIn
219}
220
221// WithLimit adds the limit to the dcim racks list params
222func (o *DcimRacksListParams) WithLimit(limit *int64) *DcimRacksListParams {
223 o.SetLimit(limit)
224 return o
225}
226
227// SetLimit adds the limit to the dcim racks list params
228func (o *DcimRacksListParams) SetLimit(limit *int64) {
229 o.Limit = limit
230}
231
232// WithName adds the name to the dcim racks list params
233func (o *DcimRacksListParams) WithName(name *string) *DcimRacksListParams {
234 o.SetName(name)
235 return o
236}
237
238// SetName adds the name to the dcim racks list params
239func (o *DcimRacksListParams) SetName(name *string) {
240 o.Name = name
241}
242
243// WithOffset adds the offset to the dcim racks list params
244func (o *DcimRacksListParams) WithOffset(offset *int64) *DcimRacksListParams {
245 o.SetOffset(offset)
246 return o
247}
248
249// SetOffset adds the offset to the dcim racks list params
250func (o *DcimRacksListParams) SetOffset(offset *int64) {
251 o.Offset = offset
252}
253
254// WithQ adds the q to the dcim racks list params
255func (o *DcimRacksListParams) WithQ(q *string) *DcimRacksListParams {
256 o.SetQ(q)
257 return o
258}
259
260// SetQ adds the q to the dcim racks list params
261func (o *DcimRacksListParams) SetQ(q *string) {
262 o.Q = q
263}
264
265// WithRole adds the role to the dcim racks list params
266func (o *DcimRacksListParams) WithRole(role *string) *DcimRacksListParams {
267 o.SetRole(role)
268 return o
269}
270
271// SetRole adds the role to the dcim racks list params
272func (o *DcimRacksListParams) SetRole(role *string) {
273 o.Role = role
274}
275
276// WithRoleID adds the roleID to the dcim racks list params
277func (o *DcimRacksListParams) WithRoleID(roleID *string) *DcimRacksListParams {
278 o.SetRoleID(roleID)
279 return o
280}
281
282// SetRoleID adds the roleId to the dcim racks list params
283func (o *DcimRacksListParams) SetRoleID(roleID *string) {
284 o.RoleID = roleID
285}
286
287// WithSerial adds the serial to the dcim racks list params
288func (o *DcimRacksListParams) WithSerial(serial *string) *DcimRacksListParams {
289 o.SetSerial(serial)
290 return o
291}
292
293// SetSerial adds the serial to the dcim racks list params
294func (o *DcimRacksListParams) SetSerial(serial *string) {
295 o.Serial = serial
296}
297
298// WithSite adds the site to the dcim racks list params
299func (o *DcimRacksListParams) WithSite(site *string) *DcimRacksListParams {
300 o.SetSite(site)
301 return o
302}
303
304// SetSite adds the site to the dcim racks list params
305func (o *DcimRacksListParams) SetSite(site *string) {
306 o.Site = site
307}
308
309// WithSiteID adds the siteID to the dcim racks list params
310func (o *DcimRacksListParams) WithSiteID(siteID *string) *DcimRacksListParams {
311 o.SetSiteID(siteID)
312 return o
313}
314
315// SetSiteID adds the siteId to the dcim racks list params
316func (o *DcimRacksListParams) SetSiteID(siteID *string) {
317 o.SiteID = siteID
318}
319
320// WithTenant adds the tenant to the dcim racks list params
321func (o *DcimRacksListParams) WithTenant(tenant *string) *DcimRacksListParams {
322 o.SetTenant(tenant)
323 return o
324}
325
326// SetTenant adds the tenant to the dcim racks list params
327func (o *DcimRacksListParams) SetTenant(tenant *string) {
328 o.Tenant = tenant
329}
330
331// WithTenantID adds the tenantID to the dcim racks list params
332func (o *DcimRacksListParams) WithTenantID(tenantID *string) *DcimRacksListParams {
333 o.SetTenantID(tenantID)
334 return o
335}
336
337// SetTenantID adds the tenantId to the dcim racks list params
338func (o *DcimRacksListParams) SetTenantID(tenantID *string) {
339 o.TenantID = tenantID
340}
341
342// WithType adds the typeVar to the dcim racks list params
343func (o *DcimRacksListParams) WithType(typeVar *string) *DcimRacksListParams {
344 o.SetType(typeVar)
345 return o
346}
347
348// SetType adds the type to the dcim racks list params
349func (o *DcimRacksListParams) SetType(typeVar *string) {
350 o.Type = typeVar
351}
352
353// WithUHeight adds the uHeight to the dcim racks list params
354func (o *DcimRacksListParams) WithUHeight(uHeight *float64) *DcimRacksListParams {
355 o.SetUHeight(uHeight)
356 return o
357}
358
359// SetUHeight adds the uHeight to the dcim racks list params
360func (o *DcimRacksListParams) SetUHeight(uHeight *float64) {
361 o.UHeight = uHeight
362}
363
364// WithWidth adds the width to the dcim racks list params
365func (o *DcimRacksListParams) WithWidth(width *string) *DcimRacksListParams {
366 o.SetWidth(width)
367 return o
368}
369
370// SetWidth adds the width to the dcim racks list params
371func (o *DcimRacksListParams) SetWidth(width *string) {
372 o.Width = width
373}
374
375// WriteToRequest writes these params to a swagger request
376func (o *DcimRacksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
377
378 if err := r.SetTimeout(o.timeout); err != nil {
379 return err
380 }
381 var res []error
382
383 if o.DescUnits != nil {
384
385 // query param desc_units
386 var qrDescUnits string
387 if o.DescUnits != nil {
388 qrDescUnits = *o.DescUnits
389 }
390 qDescUnits := qrDescUnits
391 if qDescUnits != "" {
392 if err := r.SetQueryParam("desc_units", qDescUnits); err != nil {
393 return err
394 }
395 }
396
397 }
398
399 if o.FacilityID != nil {
400
401 // query param facility_id
402 var qrFacilityID string
403 if o.FacilityID != nil {
404 qrFacilityID = *o.FacilityID
405 }
406 qFacilityID := qrFacilityID
407 if qFacilityID != "" {
408 if err := r.SetQueryParam("facility_id", qFacilityID); err != nil {
409 return err
410 }
411 }
412
413 }
414
415 if o.Group != nil {
416
417 // query param group
418 var qrGroup string
419 if o.Group != nil {
420 qrGroup = *o.Group
421 }
422 qGroup := qrGroup
423 if qGroup != "" {
424 if err := r.SetQueryParam("group", qGroup); err != nil {
425 return err
426 }
427 }
428
429 }
430
431 if o.GroupID != nil {
432
433 // query param group_id
434 var qrGroupID string
435 if o.GroupID != nil {
436 qrGroupID = *o.GroupID
437 }
438 qGroupID := qrGroupID
439 if qGroupID != "" {
440 if err := r.SetQueryParam("group_id", qGroupID); err != nil {
441 return err
442 }
443 }
444
445 }
446
447 if o.IDIn != nil {
448
449 // query param id__in
450 var qrIDIn string
451 if o.IDIn != nil {
452 qrIDIn = *o.IDIn
453 }
454 qIDIn := qrIDIn
455 if qIDIn != "" {
456 if err := r.SetQueryParam("id__in", qIDIn); err != nil {
457 return err
458 }
459 }
460
461 }
462
463 if o.Limit != nil {
464
465 // query param limit
466 var qrLimit int64
467 if o.Limit != nil {
468 qrLimit = *o.Limit
469 }
470 qLimit := swag.FormatInt64(qrLimit)
471 if qLimit != "" {
472 if err := r.SetQueryParam("limit", qLimit); err != nil {
473 return err
474 }
475 }
476
477 }
478
479 if o.Name != nil {
480
481 // query param name
482 var qrName string
483 if o.Name != nil {
484 qrName = *o.Name
485 }
486 qName := qrName
487 if qName != "" {
488 if err := r.SetQueryParam("name", qName); err != nil {
489 return err
490 }
491 }
492
493 }
494
495 if o.Offset != nil {
496
497 // query param offset
498 var qrOffset int64
499 if o.Offset != nil {
500 qrOffset = *o.Offset
501 }
502 qOffset := swag.FormatInt64(qrOffset)
503 if qOffset != "" {
504 if err := r.SetQueryParam("offset", qOffset); err != nil {
505 return err
506 }
507 }
508
509 }
510
511 if o.Q != nil {
512
513 // query param q
514 var qrQ string
515 if o.Q != nil {
516 qrQ = *o.Q
517 }
518 qQ := qrQ
519 if qQ != "" {
520 if err := r.SetQueryParam("q", qQ); err != nil {
521 return err
522 }
523 }
524
525 }
526
527 if o.Role != nil {
528
529 // query param role
530 var qrRole string
531 if o.Role != nil {
532 qrRole = *o.Role
533 }
534 qRole := qrRole
535 if qRole != "" {
536 if err := r.SetQueryParam("role", qRole); err != nil {
537 return err
538 }
539 }
540
541 }
542
543 if o.RoleID != nil {
544
545 // query param role_id
546 var qrRoleID string
547 if o.RoleID != nil {
548 qrRoleID = *o.RoleID
549 }
550 qRoleID := qrRoleID
551 if qRoleID != "" {
552 if err := r.SetQueryParam("role_id", qRoleID); err != nil {
553 return err
554 }
555 }
556
557 }
558
559 if o.Serial != nil {
560
561 // query param serial
562 var qrSerial string
563 if o.Serial != nil {
564 qrSerial = *o.Serial
565 }
566 qSerial := qrSerial
567 if qSerial != "" {
568 if err := r.SetQueryParam("serial", qSerial); err != nil {
569 return err
570 }
571 }
572
573 }
574
575 if o.Site != nil {
576
577 // query param site
578 var qrSite string
579 if o.Site != nil {
580 qrSite = *o.Site
581 }
582 qSite := qrSite
583 if qSite != "" {
584 if err := r.SetQueryParam("site", qSite); err != nil {
585 return err
586 }
587 }
588
589 }
590
591 if o.SiteID != nil {
592
593 // query param site_id
594 var qrSiteID string
595 if o.SiteID != nil {
596 qrSiteID = *o.SiteID
597 }
598 qSiteID := qrSiteID
599 if qSiteID != "" {
600 if err := r.SetQueryParam("site_id", qSiteID); err != nil {
601 return err
602 }
603 }
604
605 }
606
607 if o.Tenant != nil {
608
609 // query param tenant
610 var qrTenant string
611 if o.Tenant != nil {
612 qrTenant = *o.Tenant
613 }
614 qTenant := qrTenant
615 if qTenant != "" {
616 if err := r.SetQueryParam("tenant", qTenant); err != nil {
617 return err
618 }
619 }
620
621 }
622
623 if o.TenantID != nil {
624
625 // query param tenant_id
626 var qrTenantID string
627 if o.TenantID != nil {
628 qrTenantID = *o.TenantID
629 }
630 qTenantID := qrTenantID
631 if qTenantID != "" {
632 if err := r.SetQueryParam("tenant_id", qTenantID); err != nil {
633 return err
634 }
635 }
636
637 }
638
639 if o.Type != nil {
640
641 // query param type
642 var qrType string
643 if o.Type != nil {
644 qrType = *o.Type
645 }
646 qType := qrType
647 if qType != "" {
648 if err := r.SetQueryParam("type", qType); err != nil {
649 return err
650 }
651 }
652
653 }
654
655 if o.UHeight != nil {
656
657 // query param u_height
658 var qrUHeight float64
659 if o.UHeight != nil {
660 qrUHeight = *o.UHeight
661 }
662 qUHeight := swag.FormatFloat64(qrUHeight)
663 if qUHeight != "" {
664 if err := r.SetQueryParam("u_height", qUHeight); err != nil {
665 return err
666 }
667 }
668
669 }
670
671 if o.Width != nil {
672
673 // query param width
674 var qrWidth string
675 if o.Width != nil {
676 qrWidth = *o.Width
677 }
678 qWidth := qrWidth
679 if qWidth != "" {
680 if err := r.SetQueryParam("width", qWidth); err != nil {
681 return err
682 }
683 }
684
685 }
686
687 if len(res) > 0 {
688 return errors.CompositeValidationError(res...)
689 }
690 return nil
691}