gtslib/client/admin/domain_blocks_get_parameters.go
decentral1se e4ade9c758
All checks were successful
continuous-integration/drone/push Build is passing
feat: init
2024-07-31 22:47:18 +02:00

165 lines
4.8 KiB
Go

// 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"
)
// NewDomainBlocksGetParams creates a new DomainBlocksGetParams 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 NewDomainBlocksGetParams() *DomainBlocksGetParams {
return &DomainBlocksGetParams{
timeout: cr.DefaultTimeout,
}
}
// NewDomainBlocksGetParamsWithTimeout creates a new DomainBlocksGetParams object
// with the ability to set a timeout on a request.
func NewDomainBlocksGetParamsWithTimeout(timeout time.Duration) *DomainBlocksGetParams {
return &DomainBlocksGetParams{
timeout: timeout,
}
}
// NewDomainBlocksGetParamsWithContext creates a new DomainBlocksGetParams object
// with the ability to set a context for a request.
func NewDomainBlocksGetParamsWithContext(ctx context.Context) *DomainBlocksGetParams {
return &DomainBlocksGetParams{
Context: ctx,
}
}
// NewDomainBlocksGetParamsWithHTTPClient creates a new DomainBlocksGetParams object
// with the ability to set a custom HTTPClient for a request.
func NewDomainBlocksGetParamsWithHTTPClient(client *http.Client) *DomainBlocksGetParams {
return &DomainBlocksGetParams{
HTTPClient: client,
}
}
/*
DomainBlocksGetParams contains all the parameters to send to the API endpoint
for the domain blocks get operation.
Typically these are written to a http.Request.
*/
type DomainBlocksGetParams struct {
/* Export.
If set to `true`, then each entry in the returned list of domain blocks 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 blocked on your instance, so that someone else can easily import them, but you don't want them to see the database IDs of your blocks, or private comments etc.
*/
Export *bool
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the domain blocks get params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DomainBlocksGetParams) WithDefaults() *DomainBlocksGetParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the domain blocks get params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DomainBlocksGetParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the domain blocks get params
func (o *DomainBlocksGetParams) WithTimeout(timeout time.Duration) *DomainBlocksGetParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the domain blocks get params
func (o *DomainBlocksGetParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the domain blocks get params
func (o *DomainBlocksGetParams) WithContext(ctx context.Context) *DomainBlocksGetParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the domain blocks get params
func (o *DomainBlocksGetParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the domain blocks get params
func (o *DomainBlocksGetParams) WithHTTPClient(client *http.Client) *DomainBlocksGetParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the domain blocks get params
func (o *DomainBlocksGetParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithExport adds the export to the domain blocks get params
func (o *DomainBlocksGetParams) WithExport(export *bool) *DomainBlocksGetParams {
o.SetExport(export)
return o
}
// SetExport adds the export to the domain blocks get params
func (o *DomainBlocksGetParams) SetExport(export *bool) {
o.Export = export
}
// WriteToRequest writes these params to a swagger request
func (o *DomainBlocksGetParams) 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
}