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

package admin

// 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/go-openapi/swag"
)

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

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

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

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

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

	for the media cleanup operation.

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

	/* RemoteCacheDays.

	     Number of days of remote media to keep. Native values will be treated as 0.
	If value is not specified, the value of media-remote-cache-days in the server config will be used.

	     Format: int64
	*/
	RemoteCacheDays *int64

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

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

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

// WithTimeout adds the timeout to the media cleanup params
func (o *MediaCleanupParams) WithTimeout(timeout time.Duration) *MediaCleanupParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the media cleanup params
func (o *MediaCleanupParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the media cleanup params
func (o *MediaCleanupParams) WithContext(ctx context.Context) *MediaCleanupParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the media cleanup params
func (o *MediaCleanupParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the media cleanup params
func (o *MediaCleanupParams) WithHTTPClient(client *http.Client) *MediaCleanupParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the media cleanup params
func (o *MediaCleanupParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithRemoteCacheDays adds the remoteCacheDays to the media cleanup params
func (o *MediaCleanupParams) WithRemoteCacheDays(remoteCacheDays *int64) *MediaCleanupParams {
	o.SetRemoteCacheDays(remoteCacheDays)
	return o
}

// SetRemoteCacheDays adds the remoteCacheDays to the media cleanup params
func (o *MediaCleanupParams) SetRemoteCacheDays(remoteCacheDays *int64) {
	o.RemoteCacheDays = remoteCacheDays
}

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

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

	if o.RemoteCacheDays != nil {

		// query param remote_cache_days
		var qrRemoteCacheDays int64

		if o.RemoteCacheDays != nil {
			qrRemoteCacheDays = *o.RemoteCacheDays
		}
		qRemoteCacheDays := swag.FormatInt64(qrRemoteCacheDays)
		if qRemoteCacheDays != "" {

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

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