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

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

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

// NewPutAccountsParams creates a new PutAccountsParams 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 NewPutAccountsParams() *PutAccountsParams {
	return NewPutAccountsParamsWithTimeout(cr.DefaultTimeout)
}

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

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

// NewPutAccountsParamsWithHTTPClient creates a new PutAccountsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutAccountsParamsWithHTTPClient(client *http.Client) *PutAccountsParams {
	return &PutAccountsParams{
		HTTPClient: client,
	}
}

/*
PutAccountsParams contains all the parameters to send to the API endpoint

	for the put accounts operation.

	Typically these are written to a http.Request.
*/
type PutAccountsParams struct {

	// AccountRequest.
	//
	// A request with an array of Account Objects
	AccountRequest *sfgate_models.AccountRequest

	HTTPClient *http.Client

	inner innerParams
}

// WithDefaults hydrates default values in the put accounts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutAccountsParams) WithDefaults() *PutAccountsParams {
	o.SetDefaults()
	return o
}

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

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

// SetTimeout adds the timeout to the put accounts params.
func (o *PutAccountsParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

// WithContext adds the context to the put accounts params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutAccountsParams].
func (o *PutAccountsParams) WithContext(ctx context.Context) *PutAccountsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the put accounts params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutAccountsParams].
func (o *PutAccountsParams) SetContext(ctx context.Context) {
	o.inner.ctx = ctx
}

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

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

// WithAccountRequest adds the accountRequest to the put accounts params.
func (o *PutAccountsParams) WithAccountRequest(accountRequest *sfgate_models.AccountRequest) *PutAccountsParams {
	o.SetAccountRequest(accountRequest)
	return o
}

// SetAccountRequest adds the accountRequest to the put accounts params.
func (o *PutAccountsParams) SetAccountRequest(accountRequest *sfgate_models.AccountRequest) {
	o.AccountRequest = accountRequest
}

// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *PutAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
	if err := r.SetTimeout(o.inner.timeout); err != nil {
		return err
	}
	var res []error
	if o.AccountRequest != nil {
		if err := r.SetBodyParam(o.AccountRequest); err != nil {
			return err
		}
	}

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