// 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"
)

// NewDeregisterInfraEnvParams creates a new DeregisterInfraEnvParams 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 NewDeregisterInfraEnvParams() *DeregisterInfraEnvParams {
	return &DeregisterInfraEnvParams{
		timeout: cr.DefaultTimeout,
	}
}

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

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

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

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

	for the deregister infra env operation.

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

	/* InfraEnvID.

	   The infra-env to be deleted.

	   Format: uuid
	*/
	InfraEnvID strfmt.UUID

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

// WithDefaults hydrates default values in the deregister infra env params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeregisterInfraEnvParams) WithDefaults() *DeregisterInfraEnvParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the deregister infra env params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeregisterInfraEnvParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the deregister infra env params
func (o *DeregisterInfraEnvParams) WithTimeout(timeout time.Duration) *DeregisterInfraEnvParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the deregister infra env params
func (o *DeregisterInfraEnvParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the deregister infra env params
func (o *DeregisterInfraEnvParams) WithContext(ctx context.Context) *DeregisterInfraEnvParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the deregister infra env params
func (o *DeregisterInfraEnvParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the deregister infra env params
func (o *DeregisterInfraEnvParams) WithHTTPClient(client *http.Client) *DeregisterInfraEnvParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the deregister infra env params
func (o *DeregisterInfraEnvParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithInfraEnvID adds the infraEnvID to the deregister infra env params
func (o *DeregisterInfraEnvParams) WithInfraEnvID(infraEnvID strfmt.UUID) *DeregisterInfraEnvParams {
	o.SetInfraEnvID(infraEnvID)
	return o
}

// SetInfraEnvID adds the infraEnvId to the deregister infra env params
func (o *DeregisterInfraEnvParams) SetInfraEnvID(infraEnvID strfmt.UUID) {
	o.InfraEnvID = infraEnvID
}

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

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

	// path param infra_env_id
	if err := r.SetPathParam("infra_env_id", o.InfraEnvID.String()); err != nil {
		return err
	}

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