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

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

// 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 NewPostTrackEventsParamsWithTimeout(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{
		inner: innerParams{
			timeout: timeout,
		},
	}
}

// NewPostTrackEventsParamsWithContext creates a new PostTrackEventsParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [PostTrackEventsParams].
func NewPostTrackEventsParamsWithContext(ctx context.Context) *PostTrackEventsParams {
	return &PostTrackEventsParams{
		inner: innerParams{
			ctx: 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.
	//
	// Exactly one governed Track-to-Event association
	TrackEventRequest *members_models.TrackEventRequest

	HTTPClient *http.Client

	inner innerParams
}

// 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.inner.timeout = timeout
}

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

// SetContext adds the context to the post track events params.
//
// Deprecated: use the operation call with context to pass the context instead of [PostTrackEventsParams].
func (o *PostTrackEventsParams) SetContext(ctx context.Context) {
	o.inner.ctx = 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 [runtime.ClientRequest].
func (o *PostTrackEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
	if err := r.SetTimeout(o.inner.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
}
