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

package visualization_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"

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*Body*/
	Body *visualization_model.APIVisualization
	/*Namespace*/
	Namespace string

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

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

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

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

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

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

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

// WithBody adds the body to the create visualization v1 params
func (o *CreateVisualizationV1Params) WithBody(body *visualization_model.APIVisualization) *CreateVisualizationV1Params {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the create visualization v1 params
func (o *CreateVisualizationV1Params) SetBody(body *visualization_model.APIVisualization) {
	o.Body = body
}

// WithNamespace adds the namespace to the create visualization v1 params
func (o *CreateVisualizationV1Params) WithNamespace(namespace string) *CreateVisualizationV1Params {
	o.SetNamespace(namespace)
	return o
}

// SetNamespace adds the namespace to the create visualization v1 params
func (o *CreateVisualizationV1Params) SetNamespace(namespace string) {
	o.Namespace = namespace
}

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

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

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