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

package accounts

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

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

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

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

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

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

	for the account following operation.

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

	/* ID.

	   Account ID.
	*/
	ID string

	/* Limit.

	   Number of following accounts to return.

	   Default: 40
	*/
	Limit *int64

	/* MaxID.

	   Return only following accounts *OLDER* than the given max ID. The following account with the specified ID will not be included in the response. NOTE: the ID is of the internal follow, NOT any of the returned accounts.
	*/
	MaxID *string

	/* MinID.

	   Return only following accounts *IMMEDIATELY NEWER* than the given min ID. The following account with the specified ID will not be included in the response. NOTE: the ID is of the internal follow, NOT any of the returned accounts.
	*/
	MinID *string

	/* SinceID.

	   Return only following accounts *NEWER* than the given since ID. The following account with the specified ID will not be included in the response. NOTE: the ID is of the internal follow, NOT any of the returned accounts.
	*/
	SinceID *string

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

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

// SetDefaults hydrates default values in the account following params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountFollowingParams) SetDefaults() {
	var (
		limitDefault = int64(40)
	)

	val := AccountFollowingParams{
		Limit: &limitDefault,
	}

	val.timeout = o.timeout
	val.Context = o.Context
	val.HTTPClient = o.HTTPClient
	*o = val
}

// WithTimeout adds the timeout to the account following params
func (o *AccountFollowingParams) WithTimeout(timeout time.Duration) *AccountFollowingParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the account following params
func (o *AccountFollowingParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the account following params
func (o *AccountFollowingParams) WithContext(ctx context.Context) *AccountFollowingParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the account following params
func (o *AccountFollowingParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the account following params
func (o *AccountFollowingParams) WithHTTPClient(client *http.Client) *AccountFollowingParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the account following params
func (o *AccountFollowingParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithID adds the id to the account following params
func (o *AccountFollowingParams) WithID(id string) *AccountFollowingParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the account following params
func (o *AccountFollowingParams) SetID(id string) {
	o.ID = id
}

// WithLimit adds the limit to the account following params
func (o *AccountFollowingParams) WithLimit(limit *int64) *AccountFollowingParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the account following params
func (o *AccountFollowingParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithMaxID adds the maxID to the account following params
func (o *AccountFollowingParams) WithMaxID(maxID *string) *AccountFollowingParams {
	o.SetMaxID(maxID)
	return o
}

// SetMaxID adds the maxId to the account following params
func (o *AccountFollowingParams) SetMaxID(maxID *string) {
	o.MaxID = maxID
}

// WithMinID adds the minID to the account following params
func (o *AccountFollowingParams) WithMinID(minID *string) *AccountFollowingParams {
	o.SetMinID(minID)
	return o
}

// SetMinID adds the minId to the account following params
func (o *AccountFollowingParams) SetMinID(minID *string) {
	o.MinID = minID
}

// WithSinceID adds the sinceID to the account following params
func (o *AccountFollowingParams) WithSinceID(sinceID *string) *AccountFollowingParams {
	o.SetSinceID(sinceID)
	return o
}

// SetSinceID adds the sinceId to the account following params
func (o *AccountFollowingParams) SetSinceID(sinceID *string) {
	o.SinceID = sinceID
}

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

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

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

	if o.Limit != nil {

		// query param limit
		var qrLimit int64

		if o.Limit != nil {
			qrLimit = *o.Limit
		}
		qLimit := swag.FormatInt64(qrLimit)
		if qLimit != "" {

			if err := r.SetQueryParam("limit", qLimit); err != nil {
				return err
			}
		}
	}

	if o.MaxID != nil {

		// query param max_id
		var qrMaxID string

		if o.MaxID != nil {
			qrMaxID = *o.MaxID
		}
		qMaxID := qrMaxID
		if qMaxID != "" {

			if err := r.SetQueryParam("max_id", qMaxID); err != nil {
				return err
			}
		}
	}

	if o.MinID != nil {

		// query param min_id
		var qrMinID string

		if o.MinID != nil {
			qrMinID = *o.MinID
		}
		qMinID := qrMinID
		if qMinID != "" {

			if err := r.SetQueryParam("min_id", qMinID); err != nil {
				return err
			}
		}
	}

	if o.SinceID != nil {

		// query param since_id
		var qrSinceID string

		if o.SinceID != nil {
			qrSinceID = *o.SinceID
		}
		qSinceID := qrSinceID
		if qSinceID != "" {

			if err := r.SetQueryParam("since_id", qSinceID); err != nil {
				return err
			}
		}
	}

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