mirror of https://github.com/vernonkeenan/lib
158 lines
4.3 KiB
Go
158 lines
4.3 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 tickets
|
|
|
|
// 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"
|
|
)
|
|
|
|
// NewPostTicketParams creates a new PostTicketParams 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 NewPostTicketParams() *PostTicketParams {
|
|
return &PostTicketParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewPostTicketParamsWithTimeout creates a new PostTicketParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewPostTicketParamsWithTimeout(timeout time.Duration) *PostTicketParams {
|
|
return &PostTicketParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewPostTicketParamsWithContext creates a new PostTicketParams object
|
|
// with the ability to set a context for a request.
|
|
func NewPostTicketParamsWithContext(ctx context.Context) *PostTicketParams {
|
|
return &PostTicketParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewPostTicketParamsWithHTTPClient creates a new PostTicketParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewPostTicketParamsWithHTTPClient(client *http.Client) *PostTicketParams {
|
|
return &PostTicketParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
PostTicketParams contains all the parameters to send to the API endpoint
|
|
|
|
for the post ticket operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type PostTicketParams struct {
|
|
|
|
/* TicketRequest.
|
|
|
|
An array of new Ticket records
|
|
*/
|
|
TicketRequest *members_models.TicketRequest
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the post ticket params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *PostTicketParams) WithDefaults() *PostTicketParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the post ticket params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *PostTicketParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the post ticket params
|
|
func (o *PostTicketParams) WithTimeout(timeout time.Duration) *PostTicketParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the post ticket params
|
|
func (o *PostTicketParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the post ticket params
|
|
func (o *PostTicketParams) WithContext(ctx context.Context) *PostTicketParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the post ticket params
|
|
func (o *PostTicketParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the post ticket params
|
|
func (o *PostTicketParams) WithHTTPClient(client *http.Client) *PostTicketParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the post ticket params
|
|
func (o *PostTicketParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithTicketRequest adds the ticketRequest to the post ticket params
|
|
func (o *PostTicketParams) WithTicketRequest(ticketRequest *members_models.TicketRequest) *PostTicketParams {
|
|
o.SetTicketRequest(ticketRequest)
|
|
return o
|
|
}
|
|
|
|
// SetTicketRequest adds the ticketRequest to the post ticket params
|
|
func (o *PostTicketParams) SetTicketRequest(ticketRequest *members_models.TicketRequest) {
|
|
o.TicketRequest = ticketRequest
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *PostTicketParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
if o.TicketRequest != nil {
|
|
if err := r.SetBodyParam(o.TicketRequest); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|