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

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

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

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

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

/* GetAlertByIDParams contains all the parameters to send to the API endpoint
   for the get alert by Id operation.

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

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

	// CustomColumns.
	CustomColumns *string

	// Fields.
	Fields *string

	// ID.
	ID string

	// NeedMessage.
	NeedMessage *bool

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

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

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

		needMessageDefault = bool(false)
	)

	val := GetAlertByIDParams{
		UserAgent:   &userAgentDefault,
		NeedMessage: &needMessageDefault,
	}

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

// WithTimeout adds the timeout to the get alert by Id params
func (o *GetAlertByIDParams) WithTimeout(timeout time.Duration) *GetAlertByIDParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get alert by Id params
func (o *GetAlertByIDParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get alert by Id params
func (o *GetAlertByIDParams) WithContext(ctx context.Context) *GetAlertByIDParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get alert by Id params
func (o *GetAlertByIDParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

// SetHTTPClient adds the HTTPClient to the get alert by Id params
func (o *GetAlertByIDParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithUserAgent adds the userAgent to the get alert by Id params
func (o *GetAlertByIDParams) WithUserAgent(userAgent *string) *GetAlertByIDParams {
	o.SetUserAgent(userAgent)
	return o
}

// SetUserAgent adds the userAgent to the get alert by Id params
func (o *GetAlertByIDParams) SetUserAgent(userAgent *string) {
	o.UserAgent = userAgent
}

// WithCustomColumns adds the customColumns to the get alert by Id params
func (o *GetAlertByIDParams) WithCustomColumns(customColumns *string) *GetAlertByIDParams {
	o.SetCustomColumns(customColumns)
	return o
}

// SetCustomColumns adds the customColumns to the get alert by Id params
func (o *GetAlertByIDParams) SetCustomColumns(customColumns *string) {
	o.CustomColumns = customColumns
}

// WithFields adds the fields to the get alert by Id params
func (o *GetAlertByIDParams) WithFields(fields *string) *GetAlertByIDParams {
	o.SetFields(fields)
	return o
}

// SetFields adds the fields to the get alert by Id params
func (o *GetAlertByIDParams) SetFields(fields *string) {
	o.Fields = fields
}

// WithID adds the id to the get alert by Id params
func (o *GetAlertByIDParams) WithID(id string) *GetAlertByIDParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the get alert by Id params
func (o *GetAlertByIDParams) SetID(id string) {
	o.ID = id
}

// WithNeedMessage adds the needMessage to the get alert by Id params
func (o *GetAlertByIDParams) WithNeedMessage(needMessage *bool) *GetAlertByIDParams {
	o.SetNeedMessage(needMessage)
	return o
}

// SetNeedMessage adds the needMessage to the get alert by Id params
func (o *GetAlertByIDParams) SetNeedMessage(needMessage *bool) {
	o.NeedMessage = needMessage
}

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

	if o.CustomColumns != nil {

		// query param customColumns
		var qrCustomColumns string

		if o.CustomColumns != nil {
			qrCustomColumns = *o.CustomColumns
		}
		qCustomColumns := qrCustomColumns
		if qCustomColumns != "" {

			if err := r.SetQueryParam("customColumns", qCustomColumns); 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 id
	if err := r.SetPathParam("id", o.ID); err != nil {
		return err
	}

	if o.NeedMessage != nil {

		// query param needMessage
		var qrNeedMessage bool

		if o.NeedMessage != nil {
			qrNeedMessage = *o.NeedMessage
		}
		qNeedMessage := swag.FormatBool(qrNeedMessage)
		if qNeedMessage != "" {

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

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