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

package killmails

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"net/http"
	"time"

	"golang.org/x/net/context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/swag"

	strfmt "github.com/go-openapi/strfmt"
)

// NewGetKillmailsKillmailIDKillmailHashParams creates a new GetKillmailsKillmailIDKillmailHashParams object
// with the default values initialized.
func NewGetKillmailsKillmailIDKillmailHashParams() *GetKillmailsKillmailIDKillmailHashParams {
	var (
		datasourceDefault = string("tranquility")
	)
	return &GetKillmailsKillmailIDKillmailHashParams{
		Datasource: &datasourceDefault,

		timeout: cr.DefaultTimeout,
	}
}

// NewGetKillmailsKillmailIDKillmailHashParamsWithTimeout creates a new GetKillmailsKillmailIDKillmailHashParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewGetKillmailsKillmailIDKillmailHashParamsWithTimeout(timeout time.Duration) *GetKillmailsKillmailIDKillmailHashParams {
	var (
		datasourceDefault = string("tranquility")
	)
	return &GetKillmailsKillmailIDKillmailHashParams{
		Datasource: &datasourceDefault,

		timeout: timeout,
	}
}

// NewGetKillmailsKillmailIDKillmailHashParamsWithContext creates a new GetKillmailsKillmailIDKillmailHashParams object
// with the default values initialized, and the ability to set a context for a request
func NewGetKillmailsKillmailIDKillmailHashParamsWithContext(ctx context.Context) *GetKillmailsKillmailIDKillmailHashParams {
	var (
		datasourceDefault = string("tranquility")
	)
	return &GetKillmailsKillmailIDKillmailHashParams{
		Datasource: &datasourceDefault,

		Context: ctx,
	}
}

// NewGetKillmailsKillmailIDKillmailHashParamsWithHTTPClient creates a new GetKillmailsKillmailIDKillmailHashParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetKillmailsKillmailIDKillmailHashParamsWithHTTPClient(client *http.Client) *GetKillmailsKillmailIDKillmailHashParams {
	var (
		datasourceDefault = string("tranquility")
	)
	return &GetKillmailsKillmailIDKillmailHashParams{
		Datasource: &datasourceDefault,
		HTTPClient: client,
	}
}

/*GetKillmailsKillmailIDKillmailHashParams contains all the parameters to send to the API endpoint
for the get killmails killmail id killmail hash operation typically these are written to a http.Request
*/
type GetKillmailsKillmailIDKillmailHashParams struct {

	/*XUserAgent
	  Client identifier, takes precedence over User-Agent

	*/
	XUserAgent *string
	/*Datasource
	  The server name you would like data from

	*/
	Datasource *string
	/*KillmailHash
	  The killmail hash for verification

	*/
	KillmailHash string
	/*KillmailID
	  The killmail ID to be queried

	*/
	KillmailID int32
	/*UserAgent
	  Client identifier, takes precedence over headers

	*/
	UserAgent *string

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

// WithTimeout adds the timeout to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) WithTimeout(timeout time.Duration) *GetKillmailsKillmailIDKillmailHashParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) WithContext(ctx context.Context) *GetKillmailsKillmailIDKillmailHashParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) WithHTTPClient(client *http.Client) *GetKillmailsKillmailIDKillmailHashParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithXUserAgent adds the xUserAgent to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) WithXUserAgent(xUserAgent *string) *GetKillmailsKillmailIDKillmailHashParams {
	o.SetXUserAgent(xUserAgent)
	return o
}

// SetXUserAgent adds the xUserAgent to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) SetXUserAgent(xUserAgent *string) {
	o.XUserAgent = xUserAgent
}

// WithDatasource adds the datasource to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) WithDatasource(datasource *string) *GetKillmailsKillmailIDKillmailHashParams {
	o.SetDatasource(datasource)
	return o
}

// SetDatasource adds the datasource to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) SetDatasource(datasource *string) {
	o.Datasource = datasource
}

// WithKillmailHash adds the killmailHash to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) WithKillmailHash(killmailHash string) *GetKillmailsKillmailIDKillmailHashParams {
	o.SetKillmailHash(killmailHash)
	return o
}

// SetKillmailHash adds the killmailHash to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) SetKillmailHash(killmailHash string) {
	o.KillmailHash = killmailHash
}

// WithKillmailID adds the killmailID to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) WithKillmailID(killmailID int32) *GetKillmailsKillmailIDKillmailHashParams {
	o.SetKillmailID(killmailID)
	return o
}

// SetKillmailID adds the killmailId to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) SetKillmailID(killmailID int32) {
	o.KillmailID = killmailID
}

// WithUserAgent adds the userAgent to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) WithUserAgent(userAgent *string) *GetKillmailsKillmailIDKillmailHashParams {
	o.SetUserAgent(userAgent)
	return o
}

// SetUserAgent adds the userAgent to the get killmails killmail id killmail hash params
func (o *GetKillmailsKillmailIDKillmailHashParams) SetUserAgent(userAgent *string) {
	o.UserAgent = userAgent
}

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

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

	if o.XUserAgent != nil {

		// header param X-User-Agent
		if err := r.SetHeaderParam("X-User-Agent", *o.XUserAgent); err != nil {
			return err
		}

	}

	if o.Datasource != nil {

		// query param datasource
		var qrDatasource string
		if o.Datasource != nil {
			qrDatasource = *o.Datasource
		}
		qDatasource := qrDatasource
		if qDatasource != "" {
			if err := r.SetQueryParam("datasource", qDatasource); err != nil {
				return err
			}
		}

	}

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

	// path param killmail_id
	if err := r.SetPathParam("killmail_id", swag.FormatInt32(o.KillmailID)); err != nil {
		return err
	}

	if o.UserAgent != nil {

		// query param user_agent
		var qrUserAgent string
		if o.UserAgent != nil {
			qrUserAgent = *o.UserAgent
		}
		qUserAgent := qrUserAgent
		if qUserAgent != "" {
			if err := r.SetQueryParam("user_agent", qUserAgent); err != nil {
				return err
			}
		}

	}

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