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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*PutAuthoritiesParams contains all the parameters to send to the API endpoint
for the put authorities operation typically these are written to a http.Request
*/
type PutAuthoritiesParams struct {

	/*AuthorityRequest
	  A request with an array of Authority Objects

	*/
	AuthorityRequest *regs_models.AuthorityRequest

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

// WithTimeout adds the timeout to the put authorities params
func (o *PutAuthoritiesParams) WithTimeout(timeout time.Duration) *PutAuthoritiesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the put authorities params
func (o *PutAuthoritiesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the put authorities params
func (o *PutAuthoritiesParams) WithContext(ctx context.Context) *PutAuthoritiesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the put authorities params
func (o *PutAuthoritiesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the put authorities params
func (o *PutAuthoritiesParams) WithHTTPClient(client *http.Client) *PutAuthoritiesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the put authorities params
func (o *PutAuthoritiesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithAuthorityRequest adds the authorityRequest to the put authorities params
func (o *PutAuthoritiesParams) WithAuthorityRequest(authorityRequest *regs_models.AuthorityRequest) *PutAuthoritiesParams {
	o.SetAuthorityRequest(authorityRequest)
	return o
}

// SetAuthorityRequest adds the authorityRequest to the put authorities params
func (o *PutAuthoritiesParams) SetAuthorityRequest(authorityRequest *regs_models.AuthorityRequest) {
	o.AuthorityRequest = authorityRequest
}

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

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

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

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