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

package gateway_service

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

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

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

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

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

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

	for the gateway service get duty cycle metrics operation.

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

	/* End.

	   Interval end timestamp.

	   Format: date-time
	*/
	End *strfmt.DateTime

	/* GatewayID.

	   Gateway ID (EUI64).
	*/
	GatewayID string

	/* Start.

	   Interval start timestamp.

	   Format: date-time
	*/
	Start *strfmt.DateTime

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

// WithDefaults hydrates default values in the gateway service get duty cycle metrics params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GatewayServiceGetDutyCycleMetricsParams) WithDefaults() *GatewayServiceGetDutyCycleMetricsParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the gateway service get duty cycle metrics params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GatewayServiceGetDutyCycleMetricsParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) WithTimeout(timeout time.Duration) *GatewayServiceGetDutyCycleMetricsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) WithContext(ctx context.Context) *GatewayServiceGetDutyCycleMetricsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) WithHTTPClient(client *http.Client) *GatewayServiceGetDutyCycleMetricsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithEnd adds the end to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) WithEnd(end *strfmt.DateTime) *GatewayServiceGetDutyCycleMetricsParams {
	o.SetEnd(end)
	return o
}

// SetEnd adds the end to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) SetEnd(end *strfmt.DateTime) {
	o.End = end
}

// WithGatewayID adds the gatewayID to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) WithGatewayID(gatewayID string) *GatewayServiceGetDutyCycleMetricsParams {
	o.SetGatewayID(gatewayID)
	return o
}

// SetGatewayID adds the gatewayId to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) SetGatewayID(gatewayID string) {
	o.GatewayID = gatewayID
}

// WithStart adds the start to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) WithStart(start *strfmt.DateTime) *GatewayServiceGetDutyCycleMetricsParams {
	o.SetStart(start)
	return o
}

// SetStart adds the start to the gateway service get duty cycle metrics params
func (o *GatewayServiceGetDutyCycleMetricsParams) SetStart(start *strfmt.DateTime) {
	o.Start = start
}

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

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

	if o.End != nil {

		// query param end
		var qrEnd strfmt.DateTime

		if o.End != nil {
			qrEnd = *o.End
		}
		qEnd := qrEnd.String()
		if qEnd != "" {

			if err := r.SetQueryParam("end", qEnd); err != nil {
				return err
			}
		}
	}

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

	if o.Start != nil {

		// query param start
		var qrStart strfmt.DateTime

		if o.Start != nil {
			qrStart = *o.Start
		}
		qStart := qrStart.String()
		if qStart != "" {

			if err := r.SetQueryParam("start", qStart); err != nil {
				return err
			}
		}
	}

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