lib/api/workflow/workflow_client/task/post_tasks_parameters.go

156 lines
4.2 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 task
// 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/workflow/workflow_models"
)
// NewPostTasksParams creates a new PostTasksParams 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 NewPostTasksParams() *PostTasksParams {
return &PostTasksParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostTasksParamsWithTimeout creates a new PostTasksParams object
// with the ability to set a timeout on a request.
func NewPostTasksParamsWithTimeout(timeout time.Duration) *PostTasksParams {
return &PostTasksParams{
timeout: timeout,
}
}
// NewPostTasksParamsWithContext creates a new PostTasksParams object
// with the ability to set a context for a request.
func NewPostTasksParamsWithContext(ctx context.Context) *PostTasksParams {
return &PostTasksParams{
Context: ctx,
}
}
// NewPostTasksParamsWithHTTPClient creates a new PostTasksParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostTasksParamsWithHTTPClient(client *http.Client) *PostTasksParams {
return &PostTasksParams{
HTTPClient: client,
}
}
/* PostTasksParams contains all the parameters to send to the API endpoint
for the post tasks operation.
Typically these are written to a http.Request.
*/
type PostTasksParams struct {
/* TaskRequest.
An array of new Task records
*/
TaskRequest *workflow_models.TaskRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post tasks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTasksParams) WithDefaults() *PostTasksParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post tasks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTasksParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post tasks params
func (o *PostTasksParams) WithTimeout(timeout time.Duration) *PostTasksParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post tasks params
func (o *PostTasksParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post tasks params
func (o *PostTasksParams) WithContext(ctx context.Context) *PostTasksParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post tasks params
func (o *PostTasksParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post tasks params
func (o *PostTasksParams) WithHTTPClient(client *http.Client) *PostTasksParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post tasks params
func (o *PostTasksParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTaskRequest adds the taskRequest to the post tasks params
func (o *PostTasksParams) WithTaskRequest(taskRequest *workflow_models.TaskRequest) *PostTasksParams {
o.SetTaskRequest(taskRequest)
return o
}
// SetTaskRequest adds the taskRequest to the post tasks params
func (o *PostTasksParams) SetTaskRequest(taskRequest *workflow_models.TaskRequest) {
o.TaskRequest = taskRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.TaskRequest != nil {
if err := r.SetBodyParam(o.TaskRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}