// 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 users

import (
	"context"
	"net/http"
	"time"

	"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

// NewPutUsersSessionsParams creates a new PutUsersSessionsParams 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 NewPutUsersSessionsParams() *PutUsersSessionsParams {
	return NewPutUsersSessionsParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the put users sessions operation.

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

	// UserRequest.
	//
	// A single new user record
	UserRequest *sfgate_models.UserRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

// WithTimeout adds the timeout to the put users sessions params.
func (o *PutUsersSessionsParams) WithTimeout(timeout time.Duration) *PutUsersSessionsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the put users sessions params.
func (o *PutUsersSessionsParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

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

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

// WithHTTPClient adds the HTTPClient to the put users sessions params.
func (o *PutUsersSessionsParams) WithHTTPClient(client *http.Client) *PutUsersSessionsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the put users sessions params.
func (o *PutUsersSessionsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithUserRequest adds the userRequest to the put users sessions params.
func (o *PutUsersSessionsParams) WithUserRequest(userRequest *sfgate_models.UserRequest) *PutUsersSessionsParams {
	o.SetUserRequest(userRequest)
	return o
}

// SetUserRequest adds the userRequest to the put users sessions params.
func (o *PutUsersSessionsParams) SetUserRequest(userRequest *sfgate_models.UserRequest) {
	o.UserRequest = userRequest
}

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

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