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

// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package documents

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

	"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)

// NewPostDocumentsParams creates a new PostDocumentsParams 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 NewPostDocumentsParams() *PostDocumentsParams {
	return &PostDocumentsParams{
		timeout: cr.DefaultTimeout,
	}
}

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

// NewPostDocumentsParamsWithContext creates a new PostDocumentsParams object
// with the ability to set a context for a request.
func NewPostDocumentsParamsWithContext(ctx context.Context) *PostDocumentsParams {
	return &PostDocumentsParams{
		Context: ctx,
	}
}

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

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

	for the post documents operation.

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

	/* DocumentRequest.

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

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

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

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

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

// SetTimeout adds the timeout to the post documents params
func (o *PostDocumentsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the post documents params
func (o *PostDocumentsParams) WithContext(ctx context.Context) *PostDocumentsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post documents params
func (o *PostDocumentsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

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

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

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

	if err := r.SetTimeout(o.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
}
