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