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

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

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

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

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

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

	for the a bit of everything service update v2 operation.

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

	/* Abe.

	     A bit of everything

	Intentionally complicated message type to cover many features of Protobuf.
	*/
	Abe ABitOfEverythingServiceUpdateV2Body

	/* UpdateMask.

	   The paths to update.
	*/
	UpdateMask *string

	// UUIDName.
	//
	// Format: uuid
	UUIDName strfmt.UUID

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

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

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

// WithTimeout adds the timeout to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) WithTimeout(timeout time.Duration) *ABitOfEverythingServiceUpdateV2Params {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) WithContext(ctx context.Context) *ABitOfEverythingServiceUpdateV2Params {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) WithHTTPClient(client *http.Client) *ABitOfEverythingServiceUpdateV2Params {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithAbe adds the abe to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) WithAbe(abe ABitOfEverythingServiceUpdateV2Body) *ABitOfEverythingServiceUpdateV2Params {
	o.SetAbe(abe)
	return o
}

// SetAbe adds the abe to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) SetAbe(abe ABitOfEverythingServiceUpdateV2Body) {
	o.Abe = abe
}

// WithUpdateMask adds the updateMask to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) WithUpdateMask(updateMask *string) *ABitOfEverythingServiceUpdateV2Params {
	o.SetUpdateMask(updateMask)
	return o
}

// SetUpdateMask adds the updateMask to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) SetUpdateMask(updateMask *string) {
	o.UpdateMask = updateMask
}

// WithUUIDName adds the uuidName to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) WithUUIDName(uuidName strfmt.UUID) *ABitOfEverythingServiceUpdateV2Params {
	o.SetUUIDName(uuidName)
	return o
}

// SetUUIDName adds the uuidName to the a bit of everything service update v2 params
func (o *ABitOfEverythingServiceUpdateV2Params) SetUUIDName(uuidName strfmt.UUID) {
	o.UUIDName = uuidName
}

// WriteToRequest writes these params to a swagger request
func (o *ABitOfEverythingServiceUpdateV2Params) 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.Abe); err != nil {
		return err
	}

	if o.UpdateMask != nil {

		// query param updateMask
		var qrUpdateMask string

		if o.UpdateMask != nil {
			qrUpdateMask = *o.UpdateMask
		}
		qUpdateMask := qrUpdateMask
		if qUpdateMask != "" {

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

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

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