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

// NewCompletePasswordRecoveryParams creates a new CompletePasswordRecoveryParams 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 NewCompletePasswordRecoveryParams() *CompletePasswordRecoveryParams {
	return NewCompletePasswordRecoveryParamsWithTimeout(cr.DefaultTimeout)
}

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

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

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

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

	for the complete password recovery operation.

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

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

	// PasswordRecoveryCompletion.
	PasswordRecoveryCompletion *members_models.PasswordRecoveryCompletion

	HTTPClient *http.Client

	inner innerParams
}

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

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

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

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

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

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

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

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

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

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

// WithPasswordRecoveryCompletion adds the passwordRecoveryCompletion to the complete password recovery params.
func (o *CompletePasswordRecoveryParams) WithPasswordRecoveryCompletion(passwordRecoveryCompletion *members_models.PasswordRecoveryCompletion) *CompletePasswordRecoveryParams {
	o.SetPasswordRecoveryCompletion(passwordRecoveryCompletion)
	return o
}

// SetPasswordRecoveryCompletion adds the passwordRecoveryCompletion to the complete password recovery params.
func (o *CompletePasswordRecoveryParams) SetPasswordRecoveryCompletion(passwordRecoveryCompletion *members_models.PasswordRecoveryCompletion) {
	o.PasswordRecoveryCompletion = passwordRecoveryCompletion
}

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

	if o.XRequestID != nil {

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

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