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

package resource_service

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

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

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

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

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

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

	for the search resources operation.

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

	// Body.
	Body SearchResourcesBody

	/* LocationProjectID.

	   project_id is the projects id.
	*/
	LocationProjectID string

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

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

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

// WithTimeout adds the timeout to the search resources params
func (o *SearchResourcesParams) WithTimeout(timeout time.Duration) *SearchResourcesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the search resources params
func (o *SearchResourcesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the search resources params
func (o *SearchResourcesParams) WithContext(ctx context.Context) *SearchResourcesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the search resources params
func (o *SearchResourcesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the search resources params
func (o *SearchResourcesParams) WithHTTPClient(client *http.Client) *SearchResourcesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the search resources params
func (o *SearchResourcesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the search resources params
func (o *SearchResourcesParams) WithBody(body SearchResourcesBody) *SearchResourcesParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the search resources params
func (o *SearchResourcesParams) SetBody(body SearchResourcesBody) {
	o.Body = body
}

// WithLocationProjectID adds the locationProjectID to the search resources params
func (o *SearchResourcesParams) WithLocationProjectID(locationProjectID string) *SearchResourcesParams {
	o.SetLocationProjectID(locationProjectID)
	return o
}

// SetLocationProjectID adds the locationProjectId to the search resources params
func (o *SearchResourcesParams) SetLocationProjectID(locationProjectID string) {
	o.LocationProjectID = locationProjectID
}

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

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

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

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