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