gtslib/client/federation/s2s_outbox_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

266 lines
6.1 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package federation
// 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"
)
// NewS2sOutboxGetParams creates a new S2sOutboxGetParams 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 NewS2sOutboxGetParams() *S2sOutboxGetParams {
return &S2sOutboxGetParams{
timeout: cr.DefaultTimeout,
}
}
// NewS2sOutboxGetParamsWithTimeout creates a new S2sOutboxGetParams object
// with the ability to set a timeout on a request.
func NewS2sOutboxGetParamsWithTimeout(timeout time.Duration) *S2sOutboxGetParams {
return &S2sOutboxGetParams{
timeout: timeout,
}
}
// NewS2sOutboxGetParamsWithContext creates a new S2sOutboxGetParams object
// with the ability to set a context for a request.
func NewS2sOutboxGetParamsWithContext(ctx context.Context) *S2sOutboxGetParams {
return &S2sOutboxGetParams{
Context: ctx,
}
}
// NewS2sOutboxGetParamsWithHTTPClient creates a new S2sOutboxGetParams object
// with the ability to set a custom HTTPClient for a request.
func NewS2sOutboxGetParamsWithHTTPClient(client *http.Client) *S2sOutboxGetParams {
return &S2sOutboxGetParams{
HTTPClient: client,
}
}
/*
S2sOutboxGetParams contains all the parameters to send to the API endpoint
for the s2s outbox get operation.
Typically these are written to a http.Request.
*/
type S2sOutboxGetParams struct {
/* MaxID.
Maximum ID of the next status, used for paging.
*/
MaxID *string
/* MinID.
Minimum ID of the next status, used for paging.
*/
MinID *string
/* Page.
Return response as a CollectionPage.
*/
Page *bool
/* Username.
Username of the account.
*/
Username string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the s2s outbox get params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *S2sOutboxGetParams) WithDefaults() *S2sOutboxGetParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the s2s outbox get params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *S2sOutboxGetParams) SetDefaults() {
var (
pageDefault = bool(false)
)
val := S2sOutboxGetParams{
Page: &pageDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the s2s outbox get params
func (o *S2sOutboxGetParams) WithTimeout(timeout time.Duration) *S2sOutboxGetParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the s2s outbox get params
func (o *S2sOutboxGetParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the s2s outbox get params
func (o *S2sOutboxGetParams) WithContext(ctx context.Context) *S2sOutboxGetParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the s2s outbox get params
func (o *S2sOutboxGetParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the s2s outbox get params
func (o *S2sOutboxGetParams) WithHTTPClient(client *http.Client) *S2sOutboxGetParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the s2s outbox get params
func (o *S2sOutboxGetParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithMaxID adds the maxID to the s2s outbox get params
func (o *S2sOutboxGetParams) WithMaxID(maxID *string) *S2sOutboxGetParams {
o.SetMaxID(maxID)
return o
}
// SetMaxID adds the maxId to the s2s outbox get params
func (o *S2sOutboxGetParams) SetMaxID(maxID *string) {
o.MaxID = maxID
}
// WithMinID adds the minID to the s2s outbox get params
func (o *S2sOutboxGetParams) WithMinID(minID *string) *S2sOutboxGetParams {
o.SetMinID(minID)
return o
}
// SetMinID adds the minId to the s2s outbox get params
func (o *S2sOutboxGetParams) SetMinID(minID *string) {
o.MinID = minID
}
// WithPage adds the page to the s2s outbox get params
func (o *S2sOutboxGetParams) WithPage(page *bool) *S2sOutboxGetParams {
o.SetPage(page)
return o
}
// SetPage adds the page to the s2s outbox get params
func (o *S2sOutboxGetParams) SetPage(page *bool) {
o.Page = page
}
// WithUsername adds the username to the s2s outbox get params
func (o *S2sOutboxGetParams) WithUsername(username string) *S2sOutboxGetParams {
o.SetUsername(username)
return o
}
// SetUsername adds the username to the s2s outbox get params
func (o *S2sOutboxGetParams) SetUsername(username string) {
o.Username = username
}
// WriteToRequest writes these params to a swagger request
func (o *S2sOutboxGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.MaxID != nil {
// query param max_id
var qrMaxID string
if o.MaxID != nil {
qrMaxID = *o.MaxID
}
qMaxID := qrMaxID
if qMaxID != "" {
if err := r.SetQueryParam("max_id", qMaxID); err != nil {
return err
}
}
}
if o.MinID != nil {
// query param min_id
var qrMinID string
if o.MinID != nil {
qrMinID = *o.MinID
}
qMinID := qrMinID
if qMinID != "" {
if err := r.SetQueryParam("min_id", qMinID); err != nil {
return err
}
}
}
if o.Page != nil {
// query param page
var qrPage bool
if o.Page != nil {
qrPage = *o.Page
}
qPage := swag.FormatBool(qrPage)
if qPage != "" {
if err := r.SetQueryParam("page", qPage); err != nil {
return err
}
}
}
// path param username
if err := r.SetPathParam("username", o.Username); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}