client/reseller_sales_prices/get_async_parameters.go
// Code generated by go-swagger; DO NOT EDIT.
package reseller_sales_prices
// 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"
)
// NewGetAsyncParams creates a new GetAsyncParams object
// with the default values initialized.
func NewGetAsyncParams() *GetAsyncParams {
var ()
return &GetAsyncParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetAsyncParamsWithTimeout creates a new GetAsyncParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewGetAsyncParamsWithTimeout(timeout time.Duration) *GetAsyncParams {
var ()
return &GetAsyncParams{
timeout: timeout,
}
}
// NewGetAsyncParamsWithContext creates a new GetAsyncParams object
// with the default values initialized, and the ability to set a context for a request
func NewGetAsyncParamsWithContext(ctx context.Context) *GetAsyncParams {
var ()
return &GetAsyncParams{
Context: ctx,
}
}
// NewGetAsyncParamsWithHTTPClient creates a new GetAsyncParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetAsyncParamsWithHTTPClient(client *http.Client) *GetAsyncParams {
var ()
return &GetAsyncParams{
HTTPClient: client,
}
}
/*GetAsyncParams contains all the parameters to send to the API endpoint
for the get async operation typically these are written to a http.Request
*/
type GetAsyncParams struct {
/*FromDate*/
FromDate *strfmt.DateTime
/*ObjectID*/
ObjectID *int32
/*ObjectType*/
ObjectType *string
/*Type*/
Type *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the get async params
func (o *GetAsyncParams) WithTimeout(timeout time.Duration) *GetAsyncParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get async params
func (o *GetAsyncParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get async params
func (o *GetAsyncParams) WithContext(ctx context.Context) *GetAsyncParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get async params
func (o *GetAsyncParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get async params
func (o *GetAsyncParams) WithHTTPClient(client *http.Client) *GetAsyncParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get async params
func (o *GetAsyncParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithFromDate adds the fromDate to the get async params
func (o *GetAsyncParams) WithFromDate(fromDate *strfmt.DateTime) *GetAsyncParams {
o.SetFromDate(fromDate)
return o
}
// SetFromDate adds the fromDate to the get async params
func (o *GetAsyncParams) SetFromDate(fromDate *strfmt.DateTime) {
o.FromDate = fromDate
}
// WithObjectID adds the objectID to the get async params
func (o *GetAsyncParams) WithObjectID(objectID *int32) *GetAsyncParams {
o.SetObjectID(objectID)
return o
}
// SetObjectID adds the objectId to the get async params
func (o *GetAsyncParams) SetObjectID(objectID *int32) {
o.ObjectID = objectID
}
// WithObjectType adds the objectType to the get async params
func (o *GetAsyncParams) WithObjectType(objectType *string) *GetAsyncParams {
o.SetObjectType(objectType)
return o
}
// SetObjectType adds the objectType to the get async params
func (o *GetAsyncParams) SetObjectType(objectType *string) {
o.ObjectType = objectType
}
// WithType adds the typeVar to the get async params
func (o *GetAsyncParams) WithType(typeVar *string) *GetAsyncParams {
o.SetType(typeVar)
return o
}
// SetType adds the type to the get async params
func (o *GetAsyncParams) SetType(typeVar *string) {
o.Type = typeVar
}
// WriteToRequest writes these params to a swagger request
func (o *GetAsyncParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.FromDate != nil {
// query param FromDate
var qrFromDate strfmt.DateTime
if o.FromDate != nil {
qrFromDate = *o.FromDate
}
qFromDate := qrFromDate.String()
if qFromDate != "" {
if err := r.SetQueryParam("FromDate", qFromDate); err != nil {
return err
}
}
}
if o.ObjectID != nil {
// query param ObjectId
var qrObjectID int32
if o.ObjectID != nil {
qrObjectID = *o.ObjectID
}
qObjectID := swag.FormatInt32(qrObjectID)
if qObjectID != "" {
if err := r.SetQueryParam("ObjectId", qObjectID); err != nil {
return err
}
}
}
if o.ObjectType != nil {
// query param ObjectType
var qrObjectType string
if o.ObjectType != nil {
qrObjectType = *o.ObjectType
}
qObjectType := qrObjectType
if qObjectType != "" {
if err := r.SetQueryParam("ObjectType", qObjectType); err != nil {
return err
}
}
}
if o.Type != nil {
// query param Type
var qrType string
if o.Type != nil {
qrType = *o.Type
}
qType := qrType
if qType != "" {
if err := r.SetQueryParam("Type", qType); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}