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

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package sessions

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

// NewCreateHandoffParams creates a new CreateHandoffParams 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 NewCreateHandoffParams() *CreateHandoffParams {
	return NewCreateHandoffParamsWithTimeout(cr.DefaultTimeout)
}

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

// NewCreateHandoffParamsWithContext creates a new CreateHandoffParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [CreateHandoffParams].
func NewCreateHandoffParamsWithContext(ctx context.Context) *CreateHandoffParams {
	return &CreateHandoffParams{
		inner: innerParams{
			ctx: ctx,
		},
	}
}

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

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

	for the create handoff operation.

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

	// HandoffRequest.
	HandoffRequest CreateHandoffBody

	HTTPClient *http.Client

	inner innerParams
}

// WithDefaults hydrates default values in the create handoff params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CreateHandoffParams) WithDefaults() *CreateHandoffParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the create handoff params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CreateHandoffParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the create handoff params.
func (o *CreateHandoffParams) WithTimeout(timeout time.Duration) *CreateHandoffParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the create handoff params.
func (o *CreateHandoffParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

// WithContext adds the context to the create handoff params.
//
// Deprecated: use the operation call with context to pass the context instead of [CreateHandoffParams].
func (o *CreateHandoffParams) WithContext(ctx context.Context) *CreateHandoffParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the create handoff params.
//
// Deprecated: use the operation call with context to pass the context instead of [CreateHandoffParams].
func (o *CreateHandoffParams) SetContext(ctx context.Context) {
	o.inner.ctx = ctx
}

// WithHTTPClient adds the HTTPClient to the create handoff params.
func (o *CreateHandoffParams) WithHTTPClient(client *http.Client) *CreateHandoffParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the create handoff params.
func (o *CreateHandoffParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithHandoffRequest adds the handoffRequest to the create handoff params.
func (o *CreateHandoffParams) WithHandoffRequest(handoffRequest CreateHandoffBody) *CreateHandoffParams {
	o.SetHandoffRequest(handoffRequest)
	return o
}

// SetHandoffRequest adds the handoffRequest to the create handoff params.
func (o *CreateHandoffParams) SetHandoffRequest(handoffRequest CreateHandoffBody) {
	o.HandoffRequest = handoffRequest
}

// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *CreateHandoffParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
	if err := r.SetTimeout(o.inner.timeout); err != nil {
		return err
	}
	var res []error
	if err := r.SetBodyParam(o.HandoffRequest); err != nil {
		return err
	}

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