lib/api/blaze/blaze_client/transactions/get_transactions_parameters.go

255 lines
6.4 KiB
Go
Raw Permalink Normal View History

2021-01-08 17:40:28 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2021-01-19 16:58:40 +00:00
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
2021-01-08 17:40:28 +00:00
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package transactions
// 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"
)
2021-02-09 16:56:57 +00:00
// NewGetTransactionsParams creates a new GetTransactionsParams 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.
2021-01-08 17:40:28 +00:00
func NewGetTransactionsParams() *GetTransactionsParams {
return &GetTransactionsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetTransactionsParamsWithTimeout creates a new GetTransactionsParams object
2021-02-09 16:56:57 +00:00
// with the ability to set a timeout on a request.
2021-01-08 17:40:28 +00:00
func NewGetTransactionsParamsWithTimeout(timeout time.Duration) *GetTransactionsParams {
return &GetTransactionsParams{
timeout: timeout,
}
}
// NewGetTransactionsParamsWithContext creates a new GetTransactionsParams object
2021-02-09 16:56:57 +00:00
// with the ability to set a context for a request.
2021-01-08 17:40:28 +00:00
func NewGetTransactionsParamsWithContext(ctx context.Context) *GetTransactionsParams {
return &GetTransactionsParams{
Context: ctx,
}
}
// NewGetTransactionsParamsWithHTTPClient creates a new GetTransactionsParams object
2021-02-09 16:56:57 +00:00
// with the ability to set a custom HTTPClient for a request.
2021-01-08 17:40:28 +00:00
func NewGetTransactionsParamsWithHTTPClient(client *http.Client) *GetTransactionsParams {
return &GetTransactionsParams{
HTTPClient: client,
}
}
2021-02-09 16:56:57 +00:00
/* GetTransactionsParams contains all the parameters to send to the API endpoint
for the get transactions operation.
Typically these are written to a http.Request.
2021-01-08 17:40:28 +00:00
*/
type GetTransactionsParams struct {
2021-02-09 16:56:57 +00:00
/* EndDate.
2021-01-08 17:40:28 +00:00
2021-02-09 16:56:57 +00:00
The end date of transaction query
2021-01-08 17:40:28 +00:00
*/
EndDate string
2021-02-09 16:56:57 +00:00
/* Limit.
The number of records to retrieve
2021-01-08 17:40:28 +00:00
*/
Limit *float64
2021-02-09 16:56:57 +00:00
/* Start.
The starting record in multi-record retrievals
2021-01-08 17:40:28 +00:00
*/
Start *float64
2021-02-09 16:56:57 +00:00
/* StartDate.
The start date of transaction query
2021-01-08 17:40:28 +00:00
*/
StartDate string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
2021-02-09 16:56:57 +00:00
// WithDefaults hydrates default values in the get transactions params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTransactionsParams) WithDefaults() *GetTransactionsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get transactions params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTransactionsParams) SetDefaults() {
// no default values defined for this parameter
}
2021-01-08 17:40:28 +00:00
// WithTimeout adds the timeout to the get transactions params
func (o *GetTransactionsParams) WithTimeout(timeout time.Duration) *GetTransactionsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get transactions params
func (o *GetTransactionsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get transactions params
func (o *GetTransactionsParams) WithContext(ctx context.Context) *GetTransactionsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get transactions params
func (o *GetTransactionsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get transactions params
func (o *GetTransactionsParams) WithHTTPClient(client *http.Client) *GetTransactionsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get transactions params
func (o *GetTransactionsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithEndDate adds the endDate to the get transactions params
func (o *GetTransactionsParams) WithEndDate(endDate string) *GetTransactionsParams {
o.SetEndDate(endDate)
return o
}
// SetEndDate adds the endDate to the get transactions params
func (o *GetTransactionsParams) SetEndDate(endDate string) {
o.EndDate = endDate
}
// WithLimit adds the limit to the get transactions params
func (o *GetTransactionsParams) WithLimit(limit *float64) *GetTransactionsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get transactions params
func (o *GetTransactionsParams) SetLimit(limit *float64) {
o.Limit = limit
}
// WithStart adds the start to the get transactions params
func (o *GetTransactionsParams) WithStart(start *float64) *GetTransactionsParams {
o.SetStart(start)
return o
}
// SetStart adds the start to the get transactions params
func (o *GetTransactionsParams) SetStart(start *float64) {
o.Start = start
}
// WithStartDate adds the startDate to the get transactions params
func (o *GetTransactionsParams) WithStartDate(startDate string) *GetTransactionsParams {
o.SetStartDate(startDate)
return o
}
// SetStartDate adds the startDate to the get transactions params
func (o *GetTransactionsParams) SetStartDate(startDate string) {
o.StartDate = startDate
}
// WriteToRequest writes these params to a swagger request
func (o *GetTransactionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// query param endDate
qrEndDate := o.EndDate
qEndDate := qrEndDate
if qEndDate != "" {
2021-02-09 16:56:57 +00:00
2021-01-08 17:40:28 +00:00
if err := r.SetQueryParam("endDate", qEndDate); err != nil {
return err
}
}
if o.Limit != nil {
// query param limit
var qrLimit float64
2021-02-09 16:56:57 +00:00
2021-01-08 17:40:28 +00:00
if o.Limit != nil {
qrLimit = *o.Limit
}
qLimit := swag.FormatFloat64(qrLimit)
if qLimit != "" {
2021-02-09 16:56:57 +00:00
2021-01-08 17:40:28 +00:00
if err := r.SetQueryParam("limit", qLimit); err != nil {
return err
}
}
}
if o.Start != nil {
// query param start
var qrStart float64
2021-02-09 16:56:57 +00:00
2021-01-08 17:40:28 +00:00
if o.Start != nil {
qrStart = *o.Start
}
qStart := swag.FormatFloat64(qrStart)
if qStart != "" {
2021-02-09 16:56:57 +00:00
2021-01-08 17:40:28 +00:00
if err := r.SetQueryParam("start", qStart); err != nil {
return err
}
}
}
// query param startDate
qrStartDate := o.StartDate
qStartDate := qrStartDate
if qStartDate != "" {
2021-02-09 16:56:57 +00:00
2021-01-08 17:40:28 +00:00
if err := r.SetQueryParam("startDate", qStartDate); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}