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

package library_elements

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

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

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

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

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

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

	for the get library element by name operation.

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

	// LibraryElementName.
	LibraryElementName string

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

// WithDefaults hydrates default values in the get library element by name params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetLibraryElementByNameParams) WithDefaults() *GetLibraryElementByNameParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the get library element by name params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetLibraryElementByNameParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the get library element by name params
func (o *GetLibraryElementByNameParams) WithTimeout(timeout time.Duration) *GetLibraryElementByNameParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get library element by name params
func (o *GetLibraryElementByNameParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get library element by name params
func (o *GetLibraryElementByNameParams) WithContext(ctx context.Context) *GetLibraryElementByNameParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get library element by name params
func (o *GetLibraryElementByNameParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get library element by name params
func (o *GetLibraryElementByNameParams) WithHTTPClient(client *http.Client) *GetLibraryElementByNameParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get library element by name params
func (o *GetLibraryElementByNameParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithLibraryElementName adds the libraryElementName to the get library element by name params
func (o *GetLibraryElementByNameParams) WithLibraryElementName(libraryElementName string) *GetLibraryElementByNameParams {
	o.SetLibraryElementName(libraryElementName)
	return o
}

// SetLibraryElementName adds the libraryElementName to the get library element by name params
func (o *GetLibraryElementByNameParams) SetLibraryElementName(libraryElementName string) {
	o.LibraryElementName = libraryElementName
}

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

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

	// path param library_element_name
	if err := r.SetPathParam("library_element_name", o.LibraryElementName); err != nil {
		return err
	}

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