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

import (
	"context"
	"net/http"
	"time"

	"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

// NewPostOutgoingEmailMessagesParams creates a new PostOutgoingEmailMessagesParams 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 NewPostOutgoingEmailMessagesParams() *PostOutgoingEmailMessagesParams {
	return NewPostOutgoingEmailMessagesParamsWithTimeout(cr.DefaultTimeout)
}

// NewPostOutgoingEmailMessagesParamsWithTimeout creates a new PostOutgoingEmailMessagesParams object
// with the ability to set a timeout on a request.
func NewPostOutgoingEmailMessagesParamsWithTimeout(timeout time.Duration) *PostOutgoingEmailMessagesParams {
	return &PostOutgoingEmailMessagesParams{
		inner: innerParams{
			timeout: timeout,
		},
	}
}

// NewPostOutgoingEmailMessagesParamsWithContext creates a new PostOutgoingEmailMessagesParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [PostOutgoingEmailMessagesParams].
func NewPostOutgoingEmailMessagesParamsWithContext(ctx context.Context) *PostOutgoingEmailMessagesParams {
	return &PostOutgoingEmailMessagesParams{
		inner: innerParams{
			ctx: ctx,
		},
	}
}

// NewPostOutgoingEmailMessagesParamsWithHTTPClient creates a new PostOutgoingEmailMessagesParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostOutgoingEmailMessagesParamsWithHTTPClient(client *http.Client) *PostOutgoingEmailMessagesParams {
	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 *members_models.OutgoingEmailMessageRequest

	HTTPClient *http.Client

	inner innerParams
}

// WithDefaults hydrates default values in the post outgoing email messages params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostOutgoingEmailMessagesParams) WithDefaults() *PostOutgoingEmailMessagesParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the post outgoing email messages params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostOutgoingEmailMessagesParams) SetDefaults() {
	// no default values defined for this parameter
}

// 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.inner.timeout = timeout
}

// WithContext adds the context to the post outgoing email messages params.
//
// Deprecated: use the operation call with context to pass the context instead of [PostOutgoingEmailMessagesParams].
func (o *PostOutgoingEmailMessagesParams) WithContext(ctx context.Context) *PostOutgoingEmailMessagesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post outgoing email messages params.
//
// Deprecated: use the operation call with context to pass the context instead of [PostOutgoingEmailMessagesParams].
func (o *PostOutgoingEmailMessagesParams) SetContext(ctx context.Context) {
	o.inner.ctx = 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 *members_models.OutgoingEmailMessageRequest) *PostOutgoingEmailMessagesParams {
	o.SetOutgoingEmailMessageRequest(outgoingEmailMessageRequest)
	return o
}

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

// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *PostOutgoingEmailMessagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
	if err := r.SetTimeout(o.inner.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
}
