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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*PostPaymentMethodsParams contains all the parameters to send to the API endpoint
for the post payment methods operation typically these are written to a http.Request
*/
type PostPaymentMethodsParams struct {

	/*PaymentMethodRequest
	  A request with an array of Purchase Order Objects

	*/
	PaymentMethodRequest *ops_models.PaymentMethodRequest

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

// WithTimeout adds the timeout to the post payment methods params
func (o *PostPaymentMethodsParams) WithTimeout(timeout time.Duration) *PostPaymentMethodsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the post payment methods params
func (o *PostPaymentMethodsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the post payment methods params
func (o *PostPaymentMethodsParams) WithContext(ctx context.Context) *PostPaymentMethodsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post payment methods params
func (o *PostPaymentMethodsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the post payment methods params
func (o *PostPaymentMethodsParams) WithHTTPClient(client *http.Client) *PostPaymentMethodsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the post payment methods params
func (o *PostPaymentMethodsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithPaymentMethodRequest adds the paymentMethodRequest to the post payment methods params
func (o *PostPaymentMethodsParams) WithPaymentMethodRequest(paymentMethodRequest *ops_models.PaymentMethodRequest) *PostPaymentMethodsParams {
	o.SetPaymentMethodRequest(paymentMethodRequest)
	return o
}

// SetPaymentMethodRequest adds the paymentMethodRequest to the post payment methods params
func (o *PostPaymentMethodsParams) SetPaymentMethodRequest(paymentMethodRequest *ops_models.PaymentMethodRequest) {
	o.PaymentMethodRequest = paymentMethodRequest
}

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

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

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

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