Files
gtslib/client/debug/debug_a_p_url_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

157 lines
4.1 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package debug
// 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"
)
// NewDebugAPURLParams creates a new DebugAPURLParams 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 NewDebugAPURLParams() *DebugAPURLParams {
return &DebugAPURLParams{
timeout: cr.DefaultTimeout,
}
}
// NewDebugAPURLParamsWithTimeout creates a new DebugAPURLParams object
// with the ability to set a timeout on a request.
func NewDebugAPURLParamsWithTimeout(timeout time.Duration) *DebugAPURLParams {
return &DebugAPURLParams{
timeout: timeout,
}
}
// NewDebugAPURLParamsWithContext creates a new DebugAPURLParams object
// with the ability to set a context for a request.
func NewDebugAPURLParamsWithContext(ctx context.Context) *DebugAPURLParams {
return &DebugAPURLParams{
Context: ctx,
}
}
// NewDebugAPURLParamsWithHTTPClient creates a new DebugAPURLParams object
// with the ability to set a custom HTTPClient for a request.
func NewDebugAPURLParamsWithHTTPClient(client *http.Client) *DebugAPURLParams {
return &DebugAPURLParams{
HTTPClient: client,
}
}
/*
DebugAPURLParams contains all the parameters to send to the API endpoint
for the debug a p Url operation.
Typically these are written to a http.Request.
*/
type DebugAPURLParams struct {
/* URL.
The URL / ActivityPub ID to dereference. This should be a full URL, including protocol. Eg., `https://example.org/users/someone`
*/
URL string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the debug a p Url params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DebugAPURLParams) WithDefaults() *DebugAPURLParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the debug a p Url params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DebugAPURLParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the debug a p Url params
func (o *DebugAPURLParams) WithTimeout(timeout time.Duration) *DebugAPURLParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the debug a p Url params
func (o *DebugAPURLParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the debug a p Url params
func (o *DebugAPURLParams) WithContext(ctx context.Context) *DebugAPURLParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the debug a p Url params
func (o *DebugAPURLParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the debug a p Url params
func (o *DebugAPURLParams) WithHTTPClient(client *http.Client) *DebugAPURLParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the debug a p Url params
func (o *DebugAPURLParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithURL adds the url to the debug a p Url params
func (o *DebugAPURLParams) WithURL(url string) *DebugAPURLParams {
o.SetURL(url)
return o
}
// SetURL adds the url to the debug a p Url params
func (o *DebugAPURLParams) SetURL(url string) {
o.URL = url
}
// WriteToRequest writes these params to a swagger request
func (o *DebugAPURLParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// query param url
qrURL := o.URL
qURL := qrURL
if qURL != "" {
if err := r.SetQueryParam("url", qURL); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}