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

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

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

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

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

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

	for the a bit of everything service post oneof enum operation.

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

	// ExampleEnum.
	ExampleEnum *models.OneofenumExampleEnum

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

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

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

// WithTimeout adds the timeout to the a bit of everything service post oneof enum params
func (o *ABitOfEverythingServicePostOneofEnumParams) WithTimeout(timeout time.Duration) *ABitOfEverythingServicePostOneofEnumParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the a bit of everything service post oneof enum params
func (o *ABitOfEverythingServicePostOneofEnumParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the a bit of everything service post oneof enum params
func (o *ABitOfEverythingServicePostOneofEnumParams) WithContext(ctx context.Context) *ABitOfEverythingServicePostOneofEnumParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the a bit of everything service post oneof enum params
func (o *ABitOfEverythingServicePostOneofEnumParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the a bit of everything service post oneof enum params
func (o *ABitOfEverythingServicePostOneofEnumParams) WithHTTPClient(client *http.Client) *ABitOfEverythingServicePostOneofEnumParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the a bit of everything service post oneof enum params
func (o *ABitOfEverythingServicePostOneofEnumParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithExampleEnum adds the exampleEnum to the a bit of everything service post oneof enum params
func (o *ABitOfEverythingServicePostOneofEnumParams) WithExampleEnum(exampleEnum *models.OneofenumExampleEnum) *ABitOfEverythingServicePostOneofEnumParams {
	o.SetExampleEnum(exampleEnum)
	return o
}

// SetExampleEnum adds the exampleEnum to the a bit of everything service post oneof enum params
func (o *ABitOfEverythingServicePostOneofEnumParams) SetExampleEnum(exampleEnum *models.OneofenumExampleEnum) {
	o.ExampleEnum = exampleEnum
}

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

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

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