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

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

package sales

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

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

// NewDeleteSalesDeliveryParams creates a new DeleteSalesDeliveryParams object
// with the default values initialized.
func NewDeleteSalesDeliveryParams() *DeleteSalesDeliveryParams {
	var ()
	return &DeleteSalesDeliveryParams{

		timeout: cr.DefaultTimeout,
	}
}

// NewDeleteSalesDeliveryParamsWithTimeout creates a new DeleteSalesDeliveryParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewDeleteSalesDeliveryParamsWithTimeout(timeout time.Duration) *DeleteSalesDeliveryParams {
	var ()
	return &DeleteSalesDeliveryParams{

		timeout: timeout,
	}
}

// NewDeleteSalesDeliveryParamsWithContext creates a new DeleteSalesDeliveryParams object
// with the default values initialized, and the ability to set a context for a request
func NewDeleteSalesDeliveryParamsWithContext(ctx context.Context) *DeleteSalesDeliveryParams {
	var ()
	return &DeleteSalesDeliveryParams{

		Context: ctx,
	}
}

// NewDeleteSalesDeliveryParamsWithHTTPClient creates a new DeleteSalesDeliveryParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewDeleteSalesDeliveryParamsWithHTTPClient(client *http.Client) *DeleteSalesDeliveryParams {
	var ()
	return &DeleteSalesDeliveryParams{
		HTTPClient: client,
	}
}

/*DeleteSalesDeliveryParams contains all the parameters to send to the API endpoint
for the delete sales delivery operation typically these are written to a http.Request
*/
type DeleteSalesDeliveryParams struct {

	/*License
	  The Licnese Number for the query

	*/
	License string
	/*Reseller
	  The METRC Reseller Key

	*/
	Reseller string
	/*SalesDeliveryID
	  The Sales Delivery Number

	*/
	SalesDeliveryID string
	/*State
	  The 2-character State Code

	*/
	State string
	/*User
	  The METRC User Key

	*/
	User string

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

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

// SetTimeout adds the timeout to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) WithContext(ctx context.Context) *DeleteSalesDeliveryParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithLicense adds the license to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) WithLicense(license string) *DeleteSalesDeliveryParams {
	o.SetLicense(license)
	return o
}

// SetLicense adds the license to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) SetLicense(license string) {
	o.License = license
}

// WithReseller adds the reseller to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) WithReseller(reseller string) *DeleteSalesDeliveryParams {
	o.SetReseller(reseller)
	return o
}

// SetReseller adds the reseller to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) SetReseller(reseller string) {
	o.Reseller = reseller
}

// WithSalesDeliveryID adds the salesDeliveryID to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) WithSalesDeliveryID(salesDeliveryID string) *DeleteSalesDeliveryParams {
	o.SetSalesDeliveryID(salesDeliveryID)
	return o
}

// SetSalesDeliveryID adds the salesDeliveryId to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) SetSalesDeliveryID(salesDeliveryID string) {
	o.SalesDeliveryID = salesDeliveryID
}

// WithState adds the state to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) WithState(state string) *DeleteSalesDeliveryParams {
	o.SetState(state)
	return o
}

// SetState adds the state to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) SetState(state string) {
	o.State = state
}

// WithUser adds the user to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) WithUser(user string) *DeleteSalesDeliveryParams {
	o.SetUser(user)
	return o
}

// SetUser adds the user to the delete sales delivery params
func (o *DeleteSalesDeliveryParams) SetUser(user string) {
	o.User = user
}

// WriteToRequest writes these params to a swagger request
func (o *DeleteSalesDeliveryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	// query param license
	qrLicense := o.License
	qLicense := qrLicense
	if qLicense != "" {
		if err := r.SetQueryParam("license", qLicense); err != nil {
			return err
		}
	}

	// query param reseller
	qrReseller := o.Reseller
	qReseller := qrReseller
	if qReseller != "" {
		if err := r.SetQueryParam("reseller", qReseller); err != nil {
			return err
		}
	}

	// query param salesDeliveryId
	qrSalesDeliveryID := o.SalesDeliveryID
	qSalesDeliveryID := qrSalesDeliveryID
	if qSalesDeliveryID != "" {
		if err := r.SetQueryParam("salesDeliveryId", qSalesDeliveryID); err != nil {
			return err
		}
	}

	// query param state
	qrState := o.State
	qState := qrState
	if qState != "" {
		if err := r.SetQueryParam("state", qState); err != nil {
			return err
		}
	}

	// query param user
	qrUser := o.User
	qUser := qrUser
	if qUser != "" {
		if err := r.SetQueryParam("user", qUser); err != nil {
			return err
		}
	}

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