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

package echo_service

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

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

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

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

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

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

	for the echo service echo4 operation.

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

	// En.
	//
	// Format: int64
	En *string

	/* ID.

	   Id represents the message identifier.
	*/
	ID string

	// Lang.
	Lang *string

	// LineNum.
	//
	// Format: int64
	LineNum string

	// NIDnID.
	NIDnID *string

	// NIDVal.
	NIDVal *string

	// NoProgress.
	//
	// Format: int64
	NoProgress *string

	// Num.
	//
	// Format: int64
	Num *string

	// ResourceID.
	ResourceID *string

	// StatusNote.
	StatusNote string

	// StatusProgress.
	//
	// Format: int64
	StatusProgress *string

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

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

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

// WithTimeout adds the timeout to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithTimeout(timeout time.Duration) *EchoServiceEcho4Params {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithContext(ctx context.Context) *EchoServiceEcho4Params {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithHTTPClient(client *http.Client) *EchoServiceEcho4Params {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithEn adds the en to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithEn(en *string) *EchoServiceEcho4Params {
	o.SetEn(en)
	return o
}

// SetEn adds the en to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetEn(en *string) {
	o.En = en
}

// WithID adds the id to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithID(id string) *EchoServiceEcho4Params {
	o.SetID(id)
	return o
}

// SetID adds the id to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetID(id string) {
	o.ID = id
}

// WithLang adds the lang to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithLang(lang *string) *EchoServiceEcho4Params {
	o.SetLang(lang)
	return o
}

// SetLang adds the lang to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetLang(lang *string) {
	o.Lang = lang
}

// WithLineNum adds the lineNum to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithLineNum(lineNum string) *EchoServiceEcho4Params {
	o.SetLineNum(lineNum)
	return o
}

// SetLineNum adds the lineNum to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetLineNum(lineNum string) {
	o.LineNum = lineNum
}

// WithNIDnID adds the nIDnID to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithNIDnID(nIDnID *string) *EchoServiceEcho4Params {
	o.SetNIDnID(nIDnID)
	return o
}

// SetNIDnID adds the nIdNId to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetNIDnID(nIDnID *string) {
	o.NIDnID = nIDnID
}

// WithNIDVal adds the nIDVal to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithNIDVal(nIDVal *string) *EchoServiceEcho4Params {
	o.SetNIDVal(nIDVal)
	return o
}

// SetNIDVal adds the nIdVal to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetNIDVal(nIDVal *string) {
	o.NIDVal = nIDVal
}

// WithNoProgress adds the noProgress to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithNoProgress(noProgress *string) *EchoServiceEcho4Params {
	o.SetNoProgress(noProgress)
	return o
}

// SetNoProgress adds the noProgress to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetNoProgress(noProgress *string) {
	o.NoProgress = noProgress
}

// WithNum adds the num to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithNum(num *string) *EchoServiceEcho4Params {
	o.SetNum(num)
	return o
}

// SetNum adds the num to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetNum(num *string) {
	o.Num = num
}

// WithResourceID adds the resourceID to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithResourceID(resourceID *string) *EchoServiceEcho4Params {
	o.SetResourceID(resourceID)
	return o
}

// SetResourceID adds the resourceId to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetResourceID(resourceID *string) {
	o.ResourceID = resourceID
}

// WithStatusNote adds the statusNote to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithStatusNote(statusNote string) *EchoServiceEcho4Params {
	o.SetStatusNote(statusNote)
	return o
}

// SetStatusNote adds the statusNote to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetStatusNote(statusNote string) {
	o.StatusNote = statusNote
}

// WithStatusProgress adds the statusProgress to the echo service echo4 params
func (o *EchoServiceEcho4Params) WithStatusProgress(statusProgress *string) *EchoServiceEcho4Params {
	o.SetStatusProgress(statusProgress)
	return o
}

// SetStatusProgress adds the statusProgress to the echo service echo4 params
func (o *EchoServiceEcho4Params) SetStatusProgress(statusProgress *string) {
	o.StatusProgress = statusProgress
}

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

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

	if o.En != nil {

		// query param en
		var qrEn string

		if o.En != nil {
			qrEn = *o.En
		}
		qEn := qrEn
		if qEn != "" {

			if err := r.SetQueryParam("en", qEn); err != nil {
				return err
			}
		}
	}

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

	if o.Lang != nil {

		// query param lang
		var qrLang string

		if o.Lang != nil {
			qrLang = *o.Lang
		}
		qLang := qrLang
		if qLang != "" {

			if err := r.SetQueryParam("lang", qLang); err != nil {
				return err
			}
		}
	}

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

	if o.NIDnID != nil {

		// query param nId.nId
		var qrNIDnID string

		if o.NIDnID != nil {
			qrNIDnID = *o.NIDnID
		}
		qNIDnID := qrNIDnID
		if qNIDnID != "" {

			if err := r.SetQueryParam("nId.nId", qNIDnID); err != nil {
				return err
			}
		}
	}

	if o.NIDVal != nil {

		// query param nId.val
		var qrNIDVal string

		if o.NIDVal != nil {
			qrNIDVal = *o.NIDVal
		}
		qNIDVal := qrNIDVal
		if qNIDVal != "" {

			if err := r.SetQueryParam("nId.val", qNIDVal); err != nil {
				return err
			}
		}
	}

	if o.NoProgress != nil {

		// query param no.progress
		var qrNoProgress string

		if o.NoProgress != nil {
			qrNoProgress = *o.NoProgress
		}
		qNoProgress := qrNoProgress
		if qNoProgress != "" {

			if err := r.SetQueryParam("no.progress", qNoProgress); err != nil {
				return err
			}
		}
	}

	if o.Num != nil {

		// query param num
		var qrNum string

		if o.Num != nil {
			qrNum = *o.Num
		}
		qNum := qrNum
		if qNum != "" {

			if err := r.SetQueryParam("num", qNum); err != nil {
				return err
			}
		}
	}

	if o.ResourceID != nil {

		// query param resourceId
		var qrResourceID string

		if o.ResourceID != nil {
			qrResourceID = *o.ResourceID
		}
		qResourceID := qrResourceID
		if qResourceID != "" {

			if err := r.SetQueryParam("resourceId", qResourceID); err != nil {
				return err
			}
		}
	}

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

	if o.StatusProgress != nil {

		// query param status.progress
		var qrStatusProgress string

		if o.StatusProgress != nil {
			qrStatusProgress = *o.StatusProgress
		}
		qStatusProgress := qrStatusProgress
		if qStatusProgress != "" {

			if err := r.SetQueryParam("status.progress", qStatusProgress); err != nil {
				return err
			}
		}
	}

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