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

package a_bit_of_everything

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"

	"github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/clients/abe/models"
)

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

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

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

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

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

	for the a bit of everything service deep path echo operation.

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

	// Body.
	Body *models.ABitOfEverythingServiceDeepPathEchoBody

	/* SingleNestedName.

	   name is nested field.
	*/
	SingleNestedName string

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

// WithDefaults hydrates default values in the a bit of everything service deep path echo params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ABitOfEverythingServiceDeepPathEchoParams) WithDefaults() *ABitOfEverythingServiceDeepPathEchoParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the a bit of everything service deep path echo params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ABitOfEverythingServiceDeepPathEchoParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the a bit of everything service deep path echo params
func (o *ABitOfEverythingServiceDeepPathEchoParams) WithTimeout(timeout time.Duration) *ABitOfEverythingServiceDeepPathEchoParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the a bit of everything service deep path echo params
func (o *ABitOfEverythingServiceDeepPathEchoParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the a bit of everything service deep path echo params
func (o *ABitOfEverythingServiceDeepPathEchoParams) WithContext(ctx context.Context) *ABitOfEverythingServiceDeepPathEchoParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the a bit of everything service deep path echo params
func (o *ABitOfEverythingServiceDeepPathEchoParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the a bit of everything service deep path echo params
func (o *ABitOfEverythingServiceDeepPathEchoParams) WithHTTPClient(client *http.Client) *ABitOfEverythingServiceDeepPathEchoParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the a bit of everything service deep path echo params
func (o *ABitOfEverythingServiceDeepPathEchoParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the a bit of everything service deep path echo params
func (o *ABitOfEverythingServiceDeepPathEchoParams) WithBody(body *models.ABitOfEverythingServiceDeepPathEchoBody) *ABitOfEverythingServiceDeepPathEchoParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the a bit of everything service deep path echo params
func (o *ABitOfEverythingServiceDeepPathEchoParams) SetBody(body *models.ABitOfEverythingServiceDeepPathEchoBody) {
	o.Body = body
}

// WithSingleNestedName adds the singleNestedName to the a bit of everything service deep path echo params
func (o *ABitOfEverythingServiceDeepPathEchoParams) WithSingleNestedName(singleNestedName string) *ABitOfEverythingServiceDeepPathEchoParams {
	o.SetSingleNestedName(singleNestedName)
	return o
}

// SetSingleNestedName adds the singleNestedName to the a bit of everything service deep path echo params
func (o *ABitOfEverythingServiceDeepPathEchoParams) SetSingleNestedName(singleNestedName string) {
	o.SingleNestedName = singleNestedName
}

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

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

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

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