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

package cluster_authorization

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

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

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

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

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

/* ClusterAuthorizationGetUserAuthorizationParams contains all the parameters to send to the API endpoint
   for the cluster authorization get user authorization operation.

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

	// CertIssueSeconds.
	//
	// Format: int64
	CertIssueSeconds *string

	// ClusterID.
	ClusterID *string

	// UserCN.
	UserCN *string

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

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

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

// WithTimeout adds the timeout to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithTimeout(timeout time.Duration) *ClusterAuthorizationGetUserAuthorizationParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithContext(ctx context.Context) *ClusterAuthorizationGetUserAuthorizationParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithHTTPClient(client *http.Client) *ClusterAuthorizationGetUserAuthorizationParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithCertIssueSeconds adds the certIssueSeconds to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithCertIssueSeconds(certIssueSeconds *string) *ClusterAuthorizationGetUserAuthorizationParams {
	o.SetCertIssueSeconds(certIssueSeconds)
	return o
}

// SetCertIssueSeconds adds the certIssueSeconds to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetCertIssueSeconds(certIssueSeconds *string) {
	o.CertIssueSeconds = certIssueSeconds
}

// WithClusterID adds the clusterID to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithClusterID(clusterID *string) *ClusterAuthorizationGetUserAuthorizationParams {
	o.SetClusterID(clusterID)
	return o
}

// SetClusterID adds the clusterId to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetClusterID(clusterID *string) {
	o.ClusterID = clusterID
}

// WithUserCN adds the userCN to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithUserCN(userCN *string) *ClusterAuthorizationGetUserAuthorizationParams {
	o.SetUserCN(userCN)
	return o
}

// SetUserCN adds the userCN to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetUserCN(userCN *string) {
	o.UserCN = userCN
}

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

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

	if o.CertIssueSeconds != nil {

		// query param certIssueSeconds
		var qrCertIssueSeconds string

		if o.CertIssueSeconds != nil {
			qrCertIssueSeconds = *o.CertIssueSeconds
		}
		qCertIssueSeconds := qrCertIssueSeconds
		if qCertIssueSeconds != "" {

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

	if o.ClusterID != nil {

		// query param clusterID
		var qrClusterID string

		if o.ClusterID != nil {
			qrClusterID = *o.ClusterID
		}
		qClusterID := qrClusterID
		if qClusterID != "" {

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

	if o.UserCN != nil {

		// query param userCN
		var qrUserCN string

		if o.UserCN != nil {
			qrUserCN = *o.UserCN
		}
		qUserCN := qrUserCN
		if qUserCN != "" {

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

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