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

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package credentials

import (
	"context"
	"net/http"
	"time"

	"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

// NewRequestPasswordRecoveryParams creates a new RequestPasswordRecoveryParams 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 NewRequestPasswordRecoveryParams() *RequestPasswordRecoveryParams {
	return NewRequestPasswordRecoveryParamsWithTimeout(cr.DefaultTimeout)
}

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

// NewRequestPasswordRecoveryParamsWithContext creates a new RequestPasswordRecoveryParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [RequestPasswordRecoveryParams].
func NewRequestPasswordRecoveryParamsWithContext(ctx context.Context) *RequestPasswordRecoveryParams {
	return &RequestPasswordRecoveryParams{
		inner: innerParams{
			ctx: ctx,
		},
	}
}

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

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

	for the request password recovery operation.

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

	// XKVClientIP.
	//
	// Original network client IP asserted by the authenticated KV ID server; used only to derive a keyed throttle bucket and never stored raw.
	XKVClientIP *string

	// XRequestID.
	//
	// Optional bounded correlation identifier stored with membership audit events.
	XRequestID *string

	// PasswordRecoveryRequest.
	PasswordRecoveryRequest *members_models.PasswordRecoveryRequest

	HTTPClient *http.Client

	inner innerParams
}

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

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

// WithTimeout adds the timeout to the request password recovery params.
func (o *RequestPasswordRecoveryParams) WithTimeout(timeout time.Duration) *RequestPasswordRecoveryParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the request password recovery params.
func (o *RequestPasswordRecoveryParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

// WithContext adds the context to the request password recovery params.
//
// Deprecated: use the operation call with context to pass the context instead of [RequestPasswordRecoveryParams].
func (o *RequestPasswordRecoveryParams) WithContext(ctx context.Context) *RequestPasswordRecoveryParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the request password recovery params.
//
// Deprecated: use the operation call with context to pass the context instead of [RequestPasswordRecoveryParams].
func (o *RequestPasswordRecoveryParams) SetContext(ctx context.Context) {
	o.inner.ctx = ctx
}

// WithHTTPClient adds the HTTPClient to the request password recovery params.
func (o *RequestPasswordRecoveryParams) WithHTTPClient(client *http.Client) *RequestPasswordRecoveryParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the request password recovery params.
func (o *RequestPasswordRecoveryParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithXKVClientIP adds the xKVClientIP to the request password recovery params.
func (o *RequestPasswordRecoveryParams) WithXKVClientIP(xKVClientIP *string) *RequestPasswordRecoveryParams {
	o.SetXKVClientIP(xKVClientIP)
	return o
}

// SetXKVClientIP adds the xKVClientIp to the request password recovery params.
func (o *RequestPasswordRecoveryParams) SetXKVClientIP(xKVClientIP *string) {
	o.XKVClientIP = xKVClientIP
}

// WithXRequestID adds the xRequestID to the request password recovery params.
func (o *RequestPasswordRecoveryParams) WithXRequestID(xRequestID *string) *RequestPasswordRecoveryParams {
	o.SetXRequestID(xRequestID)
	return o
}

// SetXRequestID adds the xRequestId to the request password recovery params.
func (o *RequestPasswordRecoveryParams) SetXRequestID(xRequestID *string) {
	o.XRequestID = xRequestID
}

// WithPasswordRecoveryRequest adds the passwordRecoveryRequest to the request password recovery params.
func (o *RequestPasswordRecoveryParams) WithPasswordRecoveryRequest(passwordRecoveryRequest *members_models.PasswordRecoveryRequest) *RequestPasswordRecoveryParams {
	o.SetPasswordRecoveryRequest(passwordRecoveryRequest)
	return o
}

// SetPasswordRecoveryRequest adds the passwordRecoveryRequest to the request password recovery params.
func (o *RequestPasswordRecoveryParams) SetPasswordRecoveryRequest(passwordRecoveryRequest *members_models.PasswordRecoveryRequest) {
	o.PasswordRecoveryRequest = passwordRecoveryRequest
}

// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *RequestPasswordRecoveryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
	if err := r.SetTimeout(o.inner.timeout); err != nil {
		return err
	}
	var res []error

	if o.XKVClientIP != nil {

		// header param X-KV-Client-IP
		if err := r.SetHeaderParam("X-KV-Client-IP", *o.XKVClientIP); err != nil {
			return err
		}
	}

	if o.XRequestID != nil {

		// header param X-Request-ID
		if err := r.SetHeaderParam("X-Request-ID", *o.XRequestID); err != nil {
			return err
		}
	}
	if o.PasswordRecoveryRequest != nil {
		if err := r.SetBodyParam(o.PasswordRecoveryRequest); err != nil {
			return err
		}
	}

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