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

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

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

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

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

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

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

	for the post certificates operation.

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

	/* CertificateRequest.

	   An array of new Certificate records
	*/
	CertificateRequest *members_models.CertificateRequest

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

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

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

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

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

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

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

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

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

// WithCertificateRequest adds the certificateRequest to the post certificates params
func (o *PostCertificatesParams) WithCertificateRequest(certificateRequest *members_models.CertificateRequest) *PostCertificatesParams {
	o.SetCertificateRequest(certificateRequest)
	return o
}

// SetCertificateRequest adds the certificateRequest to the post certificates params
func (o *PostCertificatesParams) SetCertificateRequest(certificateRequest *members_models.CertificateRequest) {
	o.CertificateRequest = certificateRequest
}

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

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

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