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

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

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

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

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

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

	for the a bit of everything service get message with body operation.

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

	// Data.
	Data *models.ExamplepbBody

	// ID.
	ID string

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

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

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

// WithTimeout adds the timeout to the a bit of everything service get message with body params
func (o *ABitOfEverythingServiceGetMessageWithBodyParams) WithTimeout(timeout time.Duration) *ABitOfEverythingServiceGetMessageWithBodyParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the a bit of everything service get message with body params
func (o *ABitOfEverythingServiceGetMessageWithBodyParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the a bit of everything service get message with body params
func (o *ABitOfEverythingServiceGetMessageWithBodyParams) WithContext(ctx context.Context) *ABitOfEverythingServiceGetMessageWithBodyParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the a bit of everything service get message with body params
func (o *ABitOfEverythingServiceGetMessageWithBodyParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the a bit of everything service get message with body params
func (o *ABitOfEverythingServiceGetMessageWithBodyParams) WithHTTPClient(client *http.Client) *ABitOfEverythingServiceGetMessageWithBodyParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the a bit of everything service get message with body params
func (o *ABitOfEverythingServiceGetMessageWithBodyParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithData adds the data to the a bit of everything service get message with body params
func (o *ABitOfEverythingServiceGetMessageWithBodyParams) WithData(data *models.ExamplepbBody) *ABitOfEverythingServiceGetMessageWithBodyParams {
	o.SetData(data)
	return o
}

// SetData adds the data to the a bit of everything service get message with body params
func (o *ABitOfEverythingServiceGetMessageWithBodyParams) SetData(data *models.ExamplepbBody) {
	o.Data = data
}

// WithID adds the id to the a bit of everything service get message with body params
func (o *ABitOfEverythingServiceGetMessageWithBodyParams) WithID(id string) *ABitOfEverythingServiceGetMessageWithBodyParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the a bit of everything service get message with body params
func (o *ABitOfEverythingServiceGetMessageWithBodyParams) SetID(id string) {
	o.ID = id
}

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

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

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

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