307 lines
6.5 KiB
Go
307 lines
6.5 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package leads
|
|
|
|
// 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"
|
|
)
|
|
|
|
// NewGetLeadsParams creates a new GetLeadsParams 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 NewGetLeadsParams() *GetLeadsParams {
|
|
return &GetLeadsParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewGetLeadsParamsWithTimeout creates a new GetLeadsParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewGetLeadsParamsWithTimeout(timeout time.Duration) *GetLeadsParams {
|
|
return &GetLeadsParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewGetLeadsParamsWithContext creates a new GetLeadsParams object
|
|
// with the ability to set a context for a request.
|
|
func NewGetLeadsParamsWithContext(ctx context.Context) *GetLeadsParams {
|
|
return &GetLeadsParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewGetLeadsParamsWithHTTPClient creates a new GetLeadsParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewGetLeadsParamsWithHTTPClient(client *http.Client) *GetLeadsParams {
|
|
return &GetLeadsParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/* GetLeadsParams contains all the parameters to send to the API endpoint
|
|
for the get leads operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type GetLeadsParams struct {
|
|
|
|
/* Email.
|
|
|
|
Email address used for identity lookup
|
|
*/
|
|
Email *string
|
|
|
|
/* LeadID.
|
|
|
|
Taxnexus Lead record ID
|
|
*/
|
|
LeadID *string
|
|
|
|
/* Limit.
|
|
|
|
How many objects to return at one time
|
|
|
|
Format: int64
|
|
*/
|
|
Limit *int64
|
|
|
|
/* Name.
|
|
|
|
The Name of this Object
|
|
*/
|
|
Name *string
|
|
|
|
/* Offset.
|
|
|
|
How many objects to skip?
|
|
|
|
Format: int64
|
|
*/
|
|
Offset *int64
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the get leads params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *GetLeadsParams) WithDefaults() *GetLeadsParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the get leads params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *GetLeadsParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the get leads params
|
|
func (o *GetLeadsParams) WithTimeout(timeout time.Duration) *GetLeadsParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the get leads params
|
|
func (o *GetLeadsParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the get leads params
|
|
func (o *GetLeadsParams) WithContext(ctx context.Context) *GetLeadsParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the get leads params
|
|
func (o *GetLeadsParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the get leads params
|
|
func (o *GetLeadsParams) WithHTTPClient(client *http.Client) *GetLeadsParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the get leads params
|
|
func (o *GetLeadsParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithEmail adds the email to the get leads params
|
|
func (o *GetLeadsParams) WithEmail(email *string) *GetLeadsParams {
|
|
o.SetEmail(email)
|
|
return o
|
|
}
|
|
|
|
// SetEmail adds the email to the get leads params
|
|
func (o *GetLeadsParams) SetEmail(email *string) {
|
|
o.Email = email
|
|
}
|
|
|
|
// WithLeadID adds the leadID to the get leads params
|
|
func (o *GetLeadsParams) WithLeadID(leadID *string) *GetLeadsParams {
|
|
o.SetLeadID(leadID)
|
|
return o
|
|
}
|
|
|
|
// SetLeadID adds the leadId to the get leads params
|
|
func (o *GetLeadsParams) SetLeadID(leadID *string) {
|
|
o.LeadID = leadID
|
|
}
|
|
|
|
// WithLimit adds the limit to the get leads params
|
|
func (o *GetLeadsParams) WithLimit(limit *int64) *GetLeadsParams {
|
|
o.SetLimit(limit)
|
|
return o
|
|
}
|
|
|
|
// SetLimit adds the limit to the get leads params
|
|
func (o *GetLeadsParams) SetLimit(limit *int64) {
|
|
o.Limit = limit
|
|
}
|
|
|
|
// WithName adds the name to the get leads params
|
|
func (o *GetLeadsParams) WithName(name *string) *GetLeadsParams {
|
|
o.SetName(name)
|
|
return o
|
|
}
|
|
|
|
// SetName adds the name to the get leads params
|
|
func (o *GetLeadsParams) SetName(name *string) {
|
|
o.Name = name
|
|
}
|
|
|
|
// WithOffset adds the offset to the get leads params
|
|
func (o *GetLeadsParams) WithOffset(offset *int64) *GetLeadsParams {
|
|
o.SetOffset(offset)
|
|
return o
|
|
}
|
|
|
|
// SetOffset adds the offset to the get leads params
|
|
func (o *GetLeadsParams) SetOffset(offset *int64) {
|
|
o.Offset = offset
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *GetLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
if o.Email != nil {
|
|
|
|
// query param email
|
|
var qrEmail string
|
|
|
|
if o.Email != nil {
|
|
qrEmail = *o.Email
|
|
}
|
|
qEmail := qrEmail
|
|
if qEmail != "" {
|
|
|
|
if err := r.SetQueryParam("email", qEmail); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if o.LeadID != nil {
|
|
|
|
// query param leadId
|
|
var qrLeadID string
|
|
|
|
if o.LeadID != nil {
|
|
qrLeadID = *o.LeadID
|
|
}
|
|
qLeadID := qrLeadID
|
|
if qLeadID != "" {
|
|
|
|
if err := r.SetQueryParam("leadId", qLeadID); 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.Name != nil {
|
|
|
|
// query param name
|
|
var qrName string
|
|
|
|
if o.Name != nil {
|
|
qrName = *o.Name
|
|
}
|
|
qName := qrName
|
|
if qName != "" {
|
|
|
|
if err := r.SetQueryParam("name", qName); 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
|
|
}
|