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

package operations

// 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/fiskerinc/cloud-services/pkg/ota_api/models"
)

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

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

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

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

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

	for the put supplier email operation.

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

	/* Account.

	   Supplier account data
	*/
	Account *models.CommonSupplierAccount

	/* Email.

	   Supplier email address
	*/
	Email string

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

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

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

// WithTimeout adds the timeout to the put supplier email params
func (o *PutSupplierEmailParams) WithTimeout(timeout time.Duration) *PutSupplierEmailParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the put supplier email params
func (o *PutSupplierEmailParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the put supplier email params
func (o *PutSupplierEmailParams) WithContext(ctx context.Context) *PutSupplierEmailParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the put supplier email params
func (o *PutSupplierEmailParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the put supplier email params
func (o *PutSupplierEmailParams) WithHTTPClient(client *http.Client) *PutSupplierEmailParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the put supplier email params
func (o *PutSupplierEmailParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithAccount adds the account to the put supplier email params
func (o *PutSupplierEmailParams) WithAccount(account *models.CommonSupplierAccount) *PutSupplierEmailParams {
	o.SetAccount(account)
	return o
}

// SetAccount adds the account to the put supplier email params
func (o *PutSupplierEmailParams) SetAccount(account *models.CommonSupplierAccount) {
	o.Account = account
}

// WithEmail adds the email to the put supplier email params
func (o *PutSupplierEmailParams) WithEmail(email string) *PutSupplierEmailParams {
	o.SetEmail(email)
	return o
}

// SetEmail adds the email to the put supplier email params
func (o *PutSupplierEmailParams) SetEmail(email string) {
	o.Email = email
}

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

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

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

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