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

package multicast_group_service

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

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

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

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

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

/*
MulticastGroupServiceListParams contains all the parameters to send to the API endpoint

	for the multicast group service list operation.

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

	/* ApplicationID.

	   Application ID to list the multicast groups for.
	*/
	ApplicationID *string

	/* Limit.

	     Max number of multicast groups to return in the result-set.
	If not set, it will be treated as 0, and the response will only return the total_count.

	     Format: int64
	*/
	Limit *int64

	/* Offset.

	   Offset in the result-set (for pagination).

	   Format: int64
	*/
	Offset *int64

	/* Search.

	   If set, the given string will be used to search on name.
	*/
	Search *string

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

// WithDefaults hydrates default values in the multicast group service list params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *MulticastGroupServiceListParams) WithDefaults() *MulticastGroupServiceListParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the multicast group service list params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *MulticastGroupServiceListParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the multicast group service list params
func (o *MulticastGroupServiceListParams) WithTimeout(timeout time.Duration) *MulticastGroupServiceListParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the multicast group service list params
func (o *MulticastGroupServiceListParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the multicast group service list params
func (o *MulticastGroupServiceListParams) WithContext(ctx context.Context) *MulticastGroupServiceListParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the multicast group service list params
func (o *MulticastGroupServiceListParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the multicast group service list params
func (o *MulticastGroupServiceListParams) WithHTTPClient(client *http.Client) *MulticastGroupServiceListParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the multicast group service list params
func (o *MulticastGroupServiceListParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithApplicationID adds the applicationID to the multicast group service list params
func (o *MulticastGroupServiceListParams) WithApplicationID(applicationID *string) *MulticastGroupServiceListParams {
	o.SetApplicationID(applicationID)
	return o
}

// SetApplicationID adds the applicationId to the multicast group service list params
func (o *MulticastGroupServiceListParams) SetApplicationID(applicationID *string) {
	o.ApplicationID = applicationID
}

// WithLimit adds the limit to the multicast group service list params
func (o *MulticastGroupServiceListParams) WithLimit(limit *int64) *MulticastGroupServiceListParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the multicast group service list params
func (o *MulticastGroupServiceListParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithOffset adds the offset to the multicast group service list params
func (o *MulticastGroupServiceListParams) WithOffset(offset *int64) *MulticastGroupServiceListParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the multicast group service list params
func (o *MulticastGroupServiceListParams) SetOffset(offset *int64) {
	o.Offset = offset
}

// WithSearch adds the search to the multicast group service list params
func (o *MulticastGroupServiceListParams) WithSearch(search *string) *MulticastGroupServiceListParams {
	o.SetSearch(search)
	return o
}

// SetSearch adds the search to the multicast group service list params
func (o *MulticastGroupServiceListParams) SetSearch(search *string) {
	o.Search = search
}

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

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

	if o.ApplicationID != nil {

		// query param applicationId
		var qrApplicationID string

		if o.ApplicationID != nil {
			qrApplicationID = *o.ApplicationID
		}
		qApplicationID := qrApplicationID
		if qApplicationID != "" {

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

	if o.Limit != nil {

		// query param limit
		var qrLimit int64

		if o.Limit != nil {
			qrLimit = *o.Limit
		}
		qLimit := swag.FormatInt64(qrLimit)
		if qLimit != "" {

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

	if o.Offset != nil {

		// query param offset
		var qrOffset int64

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

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

	if o.Search != nil {

		// query param search
		var qrSearch string

		if o.Search != nil {
			qrSearch = *o.Search
		}
		qSearch := qrSearch
		if qSearch != "" {

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

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