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

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

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

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

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

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

	for the put customer ota emails operation.

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

	/* APIKey.

	   <API token>
	*/
	APIKey *string

	/* Authorization.

	   Bearer <ID token>
	*/
	Authorization *string

	/* Data.

	   Customer OTA Emails Request
	*/
	Data *models.CommonCustomerOtaEmailsRequest

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

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

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

// WithTimeout adds the timeout to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) WithTimeout(timeout time.Duration) *PutCustomerOtaEmailsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) WithContext(ctx context.Context) *PutCustomerOtaEmailsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) WithHTTPClient(client *http.Client) *PutCustomerOtaEmailsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithAPIKey adds the aPIKey to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) WithAPIKey(aPIKey *string) *PutCustomerOtaEmailsParams {
	o.SetAPIKey(aPIKey)
	return o
}

// SetAPIKey adds the apiKey to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) SetAPIKey(aPIKey *string) {
	o.APIKey = aPIKey
}

// WithAuthorization adds the authorization to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) WithAuthorization(authorization *string) *PutCustomerOtaEmailsParams {
	o.SetAuthorization(authorization)
	return o
}

// SetAuthorization adds the authorization to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) SetAuthorization(authorization *string) {
	o.Authorization = authorization
}

// WithData adds the data to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) WithData(data *models.CommonCustomerOtaEmailsRequest) *PutCustomerOtaEmailsParams {
	o.SetData(data)
	return o
}

// SetData adds the data to the put customer ota emails params
func (o *PutCustomerOtaEmailsParams) SetData(data *models.CommonCustomerOtaEmailsRequest) {
	o.Data = data
}

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

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

	if o.APIKey != nil {

		// header param Api-Key
		if err := r.SetHeaderParam("Api-Key", *o.APIKey); err != nil {
			return err
		}
	}

	if o.Authorization != nil {

		// header param Authorization
		if err := r.SetHeaderParam("Authorization", *o.Authorization); err != nil {
			return err
		}
	}
	if o.Data != nil {
		if err := r.SetBodyParam(o.Data); err != nil {
			return err
		}
	}

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