gtslib/client/favourites/favourites_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

246 lines
5.9 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package favourites
// 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"
)
// NewFavouritesGetParams creates a new FavouritesGetParams 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 NewFavouritesGetParams() *FavouritesGetParams {
return &FavouritesGetParams{
timeout: cr.DefaultTimeout,
}
}
// NewFavouritesGetParamsWithTimeout creates a new FavouritesGetParams object
// with the ability to set a timeout on a request.
func NewFavouritesGetParamsWithTimeout(timeout time.Duration) *FavouritesGetParams {
return &FavouritesGetParams{
timeout: timeout,
}
}
// NewFavouritesGetParamsWithContext creates a new FavouritesGetParams object
// with the ability to set a context for a request.
func NewFavouritesGetParamsWithContext(ctx context.Context) *FavouritesGetParams {
return &FavouritesGetParams{
Context: ctx,
}
}
// NewFavouritesGetParamsWithHTTPClient creates a new FavouritesGetParams object
// with the ability to set a custom HTTPClient for a request.
func NewFavouritesGetParamsWithHTTPClient(client *http.Client) *FavouritesGetParams {
return &FavouritesGetParams{
HTTPClient: client,
}
}
/*
FavouritesGetParams contains all the parameters to send to the API endpoint
for the favourites get operation.
Typically these are written to a http.Request.
*/
type FavouritesGetParams struct {
/* Limit.
Number of statuses to return.
Default: 20
*/
Limit *int64
/* MaxID.
Return only favourited statuses *OLDER* than the given favourite ID. The status with the corresponding fave ID will not be included in the response.
*/
MaxID *string
/* MinID.
Return only favourited statuses *NEWER* than the given favourite ID. The status with the corresponding fave ID will not be included in the response.
*/
MinID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the favourites get params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *FavouritesGetParams) WithDefaults() *FavouritesGetParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the favourites get params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *FavouritesGetParams) SetDefaults() {
var (
limitDefault = int64(20)
)
val := FavouritesGetParams{
Limit: &limitDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the favourites get params
func (o *FavouritesGetParams) WithTimeout(timeout time.Duration) *FavouritesGetParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the favourites get params
func (o *FavouritesGetParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the favourites get params
func (o *FavouritesGetParams) WithContext(ctx context.Context) *FavouritesGetParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the favourites get params
func (o *FavouritesGetParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the favourites get params
func (o *FavouritesGetParams) WithHTTPClient(client *http.Client) *FavouritesGetParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the favourites get params
func (o *FavouritesGetParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithLimit adds the limit to the favourites get params
func (o *FavouritesGetParams) WithLimit(limit *int64) *FavouritesGetParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the favourites get params
func (o *FavouritesGetParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithMaxID adds the maxID to the favourites get params
func (o *FavouritesGetParams) WithMaxID(maxID *string) *FavouritesGetParams {
o.SetMaxID(maxID)
return o
}
// SetMaxID adds the maxId to the favourites get params
func (o *FavouritesGetParams) SetMaxID(maxID *string) {
o.MaxID = maxID
}
// WithMinID adds the minID to the favourites get params
func (o *FavouritesGetParams) WithMinID(minID *string) *FavouritesGetParams {
o.SetMinID(minID)
return o
}
// SetMinID adds the minId to the favourites get params
func (o *FavouritesGetParams) SetMinID(minID *string) {
o.MinID = minID
}
// WriteToRequest writes these params to a swagger request
func (o *FavouritesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Limit != nil {
// query param limit
var qrLimit int64
if o.Limit != nil {
qrLimit = *o.Limit
}
qLimit := swag.FormatInt64(qrLimit)
if qLimit != "" {
if err := r.SetQueryParam("limit", qLimit); err != nil {
return err
}
}
}
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 len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}