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

package organization

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

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

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

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

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

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

	for the organization block user operation.

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

	/* Note.

	   optional note for the block
	*/
	Note *string

	/* Org.

	   name of the organization
	*/
	Org string

	/* Username.

	   user to block
	*/
	Username string

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

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

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

// WithTimeout adds the timeout to the organization block user params
func (o *OrganizationBlockUserParams) WithTimeout(timeout time.Duration) *OrganizationBlockUserParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the organization block user params
func (o *OrganizationBlockUserParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the organization block user params
func (o *OrganizationBlockUserParams) WithContext(ctx context.Context) *OrganizationBlockUserParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the organization block user params
func (o *OrganizationBlockUserParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the organization block user params
func (o *OrganizationBlockUserParams) WithHTTPClient(client *http.Client) *OrganizationBlockUserParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the organization block user params
func (o *OrganizationBlockUserParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithNote adds the note to the organization block user params
func (o *OrganizationBlockUserParams) WithNote(note *string) *OrganizationBlockUserParams {
	o.SetNote(note)
	return o
}

// SetNote adds the note to the organization block user params
func (o *OrganizationBlockUserParams) SetNote(note *string) {
	o.Note = note
}

// WithOrg adds the org to the organization block user params
func (o *OrganizationBlockUserParams) WithOrg(org string) *OrganizationBlockUserParams {
	o.SetOrg(org)
	return o
}

// SetOrg adds the org to the organization block user params
func (o *OrganizationBlockUserParams) SetOrg(org string) {
	o.Org = org
}

// WithUsername adds the username to the organization block user params
func (o *OrganizationBlockUserParams) WithUsername(username string) *OrganizationBlockUserParams {
	o.SetUsername(username)
	return o
}

// SetUsername adds the username to the organization block user params
func (o *OrganizationBlockUserParams) SetUsername(username string) {
	o.Username = username
}

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

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

	if o.Note != nil {

		// query param note
		var qrNote string

		if o.Note != nil {
			qrNote = *o.Note
		}
		qNote := qrNote
		if qNote != "" {

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

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

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

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