This commit is contained in:
290
client/federation/s2s_replies_get_parameters.go
Normal file
290
client/federation/s2s_replies_get_parameters.go
Normal file
@ -0,0 +1,290 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewS2sRepliesGetParams creates a new S2sRepliesGetParams 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 NewS2sRepliesGetParams() *S2sRepliesGetParams {
|
||||
return &S2sRepliesGetParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewS2sRepliesGetParamsWithTimeout creates a new S2sRepliesGetParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewS2sRepliesGetParamsWithTimeout(timeout time.Duration) *S2sRepliesGetParams {
|
||||
return &S2sRepliesGetParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewS2sRepliesGetParamsWithContext creates a new S2sRepliesGetParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewS2sRepliesGetParamsWithContext(ctx context.Context) *S2sRepliesGetParams {
|
||||
return &S2sRepliesGetParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewS2sRepliesGetParamsWithHTTPClient creates a new S2sRepliesGetParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewS2sRepliesGetParamsWithHTTPClient(client *http.Client) *S2sRepliesGetParams {
|
||||
return &S2sRepliesGetParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
S2sRepliesGetParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the s2s replies get operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type S2sRepliesGetParams struct {
|
||||
|
||||
/* MinID.
|
||||
|
||||
Minimum ID of the next status, used for paging.
|
||||
*/
|
||||
MinID *string
|
||||
|
||||
/* OnlyOtherAccounts.
|
||||
|
||||
Return replies only from accounts other than the status owner.
|
||||
*/
|
||||
OnlyOtherAccounts *bool
|
||||
|
||||
/* Page.
|
||||
|
||||
Return response as a CollectionPage.
|
||||
*/
|
||||
Page *bool
|
||||
|
||||
/* Status.
|
||||
|
||||
ID of the status.
|
||||
*/
|
||||
Status string
|
||||
|
||||
/* Username.
|
||||
|
||||
Username of the account.
|
||||
*/
|
||||
Username string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the s2s replies get params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *S2sRepliesGetParams) WithDefaults() *S2sRepliesGetParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the s2s replies get params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *S2sRepliesGetParams) SetDefaults() {
|
||||
var (
|
||||
onlyOtherAccountsDefault = bool(false)
|
||||
|
||||
pageDefault = bool(false)
|
||||
)
|
||||
|
||||
val := S2sRepliesGetParams{
|
||||
OnlyOtherAccounts: &onlyOtherAccountsDefault,
|
||||
Page: &pageDefault,
|
||||
}
|
||||
|
||||
val.timeout = o.timeout
|
||||
val.Context = o.Context
|
||||
val.HTTPClient = o.HTTPClient
|
||||
*o = val
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) WithTimeout(timeout time.Duration) *S2sRepliesGetParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) WithContext(ctx context.Context) *S2sRepliesGetParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) WithHTTPClient(client *http.Client) *S2sRepliesGetParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithMinID adds the minID to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) WithMinID(minID *string) *S2sRepliesGetParams {
|
||||
o.SetMinID(minID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetMinID adds the minId to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) SetMinID(minID *string) {
|
||||
o.MinID = minID
|
||||
}
|
||||
|
||||
// WithOnlyOtherAccounts adds the onlyOtherAccounts to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) WithOnlyOtherAccounts(onlyOtherAccounts *bool) *S2sRepliesGetParams {
|
||||
o.SetOnlyOtherAccounts(onlyOtherAccounts)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOnlyOtherAccounts adds the onlyOtherAccounts to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) SetOnlyOtherAccounts(onlyOtherAccounts *bool) {
|
||||
o.OnlyOtherAccounts = onlyOtherAccounts
|
||||
}
|
||||
|
||||
// WithPage adds the page to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) WithPage(page *bool) *S2sRepliesGetParams {
|
||||
o.SetPage(page)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetPage adds the page to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) SetPage(page *bool) {
|
||||
o.Page = page
|
||||
}
|
||||
|
||||
// WithStatus adds the status to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) WithStatus(status string) *S2sRepliesGetParams {
|
||||
o.SetStatus(status)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetStatus adds the status to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) SetStatus(status string) {
|
||||
o.Status = status
|
||||
}
|
||||
|
||||
// WithUsername adds the username to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) WithUsername(username string) *S2sRepliesGetParams {
|
||||
o.SetUsername(username)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetUsername adds the username to the s2s replies get params
|
||||
func (o *S2sRepliesGetParams) SetUsername(username string) {
|
||||
o.Username = username
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *S2sRepliesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
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.OnlyOtherAccounts != nil {
|
||||
|
||||
// query param only_other_accounts
|
||||
var qrOnlyOtherAccounts bool
|
||||
|
||||
if o.OnlyOtherAccounts != nil {
|
||||
qrOnlyOtherAccounts = *o.OnlyOtherAccounts
|
||||
}
|
||||
qOnlyOtherAccounts := swag.FormatBool(qrOnlyOtherAccounts)
|
||||
if qOnlyOtherAccounts != "" {
|
||||
|
||||
if err := r.SetQueryParam("only_other_accounts", qOnlyOtherAccounts); 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 status
|
||||
if err := r.SetPathParam("status", o.Status); 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
|
||||
}
|
Reference in New Issue
Block a user