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

package access_control

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

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

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

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

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

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

	for the list user roles operation.

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

	// UserID.
	//
	// Format: int64
	UserID int64

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

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

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

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

// SetTimeout adds the timeout to the list user roles params
func (o *ListUserRolesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the list user roles params
func (o *ListUserRolesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithUserID adds the userID to the list user roles params
func (o *ListUserRolesParams) WithUserID(userID int64) *ListUserRolesParams {
	o.SetUserID(userID)
	return o
}

// SetUserID adds the userId to the list user roles params
func (o *ListUserRolesParams) SetUserID(userID int64) {
	o.UserID = userID
}

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

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

	// path param userId
	if err := r.SetPathParam("userId", swag.FormatInt64(o.UserID)); err != nil {
		return err
	}

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