lib/api/crm/crm_client/assets/get_assets_observable_param...

202 lines
5.4 KiB
Go
Raw Normal View History

2022-09-03 03:34:04 +00:00
// 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 assets
// 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"
)
// NewGetAssetsObservableParams creates a new GetAssetsObservableParams 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 NewGetAssetsObservableParams() *GetAssetsObservableParams {
return &GetAssetsObservableParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetAssetsObservableParamsWithTimeout creates a new GetAssetsObservableParams object
// with the ability to set a timeout on a request.
func NewGetAssetsObservableParamsWithTimeout(timeout time.Duration) *GetAssetsObservableParams {
return &GetAssetsObservableParams{
timeout: timeout,
}
}
// NewGetAssetsObservableParamsWithContext creates a new GetAssetsObservableParams object
// with the ability to set a context for a request.
func NewGetAssetsObservableParamsWithContext(ctx context.Context) *GetAssetsObservableParams {
return &GetAssetsObservableParams{
Context: ctx,
}
}
// NewGetAssetsObservableParamsWithHTTPClient creates a new GetAssetsObservableParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetAssetsObservableParamsWithHTTPClient(client *http.Client) *GetAssetsObservableParams {
return &GetAssetsObservableParams{
HTTPClient: client,
}
}
2023-03-22 20:49:01 +00:00
/*
GetAssetsObservableParams contains all the parameters to send to the API endpoint
2022-09-03 03:34:04 +00:00
2023-03-22 20:49:01 +00:00
for the get assets observable operation.
Typically these are written to a http.Request.
2022-09-03 03:34:04 +00:00
*/
type GetAssetsObservableParams struct {
/* AccountID.
2023-03-28 17:47:34 +00:00
Record Id of an Account
2022-09-03 03:34:04 +00:00
*/
AccountID *string
/* AssetID.
2023-03-28 17:47:34 +00:00
Record Id of an Asset
2022-09-03 03:34:04 +00:00
*/
AssetID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get assets observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAssetsObservableParams) WithDefaults() *GetAssetsObservableParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get assets observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAssetsObservableParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get assets observable params
func (o *GetAssetsObservableParams) WithTimeout(timeout time.Duration) *GetAssetsObservableParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get assets observable params
func (o *GetAssetsObservableParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get assets observable params
func (o *GetAssetsObservableParams) WithContext(ctx context.Context) *GetAssetsObservableParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get assets observable params
func (o *GetAssetsObservableParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get assets observable params
func (o *GetAssetsObservableParams) WithHTTPClient(client *http.Client) *GetAssetsObservableParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get assets observable params
func (o *GetAssetsObservableParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAccountID adds the accountID to the get assets observable params
func (o *GetAssetsObservableParams) WithAccountID(accountID *string) *GetAssetsObservableParams {
o.SetAccountID(accountID)
return o
}
// SetAccountID adds the accountId to the get assets observable params
func (o *GetAssetsObservableParams) SetAccountID(accountID *string) {
o.AccountID = accountID
}
// WithAssetID adds the assetID to the get assets observable params
func (o *GetAssetsObservableParams) WithAssetID(assetID *string) *GetAssetsObservableParams {
o.SetAssetID(assetID)
return o
}
// SetAssetID adds the assetId to the get assets observable params
func (o *GetAssetsObservableParams) SetAssetID(assetID *string) {
o.AssetID = assetID
}
// WriteToRequest writes these params to a swagger request
func (o *GetAssetsObservableParams) 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.AssetID != nil {
// query param assetId
var qrAssetID string
if o.AssetID != nil {
qrAssetID = *o.AssetID
}
qAssetID := qrAssetID
if qAssetID != "" {
if err := r.SetQueryParam("assetId", qAssetID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}