// Code generated by go-swagger; DO NOT EDIT.

package lists

// 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/go-openapi/swag"
)

// NewRemoveListAccountsParams creates a new RemoveListAccountsParams 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 NewRemoveListAccountsParams() *RemoveListAccountsParams {
	return &RemoveListAccountsParams{
		timeout: cr.DefaultTimeout,
	}
}

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

// NewRemoveListAccountsParamsWithContext creates a new RemoveListAccountsParams object
// with the ability to set a context for a request.
func NewRemoveListAccountsParamsWithContext(ctx context.Context) *RemoveListAccountsParams {
	return &RemoveListAccountsParams{
		Context: ctx,
	}
}

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

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

	for the remove list accounts operation.

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

	/* AccountIds.

	   Array of accountIDs to modify. Each accountID must correspond to an account that the requesting account follows.
	*/
	AccountIds []string

	/* ID.

	   ID of the list
	*/
	ID string

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

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

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

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

// SetTimeout adds the timeout to the remove list accounts params
func (o *RemoveListAccountsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the remove list accounts params
func (o *RemoveListAccountsParams) WithContext(ctx context.Context) *RemoveListAccountsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the remove list accounts params
func (o *RemoveListAccountsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithAccountIds adds the accountIds to the remove list accounts params
func (o *RemoveListAccountsParams) WithAccountIds(accountIds []string) *RemoveListAccountsParams {
	o.SetAccountIds(accountIds)
	return o
}

// SetAccountIds adds the accountIds to the remove list accounts params
func (o *RemoveListAccountsParams) SetAccountIds(accountIds []string) {
	o.AccountIds = accountIds
}

// WithID adds the id to the remove list accounts params
func (o *RemoveListAccountsParams) WithID(id string) *RemoveListAccountsParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the remove list accounts params
func (o *RemoveListAccountsParams) SetID(id string) {
	o.ID = id
}

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

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

	if o.AccountIds != nil {

		// binding items for account_ids[]
		joinedAccountIds := o.bindParamAccountIds(reg)

		// form array param account_ids[]
		if err := r.SetFormParam("account_ids[]", joinedAccountIds...); err != nil {
			return err
		}
	}

	// path param id
	if err := r.SetPathParam("id", o.ID); err != nil {
		return err
	}

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

// bindParamRemoveListAccounts binds the parameter account_ids[]
func (o *RemoveListAccountsParams) bindParamAccountIds(formats strfmt.Registry) []string {
	accountIdsIR := o.AccountIds

	var accountIdsIC []string
	for _, accountIdsIIR := range accountIdsIR { // explode []string

		accountIdsIIV := accountIdsIIR // string as string
		accountIdsIC = append(accountIdsIC, accountIdsIIV)
	}

	// items.CollectionFormat: "multi"
	accountIdsIS := swag.JoinByFormat(accountIdsIC, "multi")

	return accountIdsIS
}
