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

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

// NewGetMtaFilesParams creates a new GetMtaFilesParams object
// with the default values initialized.
func NewGetMtaFilesParams() *GetMtaFilesParams {

	return &GetMtaFilesParams{

		timeout: cr.DefaultTimeout,
	}
}

// NewGetMtaFilesParamsWithTimeout creates a new GetMtaFilesParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewGetMtaFilesParamsWithTimeout(timeout time.Duration) *GetMtaFilesParams {

	return &GetMtaFilesParams{

		timeout: timeout,
	}
}

// NewGetMtaFilesParamsWithContext creates a new GetMtaFilesParams object
// with the default values initialized, and the ability to set a context for a request
func NewGetMtaFilesParamsWithContext(ctx context.Context) *GetMtaFilesParams {

	return &GetMtaFilesParams{

		Context: ctx,
	}
}

// NewGetMtaFilesParamsWithHTTPClient creates a new GetMtaFilesParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetMtaFilesParamsWithHTTPClient(client *http.Client) *GetMtaFilesParams {

	return &GetMtaFilesParams{
		HTTPClient: client,
	}
}

/*GetMtaFilesParams contains all the parameters to send to the API endpoint
for the get mta files operation typically these are written to a http.Request
*/
type GetMtaFilesParams struct {
	/*Namespace
	  Filter mtas by namespace

	*/
	Namespace *string
	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithTimeout adds the timeout to the get mta files params
func (o *GetMtaFilesParams) WithTimeout(timeout time.Duration) *GetMtaFilesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get mta files params
func (o *GetMtaFilesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get mta files params
func (o *GetMtaFilesParams) WithContext(ctx context.Context) *GetMtaFilesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get mta files params
func (o *GetMtaFilesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get mta files params
func (o *GetMtaFilesParams) WithHTTPClient(client *http.Client) *GetMtaFilesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get mta files params
func (o *GetMtaFilesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithNamespace adds the namespace to the get mta files params
func (o *GetMtaFilesParams) WithNamespace(namespace *string) *GetMtaFilesParams {
	o.SetNamespace(namespace)
	return o
}

// SetNamespace adds the namespace to the get mta files params
func (o *GetMtaFilesParams) SetNamespace(namespace *string) {
	o.Namespace = namespace
}

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

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

		// query param namespace
		var qrNamespace string
		if o.Namespace != nil {
			qrNamespace = *o.Namespace
		}
		qNamespace := qrNamespace
		if qNamespace != "" {
			if err := r.SetQueryParam("namespace", qNamespace); err != nil {
				return err
			}
		}

	}

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