Serge Bazanski | cc25bdf | 2018-10-25 14:02:58 +0200 | [diff] [blame^] | 1 | // 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 | |
| 17 | package 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 | |
| 22 | import ( |
| 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 | // NewDcimDevicesListParams creates a new DcimDevicesListParams object |
| 37 | // with the default values initialized. |
| 38 | func NewDcimDevicesListParams() *DcimDevicesListParams { |
| 39 | var () |
| 40 | return &DcimDevicesListParams{ |
| 41 | |
| 42 | timeout: cr.DefaultTimeout, |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | // NewDcimDevicesListParamsWithTimeout creates a new DcimDevicesListParams object |
| 47 | // with the default values initialized, and the ability to set a timeout on a request |
| 48 | func NewDcimDevicesListParamsWithTimeout(timeout time.Duration) *DcimDevicesListParams { |
| 49 | var () |
| 50 | return &DcimDevicesListParams{ |
| 51 | |
| 52 | timeout: timeout, |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // NewDcimDevicesListParamsWithContext creates a new DcimDevicesListParams object |
| 57 | // with the default values initialized, and the ability to set a context for a request |
| 58 | func NewDcimDevicesListParamsWithContext(ctx context.Context) *DcimDevicesListParams { |
| 59 | var () |
| 60 | return &DcimDevicesListParams{ |
| 61 | |
| 62 | Context: ctx, |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | // NewDcimDevicesListParamsWithHTTPClient creates a new DcimDevicesListParams object |
| 67 | // with the default values initialized, and the ability to set a custom HTTPClient for a request |
| 68 | func NewDcimDevicesListParamsWithHTTPClient(client *http.Client) *DcimDevicesListParams { |
| 69 | var () |
| 70 | return &DcimDevicesListParams{ |
| 71 | HTTPClient: client, |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /*DcimDevicesListParams contains all the parameters to send to the API endpoint |
| 76 | for the dcim devices list operation typically these are written to a http.Request |
| 77 | */ |
| 78 | type DcimDevicesListParams struct { |
| 79 | |
| 80 | /*AssetTag*/ |
| 81 | AssetTag *string |
| 82 | /*ClusterID*/ |
| 83 | ClusterID *string |
| 84 | /*DeviceTypeID*/ |
| 85 | DeviceTypeID *string |
| 86 | /*HasPrimaryIP*/ |
| 87 | HasPrimaryIP *string |
| 88 | /*IDIn |
| 89 | Multiple values may be separated by commas. |
| 90 | |
| 91 | */ |
| 92 | IDIn *string |
| 93 | /*IsConsoleServer*/ |
| 94 | IsConsoleServer *string |
| 95 | /*IsFullDepth*/ |
| 96 | IsFullDepth *string |
| 97 | /*IsNetworkDevice*/ |
| 98 | IsNetworkDevice *string |
| 99 | /*IsPdu*/ |
| 100 | IsPdu *string |
| 101 | /*Limit |
| 102 | Number of results to return per page. |
| 103 | |
| 104 | */ |
| 105 | Limit *int64 |
| 106 | /*MacAddress*/ |
| 107 | MacAddress *string |
| 108 | /*Manufacturer*/ |
| 109 | Manufacturer *string |
| 110 | /*ManufacturerID*/ |
| 111 | ManufacturerID *string |
| 112 | /*Model*/ |
| 113 | Model *string |
| 114 | /*Name*/ |
| 115 | Name *string |
| 116 | /*Offset |
| 117 | The initial index from which to return the results. |
| 118 | |
| 119 | */ |
| 120 | Offset *int64 |
| 121 | /*Platform*/ |
| 122 | Platform *string |
| 123 | /*PlatformID*/ |
| 124 | PlatformID *string |
| 125 | /*Position*/ |
| 126 | Position *float64 |
| 127 | /*Q*/ |
| 128 | Q *string |
| 129 | /*RackGroupID*/ |
| 130 | RackGroupID *string |
| 131 | /*RackID*/ |
| 132 | RackID *string |
| 133 | /*Role*/ |
| 134 | Role *string |
| 135 | /*RoleID*/ |
| 136 | RoleID *string |
| 137 | /*Serial*/ |
| 138 | Serial *string |
| 139 | /*Site*/ |
| 140 | Site *string |
| 141 | /*SiteID*/ |
| 142 | SiteID *string |
| 143 | /*Status*/ |
| 144 | Status *string |
| 145 | /*Tenant*/ |
| 146 | Tenant *string |
| 147 | /*TenantID*/ |
| 148 | TenantID *string |
| 149 | /*VirtualChassisID*/ |
| 150 | VirtualChassisID *string |
| 151 | |
| 152 | timeout time.Duration |
| 153 | Context context.Context |
| 154 | HTTPClient *http.Client |
| 155 | } |
| 156 | |
| 157 | // WithTimeout adds the timeout to the dcim devices list params |
| 158 | func (o *DcimDevicesListParams) WithTimeout(timeout time.Duration) *DcimDevicesListParams { |
| 159 | o.SetTimeout(timeout) |
| 160 | return o |
| 161 | } |
| 162 | |
| 163 | // SetTimeout adds the timeout to the dcim devices list params |
| 164 | func (o *DcimDevicesListParams) SetTimeout(timeout time.Duration) { |
| 165 | o.timeout = timeout |
| 166 | } |
| 167 | |
| 168 | // WithContext adds the context to the dcim devices list params |
| 169 | func (o *DcimDevicesListParams) WithContext(ctx context.Context) *DcimDevicesListParams { |
| 170 | o.SetContext(ctx) |
| 171 | return o |
| 172 | } |
| 173 | |
| 174 | // SetContext adds the context to the dcim devices list params |
| 175 | func (o *DcimDevicesListParams) SetContext(ctx context.Context) { |
| 176 | o.Context = ctx |
| 177 | } |
| 178 | |
| 179 | // WithHTTPClient adds the HTTPClient to the dcim devices list params |
| 180 | func (o *DcimDevicesListParams) WithHTTPClient(client *http.Client) *DcimDevicesListParams { |
| 181 | o.SetHTTPClient(client) |
| 182 | return o |
| 183 | } |
| 184 | |
| 185 | // SetHTTPClient adds the HTTPClient to the dcim devices list params |
| 186 | func (o *DcimDevicesListParams) SetHTTPClient(client *http.Client) { |
| 187 | o.HTTPClient = client |
| 188 | } |
| 189 | |
| 190 | // WithAssetTag adds the assetTag to the dcim devices list params |
| 191 | func (o *DcimDevicesListParams) WithAssetTag(assetTag *string) *DcimDevicesListParams { |
| 192 | o.SetAssetTag(assetTag) |
| 193 | return o |
| 194 | } |
| 195 | |
| 196 | // SetAssetTag adds the assetTag to the dcim devices list params |
| 197 | func (o *DcimDevicesListParams) SetAssetTag(assetTag *string) { |
| 198 | o.AssetTag = assetTag |
| 199 | } |
| 200 | |
| 201 | // WithClusterID adds the clusterID to the dcim devices list params |
| 202 | func (o *DcimDevicesListParams) WithClusterID(clusterID *string) *DcimDevicesListParams { |
| 203 | o.SetClusterID(clusterID) |
| 204 | return o |
| 205 | } |
| 206 | |
| 207 | // SetClusterID adds the clusterId to the dcim devices list params |
| 208 | func (o *DcimDevicesListParams) SetClusterID(clusterID *string) { |
| 209 | o.ClusterID = clusterID |
| 210 | } |
| 211 | |
| 212 | // WithDeviceTypeID adds the deviceTypeID to the dcim devices list params |
| 213 | func (o *DcimDevicesListParams) WithDeviceTypeID(deviceTypeID *string) *DcimDevicesListParams { |
| 214 | o.SetDeviceTypeID(deviceTypeID) |
| 215 | return o |
| 216 | } |
| 217 | |
| 218 | // SetDeviceTypeID adds the deviceTypeId to the dcim devices list params |
| 219 | func (o *DcimDevicesListParams) SetDeviceTypeID(deviceTypeID *string) { |
| 220 | o.DeviceTypeID = deviceTypeID |
| 221 | } |
| 222 | |
| 223 | // WithHasPrimaryIP adds the hasPrimaryIP to the dcim devices list params |
| 224 | func (o *DcimDevicesListParams) WithHasPrimaryIP(hasPrimaryIP *string) *DcimDevicesListParams { |
| 225 | o.SetHasPrimaryIP(hasPrimaryIP) |
| 226 | return o |
| 227 | } |
| 228 | |
| 229 | // SetHasPrimaryIP adds the hasPrimaryIp to the dcim devices list params |
| 230 | func (o *DcimDevicesListParams) SetHasPrimaryIP(hasPrimaryIP *string) { |
| 231 | o.HasPrimaryIP = hasPrimaryIP |
| 232 | } |
| 233 | |
| 234 | // WithIDIn adds the iDIn to the dcim devices list params |
| 235 | func (o *DcimDevicesListParams) WithIDIn(iDIn *string) *DcimDevicesListParams { |
| 236 | o.SetIDIn(iDIn) |
| 237 | return o |
| 238 | } |
| 239 | |
| 240 | // SetIDIn adds the idIn to the dcim devices list params |
| 241 | func (o *DcimDevicesListParams) SetIDIn(iDIn *string) { |
| 242 | o.IDIn = iDIn |
| 243 | } |
| 244 | |
| 245 | // WithIsConsoleServer adds the isConsoleServer to the dcim devices list params |
| 246 | func (o *DcimDevicesListParams) WithIsConsoleServer(isConsoleServer *string) *DcimDevicesListParams { |
| 247 | o.SetIsConsoleServer(isConsoleServer) |
| 248 | return o |
| 249 | } |
| 250 | |
| 251 | // SetIsConsoleServer adds the isConsoleServer to the dcim devices list params |
| 252 | func (o *DcimDevicesListParams) SetIsConsoleServer(isConsoleServer *string) { |
| 253 | o.IsConsoleServer = isConsoleServer |
| 254 | } |
| 255 | |
| 256 | // WithIsFullDepth adds the isFullDepth to the dcim devices list params |
| 257 | func (o *DcimDevicesListParams) WithIsFullDepth(isFullDepth *string) *DcimDevicesListParams { |
| 258 | o.SetIsFullDepth(isFullDepth) |
| 259 | return o |
| 260 | } |
| 261 | |
| 262 | // SetIsFullDepth adds the isFullDepth to the dcim devices list params |
| 263 | func (o *DcimDevicesListParams) SetIsFullDepth(isFullDepth *string) { |
| 264 | o.IsFullDepth = isFullDepth |
| 265 | } |
| 266 | |
| 267 | // WithIsNetworkDevice adds the isNetworkDevice to the dcim devices list params |
| 268 | func (o *DcimDevicesListParams) WithIsNetworkDevice(isNetworkDevice *string) *DcimDevicesListParams { |
| 269 | o.SetIsNetworkDevice(isNetworkDevice) |
| 270 | return o |
| 271 | } |
| 272 | |
| 273 | // SetIsNetworkDevice adds the isNetworkDevice to the dcim devices list params |
| 274 | func (o *DcimDevicesListParams) SetIsNetworkDevice(isNetworkDevice *string) { |
| 275 | o.IsNetworkDevice = isNetworkDevice |
| 276 | } |
| 277 | |
| 278 | // WithIsPdu adds the isPdu to the dcim devices list params |
| 279 | func (o *DcimDevicesListParams) WithIsPdu(isPdu *string) *DcimDevicesListParams { |
| 280 | o.SetIsPdu(isPdu) |
| 281 | return o |
| 282 | } |
| 283 | |
| 284 | // SetIsPdu adds the isPdu to the dcim devices list params |
| 285 | func (o *DcimDevicesListParams) SetIsPdu(isPdu *string) { |
| 286 | o.IsPdu = isPdu |
| 287 | } |
| 288 | |
| 289 | // WithLimit adds the limit to the dcim devices list params |
| 290 | func (o *DcimDevicesListParams) WithLimit(limit *int64) *DcimDevicesListParams { |
| 291 | o.SetLimit(limit) |
| 292 | return o |
| 293 | } |
| 294 | |
| 295 | // SetLimit adds the limit to the dcim devices list params |
| 296 | func (o *DcimDevicesListParams) SetLimit(limit *int64) { |
| 297 | o.Limit = limit |
| 298 | } |
| 299 | |
| 300 | // WithMacAddress adds the macAddress to the dcim devices list params |
| 301 | func (o *DcimDevicesListParams) WithMacAddress(macAddress *string) *DcimDevicesListParams { |
| 302 | o.SetMacAddress(macAddress) |
| 303 | return o |
| 304 | } |
| 305 | |
| 306 | // SetMacAddress adds the macAddress to the dcim devices list params |
| 307 | func (o *DcimDevicesListParams) SetMacAddress(macAddress *string) { |
| 308 | o.MacAddress = macAddress |
| 309 | } |
| 310 | |
| 311 | // WithManufacturer adds the manufacturer to the dcim devices list params |
| 312 | func (o *DcimDevicesListParams) WithManufacturer(manufacturer *string) *DcimDevicesListParams { |
| 313 | o.SetManufacturer(manufacturer) |
| 314 | return o |
| 315 | } |
| 316 | |
| 317 | // SetManufacturer adds the manufacturer to the dcim devices list params |
| 318 | func (o *DcimDevicesListParams) SetManufacturer(manufacturer *string) { |
| 319 | o.Manufacturer = manufacturer |
| 320 | } |
| 321 | |
| 322 | // WithManufacturerID adds the manufacturerID to the dcim devices list params |
| 323 | func (o *DcimDevicesListParams) WithManufacturerID(manufacturerID *string) *DcimDevicesListParams { |
| 324 | o.SetManufacturerID(manufacturerID) |
| 325 | return o |
| 326 | } |
| 327 | |
| 328 | // SetManufacturerID adds the manufacturerId to the dcim devices list params |
| 329 | func (o *DcimDevicesListParams) SetManufacturerID(manufacturerID *string) { |
| 330 | o.ManufacturerID = manufacturerID |
| 331 | } |
| 332 | |
| 333 | // WithModel adds the model to the dcim devices list params |
| 334 | func (o *DcimDevicesListParams) WithModel(model *string) *DcimDevicesListParams { |
| 335 | o.SetModel(model) |
| 336 | return o |
| 337 | } |
| 338 | |
| 339 | // SetModel adds the model to the dcim devices list params |
| 340 | func (o *DcimDevicesListParams) SetModel(model *string) { |
| 341 | o.Model = model |
| 342 | } |
| 343 | |
| 344 | // WithName adds the name to the dcim devices list params |
| 345 | func (o *DcimDevicesListParams) WithName(name *string) *DcimDevicesListParams { |
| 346 | o.SetName(name) |
| 347 | return o |
| 348 | } |
| 349 | |
| 350 | // SetName adds the name to the dcim devices list params |
| 351 | func (o *DcimDevicesListParams) SetName(name *string) { |
| 352 | o.Name = name |
| 353 | } |
| 354 | |
| 355 | // WithOffset adds the offset to the dcim devices list params |
| 356 | func (o *DcimDevicesListParams) WithOffset(offset *int64) *DcimDevicesListParams { |
| 357 | o.SetOffset(offset) |
| 358 | return o |
| 359 | } |
| 360 | |
| 361 | // SetOffset adds the offset to the dcim devices list params |
| 362 | func (o *DcimDevicesListParams) SetOffset(offset *int64) { |
| 363 | o.Offset = offset |
| 364 | } |
| 365 | |
| 366 | // WithPlatform adds the platform to the dcim devices list params |
| 367 | func (o *DcimDevicesListParams) WithPlatform(platform *string) *DcimDevicesListParams { |
| 368 | o.SetPlatform(platform) |
| 369 | return o |
| 370 | } |
| 371 | |
| 372 | // SetPlatform adds the platform to the dcim devices list params |
| 373 | func (o *DcimDevicesListParams) SetPlatform(platform *string) { |
| 374 | o.Platform = platform |
| 375 | } |
| 376 | |
| 377 | // WithPlatformID adds the platformID to the dcim devices list params |
| 378 | func (o *DcimDevicesListParams) WithPlatformID(platformID *string) *DcimDevicesListParams { |
| 379 | o.SetPlatformID(platformID) |
| 380 | return o |
| 381 | } |
| 382 | |
| 383 | // SetPlatformID adds the platformId to the dcim devices list params |
| 384 | func (o *DcimDevicesListParams) SetPlatformID(platformID *string) { |
| 385 | o.PlatformID = platformID |
| 386 | } |
| 387 | |
| 388 | // WithPosition adds the position to the dcim devices list params |
| 389 | func (o *DcimDevicesListParams) WithPosition(position *float64) *DcimDevicesListParams { |
| 390 | o.SetPosition(position) |
| 391 | return o |
| 392 | } |
| 393 | |
| 394 | // SetPosition adds the position to the dcim devices list params |
| 395 | func (o *DcimDevicesListParams) SetPosition(position *float64) { |
| 396 | o.Position = position |
| 397 | } |
| 398 | |
| 399 | // WithQ adds the q to the dcim devices list params |
| 400 | func (o *DcimDevicesListParams) WithQ(q *string) *DcimDevicesListParams { |
| 401 | o.SetQ(q) |
| 402 | return o |
| 403 | } |
| 404 | |
| 405 | // SetQ adds the q to the dcim devices list params |
| 406 | func (o *DcimDevicesListParams) SetQ(q *string) { |
| 407 | o.Q = q |
| 408 | } |
| 409 | |
| 410 | // WithRackGroupID adds the rackGroupID to the dcim devices list params |
| 411 | func (o *DcimDevicesListParams) WithRackGroupID(rackGroupID *string) *DcimDevicesListParams { |
| 412 | o.SetRackGroupID(rackGroupID) |
| 413 | return o |
| 414 | } |
| 415 | |
| 416 | // SetRackGroupID adds the rackGroupId to the dcim devices list params |
| 417 | func (o *DcimDevicesListParams) SetRackGroupID(rackGroupID *string) { |
| 418 | o.RackGroupID = rackGroupID |
| 419 | } |
| 420 | |
| 421 | // WithRackID adds the rackID to the dcim devices list params |
| 422 | func (o *DcimDevicesListParams) WithRackID(rackID *string) *DcimDevicesListParams { |
| 423 | o.SetRackID(rackID) |
| 424 | return o |
| 425 | } |
| 426 | |
| 427 | // SetRackID adds the rackId to the dcim devices list params |
| 428 | func (o *DcimDevicesListParams) SetRackID(rackID *string) { |
| 429 | o.RackID = rackID |
| 430 | } |
| 431 | |
| 432 | // WithRole adds the role to the dcim devices list params |
| 433 | func (o *DcimDevicesListParams) WithRole(role *string) *DcimDevicesListParams { |
| 434 | o.SetRole(role) |
| 435 | return o |
| 436 | } |
| 437 | |
| 438 | // SetRole adds the role to the dcim devices list params |
| 439 | func (o *DcimDevicesListParams) SetRole(role *string) { |
| 440 | o.Role = role |
| 441 | } |
| 442 | |
| 443 | // WithRoleID adds the roleID to the dcim devices list params |
| 444 | func (o *DcimDevicesListParams) WithRoleID(roleID *string) *DcimDevicesListParams { |
| 445 | o.SetRoleID(roleID) |
| 446 | return o |
| 447 | } |
| 448 | |
| 449 | // SetRoleID adds the roleId to the dcim devices list params |
| 450 | func (o *DcimDevicesListParams) SetRoleID(roleID *string) { |
| 451 | o.RoleID = roleID |
| 452 | } |
| 453 | |
| 454 | // WithSerial adds the serial to the dcim devices list params |
| 455 | func (o *DcimDevicesListParams) WithSerial(serial *string) *DcimDevicesListParams { |
| 456 | o.SetSerial(serial) |
| 457 | return o |
| 458 | } |
| 459 | |
| 460 | // SetSerial adds the serial to the dcim devices list params |
| 461 | func (o *DcimDevicesListParams) SetSerial(serial *string) { |
| 462 | o.Serial = serial |
| 463 | } |
| 464 | |
| 465 | // WithSite adds the site to the dcim devices list params |
| 466 | func (o *DcimDevicesListParams) WithSite(site *string) *DcimDevicesListParams { |
| 467 | o.SetSite(site) |
| 468 | return o |
| 469 | } |
| 470 | |
| 471 | // SetSite adds the site to the dcim devices list params |
| 472 | func (o *DcimDevicesListParams) SetSite(site *string) { |
| 473 | o.Site = site |
| 474 | } |
| 475 | |
| 476 | // WithSiteID adds the siteID to the dcim devices list params |
| 477 | func (o *DcimDevicesListParams) WithSiteID(siteID *string) *DcimDevicesListParams { |
| 478 | o.SetSiteID(siteID) |
| 479 | return o |
| 480 | } |
| 481 | |
| 482 | // SetSiteID adds the siteId to the dcim devices list params |
| 483 | func (o *DcimDevicesListParams) SetSiteID(siteID *string) { |
| 484 | o.SiteID = siteID |
| 485 | } |
| 486 | |
| 487 | // WithStatus adds the status to the dcim devices list params |
| 488 | func (o *DcimDevicesListParams) WithStatus(status *string) *DcimDevicesListParams { |
| 489 | o.SetStatus(status) |
| 490 | return o |
| 491 | } |
| 492 | |
| 493 | // SetStatus adds the status to the dcim devices list params |
| 494 | func (o *DcimDevicesListParams) SetStatus(status *string) { |
| 495 | o.Status = status |
| 496 | } |
| 497 | |
| 498 | // WithTenant adds the tenant to the dcim devices list params |
| 499 | func (o *DcimDevicesListParams) WithTenant(tenant *string) *DcimDevicesListParams { |
| 500 | o.SetTenant(tenant) |
| 501 | return o |
| 502 | } |
| 503 | |
| 504 | // SetTenant adds the tenant to the dcim devices list params |
| 505 | func (o *DcimDevicesListParams) SetTenant(tenant *string) { |
| 506 | o.Tenant = tenant |
| 507 | } |
| 508 | |
| 509 | // WithTenantID adds the tenantID to the dcim devices list params |
| 510 | func (o *DcimDevicesListParams) WithTenantID(tenantID *string) *DcimDevicesListParams { |
| 511 | o.SetTenantID(tenantID) |
| 512 | return o |
| 513 | } |
| 514 | |
| 515 | // SetTenantID adds the tenantId to the dcim devices list params |
| 516 | func (o *DcimDevicesListParams) SetTenantID(tenantID *string) { |
| 517 | o.TenantID = tenantID |
| 518 | } |
| 519 | |
| 520 | // WithVirtualChassisID adds the virtualChassisID to the dcim devices list params |
| 521 | func (o *DcimDevicesListParams) WithVirtualChassisID(virtualChassisID *string) *DcimDevicesListParams { |
| 522 | o.SetVirtualChassisID(virtualChassisID) |
| 523 | return o |
| 524 | } |
| 525 | |
| 526 | // SetVirtualChassisID adds the virtualChassisId to the dcim devices list params |
| 527 | func (o *DcimDevicesListParams) SetVirtualChassisID(virtualChassisID *string) { |
| 528 | o.VirtualChassisID = virtualChassisID |
| 529 | } |
| 530 | |
| 531 | // WriteToRequest writes these params to a swagger request |
| 532 | func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { |
| 533 | |
| 534 | if err := r.SetTimeout(o.timeout); err != nil { |
| 535 | return err |
| 536 | } |
| 537 | var res []error |
| 538 | |
| 539 | if o.AssetTag != nil { |
| 540 | |
| 541 | // query param asset_tag |
| 542 | var qrAssetTag string |
| 543 | if o.AssetTag != nil { |
| 544 | qrAssetTag = *o.AssetTag |
| 545 | } |
| 546 | qAssetTag := qrAssetTag |
| 547 | if qAssetTag != "" { |
| 548 | if err := r.SetQueryParam("asset_tag", qAssetTag); err != nil { |
| 549 | return err |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | } |
| 554 | |
| 555 | if o.ClusterID != nil { |
| 556 | |
| 557 | // query param cluster_id |
| 558 | var qrClusterID string |
| 559 | if o.ClusterID != nil { |
| 560 | qrClusterID = *o.ClusterID |
| 561 | } |
| 562 | qClusterID := qrClusterID |
| 563 | if qClusterID != "" { |
| 564 | if err := r.SetQueryParam("cluster_id", qClusterID); err != nil { |
| 565 | return err |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | } |
| 570 | |
| 571 | if o.DeviceTypeID != nil { |
| 572 | |
| 573 | // query param device_type_id |
| 574 | var qrDeviceTypeID string |
| 575 | if o.DeviceTypeID != nil { |
| 576 | qrDeviceTypeID = *o.DeviceTypeID |
| 577 | } |
| 578 | qDeviceTypeID := qrDeviceTypeID |
| 579 | if qDeviceTypeID != "" { |
| 580 | if err := r.SetQueryParam("device_type_id", qDeviceTypeID); err != nil { |
| 581 | return err |
| 582 | } |
| 583 | } |
| 584 | |
| 585 | } |
| 586 | |
| 587 | if o.HasPrimaryIP != nil { |
| 588 | |
| 589 | // query param has_primary_ip |
| 590 | var qrHasPrimaryIP string |
| 591 | if o.HasPrimaryIP != nil { |
| 592 | qrHasPrimaryIP = *o.HasPrimaryIP |
| 593 | } |
| 594 | qHasPrimaryIP := qrHasPrimaryIP |
| 595 | if qHasPrimaryIP != "" { |
| 596 | if err := r.SetQueryParam("has_primary_ip", qHasPrimaryIP); err != nil { |
| 597 | return err |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | } |
| 602 | |
| 603 | if o.IDIn != nil { |
| 604 | |
| 605 | // query param id__in |
| 606 | var qrIDIn string |
| 607 | if o.IDIn != nil { |
| 608 | qrIDIn = *o.IDIn |
| 609 | } |
| 610 | qIDIn := qrIDIn |
| 611 | if qIDIn != "" { |
| 612 | if err := r.SetQueryParam("id__in", qIDIn); err != nil { |
| 613 | return err |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | } |
| 618 | |
| 619 | if o.IsConsoleServer != nil { |
| 620 | |
| 621 | // query param is_console_server |
| 622 | var qrIsConsoleServer string |
| 623 | if o.IsConsoleServer != nil { |
| 624 | qrIsConsoleServer = *o.IsConsoleServer |
| 625 | } |
| 626 | qIsConsoleServer := qrIsConsoleServer |
| 627 | if qIsConsoleServer != "" { |
| 628 | if err := r.SetQueryParam("is_console_server", qIsConsoleServer); err != nil { |
| 629 | return err |
| 630 | } |
| 631 | } |
| 632 | |
| 633 | } |
| 634 | |
| 635 | if o.IsFullDepth != nil { |
| 636 | |
| 637 | // query param is_full_depth |
| 638 | var qrIsFullDepth string |
| 639 | if o.IsFullDepth != nil { |
| 640 | qrIsFullDepth = *o.IsFullDepth |
| 641 | } |
| 642 | qIsFullDepth := qrIsFullDepth |
| 643 | if qIsFullDepth != "" { |
| 644 | if err := r.SetQueryParam("is_full_depth", qIsFullDepth); err != nil { |
| 645 | return err |
| 646 | } |
| 647 | } |
| 648 | |
| 649 | } |
| 650 | |
| 651 | if o.IsNetworkDevice != nil { |
| 652 | |
| 653 | // query param is_network_device |
| 654 | var qrIsNetworkDevice string |
| 655 | if o.IsNetworkDevice != nil { |
| 656 | qrIsNetworkDevice = *o.IsNetworkDevice |
| 657 | } |
| 658 | qIsNetworkDevice := qrIsNetworkDevice |
| 659 | if qIsNetworkDevice != "" { |
| 660 | if err := r.SetQueryParam("is_network_device", qIsNetworkDevice); err != nil { |
| 661 | return err |
| 662 | } |
| 663 | } |
| 664 | |
| 665 | } |
| 666 | |
| 667 | if o.IsPdu != nil { |
| 668 | |
| 669 | // query param is_pdu |
| 670 | var qrIsPdu string |
| 671 | if o.IsPdu != nil { |
| 672 | qrIsPdu = *o.IsPdu |
| 673 | } |
| 674 | qIsPdu := qrIsPdu |
| 675 | if qIsPdu != "" { |
| 676 | if err := r.SetQueryParam("is_pdu", qIsPdu); err != nil { |
| 677 | return err |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | } |
| 682 | |
| 683 | if o.Limit != nil { |
| 684 | |
| 685 | // query param limit |
| 686 | var qrLimit int64 |
| 687 | if o.Limit != nil { |
| 688 | qrLimit = *o.Limit |
| 689 | } |
| 690 | qLimit := swag.FormatInt64(qrLimit) |
| 691 | if qLimit != "" { |
| 692 | if err := r.SetQueryParam("limit", qLimit); err != nil { |
| 693 | return err |
| 694 | } |
| 695 | } |
| 696 | |
| 697 | } |
| 698 | |
| 699 | if o.MacAddress != nil { |
| 700 | |
| 701 | // query param mac_address |
| 702 | var qrMacAddress string |
| 703 | if o.MacAddress != nil { |
| 704 | qrMacAddress = *o.MacAddress |
| 705 | } |
| 706 | qMacAddress := qrMacAddress |
| 707 | if qMacAddress != "" { |
| 708 | if err := r.SetQueryParam("mac_address", qMacAddress); err != nil { |
| 709 | return err |
| 710 | } |
| 711 | } |
| 712 | |
| 713 | } |
| 714 | |
| 715 | if o.Manufacturer != nil { |
| 716 | |
| 717 | // query param manufacturer |
| 718 | var qrManufacturer string |
| 719 | if o.Manufacturer != nil { |
| 720 | qrManufacturer = *o.Manufacturer |
| 721 | } |
| 722 | qManufacturer := qrManufacturer |
| 723 | if qManufacturer != "" { |
| 724 | if err := r.SetQueryParam("manufacturer", qManufacturer); err != nil { |
| 725 | return err |
| 726 | } |
| 727 | } |
| 728 | |
| 729 | } |
| 730 | |
| 731 | if o.ManufacturerID != nil { |
| 732 | |
| 733 | // query param manufacturer_id |
| 734 | var qrManufacturerID string |
| 735 | if o.ManufacturerID != nil { |
| 736 | qrManufacturerID = *o.ManufacturerID |
| 737 | } |
| 738 | qManufacturerID := qrManufacturerID |
| 739 | if qManufacturerID != "" { |
| 740 | if err := r.SetQueryParam("manufacturer_id", qManufacturerID); err != nil { |
| 741 | return err |
| 742 | } |
| 743 | } |
| 744 | |
| 745 | } |
| 746 | |
| 747 | if o.Model != nil { |
| 748 | |
| 749 | // query param model |
| 750 | var qrModel string |
| 751 | if o.Model != nil { |
| 752 | qrModel = *o.Model |
| 753 | } |
| 754 | qModel := qrModel |
| 755 | if qModel != "" { |
| 756 | if err := r.SetQueryParam("model", qModel); err != nil { |
| 757 | return err |
| 758 | } |
| 759 | } |
| 760 | |
| 761 | } |
| 762 | |
| 763 | if o.Name != nil { |
| 764 | |
| 765 | // query param name |
| 766 | var qrName string |
| 767 | if o.Name != nil { |
| 768 | qrName = *o.Name |
| 769 | } |
| 770 | qName := qrName |
| 771 | if qName != "" { |
| 772 | if err := r.SetQueryParam("name", qName); err != nil { |
| 773 | return err |
| 774 | } |
| 775 | } |
| 776 | |
| 777 | } |
| 778 | |
| 779 | if o.Offset != nil { |
| 780 | |
| 781 | // query param offset |
| 782 | var qrOffset int64 |
| 783 | if o.Offset != nil { |
| 784 | qrOffset = *o.Offset |
| 785 | } |
| 786 | qOffset := swag.FormatInt64(qrOffset) |
| 787 | if qOffset != "" { |
| 788 | if err := r.SetQueryParam("offset", qOffset); err != nil { |
| 789 | return err |
| 790 | } |
| 791 | } |
| 792 | |
| 793 | } |
| 794 | |
| 795 | if o.Platform != nil { |
| 796 | |
| 797 | // query param platform |
| 798 | var qrPlatform string |
| 799 | if o.Platform != nil { |
| 800 | qrPlatform = *o.Platform |
| 801 | } |
| 802 | qPlatform := qrPlatform |
| 803 | if qPlatform != "" { |
| 804 | if err := r.SetQueryParam("platform", qPlatform); err != nil { |
| 805 | return err |
| 806 | } |
| 807 | } |
| 808 | |
| 809 | } |
| 810 | |
| 811 | if o.PlatformID != nil { |
| 812 | |
| 813 | // query param platform_id |
| 814 | var qrPlatformID string |
| 815 | if o.PlatformID != nil { |
| 816 | qrPlatformID = *o.PlatformID |
| 817 | } |
| 818 | qPlatformID := qrPlatformID |
| 819 | if qPlatformID != "" { |
| 820 | if err := r.SetQueryParam("platform_id", qPlatformID); err != nil { |
| 821 | return err |
| 822 | } |
| 823 | } |
| 824 | |
| 825 | } |
| 826 | |
| 827 | if o.Position != nil { |
| 828 | |
| 829 | // query param position |
| 830 | var qrPosition float64 |
| 831 | if o.Position != nil { |
| 832 | qrPosition = *o.Position |
| 833 | } |
| 834 | qPosition := swag.FormatFloat64(qrPosition) |
| 835 | if qPosition != "" { |
| 836 | if err := r.SetQueryParam("position", qPosition); err != nil { |
| 837 | return err |
| 838 | } |
| 839 | } |
| 840 | |
| 841 | } |
| 842 | |
| 843 | if o.Q != nil { |
| 844 | |
| 845 | // query param q |
| 846 | var qrQ string |
| 847 | if o.Q != nil { |
| 848 | qrQ = *o.Q |
| 849 | } |
| 850 | qQ := qrQ |
| 851 | if qQ != "" { |
| 852 | if err := r.SetQueryParam("q", qQ); err != nil { |
| 853 | return err |
| 854 | } |
| 855 | } |
| 856 | |
| 857 | } |
| 858 | |
| 859 | if o.RackGroupID != nil { |
| 860 | |
| 861 | // query param rack_group_id |
| 862 | var qrRackGroupID string |
| 863 | if o.RackGroupID != nil { |
| 864 | qrRackGroupID = *o.RackGroupID |
| 865 | } |
| 866 | qRackGroupID := qrRackGroupID |
| 867 | if qRackGroupID != "" { |
| 868 | if err := r.SetQueryParam("rack_group_id", qRackGroupID); err != nil { |
| 869 | return err |
| 870 | } |
| 871 | } |
| 872 | |
| 873 | } |
| 874 | |
| 875 | if o.RackID != nil { |
| 876 | |
| 877 | // query param rack_id |
| 878 | var qrRackID string |
| 879 | if o.RackID != nil { |
| 880 | qrRackID = *o.RackID |
| 881 | } |
| 882 | qRackID := qrRackID |
| 883 | if qRackID != "" { |
| 884 | if err := r.SetQueryParam("rack_id", qRackID); err != nil { |
| 885 | return err |
| 886 | } |
| 887 | } |
| 888 | |
| 889 | } |
| 890 | |
| 891 | if o.Role != nil { |
| 892 | |
| 893 | // query param role |
| 894 | var qrRole string |
| 895 | if o.Role != nil { |
| 896 | qrRole = *o.Role |
| 897 | } |
| 898 | qRole := qrRole |
| 899 | if qRole != "" { |
| 900 | if err := r.SetQueryParam("role", qRole); err != nil { |
| 901 | return err |
| 902 | } |
| 903 | } |
| 904 | |
| 905 | } |
| 906 | |
| 907 | if o.RoleID != nil { |
| 908 | |
| 909 | // query param role_id |
| 910 | var qrRoleID string |
| 911 | if o.RoleID != nil { |
| 912 | qrRoleID = *o.RoleID |
| 913 | } |
| 914 | qRoleID := qrRoleID |
| 915 | if qRoleID != "" { |
| 916 | if err := r.SetQueryParam("role_id", qRoleID); err != nil { |
| 917 | return err |
| 918 | } |
| 919 | } |
| 920 | |
| 921 | } |
| 922 | |
| 923 | if o.Serial != nil { |
| 924 | |
| 925 | // query param serial |
| 926 | var qrSerial string |
| 927 | if o.Serial != nil { |
| 928 | qrSerial = *o.Serial |
| 929 | } |
| 930 | qSerial := qrSerial |
| 931 | if qSerial != "" { |
| 932 | if err := r.SetQueryParam("serial", qSerial); err != nil { |
| 933 | return err |
| 934 | } |
| 935 | } |
| 936 | |
| 937 | } |
| 938 | |
| 939 | if o.Site != nil { |
| 940 | |
| 941 | // query param site |
| 942 | var qrSite string |
| 943 | if o.Site != nil { |
| 944 | qrSite = *o.Site |
| 945 | } |
| 946 | qSite := qrSite |
| 947 | if qSite != "" { |
| 948 | if err := r.SetQueryParam("site", qSite); err != nil { |
| 949 | return err |
| 950 | } |
| 951 | } |
| 952 | |
| 953 | } |
| 954 | |
| 955 | if o.SiteID != nil { |
| 956 | |
| 957 | // query param site_id |
| 958 | var qrSiteID string |
| 959 | if o.SiteID != nil { |
| 960 | qrSiteID = *o.SiteID |
| 961 | } |
| 962 | qSiteID := qrSiteID |
| 963 | if qSiteID != "" { |
| 964 | if err := r.SetQueryParam("site_id", qSiteID); err != nil { |
| 965 | return err |
| 966 | } |
| 967 | } |
| 968 | |
| 969 | } |
| 970 | |
| 971 | if o.Status != nil { |
| 972 | |
| 973 | // query param status |
| 974 | var qrStatus string |
| 975 | if o.Status != nil { |
| 976 | qrStatus = *o.Status |
| 977 | } |
| 978 | qStatus := qrStatus |
| 979 | if qStatus != "" { |
| 980 | if err := r.SetQueryParam("status", qStatus); err != nil { |
| 981 | return err |
| 982 | } |
| 983 | } |
| 984 | |
| 985 | } |
| 986 | |
| 987 | if o.Tenant != nil { |
| 988 | |
| 989 | // query param tenant |
| 990 | var qrTenant string |
| 991 | if o.Tenant != nil { |
| 992 | qrTenant = *o.Tenant |
| 993 | } |
| 994 | qTenant := qrTenant |
| 995 | if qTenant != "" { |
| 996 | if err := r.SetQueryParam("tenant", qTenant); err != nil { |
| 997 | return err |
| 998 | } |
| 999 | } |
| 1000 | |
| 1001 | } |
| 1002 | |
| 1003 | if o.TenantID != nil { |
| 1004 | |
| 1005 | // query param tenant_id |
| 1006 | var qrTenantID string |
| 1007 | if o.TenantID != nil { |
| 1008 | qrTenantID = *o.TenantID |
| 1009 | } |
| 1010 | qTenantID := qrTenantID |
| 1011 | if qTenantID != "" { |
| 1012 | if err := r.SetQueryParam("tenant_id", qTenantID); err != nil { |
| 1013 | return err |
| 1014 | } |
| 1015 | } |
| 1016 | |
| 1017 | } |
| 1018 | |
| 1019 | if o.VirtualChassisID != nil { |
| 1020 | |
| 1021 | // query param virtual_chassis_id |
| 1022 | var qrVirtualChassisID string |
| 1023 | if o.VirtualChassisID != nil { |
| 1024 | qrVirtualChassisID = *o.VirtualChassisID |
| 1025 | } |
| 1026 | qVirtualChassisID := qrVirtualChassisID |
| 1027 | if qVirtualChassisID != "" { |
| 1028 | if err := r.SetQueryParam("virtual_chassis_id", qVirtualChassisID); err != nil { |
| 1029 | return err |
| 1030 | } |
| 1031 | } |
| 1032 | |
| 1033 | } |
| 1034 | |
| 1035 | if len(res) > 0 { |
| 1036 | return errors.CompositeValidationError(res...) |
| 1037 | } |
| 1038 | return nil |
| 1039 | } |