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

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

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

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

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

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

	for the a bit of everything service create nested body oneof operation.

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

	// PayloadInputValue.
	PayloadInputValue string

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

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

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

// WithTimeout adds the timeout to the a bit of everything service create nested body oneof params
func (o *ABitOfEverythingServiceCreateNestedBodyOneofParams) WithTimeout(timeout time.Duration) *ABitOfEverythingServiceCreateNestedBodyOneofParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the a bit of everything service create nested body oneof params
func (o *ABitOfEverythingServiceCreateNestedBodyOneofParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the a bit of everything service create nested body oneof params
func (o *ABitOfEverythingServiceCreateNestedBodyOneofParams) WithContext(ctx context.Context) *ABitOfEverythingServiceCreateNestedBodyOneofParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the a bit of everything service create nested body oneof params
func (o *ABitOfEverythingServiceCreateNestedBodyOneofParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the a bit of everything service create nested body oneof params
func (o *ABitOfEverythingServiceCreateNestedBodyOneofParams) WithHTTPClient(client *http.Client) *ABitOfEverythingServiceCreateNestedBodyOneofParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the a bit of everything service create nested body oneof params
func (o *ABitOfEverythingServiceCreateNestedBodyOneofParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithPayloadInputValue adds the payloadInputValue to the a bit of everything service create nested body oneof params
func (o *ABitOfEverythingServiceCreateNestedBodyOneofParams) WithPayloadInputValue(payloadInputValue string) *ABitOfEverythingServiceCreateNestedBodyOneofParams {
	o.SetPayloadInputValue(payloadInputValue)
	return o
}

// SetPayloadInputValue adds the payloadInputValue to the a bit of everything service create nested body oneof params
func (o *ABitOfEverythingServiceCreateNestedBodyOneofParams) SetPayloadInputValue(payloadInputValue string) {
	o.PayloadInputValue = payloadInputValue
}

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

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

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