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

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

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

/*GetJournalEntriesParams contains all the parameters to send to the API endpoint
for the get journal entries operation typically these are written to a http.Request
*/
type GetJournalEntriesParams struct {

	/*AccountID
	  Taxnexus Record Id of an Account

	*/
	AccountID *string
	/*DateFrom
	  The Starting Date for an object retrieval

	*/
	DateFrom *string
	/*DateTo
	  The Ending Date for an object retrieval

	*/
	DateTo *string
	/*ID
	  Taxnexus Record Id

	*/
	ID *string
	/*Limit
	  How many objects to return at one time

	*/
	Limit *int64
	/*Offset
	  How many objects to skip? (default 0)

	*/
	Offset *int64

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

// WithTimeout adds the timeout to the get journal entries params
func (o *GetJournalEntriesParams) WithTimeout(timeout time.Duration) *GetJournalEntriesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get journal entries params
func (o *GetJournalEntriesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get journal entries params
func (o *GetJournalEntriesParams) WithContext(ctx context.Context) *GetJournalEntriesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get journal entries params
func (o *GetJournalEntriesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get journal entries params
func (o *GetJournalEntriesParams) WithHTTPClient(client *http.Client) *GetJournalEntriesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get journal entries params
func (o *GetJournalEntriesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithAccountID adds the accountID to the get journal entries params
func (o *GetJournalEntriesParams) WithAccountID(accountID *string) *GetJournalEntriesParams {
	o.SetAccountID(accountID)
	return o
}

// SetAccountID adds the accountId to the get journal entries params
func (o *GetJournalEntriesParams) SetAccountID(accountID *string) {
	o.AccountID = accountID
}

// WithDateFrom adds the dateFrom to the get journal entries params
func (o *GetJournalEntriesParams) WithDateFrom(dateFrom *string) *GetJournalEntriesParams {
	o.SetDateFrom(dateFrom)
	return o
}

// SetDateFrom adds the dateFrom to the get journal entries params
func (o *GetJournalEntriesParams) SetDateFrom(dateFrom *string) {
	o.DateFrom = dateFrom
}

// WithDateTo adds the dateTo to the get journal entries params
func (o *GetJournalEntriesParams) WithDateTo(dateTo *string) *GetJournalEntriesParams {
	o.SetDateTo(dateTo)
	return o
}

// SetDateTo adds the dateTo to the get journal entries params
func (o *GetJournalEntriesParams) SetDateTo(dateTo *string) {
	o.DateTo = dateTo
}

// WithID adds the id to the get journal entries params
func (o *GetJournalEntriesParams) WithID(id *string) *GetJournalEntriesParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the get journal entries params
func (o *GetJournalEntriesParams) SetID(id *string) {
	o.ID = id
}

// WithLimit adds the limit to the get journal entries params
func (o *GetJournalEntriesParams) WithLimit(limit *int64) *GetJournalEntriesParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the get journal entries params
func (o *GetJournalEntriesParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithOffset adds the offset to the get journal entries params
func (o *GetJournalEntriesParams) WithOffset(offset *int64) *GetJournalEntriesParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the get journal entries params
func (o *GetJournalEntriesParams) SetOffset(offset *int64) {
	o.Offset = offset
}

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

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

	if o.AccountID != nil {

		// query param accountId
		var qrAccountID string
		if o.AccountID != nil {
			qrAccountID = *o.AccountID
		}
		qAccountID := qrAccountID
		if qAccountID != "" {
			if err := r.SetQueryParam("accountId", qAccountID); err != nil {
				return err
			}
		}

	}

	if o.DateFrom != nil {

		// query param dateFrom
		var qrDateFrom string
		if o.DateFrom != nil {
			qrDateFrom = *o.DateFrom
		}
		qDateFrom := qrDateFrom
		if qDateFrom != "" {
			if err := r.SetQueryParam("dateFrom", qDateFrom); err != nil {
				return err
			}
		}

	}

	if o.DateTo != nil {

		// query param dateTo
		var qrDateTo string
		if o.DateTo != nil {
			qrDateTo = *o.DateTo
		}
		qDateTo := qrDateTo
		if qDateTo != "" {
			if err := r.SetQueryParam("dateTo", qDateTo); err != nil {
				return err
			}
		}

	}

	if o.ID != nil {

		// query param id
		var qrID string
		if o.ID != nil {
			qrID = *o.ID
		}
		qID := qrID
		if qID != "" {
			if err := r.SetQueryParam("id", qID); 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.Offset != nil {

		// query param offset
		var qrOffset int64
		if o.Offset != nil {
			qrOffset = *o.Offset
		}
		qOffset := swag.FormatInt64(qrOffset)
		if qOffset != "" {
			if err := r.SetQueryParam("offset", qOffset); err != nil {
				return err
			}
		}

	}

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