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

// 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/vernonkeenan/lib/api/members/members_models"
)

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

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

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

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

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

	for the create event category assignment operation.

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

	/* EventcategoryassignmentRequest.

	   An array of new EventCategoryAssignment records
	*/
	EventcategoryassignmentRequest *members_models.EventCategoryAssignmentRequest

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

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

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

// WithTimeout adds the timeout to the create event category assignment params
func (o *CreateEventCategoryAssignmentParams) WithTimeout(timeout time.Duration) *CreateEventCategoryAssignmentParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the create event category assignment params
func (o *CreateEventCategoryAssignmentParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the create event category assignment params
func (o *CreateEventCategoryAssignmentParams) WithContext(ctx context.Context) *CreateEventCategoryAssignmentParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the create event category assignment params
func (o *CreateEventCategoryAssignmentParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the create event category assignment params
func (o *CreateEventCategoryAssignmentParams) WithHTTPClient(client *http.Client) *CreateEventCategoryAssignmentParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the create event category assignment params
func (o *CreateEventCategoryAssignmentParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithEventcategoryassignmentRequest adds the eventcategoryassignmentRequest to the create event category assignment params
func (o *CreateEventCategoryAssignmentParams) WithEventcategoryassignmentRequest(eventcategoryassignmentRequest *members_models.EventCategoryAssignmentRequest) *CreateEventCategoryAssignmentParams {
	o.SetEventcategoryassignmentRequest(eventcategoryassignmentRequest)
	return o
}

// SetEventcategoryassignmentRequest adds the eventcategoryassignmentRequest to the create event category assignment params
func (o *CreateEventCategoryAssignmentParams) SetEventcategoryassignmentRequest(eventcategoryassignmentRequest *members_models.EventCategoryAssignmentRequest) {
	o.EventcategoryassignmentRequest = eventcategoryassignmentRequest
}

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

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

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