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

package package_operations

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

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

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

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

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

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

	for the list package files operation.

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

	/* Name.

	   name of the package
	*/
	Name string

	/* Owner.

	   owner of the package
	*/
	Owner string

	/* Type.

	   type of the package
	*/
	Type string

	/* Version.

	   version of the package
	*/
	Version string

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

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

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

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

// SetTimeout adds the timeout to the list package files params
func (o *ListPackageFilesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the list package files params
func (o *ListPackageFilesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithName adds the name to the list package files params
func (o *ListPackageFilesParams) WithName(name string) *ListPackageFilesParams {
	o.SetName(name)
	return o
}

// SetName adds the name to the list package files params
func (o *ListPackageFilesParams) SetName(name string) {
	o.Name = name
}

// WithOwner adds the owner to the list package files params
func (o *ListPackageFilesParams) WithOwner(owner string) *ListPackageFilesParams {
	o.SetOwner(owner)
	return o
}

// SetOwner adds the owner to the list package files params
func (o *ListPackageFilesParams) SetOwner(owner string) {
	o.Owner = owner
}

// WithType adds the typeVar to the list package files params
func (o *ListPackageFilesParams) WithType(typeVar string) *ListPackageFilesParams {
	o.SetType(typeVar)
	return o
}

// SetType adds the type to the list package files params
func (o *ListPackageFilesParams) SetType(typeVar string) {
	o.Type = typeVar
}

// WithVersion adds the version to the list package files params
func (o *ListPackageFilesParams) WithVersion(version string) *ListPackageFilesParams {
	o.SetVersion(version)
	return o
}

// SetVersion adds the version to the list package files params
func (o *ListPackageFilesParams) SetVersion(version string) {
	o.Version = version
}

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

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

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

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

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

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

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