// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package bsky

// schema: app.bsky.feed.getTimeline

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

// FeedGetTimeline_Output is the output of a app.bsky.feed.getTimeline call.
type FeedGetTimeline_Output struct {
	Cursor *string                  `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Feed   []*FeedDefs_FeedViewPost `json:"feed" cborgen:"feed"`
}

// FeedGetTimeline calls the XRPC method "app.bsky.feed.getTimeline".
//
// algorithm: Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism.
func FeedGetTimeline(ctx context.Context, c util.LexClient, algorithm string, cursor string, limit int64) (*FeedGetTimeline_Output, error) {
	var out FeedGetTimeline_Output

	params := map[string]interface{}{}
	if algorithm != "" {
		params["algorithm"] = algorithm
	}
	if cursor != "" {
		params["cursor"] = cursor
	}
	if limit != 0 {
		params["limit"] = limit
	}
	if err := c.LexDo(ctx, util.Query, "", "app.bsky.feed.getTimeline", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
