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

package experiment_service

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

	strfmt "github.com/go-openapi/strfmt"

	experiment_model "github.com/kubeflow/pipelines/backend/api/v1beta1/go_http_client/experiment_model"
)

// NewCreateExperimentV1Params creates a new CreateExperimentV1Params object
// with the default values initialized.
func NewCreateExperimentV1Params() *CreateExperimentV1Params {
	var ()
	return &CreateExperimentV1Params{

		timeout: cr.DefaultTimeout,
	}
}

// NewCreateExperimentV1ParamsWithTimeout creates a new CreateExperimentV1Params object
// with the default values initialized, and the ability to set a timeout on a request
func NewCreateExperimentV1ParamsWithTimeout(timeout time.Duration) *CreateExperimentV1Params {
	var ()
	return &CreateExperimentV1Params{

		timeout: timeout,
	}
}

// NewCreateExperimentV1ParamsWithContext creates a new CreateExperimentV1Params object
// with the default values initialized, and the ability to set a context for a request
func NewCreateExperimentV1ParamsWithContext(ctx context.Context) *CreateExperimentV1Params {
	var ()
	return &CreateExperimentV1Params{

		Context: ctx,
	}
}

// NewCreateExperimentV1ParamsWithHTTPClient creates a new CreateExperimentV1Params object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewCreateExperimentV1ParamsWithHTTPClient(client *http.Client) *CreateExperimentV1Params {
	var ()
	return &CreateExperimentV1Params{
		HTTPClient: client,
	}
}

/*CreateExperimentV1Params contains all the parameters to send to the API endpoint
for the create experiment v1 operation typically these are written to a http.Request
*/
type CreateExperimentV1Params struct {

	/*Body
	  The experiment to be created.

	*/
	Body *experiment_model.APIExperiment

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

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

// SetTimeout adds the timeout to the create experiment v1 params
func (o *CreateExperimentV1Params) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the create experiment v1 params
func (o *CreateExperimentV1Params) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithBody adds the body to the create experiment v1 params
func (o *CreateExperimentV1Params) WithBody(body *experiment_model.APIExperiment) *CreateExperimentV1Params {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the create experiment v1 params
func (o *CreateExperimentV1Params) SetBody(body *experiment_model.APIExperiment) {
	o.Body = body
}

// WriteToRequest writes these params to a swagger request
func (o *CreateExperimentV1Params) 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
}
