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

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

// NewPutDocumentsParams creates a new PutDocumentsParams 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 NewPutDocumentsParams() *PutDocumentsParams {
	return NewPutDocumentsParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the put documents operation.

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

	// DocumentRequest.
	//
	// An array of new Document records
	DocumentRequest *sfgate_models.DocumentRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

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

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

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

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

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

// WithDocumentRequest adds the documentRequest to the put documents params.
func (o *PutDocumentsParams) WithDocumentRequest(documentRequest *sfgate_models.DocumentRequest) *PutDocumentsParams {
	o.SetDocumentRequest(documentRequest)
	return o
}

// SetDocumentRequest adds the documentRequest to the put documents params.
func (o *PutDocumentsParams) SetDocumentRequest(documentRequest *sfgate_models.DocumentRequest) {
	o.DocumentRequest = documentRequest
}

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

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