lib/api/members/members_client/documents/put_documents_parameters.go

158 lines
4.5 KiB
Go

// 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/members/members_models"
)
// 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 &PutDocumentsParams{
timeout: 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{
timeout: timeout,
}
}
// NewPutDocumentsParamsWithContext creates a new PutDocumentsParams object
// with the ability to set a context for a request.
func NewPutDocumentsParamsWithContext(ctx context.Context) *PutDocumentsParams {
return &PutDocumentsParams{
Context: 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 Document records
*/
DocumentRequest *members_models.DocumentRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the put documents params
func (o *PutDocumentsParams) WithContext(ctx context.Context) *PutDocumentsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put documents params
func (o *PutDocumentsParams) SetContext(ctx context.Context) {
o.Context = 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 *members_models.DocumentRequest) *PutDocumentsParams {
o.SetDocumentRequest(documentRequest)
return o
}
// SetDocumentRequest adds the documentRequest to the put documents params
func (o *PutDocumentsParams) SetDocumentRequest(documentRequest *members_models.DocumentRequest) {
o.DocumentRequest = documentRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutDocumentsParams) 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
}