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

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

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

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

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

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

	for the domain allows get operation.

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

	/* Export.

	   If set to `true`, then each entry in the returned list of domain allows will only consist of the fields `domain` and `public_comment`. This is perfect for when you want to save and share a list of all the domains you have allowed on your instance, so that someone else can easily import them, but you don't want them to see the database IDs of your allows, or private comments etc.
	*/
	Export *bool

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

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

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

// WithTimeout adds the timeout to the domain allows get params
func (o *DomainAllowsGetParams) WithTimeout(timeout time.Duration) *DomainAllowsGetParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the domain allows get params
func (o *DomainAllowsGetParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the domain allows get params
func (o *DomainAllowsGetParams) WithContext(ctx context.Context) *DomainAllowsGetParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the domain allows get params
func (o *DomainAllowsGetParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the domain allows get params
func (o *DomainAllowsGetParams) WithHTTPClient(client *http.Client) *DomainAllowsGetParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the domain allows get params
func (o *DomainAllowsGetParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithExport adds the export to the domain allows get params
func (o *DomainAllowsGetParams) WithExport(export *bool) *DomainAllowsGetParams {
	o.SetExport(export)
	return o
}

// SetExport adds the export to the domain allows get params
func (o *DomainAllowsGetParams) SetExport(export *bool) {
	o.Export = export
}

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

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

	if o.Export != nil {

		// query param export
		var qrExport bool

		if o.Export != nil {
			qrExport = *o.Export
		}
		qExport := swag.FormatBool(qrExport)
		if qExport != "" {

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

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