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

package orgs

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

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

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

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

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

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

	for the get org by name operation.

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

	// OrgName.
	OrgName string

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

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

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

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

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

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

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

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

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

// WithOrgName adds the orgName to the get org by name params
func (o *GetOrgByNameParams) WithOrgName(orgName string) *GetOrgByNameParams {
	o.SetOrgName(orgName)
	return o
}

// SetOrgName adds the orgName to the get org by name params
func (o *GetOrgByNameParams) SetOrgName(orgName string) {
	o.OrgName = orgName
}

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

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

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

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