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

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

// NewDeleteFactorParams creates a new DeleteFactorParams 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 NewDeleteFactorParams() *DeleteFactorParams {
	return NewDeleteFactorParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the delete factor operation.

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

	// FactorID.
	//
	// Factor record ID
	FactorID *string

	HTTPClient *http.Client

	inner innerParams
}

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

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

// WithTimeout adds the timeout to the delete factor params.
func (o *DeleteFactorParams) WithTimeout(timeout time.Duration) *DeleteFactorParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the delete factor params.
func (o *DeleteFactorParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

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

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

// WithHTTPClient adds the HTTPClient to the delete factor params.
func (o *DeleteFactorParams) WithHTTPClient(client *http.Client) *DeleteFactorParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the delete factor params.
func (o *DeleteFactorParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithFactorID adds the factorID to the delete factor params.
func (o *DeleteFactorParams) WithFactorID(factorID *string) *DeleteFactorParams {
	o.SetFactorID(factorID)
	return o
}

// SetFactorID adds the factorId to the delete factor params.
func (o *DeleteFactorParams) SetFactorID(factorID *string) {
	o.FactorID = factorID
}

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

	if o.FactorID != nil {

		// query param factorId
		var qrFactorID string

		if o.FactorID != nil {
			qrFactorID = *o.FactorID
		}
		qFactorID := qrFactorID
		if qFactorID != "" {

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

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