lib/api/crm/crm_client/contracts/get_contracts_observable_pa...

201 lines
5.6 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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"
)
// NewGetContractsObservableParams creates a new GetContractsObservableParams 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 NewGetContractsObservableParams() *GetContractsObservableParams {
return &GetContractsObservableParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetContractsObservableParamsWithTimeout creates a new GetContractsObservableParams object
// with the ability to set a timeout on a request.
func NewGetContractsObservableParamsWithTimeout(timeout time.Duration) *GetContractsObservableParams {
return &GetContractsObservableParams{
timeout: timeout,
}
}
// NewGetContractsObservableParamsWithContext creates a new GetContractsObservableParams object
// with the ability to set a context for a request.
func NewGetContractsObservableParamsWithContext(ctx context.Context) *GetContractsObservableParams {
return &GetContractsObservableParams{
Context: ctx,
}
}
// NewGetContractsObservableParamsWithHTTPClient creates a new GetContractsObservableParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetContractsObservableParamsWithHTTPClient(client *http.Client) *GetContractsObservableParams {
return &GetContractsObservableParams{
HTTPClient: client,
}
}
/* GetContractsObservableParams contains all the parameters to send to the API endpoint
for the get contracts observable operation.
Typically these are written to a http.Request.
*/
type GetContractsObservableParams struct {
/* Active.
Only retrieve active records?
*/
Active *bool
/* ContractID.
Taxnexus Contact record ID
*/
ContractID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get contracts observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContractsObservableParams) WithDefaults() *GetContractsObservableParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get contracts observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetContractsObservableParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get contracts observable params
func (o *GetContractsObservableParams) WithTimeout(timeout time.Duration) *GetContractsObservableParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get contracts observable params
func (o *GetContractsObservableParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get contracts observable params
func (o *GetContractsObservableParams) WithContext(ctx context.Context) *GetContractsObservableParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get contracts observable params
func (o *GetContractsObservableParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get contracts observable params
func (o *GetContractsObservableParams) WithHTTPClient(client *http.Client) *GetContractsObservableParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get contracts observable params
func (o *GetContractsObservableParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithActive adds the active to the get contracts observable params
func (o *GetContractsObservableParams) WithActive(active *bool) *GetContractsObservableParams {
o.SetActive(active)
return o
}
// SetActive adds the active to the get contracts observable params
func (o *GetContractsObservableParams) SetActive(active *bool) {
o.Active = active
}
// WithContractID adds the contractID to the get contracts observable params
func (o *GetContractsObservableParams) WithContractID(contractID *string) *GetContractsObservableParams {
o.SetContractID(contractID)
return o
}
// SetContractID adds the contractId to the get contracts observable params
func (o *GetContractsObservableParams) SetContractID(contractID *string) {
o.ContractID = contractID
}
// WriteToRequest writes these params to a swagger request
func (o *GetContractsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Active != nil {
// query param active
var qrActive bool
if o.Active != nil {
qrActive = *o.Active
}
qActive := swag.FormatBool(qrActive)
if qActive != "" {
if err := r.SetQueryParam("active", qActive); err != nil {
return err
}
}
}
if o.ContractID != nil {
// query param contractId
var qrContractID string
if o.ContractID != nil {
qrContractID = *o.ContractID
}
qContractID := qrContractID
if qContractID != "" {
if err := r.SetQueryParam("contractId", qContractID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}