lib/api/workflow/workflow_client/app_log/post_app_logs_parameters.go

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