// Code generated by go-swagger; DO NOT EDIT. package accounts // 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" ) // NewAccountStatusesParams creates a new AccountStatusesParams 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 NewAccountStatusesParams() *AccountStatusesParams { return &AccountStatusesParams{ timeout: cr.DefaultTimeout, } } // NewAccountStatusesParamsWithTimeout creates a new AccountStatusesParams object // with the ability to set a timeout on a request. func NewAccountStatusesParamsWithTimeout(timeout time.Duration) *AccountStatusesParams { return &AccountStatusesParams{ timeout: timeout, } } // NewAccountStatusesParamsWithContext creates a new AccountStatusesParams object // with the ability to set a context for a request. func NewAccountStatusesParamsWithContext(ctx context.Context) *AccountStatusesParams { return &AccountStatusesParams{ Context: ctx, } } // NewAccountStatusesParamsWithHTTPClient creates a new AccountStatusesParams object // with the ability to set a custom HTTPClient for a request. func NewAccountStatusesParamsWithHTTPClient(client *http.Client) *AccountStatusesParams { return &AccountStatusesParams{ HTTPClient: client, } } /* AccountStatusesParams contains all the parameters to send to the API endpoint for the account statuses operation. Typically these are written to a http.Request. */ type AccountStatusesParams struct { /* ExcludeReblogs. Exclude statuses that are a reblog/boost of another status. */ ExcludeReblogs *bool /* ExcludeReplies. Exclude statuses that are a reply to another status. */ ExcludeReplies *bool /* ID. Account ID. */ ID string /* Limit. Number of statuses to return. Default: 30 */ Limit *int64 /* MaxID. Return only statuses *OLDER* than the given max status ID. The status with the specified ID will not be included in the response. */ MaxID *string /* MinID. Return only statuses *NEWER* than the given min status ID. The status with the specified ID will not be included in the response. */ MinID *string /* OnlyMedia. Show only statuses with media attachments. */ OnlyMedia *bool /* OnlyPublic. Show only statuses with a privacy setting of 'public'. */ OnlyPublic *bool /* Pinned. Show only pinned statuses. In other words, exclude statuses that are not pinned to the given account ID. */ Pinned *bool timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the account statuses params (not the query body). // // All values with no default are reset to their zero value. func (o *AccountStatusesParams) WithDefaults() *AccountStatusesParams { o.SetDefaults() return o } // SetDefaults hydrates default values in the account statuses params (not the query body). // // All values with no default are reset to their zero value. func (o *AccountStatusesParams) SetDefaults() { var ( excludeReblogsDefault = bool(false) excludeRepliesDefault = bool(false) limitDefault = int64(30) onlyMediaDefault = bool(false) onlyPublicDefault = bool(false) pinnedDefault = bool(false) ) val := AccountStatusesParams{ ExcludeReblogs: &excludeReblogsDefault, ExcludeReplies: &excludeRepliesDefault, Limit: &limitDefault, OnlyMedia: &onlyMediaDefault, OnlyPublic: &onlyPublicDefault, Pinned: &pinnedDefault, } val.timeout = o.timeout val.Context = o.Context val.HTTPClient = o.HTTPClient *o = val } // WithTimeout adds the timeout to the account statuses params func (o *AccountStatusesParams) WithTimeout(timeout time.Duration) *AccountStatusesParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the account statuses params func (o *AccountStatusesParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the account statuses params func (o *AccountStatusesParams) WithContext(ctx context.Context) *AccountStatusesParams { o.SetContext(ctx) return o } // SetContext adds the context to the account statuses params func (o *AccountStatusesParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the account statuses params func (o *AccountStatusesParams) WithHTTPClient(client *http.Client) *AccountStatusesParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the account statuses params func (o *AccountStatusesParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithExcludeReblogs adds the excludeReblogs to the account statuses params func (o *AccountStatusesParams) WithExcludeReblogs(excludeReblogs *bool) *AccountStatusesParams { o.SetExcludeReblogs(excludeReblogs) return o } // SetExcludeReblogs adds the excludeReblogs to the account statuses params func (o *AccountStatusesParams) SetExcludeReblogs(excludeReblogs *bool) { o.ExcludeReblogs = excludeReblogs } // WithExcludeReplies adds the excludeReplies to the account statuses params func (o *AccountStatusesParams) WithExcludeReplies(excludeReplies *bool) *AccountStatusesParams { o.SetExcludeReplies(excludeReplies) return o } // SetExcludeReplies adds the excludeReplies to the account statuses params func (o *AccountStatusesParams) SetExcludeReplies(excludeReplies *bool) { o.ExcludeReplies = excludeReplies } // WithID adds the id to the account statuses params func (o *AccountStatusesParams) WithID(id string) *AccountStatusesParams { o.SetID(id) return o } // SetID adds the id to the account statuses params func (o *AccountStatusesParams) SetID(id string) { o.ID = id } // WithLimit adds the limit to the account statuses params func (o *AccountStatusesParams) WithLimit(limit *int64) *AccountStatusesParams { o.SetLimit(limit) return o } // SetLimit adds the limit to the account statuses params func (o *AccountStatusesParams) SetLimit(limit *int64) { o.Limit = limit } // WithMaxID adds the maxID to the account statuses params func (o *AccountStatusesParams) WithMaxID(maxID *string) *AccountStatusesParams { o.SetMaxID(maxID) return o } // SetMaxID adds the maxId to the account statuses params func (o *AccountStatusesParams) SetMaxID(maxID *string) { o.MaxID = maxID } // WithMinID adds the minID to the account statuses params func (o *AccountStatusesParams) WithMinID(minID *string) *AccountStatusesParams { o.SetMinID(minID) return o } // SetMinID adds the minId to the account statuses params func (o *AccountStatusesParams) SetMinID(minID *string) { o.MinID = minID } // WithOnlyMedia adds the onlyMedia to the account statuses params func (o *AccountStatusesParams) WithOnlyMedia(onlyMedia *bool) *AccountStatusesParams { o.SetOnlyMedia(onlyMedia) return o } // SetOnlyMedia adds the onlyMedia to the account statuses params func (o *AccountStatusesParams) SetOnlyMedia(onlyMedia *bool) { o.OnlyMedia = onlyMedia } // WithOnlyPublic adds the onlyPublic to the account statuses params func (o *AccountStatusesParams) WithOnlyPublic(onlyPublic *bool) *AccountStatusesParams { o.SetOnlyPublic(onlyPublic) return o } // SetOnlyPublic adds the onlyPublic to the account statuses params func (o *AccountStatusesParams) SetOnlyPublic(onlyPublic *bool) { o.OnlyPublic = onlyPublic } // WithPinned adds the pinned to the account statuses params func (o *AccountStatusesParams) WithPinned(pinned *bool) *AccountStatusesParams { o.SetPinned(pinned) return o } // SetPinned adds the pinned to the account statuses params func (o *AccountStatusesParams) SetPinned(pinned *bool) { o.Pinned = pinned } // WriteToRequest writes these params to a swagger request func (o *AccountStatusesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.ExcludeReblogs != nil { // query param exclude_reblogs var qrExcludeReblogs bool if o.ExcludeReblogs != nil { qrExcludeReblogs = *o.ExcludeReblogs } qExcludeReblogs := swag.FormatBool(qrExcludeReblogs) if qExcludeReblogs != "" { if err := r.SetQueryParam("exclude_reblogs", qExcludeReblogs); err != nil { return err } } } if o.ExcludeReplies != nil { // query param exclude_replies var qrExcludeReplies bool if o.ExcludeReplies != nil { qrExcludeReplies = *o.ExcludeReplies } qExcludeReplies := swag.FormatBool(qrExcludeReplies) if qExcludeReplies != "" { if err := r.SetQueryParam("exclude_replies", qExcludeReplies); err != nil { return err } } } // path param id if err := r.SetPathParam("id", o.ID); err != nil { return err } 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 o.OnlyMedia != nil { // query param only_media var qrOnlyMedia bool if o.OnlyMedia != nil { qrOnlyMedia = *o.OnlyMedia } qOnlyMedia := swag.FormatBool(qrOnlyMedia) if qOnlyMedia != "" { if err := r.SetQueryParam("only_media", qOnlyMedia); err != nil { return err } } } if o.OnlyPublic != nil { // query param only_public var qrOnlyPublic bool if o.OnlyPublic != nil { qrOnlyPublic = *o.OnlyPublic } qOnlyPublic := swag.FormatBool(qrOnlyPublic) if qOnlyPublic != "" { if err := r.SetQueryParam("only_public", qOnlyPublic); err != nil { return err } } } if o.Pinned != nil { // query param pinned var qrPinned bool if o.Pinned != nil { qrPinned = *o.Pinned } qPinned := swag.FormatBool(qrPinned) if qPinned != "" { if err := r.SetQueryParam("pinned", qPinned); err != nil { return err } } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }