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

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

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

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

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

/* GetDeviceDatasourceInstanceAlertSettingByIDParams contains all the parameters to send to the API endpoint
   for the get device datasource instance alert setting by Id operation.

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

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

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

	// Fields.
	Fields *string

	/* HdsID.

	   Device-DataSource ID

	   Format: int32
	*/
	HdsID int32

	// ID.
	//
	// Format: int32
	ID int32

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

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

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

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

	val := GetDeviceDatasourceInstanceAlertSettingByIDParams{
		UserAgent: &userAgentDefault,
	}

	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 by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) WithTimeout(timeout time.Duration) *GetDeviceDatasourceInstanceAlertSettingByIDParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) WithContext(ctx context.Context) *GetDeviceDatasourceInstanceAlertSettingByIDParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) WithHTTPClient(client *http.Client) *GetDeviceDatasourceInstanceAlertSettingByIDParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithUserAgent adds the userAgent to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) WithUserAgent(userAgent *string) *GetDeviceDatasourceInstanceAlertSettingByIDParams {
	o.SetUserAgent(userAgent)
	return o
}

// SetUserAgent adds the userAgent to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) SetUserAgent(userAgent *string) {
	o.UserAgent = userAgent
}

// WithDeviceID adds the deviceID to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) WithDeviceID(deviceID int32) *GetDeviceDatasourceInstanceAlertSettingByIDParams {
	o.SetDeviceID(deviceID)
	return o
}

// SetDeviceID adds the deviceId to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) SetDeviceID(deviceID int32) {
	o.DeviceID = deviceID
}

// WithFields adds the fields to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) WithFields(fields *string) *GetDeviceDatasourceInstanceAlertSettingByIDParams {
	o.SetFields(fields)
	return o
}

// SetFields adds the fields to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) SetFields(fields *string) {
	o.Fields = fields
}

// WithHdsID adds the hdsID to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) WithHdsID(hdsID int32) *GetDeviceDatasourceInstanceAlertSettingByIDParams {
	o.SetHdsID(hdsID)
	return o
}

// SetHdsID adds the hdsId to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) SetHdsID(hdsID int32) {
	o.HdsID = hdsID
}

// WithID adds the id to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) WithID(id int32) *GetDeviceDatasourceInstanceAlertSettingByIDParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) SetID(id int32) {
	o.ID = id
}

// WithInstanceID adds the instanceID to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) WithInstanceID(instanceID int32) *GetDeviceDatasourceInstanceAlertSettingByIDParams {
	o.SetInstanceID(instanceID)
	return o
}

// SetInstanceID adds the instanceId to the get device datasource instance alert setting by Id params
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) SetInstanceID(instanceID int32) {
	o.InstanceID = instanceID
}

// WriteToRequest writes these params to a swagger request
func (o *GetDeviceDatasourceInstanceAlertSettingByIDParams) 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
	}

	if o.Fields != nil {

		// query param fields
		var qrFields string

		if o.Fields != nil {
			qrFields = *o.Fields
		}
		qFields := qrFields
		if qFields != "" {

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

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

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

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

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