github.com/digitalocean/go-netbox@v0.0.2/netbox/client/extras/extras_export_templates_list_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright 2020 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 18 package extras 19 20 // This file was generated by the swagger tool. 21 // Editing this file might prove futile when you re-run the swagger generate command 22 23 import ( 24 "context" 25 "net/http" 26 "time" 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/strfmt" 32 "github.com/go-openapi/swag" 33 ) 34 35 // NewExtrasExportTemplatesListParams creates a new ExtrasExportTemplatesListParams object, 36 // with the default timeout for this client. 37 // 38 // Default values are not hydrated, since defaults are normally applied by the API server side. 39 // 40 // To enforce default values in parameter, use SetDefaults or WithDefaults. 41 func NewExtrasExportTemplatesListParams() *ExtrasExportTemplatesListParams { 42 return &ExtrasExportTemplatesListParams{ 43 timeout: cr.DefaultTimeout, 44 } 45 } 46 47 // NewExtrasExportTemplatesListParamsWithTimeout creates a new ExtrasExportTemplatesListParams object 48 // with the ability to set a timeout on a request. 49 func NewExtrasExportTemplatesListParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesListParams { 50 return &ExtrasExportTemplatesListParams{ 51 timeout: timeout, 52 } 53 } 54 55 // NewExtrasExportTemplatesListParamsWithContext creates a new ExtrasExportTemplatesListParams object 56 // with the ability to set a context for a request. 57 func NewExtrasExportTemplatesListParamsWithContext(ctx context.Context) *ExtrasExportTemplatesListParams { 58 return &ExtrasExportTemplatesListParams{ 59 Context: ctx, 60 } 61 } 62 63 // NewExtrasExportTemplatesListParamsWithHTTPClient creates a new ExtrasExportTemplatesListParams object 64 // with the ability to set a custom HTTPClient for a request. 65 func NewExtrasExportTemplatesListParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesListParams { 66 return &ExtrasExportTemplatesListParams{ 67 HTTPClient: client, 68 } 69 } 70 71 /* ExtrasExportTemplatesListParams contains all the parameters to send to the API endpoint 72 for the extras export templates list operation. 73 74 Typically these are written to a http.Request. 75 */ 76 type ExtrasExportTemplatesListParams struct { 77 78 // ContentType. 79 ContentType *string 80 81 // ContentTypen. 82 ContentTypen *string 83 84 // ID. 85 ID *string 86 87 // IDGt. 88 IDGt *string 89 90 // IDGte. 91 IDGte *string 92 93 // IDLt. 94 IDLt *string 95 96 // IDLte. 97 IDLte *string 98 99 // IDn. 100 IDn *string 101 102 /* Limit. 103 104 Number of results to return per page. 105 */ 106 Limit *int64 107 108 // Name. 109 Name *string 110 111 // NameEmpty. 112 NameEmpty *string 113 114 // NameIc. 115 NameIc *string 116 117 // NameIe. 118 NameIe *string 119 120 // NameIew. 121 NameIew *string 122 123 // NameIsw. 124 NameIsw *string 125 126 // Namen. 127 Namen *string 128 129 // NameNic. 130 NameNic *string 131 132 // NameNie. 133 NameNie *string 134 135 // NameNiew. 136 NameNiew *string 137 138 // NameNisw. 139 NameNisw *string 140 141 /* Offset. 142 143 The initial index from which to return the results. 144 */ 145 Offset *int64 146 147 timeout time.Duration 148 Context context.Context 149 HTTPClient *http.Client 150 } 151 152 // WithDefaults hydrates default values in the extras export templates list params (not the query body). 153 // 154 // All values with no default are reset to their zero value. 155 func (o *ExtrasExportTemplatesListParams) WithDefaults() *ExtrasExportTemplatesListParams { 156 o.SetDefaults() 157 return o 158 } 159 160 // SetDefaults hydrates default values in the extras export templates list params (not the query body). 161 // 162 // All values with no default are reset to their zero value. 163 func (o *ExtrasExportTemplatesListParams) SetDefaults() { 164 // no default values defined for this parameter 165 } 166 167 // WithTimeout adds the timeout to the extras export templates list params 168 func (o *ExtrasExportTemplatesListParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesListParams { 169 o.SetTimeout(timeout) 170 return o 171 } 172 173 // SetTimeout adds the timeout to the extras export templates list params 174 func (o *ExtrasExportTemplatesListParams) SetTimeout(timeout time.Duration) { 175 o.timeout = timeout 176 } 177 178 // WithContext adds the context to the extras export templates list params 179 func (o *ExtrasExportTemplatesListParams) WithContext(ctx context.Context) *ExtrasExportTemplatesListParams { 180 o.SetContext(ctx) 181 return o 182 } 183 184 // SetContext adds the context to the extras export templates list params 185 func (o *ExtrasExportTemplatesListParams) SetContext(ctx context.Context) { 186 o.Context = ctx 187 } 188 189 // WithHTTPClient adds the HTTPClient to the extras export templates list params 190 func (o *ExtrasExportTemplatesListParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesListParams { 191 o.SetHTTPClient(client) 192 return o 193 } 194 195 // SetHTTPClient adds the HTTPClient to the extras export templates list params 196 func (o *ExtrasExportTemplatesListParams) SetHTTPClient(client *http.Client) { 197 o.HTTPClient = client 198 } 199 200 // WithContentType adds the contentType to the extras export templates list params 201 func (o *ExtrasExportTemplatesListParams) WithContentType(contentType *string) *ExtrasExportTemplatesListParams { 202 o.SetContentType(contentType) 203 return o 204 } 205 206 // SetContentType adds the contentType to the extras export templates list params 207 func (o *ExtrasExportTemplatesListParams) SetContentType(contentType *string) { 208 o.ContentType = contentType 209 } 210 211 // WithContentTypen adds the contentTypen to the extras export templates list params 212 func (o *ExtrasExportTemplatesListParams) WithContentTypen(contentTypen *string) *ExtrasExportTemplatesListParams { 213 o.SetContentTypen(contentTypen) 214 return o 215 } 216 217 // SetContentTypen adds the contentTypeN to the extras export templates list params 218 func (o *ExtrasExportTemplatesListParams) SetContentTypen(contentTypen *string) { 219 o.ContentTypen = contentTypen 220 } 221 222 // WithID adds the id to the extras export templates list params 223 func (o *ExtrasExportTemplatesListParams) WithID(id *string) *ExtrasExportTemplatesListParams { 224 o.SetID(id) 225 return o 226 } 227 228 // SetID adds the id to the extras export templates list params 229 func (o *ExtrasExportTemplatesListParams) SetID(id *string) { 230 o.ID = id 231 } 232 233 // WithIDGt adds the iDGt to the extras export templates list params 234 func (o *ExtrasExportTemplatesListParams) WithIDGt(iDGt *string) *ExtrasExportTemplatesListParams { 235 o.SetIDGt(iDGt) 236 return o 237 } 238 239 // SetIDGt adds the idGt to the extras export templates list params 240 func (o *ExtrasExportTemplatesListParams) SetIDGt(iDGt *string) { 241 o.IDGt = iDGt 242 } 243 244 // WithIDGte adds the iDGte to the extras export templates list params 245 func (o *ExtrasExportTemplatesListParams) WithIDGte(iDGte *string) *ExtrasExportTemplatesListParams { 246 o.SetIDGte(iDGte) 247 return o 248 } 249 250 // SetIDGte adds the idGte to the extras export templates list params 251 func (o *ExtrasExportTemplatesListParams) SetIDGte(iDGte *string) { 252 o.IDGte = iDGte 253 } 254 255 // WithIDLt adds the iDLt to the extras export templates list params 256 func (o *ExtrasExportTemplatesListParams) WithIDLt(iDLt *string) *ExtrasExportTemplatesListParams { 257 o.SetIDLt(iDLt) 258 return o 259 } 260 261 // SetIDLt adds the idLt to the extras export templates list params 262 func (o *ExtrasExportTemplatesListParams) SetIDLt(iDLt *string) { 263 o.IDLt = iDLt 264 } 265 266 // WithIDLte adds the iDLte to the extras export templates list params 267 func (o *ExtrasExportTemplatesListParams) WithIDLte(iDLte *string) *ExtrasExportTemplatesListParams { 268 o.SetIDLte(iDLte) 269 return o 270 } 271 272 // SetIDLte adds the idLte to the extras export templates list params 273 func (o *ExtrasExportTemplatesListParams) SetIDLte(iDLte *string) { 274 o.IDLte = iDLte 275 } 276 277 // WithIDn adds the iDn to the extras export templates list params 278 func (o *ExtrasExportTemplatesListParams) WithIDn(iDn *string) *ExtrasExportTemplatesListParams { 279 o.SetIDn(iDn) 280 return o 281 } 282 283 // SetIDn adds the idN to the extras export templates list params 284 func (o *ExtrasExportTemplatesListParams) SetIDn(iDn *string) { 285 o.IDn = iDn 286 } 287 288 // WithLimit adds the limit to the extras export templates list params 289 func (o *ExtrasExportTemplatesListParams) WithLimit(limit *int64) *ExtrasExportTemplatesListParams { 290 o.SetLimit(limit) 291 return o 292 } 293 294 // SetLimit adds the limit to the extras export templates list params 295 func (o *ExtrasExportTemplatesListParams) SetLimit(limit *int64) { 296 o.Limit = limit 297 } 298 299 // WithName adds the name to the extras export templates list params 300 func (o *ExtrasExportTemplatesListParams) WithName(name *string) *ExtrasExportTemplatesListParams { 301 o.SetName(name) 302 return o 303 } 304 305 // SetName adds the name to the extras export templates list params 306 func (o *ExtrasExportTemplatesListParams) SetName(name *string) { 307 o.Name = name 308 } 309 310 // WithNameEmpty adds the nameEmpty to the extras export templates list params 311 func (o *ExtrasExportTemplatesListParams) WithNameEmpty(nameEmpty *string) *ExtrasExportTemplatesListParams { 312 o.SetNameEmpty(nameEmpty) 313 return o 314 } 315 316 // SetNameEmpty adds the nameEmpty to the extras export templates list params 317 func (o *ExtrasExportTemplatesListParams) SetNameEmpty(nameEmpty *string) { 318 o.NameEmpty = nameEmpty 319 } 320 321 // WithNameIc adds the nameIc to the extras export templates list params 322 func (o *ExtrasExportTemplatesListParams) WithNameIc(nameIc *string) *ExtrasExportTemplatesListParams { 323 o.SetNameIc(nameIc) 324 return o 325 } 326 327 // SetNameIc adds the nameIc to the extras export templates list params 328 func (o *ExtrasExportTemplatesListParams) SetNameIc(nameIc *string) { 329 o.NameIc = nameIc 330 } 331 332 // WithNameIe adds the nameIe to the extras export templates list params 333 func (o *ExtrasExportTemplatesListParams) WithNameIe(nameIe *string) *ExtrasExportTemplatesListParams { 334 o.SetNameIe(nameIe) 335 return o 336 } 337 338 // SetNameIe adds the nameIe to the extras export templates list params 339 func (o *ExtrasExportTemplatesListParams) SetNameIe(nameIe *string) { 340 o.NameIe = nameIe 341 } 342 343 // WithNameIew adds the nameIew to the extras export templates list params 344 func (o *ExtrasExportTemplatesListParams) WithNameIew(nameIew *string) *ExtrasExportTemplatesListParams { 345 o.SetNameIew(nameIew) 346 return o 347 } 348 349 // SetNameIew adds the nameIew to the extras export templates list params 350 func (o *ExtrasExportTemplatesListParams) SetNameIew(nameIew *string) { 351 o.NameIew = nameIew 352 } 353 354 // WithNameIsw adds the nameIsw to the extras export templates list params 355 func (o *ExtrasExportTemplatesListParams) WithNameIsw(nameIsw *string) *ExtrasExportTemplatesListParams { 356 o.SetNameIsw(nameIsw) 357 return o 358 } 359 360 // SetNameIsw adds the nameIsw to the extras export templates list params 361 func (o *ExtrasExportTemplatesListParams) SetNameIsw(nameIsw *string) { 362 o.NameIsw = nameIsw 363 } 364 365 // WithNamen adds the namen to the extras export templates list params 366 func (o *ExtrasExportTemplatesListParams) WithNamen(namen *string) *ExtrasExportTemplatesListParams { 367 o.SetNamen(namen) 368 return o 369 } 370 371 // SetNamen adds the nameN to the extras export templates list params 372 func (o *ExtrasExportTemplatesListParams) SetNamen(namen *string) { 373 o.Namen = namen 374 } 375 376 // WithNameNic adds the nameNic to the extras export templates list params 377 func (o *ExtrasExportTemplatesListParams) WithNameNic(nameNic *string) *ExtrasExportTemplatesListParams { 378 o.SetNameNic(nameNic) 379 return o 380 } 381 382 // SetNameNic adds the nameNic to the extras export templates list params 383 func (o *ExtrasExportTemplatesListParams) SetNameNic(nameNic *string) { 384 o.NameNic = nameNic 385 } 386 387 // WithNameNie adds the nameNie to the extras export templates list params 388 func (o *ExtrasExportTemplatesListParams) WithNameNie(nameNie *string) *ExtrasExportTemplatesListParams { 389 o.SetNameNie(nameNie) 390 return o 391 } 392 393 // SetNameNie adds the nameNie to the extras export templates list params 394 func (o *ExtrasExportTemplatesListParams) SetNameNie(nameNie *string) { 395 o.NameNie = nameNie 396 } 397 398 // WithNameNiew adds the nameNiew to the extras export templates list params 399 func (o *ExtrasExportTemplatesListParams) WithNameNiew(nameNiew *string) *ExtrasExportTemplatesListParams { 400 o.SetNameNiew(nameNiew) 401 return o 402 } 403 404 // SetNameNiew adds the nameNiew to the extras export templates list params 405 func (o *ExtrasExportTemplatesListParams) SetNameNiew(nameNiew *string) { 406 o.NameNiew = nameNiew 407 } 408 409 // WithNameNisw adds the nameNisw to the extras export templates list params 410 func (o *ExtrasExportTemplatesListParams) WithNameNisw(nameNisw *string) *ExtrasExportTemplatesListParams { 411 o.SetNameNisw(nameNisw) 412 return o 413 } 414 415 // SetNameNisw adds the nameNisw to the extras export templates list params 416 func (o *ExtrasExportTemplatesListParams) SetNameNisw(nameNisw *string) { 417 o.NameNisw = nameNisw 418 } 419 420 // WithOffset adds the offset to the extras export templates list params 421 func (o *ExtrasExportTemplatesListParams) WithOffset(offset *int64) *ExtrasExportTemplatesListParams { 422 o.SetOffset(offset) 423 return o 424 } 425 426 // SetOffset adds the offset to the extras export templates list params 427 func (o *ExtrasExportTemplatesListParams) SetOffset(offset *int64) { 428 o.Offset = offset 429 } 430 431 // WriteToRequest writes these params to a swagger request 432 func (o *ExtrasExportTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 433 434 if err := r.SetTimeout(o.timeout); err != nil { 435 return err 436 } 437 var res []error 438 439 if o.ContentType != nil { 440 441 // query param content_type 442 var qrContentType string 443 444 if o.ContentType != nil { 445 qrContentType = *o.ContentType 446 } 447 qContentType := qrContentType 448 if qContentType != "" { 449 450 if err := r.SetQueryParam("content_type", qContentType); err != nil { 451 return err 452 } 453 } 454 } 455 456 if o.ContentTypen != nil { 457 458 // query param content_type__n 459 var qrContentTypen string 460 461 if o.ContentTypen != nil { 462 qrContentTypen = *o.ContentTypen 463 } 464 qContentTypen := qrContentTypen 465 if qContentTypen != "" { 466 467 if err := r.SetQueryParam("content_type__n", qContentTypen); err != nil { 468 return err 469 } 470 } 471 } 472 473 if o.ID != nil { 474 475 // query param id 476 var qrID string 477 478 if o.ID != nil { 479 qrID = *o.ID 480 } 481 qID := qrID 482 if qID != "" { 483 484 if err := r.SetQueryParam("id", qID); err != nil { 485 return err 486 } 487 } 488 } 489 490 if o.IDGt != nil { 491 492 // query param id__gt 493 var qrIDGt string 494 495 if o.IDGt != nil { 496 qrIDGt = *o.IDGt 497 } 498 qIDGt := qrIDGt 499 if qIDGt != "" { 500 501 if err := r.SetQueryParam("id__gt", qIDGt); err != nil { 502 return err 503 } 504 } 505 } 506 507 if o.IDGte != nil { 508 509 // query param id__gte 510 var qrIDGte string 511 512 if o.IDGte != nil { 513 qrIDGte = *o.IDGte 514 } 515 qIDGte := qrIDGte 516 if qIDGte != "" { 517 518 if err := r.SetQueryParam("id__gte", qIDGte); err != nil { 519 return err 520 } 521 } 522 } 523 524 if o.IDLt != nil { 525 526 // query param id__lt 527 var qrIDLt string 528 529 if o.IDLt != nil { 530 qrIDLt = *o.IDLt 531 } 532 qIDLt := qrIDLt 533 if qIDLt != "" { 534 535 if err := r.SetQueryParam("id__lt", qIDLt); err != nil { 536 return err 537 } 538 } 539 } 540 541 if o.IDLte != nil { 542 543 // query param id__lte 544 var qrIDLte string 545 546 if o.IDLte != nil { 547 qrIDLte = *o.IDLte 548 } 549 qIDLte := qrIDLte 550 if qIDLte != "" { 551 552 if err := r.SetQueryParam("id__lte", qIDLte); err != nil { 553 return err 554 } 555 } 556 } 557 558 if o.IDn != nil { 559 560 // query param id__n 561 var qrIDn string 562 563 if o.IDn != nil { 564 qrIDn = *o.IDn 565 } 566 qIDn := qrIDn 567 if qIDn != "" { 568 569 if err := r.SetQueryParam("id__n", qIDn); err != nil { 570 return err 571 } 572 } 573 } 574 575 if o.Limit != nil { 576 577 // query param limit 578 var qrLimit int64 579 580 if o.Limit != nil { 581 qrLimit = *o.Limit 582 } 583 qLimit := swag.FormatInt64(qrLimit) 584 if qLimit != "" { 585 586 if err := r.SetQueryParam("limit", qLimit); err != nil { 587 return err 588 } 589 } 590 } 591 592 if o.Name != nil { 593 594 // query param name 595 var qrName string 596 597 if o.Name != nil { 598 qrName = *o.Name 599 } 600 qName := qrName 601 if qName != "" { 602 603 if err := r.SetQueryParam("name", qName); err != nil { 604 return err 605 } 606 } 607 } 608 609 if o.NameEmpty != nil { 610 611 // query param name__empty 612 var qrNameEmpty string 613 614 if o.NameEmpty != nil { 615 qrNameEmpty = *o.NameEmpty 616 } 617 qNameEmpty := qrNameEmpty 618 if qNameEmpty != "" { 619 620 if err := r.SetQueryParam("name__empty", qNameEmpty); err != nil { 621 return err 622 } 623 } 624 } 625 626 if o.NameIc != nil { 627 628 // query param name__ic 629 var qrNameIc string 630 631 if o.NameIc != nil { 632 qrNameIc = *o.NameIc 633 } 634 qNameIc := qrNameIc 635 if qNameIc != "" { 636 637 if err := r.SetQueryParam("name__ic", qNameIc); err != nil { 638 return err 639 } 640 } 641 } 642 643 if o.NameIe != nil { 644 645 // query param name__ie 646 var qrNameIe string 647 648 if o.NameIe != nil { 649 qrNameIe = *o.NameIe 650 } 651 qNameIe := qrNameIe 652 if qNameIe != "" { 653 654 if err := r.SetQueryParam("name__ie", qNameIe); err != nil { 655 return err 656 } 657 } 658 } 659 660 if o.NameIew != nil { 661 662 // query param name__iew 663 var qrNameIew string 664 665 if o.NameIew != nil { 666 qrNameIew = *o.NameIew 667 } 668 qNameIew := qrNameIew 669 if qNameIew != "" { 670 671 if err := r.SetQueryParam("name__iew", qNameIew); err != nil { 672 return err 673 } 674 } 675 } 676 677 if o.NameIsw != nil { 678 679 // query param name__isw 680 var qrNameIsw string 681 682 if o.NameIsw != nil { 683 qrNameIsw = *o.NameIsw 684 } 685 qNameIsw := qrNameIsw 686 if qNameIsw != "" { 687 688 if err := r.SetQueryParam("name__isw", qNameIsw); err != nil { 689 return err 690 } 691 } 692 } 693 694 if o.Namen != nil { 695 696 // query param name__n 697 var qrNamen string 698 699 if o.Namen != nil { 700 qrNamen = *o.Namen 701 } 702 qNamen := qrNamen 703 if qNamen != "" { 704 705 if err := r.SetQueryParam("name__n", qNamen); err != nil { 706 return err 707 } 708 } 709 } 710 711 if o.NameNic != nil { 712 713 // query param name__nic 714 var qrNameNic string 715 716 if o.NameNic != nil { 717 qrNameNic = *o.NameNic 718 } 719 qNameNic := qrNameNic 720 if qNameNic != "" { 721 722 if err := r.SetQueryParam("name__nic", qNameNic); err != nil { 723 return err 724 } 725 } 726 } 727 728 if o.NameNie != nil { 729 730 // query param name__nie 731 var qrNameNie string 732 733 if o.NameNie != nil { 734 qrNameNie = *o.NameNie 735 } 736 qNameNie := qrNameNie 737 if qNameNie != "" { 738 739 if err := r.SetQueryParam("name__nie", qNameNie); err != nil { 740 return err 741 } 742 } 743 } 744 745 if o.NameNiew != nil { 746 747 // query param name__niew 748 var qrNameNiew string 749 750 if o.NameNiew != nil { 751 qrNameNiew = *o.NameNiew 752 } 753 qNameNiew := qrNameNiew 754 if qNameNiew != "" { 755 756 if err := r.SetQueryParam("name__niew", qNameNiew); err != nil { 757 return err 758 } 759 } 760 } 761 762 if o.NameNisw != nil { 763 764 // query param name__nisw 765 var qrNameNisw string 766 767 if o.NameNisw != nil { 768 qrNameNisw = *o.NameNisw 769 } 770 qNameNisw := qrNameNisw 771 if qNameNisw != "" { 772 773 if err := r.SetQueryParam("name__nisw", qNameNisw); err != nil { 774 return err 775 } 776 } 777 } 778 779 if o.Offset != nil { 780 781 // query param offset 782 var qrOffset int64 783 784 if o.Offset != nil { 785 qrOffset = *o.Offset 786 } 787 qOffset := swag.FormatInt64(qrOffset) 788 if qOffset != "" { 789 790 if err := r.SetQueryParam("offset", qOffset); err != nil { 791 return err 792 } 793 } 794 } 795 796 if len(res) > 0 { 797 return errors.CompositeValidationError(res...) 798 } 799 return nil 800 }