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

// Copyright 2018 The go-netbox Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package secrets

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"net/http"
	"time"

	"golang.org/x/net/context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/swag"

	strfmt "github.com/go-openapi/strfmt"
)

// NewSecretsSecretsListParams creates a new SecretsSecretsListParams object
// with the default values initialized.
func NewSecretsSecretsListParams() *SecretsSecretsListParams {
	var ()
	return &SecretsSecretsListParams{

		timeout: cr.DefaultTimeout,
	}
}

// NewSecretsSecretsListParamsWithTimeout creates a new SecretsSecretsListParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewSecretsSecretsListParamsWithTimeout(timeout time.Duration) *SecretsSecretsListParams {
	var ()
	return &SecretsSecretsListParams{

		timeout: timeout,
	}
}

// NewSecretsSecretsListParamsWithContext creates a new SecretsSecretsListParams object
// with the default values initialized, and the ability to set a context for a request
func NewSecretsSecretsListParamsWithContext(ctx context.Context) *SecretsSecretsListParams {
	var ()
	return &SecretsSecretsListParams{

		Context: ctx,
	}
}

// NewSecretsSecretsListParamsWithHTTPClient creates a new SecretsSecretsListParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewSecretsSecretsListParamsWithHTTPClient(client *http.Client) *SecretsSecretsListParams {
	var ()
	return &SecretsSecretsListParams{
		HTTPClient: client,
	}
}

/*SecretsSecretsListParams contains all the parameters to send to the API endpoint
for the secrets secrets list operation typically these are written to a http.Request
*/
type SecretsSecretsListParams struct {

	/*Device*/
	Device *string
	/*DeviceID*/
	DeviceID *string
	/*IDIn
	  Multiple values may be separated by commas.

	*/
	IDIn *string
	/*Limit
	  Number of results to return per page.

	*/
	Limit *int64
	/*Name*/
	Name *string
	/*Offset
	  The initial index from which to return the results.

	*/
	Offset *int64
	/*Q*/
	Q *string
	/*Role*/
	Role *string
	/*RoleID*/
	RoleID *string

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

// WithTimeout adds the timeout to the secrets secrets list params
func (o *SecretsSecretsListParams) WithTimeout(timeout time.Duration) *SecretsSecretsListParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the secrets secrets list params
func (o *SecretsSecretsListParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the secrets secrets list params
func (o *SecretsSecretsListParams) WithContext(ctx context.Context) *SecretsSecretsListParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the secrets secrets list params
func (o *SecretsSecretsListParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the secrets secrets list params
func (o *SecretsSecretsListParams) WithHTTPClient(client *http.Client) *SecretsSecretsListParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the secrets secrets list params
func (o *SecretsSecretsListParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithDevice adds the device to the secrets secrets list params
func (o *SecretsSecretsListParams) WithDevice(device *string) *SecretsSecretsListParams {
	o.SetDevice(device)
	return o
}

// SetDevice adds the device to the secrets secrets list params
func (o *SecretsSecretsListParams) SetDevice(device *string) {
	o.Device = device
}

// WithDeviceID adds the deviceID to the secrets secrets list params
func (o *SecretsSecretsListParams) WithDeviceID(deviceID *string) *SecretsSecretsListParams {
	o.SetDeviceID(deviceID)
	return o
}

// SetDeviceID adds the deviceId to the secrets secrets list params
func (o *SecretsSecretsListParams) SetDeviceID(deviceID *string) {
	o.DeviceID = deviceID
}

// WithIDIn adds the iDIn to the secrets secrets list params
func (o *SecretsSecretsListParams) WithIDIn(iDIn *string) *SecretsSecretsListParams {
	o.SetIDIn(iDIn)
	return o
}

// SetIDIn adds the idIn to the secrets secrets list params
func (o *SecretsSecretsListParams) SetIDIn(iDIn *string) {
	o.IDIn = iDIn
}

// WithLimit adds the limit to the secrets secrets list params
func (o *SecretsSecretsListParams) WithLimit(limit *int64) *SecretsSecretsListParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the secrets secrets list params
func (o *SecretsSecretsListParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithName adds the name to the secrets secrets list params
func (o *SecretsSecretsListParams) WithName(name *string) *SecretsSecretsListParams {
	o.SetName(name)
	return o
}

// SetName adds the name to the secrets secrets list params
func (o *SecretsSecretsListParams) SetName(name *string) {
	o.Name = name
}

// WithOffset adds the offset to the secrets secrets list params
func (o *SecretsSecretsListParams) WithOffset(offset *int64) *SecretsSecretsListParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the secrets secrets list params
func (o *SecretsSecretsListParams) SetOffset(offset *int64) {
	o.Offset = offset
}

// WithQ adds the q to the secrets secrets list params
func (o *SecretsSecretsListParams) WithQ(q *string) *SecretsSecretsListParams {
	o.SetQ(q)
	return o
}

// SetQ adds the q to the secrets secrets list params
func (o *SecretsSecretsListParams) SetQ(q *string) {
	o.Q = q
}

// WithRole adds the role to the secrets secrets list params
func (o *SecretsSecretsListParams) WithRole(role *string) *SecretsSecretsListParams {
	o.SetRole(role)
	return o
}

// SetRole adds the role to the secrets secrets list params
func (o *SecretsSecretsListParams) SetRole(role *string) {
	o.Role = role
}

// WithRoleID adds the roleID to the secrets secrets list params
func (o *SecretsSecretsListParams) WithRoleID(roleID *string) *SecretsSecretsListParams {
	o.SetRoleID(roleID)
	return o
}

// SetRoleID adds the roleId to the secrets secrets list params
func (o *SecretsSecretsListParams) SetRoleID(roleID *string) {
	o.RoleID = roleID
}

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

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

	if o.Device != nil {

		// query param device
		var qrDevice string
		if o.Device != nil {
			qrDevice = *o.Device
		}
		qDevice := qrDevice
		if qDevice != "" {
			if err := r.SetQueryParam("device", qDevice); err != nil {
				return err
			}
		}

	}

	if o.DeviceID != nil {

		// query param device_id
		var qrDeviceID string
		if o.DeviceID != nil {
			qrDeviceID = *o.DeviceID
		}
		qDeviceID := qrDeviceID
		if qDeviceID != "" {
			if err := r.SetQueryParam("device_id", qDeviceID); err != nil {
				return err
			}
		}

	}

	if o.IDIn != nil {

		// query param id__in
		var qrIDIn string
		if o.IDIn != nil {
			qrIDIn = *o.IDIn
		}
		qIDIn := qrIDIn
		if qIDIn != "" {
			if err := r.SetQueryParam("id__in", qIDIn); 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.Name != nil {

		// query param name
		var qrName string
		if o.Name != nil {
			qrName = *o.Name
		}
		qName := qrName
		if qName != "" {
			if err := r.SetQueryParam("name", qName); 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.Q != nil {

		// query param q
		var qrQ string
		if o.Q != nil {
			qrQ = *o.Q
		}
		qQ := qrQ
		if qQ != "" {
			if err := r.SetQueryParam("q", qQ); err != nil {
				return err
			}
		}

	}

	if o.Role != nil {

		// query param role
		var qrRole string
		if o.Role != nil {
			qrRole = *o.Role
		}
		qRole := qrRole
		if qRole != "" {
			if err := r.SetQueryParam("role", qRole); err != nil {
				return err
			}
		}

	}

	if o.RoleID != nil {

		// query param role_id
		var qrRoleID string
		if o.RoleID != nil {
			qrRoleID = *o.RoleID
		}
		qRoleID := qrRoleID
		if qRoleID != "" {
			if err := r.SetQueryParam("role_id", qRoleID); err != nil {
				return err
			}
		}

	}

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