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

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

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

// NewPostEventCategoriesParams creates a new PostEventCategoriesParams 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 NewPostEventCategoriesParams() *PostEventCategoriesParams {
	return NewPostEventCategoriesParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the post event categories operation.

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

	// EventCategoryRequest.
	//
	// An array of new Event records
	EventCategoryRequest *sfgate_models.EventCategoryRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

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

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

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

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

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

// WithEventCategoryRequest adds the eventCategoryRequest to the post event categories params.
func (o *PostEventCategoriesParams) WithEventCategoryRequest(eventCategoryRequest *sfgate_models.EventCategoryRequest) *PostEventCategoriesParams {
	o.SetEventCategoryRequest(eventCategoryRequest)
	return o
}

// SetEventCategoryRequest adds the eventCategoryRequest to the post event categories params.
func (o *PostEventCategoriesParams) SetEventCategoryRequest(eventCategoryRequest *sfgate_models.EventCategoryRequest) {
	o.EventCategoryRequest = eventCategoryRequest
}

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

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