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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*GetMtasV2Params contains all the parameters to send to the API endpoint
for the get mtas v2 operation typically these are written to a http.Request
*/
type GetMtasV2Params struct {

	/*Name
	  Filter mtas by name

	*/
	Name *string
	/*Namespace
	  Filter mtas by namespace

	*/
	Namespace *string
	/*SpaceGUID
	  GUID of space with mtas

	*/
	SpaceGUID string

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

// WithTimeout adds the timeout to the get mtas v2 params
func (o *GetMtasV2Params) WithTimeout(timeout time.Duration) *GetMtasV2Params {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get mtas v2 params
func (o *GetMtasV2Params) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get mtas v2 params
func (o *GetMtasV2Params) WithContext(ctx context.Context) *GetMtasV2Params {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get mtas v2 params
func (o *GetMtasV2Params) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get mtas v2 params
func (o *GetMtasV2Params) WithHTTPClient(client *http.Client) *GetMtasV2Params {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get mtas v2 params
func (o *GetMtasV2Params) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithName adds the name to the get mtas v2 params
func (o *GetMtasV2Params) WithName(name *string) *GetMtasV2Params {
	o.SetName(name)
	return o
}

// SetName adds the name to the get mtas v2 params
func (o *GetMtasV2Params) SetName(name *string) {
	o.Name = name
}

// WithNamespace adds the namespace to the get mtas v2 params
func (o *GetMtasV2Params) WithNamespace(namespace *string) *GetMtasV2Params {
	o.SetNamespace(namespace)
	return o
}

// SetNamespace adds the namespace to the get mtas v2 params
func (o *GetMtasV2Params) SetNamespace(namespace *string) {
	o.Namespace = namespace
}

// WithSpaceGUID adds the spaceGUID to the get mtas v2 params
func (o *GetMtasV2Params) WithSpaceGUID(spaceGUID string) *GetMtasV2Params {
	o.SetSpaceGUID(spaceGUID)
	return o
}

// SetSpaceGUID adds the spaceGuid to the get mtas v2 params
func (o *GetMtasV2Params) SetSpaceGUID(spaceGUID string) {
	o.SpaceGUID = spaceGUID
}

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

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

	if o.Name != nil {

		// query param name
		var qrName string
		if o.Name != nil {
			qrName = *o.Name
		}
		qName := qrName
		if qName != "" {
			if err := r.SetQueryParam("name", qName); err != nil {
				return err
			}
		}

	}

	if o.Namespace != nil {

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

	}

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

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