// Code generated by go-swagger; DO NOT EDIT.

// All Code Copyright(c) 2018-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"

	"github.com/taxnexus/go/lib/api/workflow/workflow_models"
)

// NewPostAppLogsParams creates a new PostAppLogsParams object
// with the default values initialized.
func NewPostAppLogsParams() *PostAppLogsParams {
	var ()
	return &PostAppLogsParams{

		timeout: cr.DefaultTimeout,
	}
}

// NewPostAppLogsParamsWithTimeout creates a new PostAppLogsParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPostAppLogsParamsWithTimeout(timeout time.Duration) *PostAppLogsParams {
	var ()
	return &PostAppLogsParams{

		timeout: timeout,
	}
}

// NewPostAppLogsParamsWithContext creates a new PostAppLogsParams object
// with the default values initialized, and the ability to set a context for a request
func NewPostAppLogsParamsWithContext(ctx context.Context) *PostAppLogsParams {
	var ()
	return &PostAppLogsParams{

		Context: ctx,
	}
}

// NewPostAppLogsParamsWithHTTPClient creates a new PostAppLogsParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPostAppLogsParamsWithHTTPClient(client *http.Client) *PostAppLogsParams {
	var ()
	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
}

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