// Code generated by go-swagger; DO NOT EDIT.

package installer

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"
	"net/http"
	"time"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

// NewGetSupportedFeaturesParams creates a new GetSupportedFeaturesParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetSupportedFeaturesParams() *GetSupportedFeaturesParams {
	return &GetSupportedFeaturesParams{
		timeout: cr.DefaultTimeout,
	}
}

// NewGetSupportedFeaturesParamsWithTimeout creates a new GetSupportedFeaturesParams object
// with the ability to set a timeout on a request.
func NewGetSupportedFeaturesParamsWithTimeout(timeout time.Duration) *GetSupportedFeaturesParams {
	return &GetSupportedFeaturesParams{
		timeout: timeout,
	}
}

// NewGetSupportedFeaturesParamsWithContext creates a new GetSupportedFeaturesParams object
// with the ability to set a context for a request.
func NewGetSupportedFeaturesParamsWithContext(ctx context.Context) *GetSupportedFeaturesParams {
	return &GetSupportedFeaturesParams{
		Context: ctx,
	}
}

// NewGetSupportedFeaturesParamsWithHTTPClient creates a new GetSupportedFeaturesParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetSupportedFeaturesParamsWithHTTPClient(client *http.Client) *GetSupportedFeaturesParams {
	return &GetSupportedFeaturesParams{
		HTTPClient: client,
	}
}

/*
GetSupportedFeaturesParams contains all the parameters to send to the API endpoint

	for the get supported features operation.

	Typically these are written to a http.Request.
*/
type GetSupportedFeaturesParams struct {

	/* CPUArchitecture.

	   The CPU architecture of the image (x86_64/arm64/etc).

	   Default: "x86_64"
	*/
	CPUArchitecture *string

	/* OpenshiftVersion.

	   Version of the OpenShift cluster.
	*/
	OpenshiftVersion string

	/* PlatformType.

	   The provider platform type.
	*/
	PlatformType *string

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithDefaults hydrates default values in the get supported features params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetSupportedFeaturesParams) WithDefaults() *GetSupportedFeaturesParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the get supported features params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetSupportedFeaturesParams) SetDefaults() {
	var (
		cPUArchitectureDefault = string("x86_64")
	)

	val := GetSupportedFeaturesParams{
		CPUArchitecture: &cPUArchitectureDefault,
	}

	val.timeout = o.timeout
	val.Context = o.Context
	val.HTTPClient = o.HTTPClient
	*o = val
}

// WithTimeout adds the timeout to the get supported features params
func (o *GetSupportedFeaturesParams) WithTimeout(timeout time.Duration) *GetSupportedFeaturesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get supported features params
func (o *GetSupportedFeaturesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get supported features params
func (o *GetSupportedFeaturesParams) WithContext(ctx context.Context) *GetSupportedFeaturesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get supported features params
func (o *GetSupportedFeaturesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get supported features params
func (o *GetSupportedFeaturesParams) WithHTTPClient(client *http.Client) *GetSupportedFeaturesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get supported features params
func (o *GetSupportedFeaturesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithCPUArchitecture adds the cPUArchitecture to the get supported features params
func (o *GetSupportedFeaturesParams) WithCPUArchitecture(cPUArchitecture *string) *GetSupportedFeaturesParams {
	o.SetCPUArchitecture(cPUArchitecture)
	return o
}

// SetCPUArchitecture adds the cpuArchitecture to the get supported features params
func (o *GetSupportedFeaturesParams) SetCPUArchitecture(cPUArchitecture *string) {
	o.CPUArchitecture = cPUArchitecture
}

// WithOpenshiftVersion adds the openshiftVersion to the get supported features params
func (o *GetSupportedFeaturesParams) WithOpenshiftVersion(openshiftVersion string) *GetSupportedFeaturesParams {
	o.SetOpenshiftVersion(openshiftVersion)
	return o
}

// SetOpenshiftVersion adds the openshiftVersion to the get supported features params
func (o *GetSupportedFeaturesParams) SetOpenshiftVersion(openshiftVersion string) {
	o.OpenshiftVersion = openshiftVersion
}

// WithPlatformType adds the platformType to the get supported features params
func (o *GetSupportedFeaturesParams) WithPlatformType(platformType *string) *GetSupportedFeaturesParams {
	o.SetPlatformType(platformType)
	return o
}

// SetPlatformType adds the platformType to the get supported features params
func (o *GetSupportedFeaturesParams) SetPlatformType(platformType *string) {
	o.PlatformType = platformType
}

// WriteToRequest writes these params to a swagger request
func (o *GetSupportedFeaturesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	if o.CPUArchitecture != nil {

		// query param cpu_architecture
		var qrCPUArchitecture string

		if o.CPUArchitecture != nil {
			qrCPUArchitecture = *o.CPUArchitecture
		}
		qCPUArchitecture := qrCPUArchitecture
		if qCPUArchitecture != "" {

			if err := r.SetQueryParam("cpu_architecture", qCPUArchitecture); err != nil {
				return err
			}
		}
	}

	// query param openshift_version
	qrOpenshiftVersion := o.OpenshiftVersion
	qOpenshiftVersion := qrOpenshiftVersion
	if qOpenshiftVersion != "" {

		if err := r.SetQueryParam("openshift_version", qOpenshiftVersion); err != nil {
			return err
		}
	}

	if o.PlatformType != nil {

		// query param platform_type
		var qrPlatformType string

		if o.PlatformType != nil {
			qrPlatformType = *o.PlatformType
		}
		qPlatformType := qrPlatformType
		if qPlatformType != "" {

			if err := r.SetQueryParam("platform_type", qPlatformType); err != nil {
				return err
			}
		}
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
