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

// 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"
)

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

// NewPostOutgoingEmailMessagesParamsWithHTTPClient creates a new PostOutgoingEmailMessagesParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPostOutgoingEmailMessagesParamsWithHTTPClient(client *http.Client) *PostOutgoingEmailMessagesParams {
	var ()
	return &PostOutgoingEmailMessagesParams{
		HTTPClient: client,
	}
}

/*PostOutgoingEmailMessagesParams contains all the parameters to send to the API endpoint
for the post outgoing email messages operation typically these are written to a http.Request
*/
type PostOutgoingEmailMessagesParams struct {

	/*OutgoingEmailMessageRequest
	  An array of new Outgoing Email Message records

	*/
	OutgoingEmailMessageRequest *workflow_models.OutgoingEmailMessageRequest

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithTimeout adds the timeout to the post outgoing email messages params
func (o *PostOutgoingEmailMessagesParams) WithTimeout(timeout time.Duration) *PostOutgoingEmailMessagesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the post outgoing email messages params
func (o *PostOutgoingEmailMessagesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the post outgoing email messages params
func (o *PostOutgoingEmailMessagesParams) WithContext(ctx context.Context) *PostOutgoingEmailMessagesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post outgoing email messages params
func (o *PostOutgoingEmailMessagesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the post outgoing email messages params
func (o *PostOutgoingEmailMessagesParams) WithHTTPClient(client *http.Client) *PostOutgoingEmailMessagesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the post outgoing email messages params
func (o *PostOutgoingEmailMessagesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithOutgoingEmailMessageRequest adds the outgoingEmailMessageRequest to the post outgoing email messages params
func (o *PostOutgoingEmailMessagesParams) WithOutgoingEmailMessageRequest(outgoingEmailMessageRequest *workflow_models.OutgoingEmailMessageRequest) *PostOutgoingEmailMessagesParams {
	o.SetOutgoingEmailMessageRequest(outgoingEmailMessageRequest)
	return o
}

// SetOutgoingEmailMessageRequest adds the outgoingEmailMessageRequest to the post outgoing email messages params
func (o *PostOutgoingEmailMessagesParams) SetOutgoingEmailMessageRequest(outgoingEmailMessageRequest *workflow_models.OutgoingEmailMessageRequest) {
	o.OutgoingEmailMessageRequest = outgoingEmailMessageRequest
}

// WriteToRequest writes these params to a swagger request
func (o *PostOutgoingEmailMessagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	if o.OutgoingEmailMessageRequest != nil {
		if err := r.SetBodyParam(o.OutgoingEmailMessageRequest); err != nil {
			return err
		}
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
