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

package metadata

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

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

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

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

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

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

	for the get account metrics operation.

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

	// Duration.
	Duration *string

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

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

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

// WithTimeout adds the timeout to the get account metrics params
func (o *GetAccountMetricsParams) WithTimeout(timeout time.Duration) *GetAccountMetricsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get account metrics params
func (o *GetAccountMetricsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get account metrics params
func (o *GetAccountMetricsParams) WithContext(ctx context.Context) *GetAccountMetricsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get account metrics params
func (o *GetAccountMetricsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get account metrics params
func (o *GetAccountMetricsParams) WithHTTPClient(client *http.Client) *GetAccountMetricsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get account metrics params
func (o *GetAccountMetricsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithDuration adds the duration to the get account metrics params
func (o *GetAccountMetricsParams) WithDuration(duration *string) *GetAccountMetricsParams {
	o.SetDuration(duration)
	return o
}

// SetDuration adds the duration to the get account metrics params
func (o *GetAccountMetricsParams) SetDuration(duration *string) {
	o.Duration = duration
}

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

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

	if o.Duration != nil {

		// query param duration
		var qrDuration string

		if o.Duration != nil {
			qrDuration = *o.Duration
		}
		qDuration := qrDuration
		if qDuration != "" {

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

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