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

import (
	"context"
	"net/http"
	"time"

	"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

// NewPostEnrollmentsParams creates a new PostEnrollmentsParams 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 NewPostEnrollmentsParams() *PostEnrollmentsParams {
	return NewPostEnrollmentsParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the post enrollments operation.

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

	// EnrollmentRequest.
	//
	// An array of new Enrollment records
	EnrollmentRequest *members_models.EnrollmentRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

// SetTimeout adds the timeout to the post enrollments params.
func (o *PostEnrollmentsParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

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

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

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

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

// WithEnrollmentRequest adds the enrollmentRequest to the post enrollments params.
func (o *PostEnrollmentsParams) WithEnrollmentRequest(enrollmentRequest *members_models.EnrollmentRequest) *PostEnrollmentsParams {
	o.SetEnrollmentRequest(enrollmentRequest)
	return o
}

// SetEnrollmentRequest adds the enrollmentRequest to the post enrollments params.
func (o *PostEnrollmentsParams) SetEnrollmentRequest(enrollmentRequest *members_models.EnrollmentRequest) {
	o.EnrollmentRequest = enrollmentRequest
}

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

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