Monorepo for Tangled
tangled.org
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package tangled
4
5// schema: sh.tangled.repo.listPulls
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 RepoListPullsNSID = "sh.tangled.repo.listPulls"
15)
16
17// RepoListPulls_Output is the output of a sh.tangled.repo.listPulls call.
18type RepoListPulls_Output struct {
19 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
20 Items []*RepoListPulls_PullListItem `json:"items" cborgen:"items"`
21}
22
23// RepoListPulls_PullListItem is a "pullListItem" in the sh.tangled.repo.listPulls schema.
24type RepoListPulls_PullListItem struct {
25 Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"`
26 // commentCount: Count of sh.tangled.repo.pull.comment records targeting this pull.
27 CommentCount int64 `json:"commentCount" cborgen:"commentCount"`
28 // state: Latest derived state.
29 State string `json:"state" cborgen:"state"`
30 // stateUpdatedAt: TID-derived timestamp of the latest pull status record.
31 StateUpdatedAt *string `json:"stateUpdatedAt,omitempty" cborgen:"stateUpdatedAt,omitempty"`
32 Uri string `json:"uri" cborgen:"uri"`
33 // value: Embedded sh.tangled.repo.pull record
34 Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"`
35}
36
37// RepoListPulls calls the XRPC method "sh.tangled.repo.listPulls".
38//
39// author: Restrict to pulls authored by this user DID.
40// cursor: Pagination cursor
41// order: Sort direction by createdAt.
42// status: Restrict to pulls whose latest derived status matches.
43// subject: Repo DID to list pulls for
44func RepoListPulls(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, order string, status string, subject string) (*RepoListPulls_Output, error) {
45 var out RepoListPulls_Output
46
47 params := map[string]interface{}{}
48 if author != "" {
49 params["author"] = author
50 }
51 if cursor != "" {
52 params["cursor"] = cursor
53 }
54 if limit != 0 {
55 params["limit"] = limit
56 }
57 if order != "" {
58 params["order"] = order
59 }
60 if status != "" {
61 params["status"] = status
62 }
63 params["subject"] = subject
64 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.listPulls", params, nil, &out); err != nil {
65 return nil, err
66 }
67
68 return &out, nil
69}