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

package objects

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

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

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

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

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

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

	for the list file objects operation.

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

	/* Page.

	   The page at which to list.
	*/
	Page *int64

	/* PageSize.

	   Number of items per page.
	*/
	PageSize *int64

	/* Tags.

	   List of tags to filter by.
	*/
	Tags *string

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

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

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

// WithTimeout adds the timeout to the list file objects params
func (o *ListFileObjectsParams) WithTimeout(timeout time.Duration) *ListFileObjectsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the list file objects params
func (o *ListFileObjectsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the list file objects params
func (o *ListFileObjectsParams) WithContext(ctx context.Context) *ListFileObjectsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the list file objects params
func (o *ListFileObjectsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the list file objects params
func (o *ListFileObjectsParams) WithHTTPClient(client *http.Client) *ListFileObjectsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the list file objects params
func (o *ListFileObjectsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithPage adds the page to the list file objects params
func (o *ListFileObjectsParams) WithPage(page *int64) *ListFileObjectsParams {
	o.SetPage(page)
	return o
}

// SetPage adds the page to the list file objects params
func (o *ListFileObjectsParams) SetPage(page *int64) {
	o.Page = page
}

// WithPageSize adds the pageSize to the list file objects params
func (o *ListFileObjectsParams) WithPageSize(pageSize *int64) *ListFileObjectsParams {
	o.SetPageSize(pageSize)
	return o
}

// SetPageSize adds the pageSize to the list file objects params
func (o *ListFileObjectsParams) SetPageSize(pageSize *int64) {
	o.PageSize = pageSize
}

// WithTags adds the tags to the list file objects params
func (o *ListFileObjectsParams) WithTags(tags *string) *ListFileObjectsParams {
	o.SetTags(tags)
	return o
}

// SetTags adds the tags to the list file objects params
func (o *ListFileObjectsParams) SetTags(tags *string) {
	o.Tags = tags
}

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

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

	if o.Page != nil {

		// query param page
		var qrPage int64

		if o.Page != nil {
			qrPage = *o.Page
		}
		qPage := swag.FormatInt64(qrPage)
		if qPage != "" {

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

	if o.PageSize != nil {

		// query param pageSize
		var qrPageSize int64

		if o.PageSize != nil {
			qrPageSize = *o.PageSize
		}
		qPageSize := swag.FormatInt64(qrPageSize)
		if qPageSize != "" {

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

	if o.Tags != nil {

		// query param tags
		var qrTags string

		if o.Tags != nil {
			qrTags = *o.Tags
		}
		qTags := qrTags
		if qTags != "" {

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

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