lib/api/members/members_client/event_categories/create_event_category_param...

158 lines
4.9 KiB
Go

// 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_categories
// 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"
)
// NewCreateEventCategoryParams creates a new CreateEventCategoryParams 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 NewCreateEventCategoryParams() *CreateEventCategoryParams {
return &CreateEventCategoryParams{
timeout: cr.DefaultTimeout,
}
}
// NewCreateEventCategoryParamsWithTimeout creates a new CreateEventCategoryParams object
// with the ability to set a timeout on a request.
func NewCreateEventCategoryParamsWithTimeout(timeout time.Duration) *CreateEventCategoryParams {
return &CreateEventCategoryParams{
timeout: timeout,
}
}
// NewCreateEventCategoryParamsWithContext creates a new CreateEventCategoryParams object
// with the ability to set a context for a request.
func NewCreateEventCategoryParamsWithContext(ctx context.Context) *CreateEventCategoryParams {
return &CreateEventCategoryParams{
Context: ctx,
}
}
// NewCreateEventCategoryParamsWithHTTPClient creates a new CreateEventCategoryParams object
// with the ability to set a custom HTTPClient for a request.
func NewCreateEventCategoryParamsWithHTTPClient(client *http.Client) *CreateEventCategoryParams {
return &CreateEventCategoryParams{
HTTPClient: client,
}
}
/*
CreateEventCategoryParams contains all the parameters to send to the API endpoint
for the create event category operation.
Typically these are written to a http.Request.
*/
type CreateEventCategoryParams struct {
/* EventcategoryRequest.
An array of new EventCategory records
*/
EventcategoryRequest *members_models.EventCategoryRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the create event category params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CreateEventCategoryParams) WithDefaults() *CreateEventCategoryParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the create event category params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CreateEventCategoryParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the create event category params
func (o *CreateEventCategoryParams) WithTimeout(timeout time.Duration) *CreateEventCategoryParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the create event category params
func (o *CreateEventCategoryParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the create event category params
func (o *CreateEventCategoryParams) WithContext(ctx context.Context) *CreateEventCategoryParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the create event category params
func (o *CreateEventCategoryParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the create event category params
func (o *CreateEventCategoryParams) WithHTTPClient(client *http.Client) *CreateEventCategoryParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the create event category params
func (o *CreateEventCategoryParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithEventcategoryRequest adds the eventcategoryRequest to the create event category params
func (o *CreateEventCategoryParams) WithEventcategoryRequest(eventcategoryRequest *members_models.EventCategoryRequest) *CreateEventCategoryParams {
o.SetEventcategoryRequest(eventcategoryRequest)
return o
}
// SetEventcategoryRequest adds the eventcategoryRequest to the create event category params
func (o *CreateEventCategoryParams) SetEventcategoryRequest(eventcategoryRequest *members_models.EventCategoryRequest) {
o.EventcategoryRequest = eventcategoryRequest
}
// WriteToRequest writes these params to a swagger request
func (o *CreateEventCategoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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
}