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

package org

// 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"
	"github.com/go-openapi/swag"
)

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

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

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

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

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

	for the get org users for current org lookup operation.

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

	// Limit.
	//
	// Format: int64
	Limit *int64

	// Query.
	Query *string

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

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

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

// WithTimeout adds the timeout to the get org users for current org lookup params
func (o *GetOrgUsersForCurrentOrgLookupParams) WithTimeout(timeout time.Duration) *GetOrgUsersForCurrentOrgLookupParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get org users for current org lookup params
func (o *GetOrgUsersForCurrentOrgLookupParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get org users for current org lookup params
func (o *GetOrgUsersForCurrentOrgLookupParams) WithContext(ctx context.Context) *GetOrgUsersForCurrentOrgLookupParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get org users for current org lookup params
func (o *GetOrgUsersForCurrentOrgLookupParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get org users for current org lookup params
func (o *GetOrgUsersForCurrentOrgLookupParams) WithHTTPClient(client *http.Client) *GetOrgUsersForCurrentOrgLookupParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get org users for current org lookup params
func (o *GetOrgUsersForCurrentOrgLookupParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithLimit adds the limit to the get org users for current org lookup params
func (o *GetOrgUsersForCurrentOrgLookupParams) WithLimit(limit *int64) *GetOrgUsersForCurrentOrgLookupParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the get org users for current org lookup params
func (o *GetOrgUsersForCurrentOrgLookupParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithQuery adds the query to the get org users for current org lookup params
func (o *GetOrgUsersForCurrentOrgLookupParams) WithQuery(query *string) *GetOrgUsersForCurrentOrgLookupParams {
	o.SetQuery(query)
	return o
}

// SetQuery adds the query to the get org users for current org lookup params
func (o *GetOrgUsersForCurrentOrgLookupParams) SetQuery(query *string) {
	o.Query = query
}

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

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

	if o.Limit != nil {

		// query param limit
		var qrLimit int64

		if o.Limit != nil {
			qrLimit = *o.Limit
		}
		qLimit := swag.FormatInt64(qrLimit)
		if qLimit != "" {

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

	if o.Query != nil {

		// query param query
		var qrQuery string

		if o.Query != nil {
			qrQuery = *o.Query
		}
		qQuery := qrQuery
		if qQuery != "" {

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

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