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

package folders

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

	"github.com/grafana/grafana-openapi-client-go/models"
)

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

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

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

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

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

	for the create folder operation.

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

	// Body.
	Body *models.CreateFolderCommand

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

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

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

// WithTimeout adds the timeout to the create folder params
func (o *CreateFolderParams) WithTimeout(timeout time.Duration) *CreateFolderParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the create folder params
func (o *CreateFolderParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the create folder params
func (o *CreateFolderParams) WithContext(ctx context.Context) *CreateFolderParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the create folder params
func (o *CreateFolderParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the create folder params
func (o *CreateFolderParams) WithHTTPClient(client *http.Client) *CreateFolderParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the create folder params
func (o *CreateFolderParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the create folder params
func (o *CreateFolderParams) WithBody(body *models.CreateFolderCommand) *CreateFolderParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the create folder params
func (o *CreateFolderParams) SetBody(body *models.CreateFolderCommand) {
	o.Body = body
}

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

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

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