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

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

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

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

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

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

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

	for the post track events operation.

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

	/* TrackeventRequest.

	   An array of new TrackEvent records
	*/
	TrackeventRequest *members_models.TrackEventRequest

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

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

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

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

// SetTimeout adds the timeout to the post track events params
func (o *PostTrackEventsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the post track events params
func (o *PostTrackEventsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithTrackeventRequest adds the trackeventRequest to the post track events params
func (o *PostTrackEventsParams) WithTrackeventRequest(trackeventRequest *members_models.TrackEventRequest) *PostTrackEventsParams {
	o.SetTrackeventRequest(trackeventRequest)
	return o
}

// SetTrackeventRequest adds the trackeventRequest to the post track events params
func (o *PostTrackEventsParams) SetTrackeventRequest(trackeventRequest *members_models.TrackEventRequest) {
	o.TrackeventRequest = trackeventRequest
}

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

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

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