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

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

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

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

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

/* GetReportGroupListParams contains all the parameters to send to the API endpoint
   for the get report group list operation.

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

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

	// Fields.
	Fields *string

	// Filter.
	Filter *string

	// 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 report group list params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetReportGroupListParams) WithDefaults() *GetReportGroupListParams {
	o.SetDefaults()
	return o
}

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

		offsetDefault = int32(0)

		sizeDefault = int32(50)
	)

	val := GetReportGroupListParams{
		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 report group list params
func (o *GetReportGroupListParams) WithTimeout(timeout time.Duration) *GetReportGroupListParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get report group list params
func (o *GetReportGroupListParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get report group list params
func (o *GetReportGroupListParams) WithContext(ctx context.Context) *GetReportGroupListParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get report group list params
func (o *GetReportGroupListParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get report group list params
func (o *GetReportGroupListParams) WithHTTPClient(client *http.Client) *GetReportGroupListParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get report group list params
func (o *GetReportGroupListParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithUserAgent adds the userAgent to the get report group list params
func (o *GetReportGroupListParams) WithUserAgent(userAgent *string) *GetReportGroupListParams {
	o.SetUserAgent(userAgent)
	return o
}

// SetUserAgent adds the userAgent to the get report group list params
func (o *GetReportGroupListParams) SetUserAgent(userAgent *string) {
	o.UserAgent = userAgent
}

// WithFields adds the fields to the get report group list params
func (o *GetReportGroupListParams) WithFields(fields *string) *GetReportGroupListParams {
	o.SetFields(fields)
	return o
}

// SetFields adds the fields to the get report group list params
func (o *GetReportGroupListParams) SetFields(fields *string) {
	o.Fields = fields
}

// WithFilter adds the filter to the get report group list params
func (o *GetReportGroupListParams) WithFilter(filter *string) *GetReportGroupListParams {
	o.SetFilter(filter)
	return o
}

// SetFilter adds the filter to the get report group list params
func (o *GetReportGroupListParams) SetFilter(filter *string) {
	o.Filter = filter
}

// WithOffset adds the offset to the get report group list params
func (o *GetReportGroupListParams) WithOffset(offset *int32) *GetReportGroupListParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the get report group list params
func (o *GetReportGroupListParams) SetOffset(offset *int32) {
	o.Offset = offset
}

// WithSize adds the size to the get report group list params
func (o *GetReportGroupListParams) WithSize(size *int32) *GetReportGroupListParams {
	o.SetSize(size)
	return o
}

// SetSize adds the size to the get report group list params
func (o *GetReportGroupListParams) SetSize(size *int32) {
	o.Size = size
}

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

	if o.Filter != nil {

		// query param filter
		var qrFilter string

		if o.Filter != nil {
			qrFilter = *o.Filter
		}
		qFilter := qrFilter
		if qFilter != "" {

			if err := r.SetQueryParam("filter", qFilter); 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
}
