porting all github actions from bluesky-social/indigo to tangled CI
at main 3.6 kB view raw
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 3package bsky 4 5// schema: app.bsky.unspecced.searchPostsSkeleton 6 7import ( 8 "context" 9 10 "github.com/bluesky-social/indigo/lex/util" 11) 12 13// UnspeccedSearchPostsSkeleton_Output is the output of a app.bsky.unspecced.searchPostsSkeleton call. 14type UnspeccedSearchPostsSkeleton_Output struct { 15 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 // hitsTotal: Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. 17 HitsTotal *int64 `json:"hitsTotal,omitempty" cborgen:"hitsTotal,omitempty"` 18 Posts []*UnspeccedDefs_SkeletonSearchPost `json:"posts" cborgen:"posts"` 19} 20 21// UnspeccedSearchPostsSkeleton calls the XRPC method "app.bsky.unspecced.searchPostsSkeleton". 22// 23// author: Filter to posts by the given account. Handles are resolved to DID before query-time. 24// cursor: Optional pagination mechanism; may not necessarily allow scrolling through entire result set. 25// domain: Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. 26// lang: Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. 27// mentions: Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. 28// q: Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. 29// since: Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). 30// sort: Specifies the ranking order of results. 31// tag: Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. 32// until: Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD). 33// url: Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. 34// viewer: DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries. 35func UnspeccedSearchPostsSkeleton(ctx context.Context, c util.LexClient, author string, cursor string, domain string, lang string, limit int64, mentions string, q string, since string, sort string, tag []string, until string, url string, viewer string) (*UnspeccedSearchPostsSkeleton_Output, error) { 36 var out UnspeccedSearchPostsSkeleton_Output 37 38 params := map[string]interface{}{} 39 if author != "" { 40 params["author"] = author 41 } 42 if cursor != "" { 43 params["cursor"] = cursor 44 } 45 if domain != "" { 46 params["domain"] = domain 47 } 48 if lang != "" { 49 params["lang"] = lang 50 } 51 if limit != 0 { 52 params["limit"] = limit 53 } 54 if mentions != "" { 55 params["mentions"] = mentions 56 } 57 params["q"] = q 58 if since != "" { 59 params["since"] = since 60 } 61 if sort != "" { 62 params["sort"] = sort 63 } 64 if len(tag) != 0 { 65 params["tag"] = tag 66 } 67 if until != "" { 68 params["until"] = until 69 } 70 if url != "" { 71 params["url"] = url 72 } 73 if viewer != "" { 74 params["viewer"] = viewer 75 } 76 if err := c.LexDo(ctx, util.Query, "", "app.bsky.unspecced.searchPostsSkeleton", params, nil, &out); err != nil { 77 return nil, err 78 } 79 80 return &out, nil 81}