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

package repository

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

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

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

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

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

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

	for the get repo variable operation.

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

	/* Owner.

	   name of the owner
	*/
	Owner string

	/* Repo.

	   name of the repository
	*/
	Repo string

	/* Variablename.

	   name of the variable
	*/
	Variablename string

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

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

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

// WithTimeout adds the timeout to the get repo variable params
func (o *GetRepoVariableParams) WithTimeout(timeout time.Duration) *GetRepoVariableParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get repo variable params
func (o *GetRepoVariableParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get repo variable params
func (o *GetRepoVariableParams) WithContext(ctx context.Context) *GetRepoVariableParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get repo variable params
func (o *GetRepoVariableParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get repo variable params
func (o *GetRepoVariableParams) WithHTTPClient(client *http.Client) *GetRepoVariableParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get repo variable params
func (o *GetRepoVariableParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithOwner adds the owner to the get repo variable params
func (o *GetRepoVariableParams) WithOwner(owner string) *GetRepoVariableParams {
	o.SetOwner(owner)
	return o
}

// SetOwner adds the owner to the get repo variable params
func (o *GetRepoVariableParams) SetOwner(owner string) {
	o.Owner = owner
}

// WithRepo adds the repo to the get repo variable params
func (o *GetRepoVariableParams) WithRepo(repo string) *GetRepoVariableParams {
	o.SetRepo(repo)
	return o
}

// SetRepo adds the repo to the get repo variable params
func (o *GetRepoVariableParams) SetRepo(repo string) {
	o.Repo = repo
}

// WithVariablename adds the variablename to the get repo variable params
func (o *GetRepoVariableParams) WithVariablename(variablename string) *GetRepoVariableParams {
	o.SetVariablename(variablename)
	return o
}

// SetVariablename adds the variablename to the get repo variable params
func (o *GetRepoVariableParams) SetVariablename(variablename string) {
	o.Variablename = variablename
}

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

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

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

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

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

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