// 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"
	"github.com/go-openapi/strfmt"

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

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

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

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

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

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

	for the visualization service create visualization v1 operation.

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

	// Namespace.
	Namespace string

	// Visualization.
	Visualization *visualization_model.APIVisualization

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

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

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

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

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

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

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

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

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

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

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

// WithVisualization adds the visualization to the visualization service create visualization v1 params
func (o *VisualizationServiceCreateVisualizationV1Params) WithVisualization(visualization *visualization_model.APIVisualization) *VisualizationServiceCreateVisualizationV1Params {
	o.SetVisualization(visualization)
	return o
}

// SetVisualization adds the visualization to the visualization service create visualization v1 params
func (o *VisualizationServiceCreateVisualizationV1Params) SetVisualization(visualization *visualization_model.APIVisualization) {
	o.Visualization = visualization
}

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

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

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

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