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

package admin

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

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

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

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

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

/* ListSubjectConsentSessionsParams contains all the parameters to send to the API endpoint
   for the list subject consent sessions operation.

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

	// Subject.
	Subject string

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

// WithDefaults hydrates default values in the list subject consent sessions params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ListSubjectConsentSessionsParams) WithDefaults() *ListSubjectConsentSessionsParams {
	o.SetDefaults()
	return o
}

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

// WithTimeout adds the timeout to the list subject consent sessions params
func (o *ListSubjectConsentSessionsParams) WithTimeout(timeout time.Duration) *ListSubjectConsentSessionsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the list subject consent sessions params
func (o *ListSubjectConsentSessionsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the list subject consent sessions params
func (o *ListSubjectConsentSessionsParams) WithContext(ctx context.Context) *ListSubjectConsentSessionsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the list subject consent sessions params
func (o *ListSubjectConsentSessionsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the list subject consent sessions params
func (o *ListSubjectConsentSessionsParams) WithHTTPClient(client *http.Client) *ListSubjectConsentSessionsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the list subject consent sessions params
func (o *ListSubjectConsentSessionsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithSubject adds the subject to the list subject consent sessions params
func (o *ListSubjectConsentSessionsParams) WithSubject(subject string) *ListSubjectConsentSessionsParams {
	o.SetSubject(subject)
	return o
}

// SetSubject adds the subject to the list subject consent sessions params
func (o *ListSubjectConsentSessionsParams) SetSubject(subject string) {
	o.Subject = subject
}

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

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

	// query param subject
	qrSubject := o.Subject
	qSubject := qrSubject
	if qSubject != "" {

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

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