// Code generated by go-swagger; DO NOT EDIT.

package lm

// 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"
)

// NewGetDeviceDatasourceInstanceAlertSettingListOfDSIParams creates a new GetDeviceDatasourceInstanceAlertSettingListOfDSIParams 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 NewGetDeviceDatasourceInstanceAlertSettingListOfDSIParams() *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	return &GetDeviceDatasourceInstanceAlertSettingListOfDSIParams{
		timeout: cr.DefaultTimeout,
	}
}

// NewGetDeviceDatasourceInstanceAlertSettingListOfDSIParamsWithTimeout creates a new GetDeviceDatasourceInstanceAlertSettingListOfDSIParams object
// with the ability to set a timeout on a request.
func NewGetDeviceDatasourceInstanceAlertSettingListOfDSIParamsWithTimeout(timeout time.Duration) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	return &GetDeviceDatasourceInstanceAlertSettingListOfDSIParams{
		timeout: timeout,
	}
}

// NewGetDeviceDatasourceInstanceAlertSettingListOfDSIParamsWithContext creates a new GetDeviceDatasourceInstanceAlertSettingListOfDSIParams object
// with the ability to set a context for a request.
func NewGetDeviceDatasourceInstanceAlertSettingListOfDSIParamsWithContext(ctx context.Context) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	return &GetDeviceDatasourceInstanceAlertSettingListOfDSIParams{
		Context: ctx,
	}
}

// NewGetDeviceDatasourceInstanceAlertSettingListOfDSIParamsWithHTTPClient creates a new GetDeviceDatasourceInstanceAlertSettingListOfDSIParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetDeviceDatasourceInstanceAlertSettingListOfDSIParamsWithHTTPClient(client *http.Client) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	return &GetDeviceDatasourceInstanceAlertSettingListOfDSIParams{
		HTTPClient: client,
	}
}

/* GetDeviceDatasourceInstanceAlertSettingListOfDSIParams contains all the parameters to send to the API endpoint
   for the get device datasource instance alert setting list of d s i operation.

   Typically these are written to a http.Request.
*/
type GetDeviceDatasourceInstanceAlertSettingListOfDSIParams struct {

	// UserAgent.
	//
	// Default: "Logicmonitor/SDK: Argus Dist-v1.0.0-argus1"
	UserAgent *string

	// DeviceID.
	//
	// Format: int32
	DeviceID int32

	/* HdsID.

	   Device-DataSource ID

	   Format: int32
	*/
	HdsID int32

	// InstanceID.
	//
	// Format: int32
	InstanceID int32

	// Offset.
	//
	// Format: int32
	Offset *int32

	// Size.
	//
	// Format: int32
	// Default: 50
	Size *int32

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithDefaults hydrates default values in the get device datasource instance alert setting list of d s i params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WithDefaults() *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the get device datasource instance alert setting list of d s i params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) SetDefaults() {
	var (
		userAgentDefault = string("Logicmonitor/SDK: Argus Dist-v1.0.0-argus1")

		offsetDefault = int32(0)

		sizeDefault = int32(50)
	)

	val := GetDeviceDatasourceInstanceAlertSettingListOfDSIParams{
		UserAgent: &userAgentDefault,
		Offset:    &offsetDefault,
		Size:      &sizeDefault,
	}

	val.timeout = o.timeout
	val.Context = o.Context
	val.HTTPClient = o.HTTPClient
	*o = val
}

// WithTimeout adds the timeout to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WithTimeout(timeout time.Duration) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WithContext(ctx context.Context) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WithHTTPClient(client *http.Client) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithUserAgent adds the userAgent to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WithUserAgent(userAgent *string) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	o.SetUserAgent(userAgent)
	return o
}

// SetUserAgent adds the userAgent to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) SetUserAgent(userAgent *string) {
	o.UserAgent = userAgent
}

// WithDeviceID adds the deviceID to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WithDeviceID(deviceID int32) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	o.SetDeviceID(deviceID)
	return o
}

// SetDeviceID adds the deviceId to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) SetDeviceID(deviceID int32) {
	o.DeviceID = deviceID
}

// WithHdsID adds the hdsID to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WithHdsID(hdsID int32) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	o.SetHdsID(hdsID)
	return o
}

// SetHdsID adds the hdsId to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) SetHdsID(hdsID int32) {
	o.HdsID = hdsID
}

// WithInstanceID adds the instanceID to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WithInstanceID(instanceID int32) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	o.SetInstanceID(instanceID)
	return o
}

// SetInstanceID adds the instanceId to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) SetInstanceID(instanceID int32) {
	o.InstanceID = instanceID
}

// WithOffset adds the offset to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WithOffset(offset *int32) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) SetOffset(offset *int32) {
	o.Offset = offset
}

// WithSize adds the size to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WithSize(size *int32) *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams {
	o.SetSize(size)
	return o
}

// SetSize adds the size to the get device datasource instance alert setting list of d s i params
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) SetSize(size *int32) {
	o.Size = size
}

// WriteToRequest writes these params to a swagger request
func (o *GetDeviceDatasourceInstanceAlertSettingListOfDSIParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	if o.UserAgent != nil {

		// header param User-Agent
		if err := r.SetHeaderParam("User-Agent", *o.UserAgent); err != nil {
			return err
		}
	}

	// path param deviceId
	if err := r.SetPathParam("deviceId", swag.FormatInt32(o.DeviceID)); err != nil {
		return err
	}

	// path param hdsId
	if err := r.SetPathParam("hdsId", swag.FormatInt32(o.HdsID)); err != nil {
		return err
	}

	// path param instanceId
	if err := r.SetPathParam("instanceId", swag.FormatInt32(o.InstanceID)); err != nil {
		return err
	}

	if o.Offset != nil {

		// query param offset
		var qrOffset int32

		if o.Offset != nil {
			qrOffset = *o.Offset
		}
		qOffset := swag.FormatInt32(qrOffset)
		if qOffset != "" {

			if err := r.SetQueryParam("offset", qOffset); err != nil {
				return err
			}
		}
	}

	if o.Size != nil {

		// query param size
		var qrSize int32

		if o.Size != nil {
			qrSize = *o.Size
		}
		qSize := swag.FormatInt32(qrSize)
		if qSize != "" {

			if err := r.SetQueryParam("size", qSize); err != nil {
				return err
			}
		}
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
