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

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

// NewDeleteContractParams creates a new DeleteContractParams 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 NewDeleteContractParams() *DeleteContractParams {
	return NewDeleteContractParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the delete contract operation.

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

	// ContractID.
	//
	// Contact record ID
	ContractID *string

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

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

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

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

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

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

// WithContractID adds the contractID to the delete contract params.
func (o *DeleteContractParams) WithContractID(contractID *string) *DeleteContractParams {
	o.SetContractID(contractID)
	return o
}

// SetContractID adds the contractId to the delete contract params.
func (o *DeleteContractParams) SetContractID(contractID *string) {
	o.ContractID = contractID
}

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

	if o.ContractID != nil {

		// query param contractId
		var qrContractID string

		if o.ContractID != nil {
			qrContractID = *o.ContractID
		}
		qContractID := qrContractID
		if qContractID != "" {

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

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