github.com/percona/percona-xtradb-cluster-operator@v1.14.0/version/client/version_service/version_service_operator_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package version_service 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "context" 10 "net/http" 11 "time" 12 13 "github.com/go-openapi/errors" 14 "github.com/go-openapi/runtime" 15 cr "github.com/go-openapi/runtime/client" 16 "github.com/go-openapi/strfmt" 17 "github.com/go-openapi/swag" 18 ) 19 20 // NewVersionServiceOperatorParams creates a new VersionServiceOperatorParams object, 21 // with the default timeout for this client. 22 // 23 // Default values are not hydrated, since defaults are normally applied by the API server side. 24 // 25 // To enforce default values in parameter, use SetDefaults or WithDefaults. 26 func NewVersionServiceOperatorParams() *VersionServiceOperatorParams { 27 return &VersionServiceOperatorParams{ 28 timeout: cr.DefaultTimeout, 29 } 30 } 31 32 // NewVersionServiceOperatorParamsWithTimeout creates a new VersionServiceOperatorParams object 33 // with the ability to set a timeout on a request. 34 func NewVersionServiceOperatorParamsWithTimeout(timeout time.Duration) *VersionServiceOperatorParams { 35 return &VersionServiceOperatorParams{ 36 timeout: timeout, 37 } 38 } 39 40 // NewVersionServiceOperatorParamsWithContext creates a new VersionServiceOperatorParams object 41 // with the ability to set a context for a request. 42 func NewVersionServiceOperatorParamsWithContext(ctx context.Context) *VersionServiceOperatorParams { 43 return &VersionServiceOperatorParams{ 44 Context: ctx, 45 } 46 } 47 48 // NewVersionServiceOperatorParamsWithHTTPClient creates a new VersionServiceOperatorParams object 49 // with the ability to set a custom HTTPClient for a request. 50 func NewVersionServiceOperatorParamsWithHTTPClient(client *http.Client) *VersionServiceOperatorParams { 51 return &VersionServiceOperatorParams{ 52 HTTPClient: client, 53 } 54 } 55 56 /* 57 VersionServiceOperatorParams contains all the parameters to send to the API endpoint 58 59 for the version service operator operation. 60 61 Typically these are written to a http.Request. 62 */ 63 type VersionServiceOperatorParams struct { 64 65 // BackupVersion. 66 BackupVersion *string 67 68 // ClusterWideEnabled. 69 // 70 // Format: boolean 71 ClusterWideEnabled *bool 72 73 // CustomResourceUID. 74 CustomResourceUID *string 75 76 // DatabaseVersion. 77 DatabaseVersion *string 78 79 // HaproxyVersion. 80 HaproxyVersion *string 81 82 // HashicorpVaultEnabled. 83 // 84 // Format: boolean 85 HashicorpVaultEnabled *bool 86 87 // KubeVersion. 88 KubeVersion *string 89 90 // LogCollectorVersion. 91 LogCollectorVersion *string 92 93 // NamespaceUID. 94 NamespaceUID *string 95 96 // OperatorVersion. 97 OperatorVersion string 98 99 // Platform. 100 Platform *string 101 102 // PmmVersion. 103 PmmVersion *string 104 105 // Product. 106 Product string 107 108 // ProxysqlVersion. 109 ProxysqlVersion *string 110 111 // ShardingEnabled. 112 // 113 // Format: boolean 114 ShardingEnabled *bool 115 116 timeout time.Duration 117 Context context.Context 118 HTTPClient *http.Client 119 } 120 121 // WithDefaults hydrates default values in the version service operator params (not the query body). 122 // 123 // All values with no default are reset to their zero value. 124 func (o *VersionServiceOperatorParams) WithDefaults() *VersionServiceOperatorParams { 125 o.SetDefaults() 126 return o 127 } 128 129 // SetDefaults hydrates default values in the version service operator params (not the query body). 130 // 131 // All values with no default are reset to their zero value. 132 func (o *VersionServiceOperatorParams) SetDefaults() { 133 // no default values defined for this parameter 134 } 135 136 // WithTimeout adds the timeout to the version service operator params 137 func (o *VersionServiceOperatorParams) WithTimeout(timeout time.Duration) *VersionServiceOperatorParams { 138 o.SetTimeout(timeout) 139 return o 140 } 141 142 // SetTimeout adds the timeout to the version service operator params 143 func (o *VersionServiceOperatorParams) SetTimeout(timeout time.Duration) { 144 o.timeout = timeout 145 } 146 147 // WithContext adds the context to the version service operator params 148 func (o *VersionServiceOperatorParams) WithContext(ctx context.Context) *VersionServiceOperatorParams { 149 o.SetContext(ctx) 150 return o 151 } 152 153 // SetContext adds the context to the version service operator params 154 func (o *VersionServiceOperatorParams) SetContext(ctx context.Context) { 155 o.Context = ctx 156 } 157 158 // WithHTTPClient adds the HTTPClient to the version service operator params 159 func (o *VersionServiceOperatorParams) WithHTTPClient(client *http.Client) *VersionServiceOperatorParams { 160 o.SetHTTPClient(client) 161 return o 162 } 163 164 // SetHTTPClient adds the HTTPClient to the version service operator params 165 func (o *VersionServiceOperatorParams) SetHTTPClient(client *http.Client) { 166 o.HTTPClient = client 167 } 168 169 // WithBackupVersion adds the backupVersion to the version service operator params 170 func (o *VersionServiceOperatorParams) WithBackupVersion(backupVersion *string) *VersionServiceOperatorParams { 171 o.SetBackupVersion(backupVersion) 172 return o 173 } 174 175 // SetBackupVersion adds the backupVersion to the version service operator params 176 func (o *VersionServiceOperatorParams) SetBackupVersion(backupVersion *string) { 177 o.BackupVersion = backupVersion 178 } 179 180 // WithClusterWideEnabled adds the clusterWideEnabled to the version service operator params 181 func (o *VersionServiceOperatorParams) WithClusterWideEnabled(clusterWideEnabled *bool) *VersionServiceOperatorParams { 182 o.SetClusterWideEnabled(clusterWideEnabled) 183 return o 184 } 185 186 // SetClusterWideEnabled adds the clusterWideEnabled to the version service operator params 187 func (o *VersionServiceOperatorParams) SetClusterWideEnabled(clusterWideEnabled *bool) { 188 o.ClusterWideEnabled = clusterWideEnabled 189 } 190 191 // WithCustomResourceUID adds the customResourceUID to the version service operator params 192 func (o *VersionServiceOperatorParams) WithCustomResourceUID(customResourceUID *string) *VersionServiceOperatorParams { 193 o.SetCustomResourceUID(customResourceUID) 194 return o 195 } 196 197 // SetCustomResourceUID adds the customResourceUid to the version service operator params 198 func (o *VersionServiceOperatorParams) SetCustomResourceUID(customResourceUID *string) { 199 o.CustomResourceUID = customResourceUID 200 } 201 202 // WithDatabaseVersion adds the databaseVersion to the version service operator params 203 func (o *VersionServiceOperatorParams) WithDatabaseVersion(databaseVersion *string) *VersionServiceOperatorParams { 204 o.SetDatabaseVersion(databaseVersion) 205 return o 206 } 207 208 // SetDatabaseVersion adds the databaseVersion to the version service operator params 209 func (o *VersionServiceOperatorParams) SetDatabaseVersion(databaseVersion *string) { 210 o.DatabaseVersion = databaseVersion 211 } 212 213 // WithHaproxyVersion adds the haproxyVersion to the version service operator params 214 func (o *VersionServiceOperatorParams) WithHaproxyVersion(haproxyVersion *string) *VersionServiceOperatorParams { 215 o.SetHaproxyVersion(haproxyVersion) 216 return o 217 } 218 219 // SetHaproxyVersion adds the haproxyVersion to the version service operator params 220 func (o *VersionServiceOperatorParams) SetHaproxyVersion(haproxyVersion *string) { 221 o.HaproxyVersion = haproxyVersion 222 } 223 224 // WithHashicorpVaultEnabled adds the hashicorpVaultEnabled to the version service operator params 225 func (o *VersionServiceOperatorParams) WithHashicorpVaultEnabled(hashicorpVaultEnabled *bool) *VersionServiceOperatorParams { 226 o.SetHashicorpVaultEnabled(hashicorpVaultEnabled) 227 return o 228 } 229 230 // SetHashicorpVaultEnabled adds the hashicorpVaultEnabled to the version service operator params 231 func (o *VersionServiceOperatorParams) SetHashicorpVaultEnabled(hashicorpVaultEnabled *bool) { 232 o.HashicorpVaultEnabled = hashicorpVaultEnabled 233 } 234 235 // WithKubeVersion adds the kubeVersion to the version service operator params 236 func (o *VersionServiceOperatorParams) WithKubeVersion(kubeVersion *string) *VersionServiceOperatorParams { 237 o.SetKubeVersion(kubeVersion) 238 return o 239 } 240 241 // SetKubeVersion adds the kubeVersion to the version service operator params 242 func (o *VersionServiceOperatorParams) SetKubeVersion(kubeVersion *string) { 243 o.KubeVersion = kubeVersion 244 } 245 246 // WithLogCollectorVersion adds the logCollectorVersion to the version service operator params 247 func (o *VersionServiceOperatorParams) WithLogCollectorVersion(logCollectorVersion *string) *VersionServiceOperatorParams { 248 o.SetLogCollectorVersion(logCollectorVersion) 249 return o 250 } 251 252 // SetLogCollectorVersion adds the logCollectorVersion to the version service operator params 253 func (o *VersionServiceOperatorParams) SetLogCollectorVersion(logCollectorVersion *string) { 254 o.LogCollectorVersion = logCollectorVersion 255 } 256 257 // WithNamespaceUID adds the namespaceUID to the version service operator params 258 func (o *VersionServiceOperatorParams) WithNamespaceUID(namespaceUID *string) *VersionServiceOperatorParams { 259 o.SetNamespaceUID(namespaceUID) 260 return o 261 } 262 263 // SetNamespaceUID adds the namespaceUid to the version service operator params 264 func (o *VersionServiceOperatorParams) SetNamespaceUID(namespaceUID *string) { 265 o.NamespaceUID = namespaceUID 266 } 267 268 // WithOperatorVersion adds the operatorVersion to the version service operator params 269 func (o *VersionServiceOperatorParams) WithOperatorVersion(operatorVersion string) *VersionServiceOperatorParams { 270 o.SetOperatorVersion(operatorVersion) 271 return o 272 } 273 274 // SetOperatorVersion adds the operatorVersion to the version service operator params 275 func (o *VersionServiceOperatorParams) SetOperatorVersion(operatorVersion string) { 276 o.OperatorVersion = operatorVersion 277 } 278 279 // WithPlatform adds the platform to the version service operator params 280 func (o *VersionServiceOperatorParams) WithPlatform(platform *string) *VersionServiceOperatorParams { 281 o.SetPlatform(platform) 282 return o 283 } 284 285 // SetPlatform adds the platform to the version service operator params 286 func (o *VersionServiceOperatorParams) SetPlatform(platform *string) { 287 o.Platform = platform 288 } 289 290 // WithPmmVersion adds the pmmVersion to the version service operator params 291 func (o *VersionServiceOperatorParams) WithPmmVersion(pmmVersion *string) *VersionServiceOperatorParams { 292 o.SetPmmVersion(pmmVersion) 293 return o 294 } 295 296 // SetPmmVersion adds the pmmVersion to the version service operator params 297 func (o *VersionServiceOperatorParams) SetPmmVersion(pmmVersion *string) { 298 o.PmmVersion = pmmVersion 299 } 300 301 // WithProduct adds the product to the version service operator params 302 func (o *VersionServiceOperatorParams) WithProduct(product string) *VersionServiceOperatorParams { 303 o.SetProduct(product) 304 return o 305 } 306 307 // SetProduct adds the product to the version service operator params 308 func (o *VersionServiceOperatorParams) SetProduct(product string) { 309 o.Product = product 310 } 311 312 // WithProxysqlVersion adds the proxysqlVersion to the version service operator params 313 func (o *VersionServiceOperatorParams) WithProxysqlVersion(proxysqlVersion *string) *VersionServiceOperatorParams { 314 o.SetProxysqlVersion(proxysqlVersion) 315 return o 316 } 317 318 // SetProxysqlVersion adds the proxysqlVersion to the version service operator params 319 func (o *VersionServiceOperatorParams) SetProxysqlVersion(proxysqlVersion *string) { 320 o.ProxysqlVersion = proxysqlVersion 321 } 322 323 // WithShardingEnabled adds the shardingEnabled to the version service operator params 324 func (o *VersionServiceOperatorParams) WithShardingEnabled(shardingEnabled *bool) *VersionServiceOperatorParams { 325 o.SetShardingEnabled(shardingEnabled) 326 return o 327 } 328 329 // SetShardingEnabled adds the shardingEnabled to the version service operator params 330 func (o *VersionServiceOperatorParams) SetShardingEnabled(shardingEnabled *bool) { 331 o.ShardingEnabled = shardingEnabled 332 } 333 334 // WriteToRequest writes these params to a swagger request 335 func (o *VersionServiceOperatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 336 337 if err := r.SetTimeout(o.timeout); err != nil { 338 return err 339 } 340 var res []error 341 342 if o.BackupVersion != nil { 343 344 // query param backupVersion 345 var qrBackupVersion string 346 347 if o.BackupVersion != nil { 348 qrBackupVersion = *o.BackupVersion 349 } 350 qBackupVersion := qrBackupVersion 351 if qBackupVersion != "" { 352 353 if err := r.SetQueryParam("backupVersion", qBackupVersion); err != nil { 354 return err 355 } 356 } 357 } 358 359 if o.ClusterWideEnabled != nil { 360 361 // query param clusterWideEnabled 362 var qrClusterWideEnabled bool 363 364 if o.ClusterWideEnabled != nil { 365 qrClusterWideEnabled = *o.ClusterWideEnabled 366 } 367 qClusterWideEnabled := swag.FormatBool(qrClusterWideEnabled) 368 if qClusterWideEnabled != "" { 369 370 if err := r.SetQueryParam("clusterWideEnabled", qClusterWideEnabled); err != nil { 371 return err 372 } 373 } 374 } 375 376 if o.CustomResourceUID != nil { 377 378 // query param customResourceUid 379 var qrCustomResourceUID string 380 381 if o.CustomResourceUID != nil { 382 qrCustomResourceUID = *o.CustomResourceUID 383 } 384 qCustomResourceUID := qrCustomResourceUID 385 if qCustomResourceUID != "" { 386 387 if err := r.SetQueryParam("customResourceUid", qCustomResourceUID); err != nil { 388 return err 389 } 390 } 391 } 392 393 if o.DatabaseVersion != nil { 394 395 // query param databaseVersion 396 var qrDatabaseVersion string 397 398 if o.DatabaseVersion != nil { 399 qrDatabaseVersion = *o.DatabaseVersion 400 } 401 qDatabaseVersion := qrDatabaseVersion 402 if qDatabaseVersion != "" { 403 404 if err := r.SetQueryParam("databaseVersion", qDatabaseVersion); err != nil { 405 return err 406 } 407 } 408 } 409 410 if o.HaproxyVersion != nil { 411 412 // query param haproxyVersion 413 var qrHaproxyVersion string 414 415 if o.HaproxyVersion != nil { 416 qrHaproxyVersion = *o.HaproxyVersion 417 } 418 qHaproxyVersion := qrHaproxyVersion 419 if qHaproxyVersion != "" { 420 421 if err := r.SetQueryParam("haproxyVersion", qHaproxyVersion); err != nil { 422 return err 423 } 424 } 425 } 426 427 if o.HashicorpVaultEnabled != nil { 428 429 // query param hashicorpVaultEnabled 430 var qrHashicorpVaultEnabled bool 431 432 if o.HashicorpVaultEnabled != nil { 433 qrHashicorpVaultEnabled = *o.HashicorpVaultEnabled 434 } 435 qHashicorpVaultEnabled := swag.FormatBool(qrHashicorpVaultEnabled) 436 if qHashicorpVaultEnabled != "" { 437 438 if err := r.SetQueryParam("hashicorpVaultEnabled", qHashicorpVaultEnabled); err != nil { 439 return err 440 } 441 } 442 } 443 444 if o.KubeVersion != nil { 445 446 // query param kubeVersion 447 var qrKubeVersion string 448 449 if o.KubeVersion != nil { 450 qrKubeVersion = *o.KubeVersion 451 } 452 qKubeVersion := qrKubeVersion 453 if qKubeVersion != "" { 454 455 if err := r.SetQueryParam("kubeVersion", qKubeVersion); err != nil { 456 return err 457 } 458 } 459 } 460 461 if o.LogCollectorVersion != nil { 462 463 // query param logCollectorVersion 464 var qrLogCollectorVersion string 465 466 if o.LogCollectorVersion != nil { 467 qrLogCollectorVersion = *o.LogCollectorVersion 468 } 469 qLogCollectorVersion := qrLogCollectorVersion 470 if qLogCollectorVersion != "" { 471 472 if err := r.SetQueryParam("logCollectorVersion", qLogCollectorVersion); err != nil { 473 return err 474 } 475 } 476 } 477 478 if o.NamespaceUID != nil { 479 480 // query param namespaceUid 481 var qrNamespaceUID string 482 483 if o.NamespaceUID != nil { 484 qrNamespaceUID = *o.NamespaceUID 485 } 486 qNamespaceUID := qrNamespaceUID 487 if qNamespaceUID != "" { 488 489 if err := r.SetQueryParam("namespaceUid", qNamespaceUID); err != nil { 490 return err 491 } 492 } 493 } 494 495 // path param operatorVersion 496 if err := r.SetPathParam("operatorVersion", o.OperatorVersion); err != nil { 497 return err 498 } 499 500 if o.Platform != nil { 501 502 // query param platform 503 var qrPlatform string 504 505 if o.Platform != nil { 506 qrPlatform = *o.Platform 507 } 508 qPlatform := qrPlatform 509 if qPlatform != "" { 510 511 if err := r.SetQueryParam("platform", qPlatform); err != nil { 512 return err 513 } 514 } 515 } 516 517 if o.PmmVersion != nil { 518 519 // query param pmmVersion 520 var qrPmmVersion string 521 522 if o.PmmVersion != nil { 523 qrPmmVersion = *o.PmmVersion 524 } 525 qPmmVersion := qrPmmVersion 526 if qPmmVersion != "" { 527 528 if err := r.SetQueryParam("pmmVersion", qPmmVersion); err != nil { 529 return err 530 } 531 } 532 } 533 534 // path param product 535 if err := r.SetPathParam("product", o.Product); err != nil { 536 return err 537 } 538 539 if o.ProxysqlVersion != nil { 540 541 // query param proxysqlVersion 542 var qrProxysqlVersion string 543 544 if o.ProxysqlVersion != nil { 545 qrProxysqlVersion = *o.ProxysqlVersion 546 } 547 qProxysqlVersion := qrProxysqlVersion 548 if qProxysqlVersion != "" { 549 550 if err := r.SetQueryParam("proxysqlVersion", qProxysqlVersion); err != nil { 551 return err 552 } 553 } 554 } 555 556 if o.ShardingEnabled != nil { 557 558 // query param shardingEnabled 559 var qrShardingEnabled bool 560 561 if o.ShardingEnabled != nil { 562 qrShardingEnabled = *o.ShardingEnabled 563 } 564 qShardingEnabled := swag.FormatBool(qrShardingEnabled) 565 if qShardingEnabled != "" { 566 567 if err := r.SetQueryParam("shardingEnabled", qShardingEnabled); err != nil { 568 return err 569 } 570 } 571 } 572 573 if len(res) > 0 { 574 return errors.CompositeValidationError(res...) 575 } 576 return nil 577 }