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

package channel

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"net/http"
	"time"

	"golang.org/x/net/context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*ListChannelsParams contains all the parameters to send to the API endpoint
for the list channels operation typically these are written to a http.Request
*/
type ListChannelsParams struct {

	/*Namespace
	  namespace

	*/
	Namespace string
	/*Package
	  package name

	*/
	Package string

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

// WithTimeout adds the timeout to the list channels params
func (o *ListChannelsParams) WithTimeout(timeout time.Duration) *ListChannelsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the list channels params
func (o *ListChannelsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the list channels params
func (o *ListChannelsParams) WithContext(ctx context.Context) *ListChannelsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the list channels params
func (o *ListChannelsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the list channels params
func (o *ListChannelsParams) WithHTTPClient(client *http.Client) *ListChannelsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the list channels params
func (o *ListChannelsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithNamespace adds the namespace to the list channels params
func (o *ListChannelsParams) WithNamespace(namespace string) *ListChannelsParams {
	o.SetNamespace(namespace)
	return o
}

// SetNamespace adds the namespace to the list channels params
func (o *ListChannelsParams) SetNamespace(namespace string) {
	o.Namespace = namespace
}

// WithPackage adds the packageVar to the list channels params
func (o *ListChannelsParams) WithPackage(packageVar string) *ListChannelsParams {
	o.SetPackage(packageVar)
	return o
}

// SetPackage adds the package to the list channels params
func (o *ListChannelsParams) SetPackage(packageVar string) {
	o.Package = packageVar
}

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

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

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