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

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

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

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

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

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

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

	for the post lesson progresses operation.

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

	/* LessonprogressRequest.

	   An array of new LessonProgress records
	*/
	LessonprogressRequest *members_models.LessonProgressRequest

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

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

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

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

// SetTimeout adds the timeout to the post lesson progresses params
func (o *PostLessonProgressesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the post lesson progresses params
func (o *PostLessonProgressesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithLessonprogressRequest adds the lessonprogressRequest to the post lesson progresses params
func (o *PostLessonProgressesParams) WithLessonprogressRequest(lessonprogressRequest *members_models.LessonProgressRequest) *PostLessonProgressesParams {
	o.SetLessonprogressRequest(lessonprogressRequest)
	return o
}

// SetLessonprogressRequest adds the lessonprogressRequest to the post lesson progresses params
func (o *PostLessonProgressesParams) SetLessonprogressRequest(lessonprogressRequest *members_models.LessonProgressRequest) {
	o.LessonprogressRequest = lessonprogressRequest
}

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

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

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