+51
api/atproto/admindefs.go
+51
api/atproto/admindefs.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.defs
4
+
5
+
package atproto
6
+
7
+
import (
8
+
lexutil "github.com/bluesky-social/indigo/lex/util"
9
+
)
10
+
11
+
// AdminDefs_AccountView is a "accountView" in the com.atproto.admin.defs schema.
12
+
type AdminDefs_AccountView struct {
13
+
DeactivatedAt *string `json:"deactivatedAt,omitempty" cborgen:"deactivatedAt,omitempty"`
14
+
Did string `json:"did" cborgen:"did"`
15
+
Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
16
+
EmailConfirmedAt *string `json:"emailConfirmedAt,omitempty" cborgen:"emailConfirmedAt,omitempty"`
17
+
Handle string `json:"handle" cborgen:"handle"`
18
+
IndexedAt string `json:"indexedAt" cborgen:"indexedAt"`
19
+
InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"`
20
+
InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"`
21
+
Invites []*ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"`
22
+
InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"`
23
+
RelatedRecords []*lexutil.LexiconTypeDecoder `json:"relatedRecords,omitempty" cborgen:"relatedRecords,omitempty"`
24
+
ThreatSignatures []*AdminDefs_ThreatSignature `json:"threatSignatures,omitempty" cborgen:"threatSignatures,omitempty"`
25
+
}
26
+
27
+
// AdminDefs_RepoBlobRef is a "repoBlobRef" in the com.atproto.admin.defs schema.
28
+
type AdminDefs_RepoBlobRef struct {
29
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.admin.defs#repoBlobRef"`
30
+
Cid string `json:"cid" cborgen:"cid"`
31
+
Did string `json:"did" cborgen:"did"`
32
+
RecordUri *string `json:"recordUri,omitempty" cborgen:"recordUri,omitempty"`
33
+
}
34
+
35
+
// AdminDefs_RepoRef is a "repoRef" in the com.atproto.admin.defs schema.
36
+
type AdminDefs_RepoRef struct {
37
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.admin.defs#repoRef"`
38
+
Did string `json:"did" cborgen:"did"`
39
+
}
40
+
41
+
// AdminDefs_StatusAttr is a "statusAttr" in the com.atproto.admin.defs schema.
42
+
type AdminDefs_StatusAttr struct {
43
+
Applied bool `json:"applied" cborgen:"applied"`
44
+
Ref *string `json:"ref,omitempty" cborgen:"ref,omitempty"`
45
+
}
46
+
47
+
// AdminDefs_ThreatSignature is a "threatSignature" in the com.atproto.admin.defs schema.
48
+
type AdminDefs_ThreatSignature struct {
49
+
Property string `json:"property" cborgen:"property"`
50
+
Value string `json:"value" cborgen:"value"`
51
+
}
+25
api/atproto/admindeleteAccount.go
+25
api/atproto/admindeleteAccount.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.deleteAccount
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminDeleteAccount_Input is the input argument to a com.atproto.admin.deleteAccount call.
14
+
type AdminDeleteAccount_Input struct {
15
+
Did string `json:"did" cborgen:"did"`
16
+
}
17
+
18
+
// AdminDeleteAccount calls the XRPC method "com.atproto.admin.deleteAccount".
19
+
func AdminDeleteAccount(ctx context.Context, c lexutil.LexClient, input *AdminDeleteAccount_Input) error {
20
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.admin.deleteAccount", nil, input, nil); err != nil {
21
+
return err
22
+
}
23
+
24
+
return nil
25
+
}
+27
api/atproto/admindisableAccountInvites.go
+27
api/atproto/admindisableAccountInvites.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.disableAccountInvites
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminDisableAccountInvites_Input is the input argument to a com.atproto.admin.disableAccountInvites call.
14
+
type AdminDisableAccountInvites_Input struct {
15
+
Account string `json:"account" cborgen:"account"`
16
+
// note: Optional reason for disabled invites.
17
+
Note *string `json:"note,omitempty" cborgen:"note,omitempty"`
18
+
}
19
+
20
+
// AdminDisableAccountInvites calls the XRPC method "com.atproto.admin.disableAccountInvites".
21
+
func AdminDisableAccountInvites(ctx context.Context, c lexutil.LexClient, input *AdminDisableAccountInvites_Input) error {
22
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.admin.disableAccountInvites", nil, input, nil); err != nil {
23
+
return err
24
+
}
25
+
26
+
return nil
27
+
}
+26
api/atproto/admindisableInviteCodes.go
+26
api/atproto/admindisableInviteCodes.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.disableInviteCodes
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminDisableInviteCodes_Input is the input argument to a com.atproto.admin.disableInviteCodes call.
14
+
type AdminDisableInviteCodes_Input struct {
15
+
Accounts []string `json:"accounts,omitempty" cborgen:"accounts,omitempty"`
16
+
Codes []string `json:"codes,omitempty" cborgen:"codes,omitempty"`
17
+
}
18
+
19
+
// AdminDisableInviteCodes calls the XRPC method "com.atproto.admin.disableInviteCodes".
20
+
func AdminDisableInviteCodes(ctx context.Context, c lexutil.LexClient, input *AdminDisableInviteCodes_Input) error {
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.admin.disableInviteCodes", nil, input, nil); err != nil {
22
+
return err
23
+
}
24
+
25
+
return nil
26
+
}
+27
api/atproto/adminenableAccountInvites.go
+27
api/atproto/adminenableAccountInvites.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.enableAccountInvites
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminEnableAccountInvites_Input is the input argument to a com.atproto.admin.enableAccountInvites call.
14
+
type AdminEnableAccountInvites_Input struct {
15
+
Account string `json:"account" cborgen:"account"`
16
+
// note: Optional reason for enabled invites.
17
+
Note *string `json:"note,omitempty" cborgen:"note,omitempty"`
18
+
}
19
+
20
+
// AdminEnableAccountInvites calls the XRPC method "com.atproto.admin.enableAccountInvites".
21
+
func AdminEnableAccountInvites(ctx context.Context, c lexutil.LexClient, input *AdminEnableAccountInvites_Input) error {
22
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.admin.enableAccountInvites", nil, input, nil); err != nil {
23
+
return err
24
+
}
25
+
26
+
return nil
27
+
}
+24
api/atproto/admingetAccountInfo.go
+24
api/atproto/admingetAccountInfo.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.getAccountInfo
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminGetAccountInfo calls the XRPC method "com.atproto.admin.getAccountInfo".
14
+
func AdminGetAccountInfo(ctx context.Context, c lexutil.LexClient, did string) (*AdminDefs_AccountView, error) {
15
+
var out AdminDefs_AccountView
16
+
17
+
params := map[string]interface{}{}
18
+
params["did"] = did
19
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.admin.getAccountInfo", params, nil, &out); err != nil {
20
+
return nil, err
21
+
}
22
+
23
+
return &out, nil
24
+
}
+29
api/atproto/admingetAccountInfos.go
+29
api/atproto/admingetAccountInfos.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.getAccountInfos
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminGetAccountInfos_Output is the output of a com.atproto.admin.getAccountInfos call.
14
+
type AdminGetAccountInfos_Output struct {
15
+
Infos []*AdminDefs_AccountView `json:"infos" cborgen:"infos"`
16
+
}
17
+
18
+
// AdminGetAccountInfos calls the XRPC method "com.atproto.admin.getAccountInfos".
19
+
func AdminGetAccountInfos(ctx context.Context, c lexutil.LexClient, dids []string) (*AdminGetAccountInfos_Output, error) {
20
+
var out AdminGetAccountInfos_Output
21
+
22
+
params := map[string]interface{}{}
23
+
params["dids"] = dids
24
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.admin.getAccountInfos", params, nil, &out); err != nil {
25
+
return nil, err
26
+
}
27
+
28
+
return &out, nil
29
+
}
+38
api/atproto/admingetInviteCodes.go
+38
api/atproto/admingetInviteCodes.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.getInviteCodes
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminGetInviteCodes_Output is the output of a com.atproto.admin.getInviteCodes call.
14
+
type AdminGetInviteCodes_Output struct {
15
+
Codes []*ServerDefs_InviteCode `json:"codes" cborgen:"codes"`
16
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
17
+
}
18
+
19
+
// AdminGetInviteCodes calls the XRPC method "com.atproto.admin.getInviteCodes".
20
+
func AdminGetInviteCodes(ctx context.Context, c lexutil.LexClient, cursor string, limit int64, sort string) (*AdminGetInviteCodes_Output, error) {
21
+
var out AdminGetInviteCodes_Output
22
+
23
+
params := map[string]interface{}{}
24
+
if cursor != "" {
25
+
params["cursor"] = cursor
26
+
}
27
+
if limit != 0 {
28
+
params["limit"] = limit
29
+
}
30
+
if sort != "" {
31
+
params["sort"] = sort
32
+
}
33
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.admin.getInviteCodes", params, nil, &out); err != nil {
34
+
return nil, err
35
+
}
36
+
37
+
return &out, nil
38
+
}
+84
api/atproto/admingetSubjectStatus.go
+84
api/atproto/admingetSubjectStatus.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.getSubjectStatus
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
"encoding/json"
10
+
"fmt"
11
+
12
+
lexutil "github.com/bluesky-social/indigo/lex/util"
13
+
)
14
+
15
+
// AdminGetSubjectStatus_Output is the output of a com.atproto.admin.getSubjectStatus call.
16
+
type AdminGetSubjectStatus_Output struct {
17
+
Deactivated *AdminDefs_StatusAttr `json:"deactivated,omitempty" cborgen:"deactivated,omitempty"`
18
+
Subject *AdminGetSubjectStatus_Output_Subject `json:"subject" cborgen:"subject"`
19
+
Takedown *AdminDefs_StatusAttr `json:"takedown,omitempty" cborgen:"takedown,omitempty"`
20
+
}
21
+
22
+
type AdminGetSubjectStatus_Output_Subject struct {
23
+
AdminDefs_RepoRef *AdminDefs_RepoRef
24
+
RepoStrongRef *RepoStrongRef
25
+
AdminDefs_RepoBlobRef *AdminDefs_RepoBlobRef
26
+
}
27
+
28
+
func (t *AdminGetSubjectStatus_Output_Subject) MarshalJSON() ([]byte, error) {
29
+
if t.AdminDefs_RepoRef != nil {
30
+
t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef"
31
+
return json.Marshal(t.AdminDefs_RepoRef)
32
+
}
33
+
if t.RepoStrongRef != nil {
34
+
t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef"
35
+
return json.Marshal(t.RepoStrongRef)
36
+
}
37
+
if t.AdminDefs_RepoBlobRef != nil {
38
+
t.AdminDefs_RepoBlobRef.LexiconTypeID = "com.atproto.admin.defs#repoBlobRef"
39
+
return json.Marshal(t.AdminDefs_RepoBlobRef)
40
+
}
41
+
return nil, fmt.Errorf("can not marshal empty union as JSON")
42
+
}
43
+
44
+
func (t *AdminGetSubjectStatus_Output_Subject) UnmarshalJSON(b []byte) error {
45
+
typ, err := lexutil.TypeExtract(b)
46
+
if err != nil {
47
+
return err
48
+
}
49
+
50
+
switch typ {
51
+
case "com.atproto.admin.defs#repoRef":
52
+
t.AdminDefs_RepoRef = new(AdminDefs_RepoRef)
53
+
return json.Unmarshal(b, t.AdminDefs_RepoRef)
54
+
case "com.atproto.repo.strongRef":
55
+
t.RepoStrongRef = new(RepoStrongRef)
56
+
return json.Unmarshal(b, t.RepoStrongRef)
57
+
case "com.atproto.admin.defs#repoBlobRef":
58
+
t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef)
59
+
return json.Unmarshal(b, t.AdminDefs_RepoBlobRef)
60
+
default:
61
+
return nil
62
+
}
63
+
}
64
+
65
+
// AdminGetSubjectStatus calls the XRPC method "com.atproto.admin.getSubjectStatus".
66
+
func AdminGetSubjectStatus(ctx context.Context, c lexutil.LexClient, blob string, did string, uri string) (*AdminGetSubjectStatus_Output, error) {
67
+
var out AdminGetSubjectStatus_Output
68
+
69
+
params := map[string]interface{}{}
70
+
if blob != "" {
71
+
params["blob"] = blob
72
+
}
73
+
if did != "" {
74
+
params["did"] = did
75
+
}
76
+
if uri != "" {
77
+
params["uri"] = uri
78
+
}
79
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.admin.getSubjectStatus", params, nil, &out); err != nil {
80
+
return nil, err
81
+
}
82
+
83
+
return &out, nil
84
+
}
+38
api/atproto/adminsearchAccounts.go
+38
api/atproto/adminsearchAccounts.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.searchAccounts
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminSearchAccounts_Output is the output of a com.atproto.admin.searchAccounts call.
14
+
type AdminSearchAccounts_Output struct {
15
+
Accounts []*AdminDefs_AccountView `json:"accounts" cborgen:"accounts"`
16
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
17
+
}
18
+
19
+
// AdminSearchAccounts calls the XRPC method "com.atproto.admin.searchAccounts".
20
+
func AdminSearchAccounts(ctx context.Context, c lexutil.LexClient, cursor string, email string, limit int64) (*AdminSearchAccounts_Output, error) {
21
+
var out AdminSearchAccounts_Output
22
+
23
+
params := map[string]interface{}{}
24
+
if cursor != "" {
25
+
params["cursor"] = cursor
26
+
}
27
+
if email != "" {
28
+
params["email"] = email
29
+
}
30
+
if limit != 0 {
31
+
params["limit"] = limit
32
+
}
33
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.admin.searchAccounts", params, nil, &out); err != nil {
34
+
return nil, err
35
+
}
36
+
37
+
return &out, nil
38
+
}
+36
api/atproto/adminsendEmail.go
+36
api/atproto/adminsendEmail.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.sendEmail
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminSendEmail_Input is the input argument to a com.atproto.admin.sendEmail call.
14
+
type AdminSendEmail_Input struct {
15
+
// comment: Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers
16
+
Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"`
17
+
Content string `json:"content" cborgen:"content"`
18
+
RecipientDid string `json:"recipientDid" cborgen:"recipientDid"`
19
+
SenderDid string `json:"senderDid" cborgen:"senderDid"`
20
+
Subject *string `json:"subject,omitempty" cborgen:"subject,omitempty"`
21
+
}
22
+
23
+
// AdminSendEmail_Output is the output of a com.atproto.admin.sendEmail call.
24
+
type AdminSendEmail_Output struct {
25
+
Sent bool `json:"sent" cborgen:"sent"`
26
+
}
27
+
28
+
// AdminSendEmail calls the XRPC method "com.atproto.admin.sendEmail".
29
+
func AdminSendEmail(ctx context.Context, c lexutil.LexClient, input *AdminSendEmail_Input) (*AdminSendEmail_Output, error) {
30
+
var out AdminSendEmail_Output
31
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.admin.sendEmail", nil, input, &out); err != nil {
32
+
return nil, err
33
+
}
34
+
35
+
return &out, nil
36
+
}
+27
api/atproto/adminupdateAccountEmail.go
+27
api/atproto/adminupdateAccountEmail.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.updateAccountEmail
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminUpdateAccountEmail_Input is the input argument to a com.atproto.admin.updateAccountEmail call.
14
+
type AdminUpdateAccountEmail_Input struct {
15
+
// account: The handle or DID of the repo.
16
+
Account string `json:"account" cborgen:"account"`
17
+
Email string `json:"email" cborgen:"email"`
18
+
}
19
+
20
+
// AdminUpdateAccountEmail calls the XRPC method "com.atproto.admin.updateAccountEmail".
21
+
func AdminUpdateAccountEmail(ctx context.Context, c lexutil.LexClient, input *AdminUpdateAccountEmail_Input) error {
22
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.admin.updateAccountEmail", nil, input, nil); err != nil {
23
+
return err
24
+
}
25
+
26
+
return nil
27
+
}
+26
api/atproto/adminupdateAccountHandle.go
+26
api/atproto/adminupdateAccountHandle.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.updateAccountHandle
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminUpdateAccountHandle_Input is the input argument to a com.atproto.admin.updateAccountHandle call.
14
+
type AdminUpdateAccountHandle_Input struct {
15
+
Did string `json:"did" cborgen:"did"`
16
+
Handle string `json:"handle" cborgen:"handle"`
17
+
}
18
+
19
+
// AdminUpdateAccountHandle calls the XRPC method "com.atproto.admin.updateAccountHandle".
20
+
func AdminUpdateAccountHandle(ctx context.Context, c lexutil.LexClient, input *AdminUpdateAccountHandle_Input) error {
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.admin.updateAccountHandle", nil, input, nil); err != nil {
22
+
return err
23
+
}
24
+
25
+
return nil
26
+
}
+26
api/atproto/adminupdateAccountPassword.go
+26
api/atproto/adminupdateAccountPassword.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.updateAccountPassword
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminUpdateAccountPassword_Input is the input argument to a com.atproto.admin.updateAccountPassword call.
14
+
type AdminUpdateAccountPassword_Input struct {
15
+
Did string `json:"did" cborgen:"did"`
16
+
Password string `json:"password" cborgen:"password"`
17
+
}
18
+
19
+
// AdminUpdateAccountPassword calls the XRPC method "com.atproto.admin.updateAccountPassword".
20
+
func AdminUpdateAccountPassword(ctx context.Context, c lexutil.LexClient, input *AdminUpdateAccountPassword_Input) error {
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.admin.updateAccountPassword", nil, input, nil); err != nil {
22
+
return err
23
+
}
24
+
25
+
return nil
26
+
}
+27
api/atproto/adminupdateAccountSigningKey.go
+27
api/atproto/adminupdateAccountSigningKey.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.updateAccountSigningKey
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// AdminUpdateAccountSigningKey_Input is the input argument to a com.atproto.admin.updateAccountSigningKey call.
14
+
type AdminUpdateAccountSigningKey_Input struct {
15
+
Did string `json:"did" cborgen:"did"`
16
+
// signingKey: Did-key formatted public key
17
+
SigningKey string `json:"signingKey" cborgen:"signingKey"`
18
+
}
19
+
20
+
// AdminUpdateAccountSigningKey calls the XRPC method "com.atproto.admin.updateAccountSigningKey".
21
+
func AdminUpdateAccountSigningKey(ctx context.Context, c lexutil.LexClient, input *AdminUpdateAccountSigningKey_Input) error {
22
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.admin.updateAccountSigningKey", nil, input, nil); err != nil {
23
+
return err
24
+
}
25
+
26
+
return nil
27
+
}
+122
api/atproto/adminupdateSubjectStatus.go
+122
api/atproto/adminupdateSubjectStatus.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.admin.updateSubjectStatus
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
"encoding/json"
10
+
"fmt"
11
+
12
+
lexutil "github.com/bluesky-social/indigo/lex/util"
13
+
)
14
+
15
+
// AdminUpdateSubjectStatus_Input is the input argument to a com.atproto.admin.updateSubjectStatus call.
16
+
type AdminUpdateSubjectStatus_Input struct {
17
+
Deactivated *AdminDefs_StatusAttr `json:"deactivated,omitempty" cborgen:"deactivated,omitempty"`
18
+
Subject *AdminUpdateSubjectStatus_Input_Subject `json:"subject" cborgen:"subject"`
19
+
Takedown *AdminDefs_StatusAttr `json:"takedown,omitempty" cborgen:"takedown,omitempty"`
20
+
}
21
+
22
+
type AdminUpdateSubjectStatus_Input_Subject struct {
23
+
AdminDefs_RepoRef *AdminDefs_RepoRef
24
+
RepoStrongRef *RepoStrongRef
25
+
AdminDefs_RepoBlobRef *AdminDefs_RepoBlobRef
26
+
}
27
+
28
+
func (t *AdminUpdateSubjectStatus_Input_Subject) MarshalJSON() ([]byte, error) {
29
+
if t.AdminDefs_RepoRef != nil {
30
+
t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef"
31
+
return json.Marshal(t.AdminDefs_RepoRef)
32
+
}
33
+
if t.RepoStrongRef != nil {
34
+
t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef"
35
+
return json.Marshal(t.RepoStrongRef)
36
+
}
37
+
if t.AdminDefs_RepoBlobRef != nil {
38
+
t.AdminDefs_RepoBlobRef.LexiconTypeID = "com.atproto.admin.defs#repoBlobRef"
39
+
return json.Marshal(t.AdminDefs_RepoBlobRef)
40
+
}
41
+
return nil, fmt.Errorf("can not marshal empty union as JSON")
42
+
}
43
+
44
+
func (t *AdminUpdateSubjectStatus_Input_Subject) UnmarshalJSON(b []byte) error {
45
+
typ, err := lexutil.TypeExtract(b)
46
+
if err != nil {
47
+
return err
48
+
}
49
+
50
+
switch typ {
51
+
case "com.atproto.admin.defs#repoRef":
52
+
t.AdminDefs_RepoRef = new(AdminDefs_RepoRef)
53
+
return json.Unmarshal(b, t.AdminDefs_RepoRef)
54
+
case "com.atproto.repo.strongRef":
55
+
t.RepoStrongRef = new(RepoStrongRef)
56
+
return json.Unmarshal(b, t.RepoStrongRef)
57
+
case "com.atproto.admin.defs#repoBlobRef":
58
+
t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef)
59
+
return json.Unmarshal(b, t.AdminDefs_RepoBlobRef)
60
+
default:
61
+
return nil
62
+
}
63
+
}
64
+
65
+
// AdminUpdateSubjectStatus_Output is the output of a com.atproto.admin.updateSubjectStatus call.
66
+
type AdminUpdateSubjectStatus_Output struct {
67
+
Subject *AdminUpdateSubjectStatus_Output_Subject `json:"subject" cborgen:"subject"`
68
+
Takedown *AdminDefs_StatusAttr `json:"takedown,omitempty" cborgen:"takedown,omitempty"`
69
+
}
70
+
71
+
type AdminUpdateSubjectStatus_Output_Subject struct {
72
+
AdminDefs_RepoRef *AdminDefs_RepoRef
73
+
RepoStrongRef *RepoStrongRef
74
+
AdminDefs_RepoBlobRef *AdminDefs_RepoBlobRef
75
+
}
76
+
77
+
func (t *AdminUpdateSubjectStatus_Output_Subject) MarshalJSON() ([]byte, error) {
78
+
if t.AdminDefs_RepoRef != nil {
79
+
t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef"
80
+
return json.Marshal(t.AdminDefs_RepoRef)
81
+
}
82
+
if t.RepoStrongRef != nil {
83
+
t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef"
84
+
return json.Marshal(t.RepoStrongRef)
85
+
}
86
+
if t.AdminDefs_RepoBlobRef != nil {
87
+
t.AdminDefs_RepoBlobRef.LexiconTypeID = "com.atproto.admin.defs#repoBlobRef"
88
+
return json.Marshal(t.AdminDefs_RepoBlobRef)
89
+
}
90
+
return nil, fmt.Errorf("can not marshal empty union as JSON")
91
+
}
92
+
93
+
func (t *AdminUpdateSubjectStatus_Output_Subject) UnmarshalJSON(b []byte) error {
94
+
typ, err := lexutil.TypeExtract(b)
95
+
if err != nil {
96
+
return err
97
+
}
98
+
99
+
switch typ {
100
+
case "com.atproto.admin.defs#repoRef":
101
+
t.AdminDefs_RepoRef = new(AdminDefs_RepoRef)
102
+
return json.Unmarshal(b, t.AdminDefs_RepoRef)
103
+
case "com.atproto.repo.strongRef":
104
+
t.RepoStrongRef = new(RepoStrongRef)
105
+
return json.Unmarshal(b, t.RepoStrongRef)
106
+
case "com.atproto.admin.defs#repoBlobRef":
107
+
t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef)
108
+
return json.Unmarshal(b, t.AdminDefs_RepoBlobRef)
109
+
default:
110
+
return nil
111
+
}
112
+
}
113
+
114
+
// AdminUpdateSubjectStatus calls the XRPC method "com.atproto.admin.updateSubjectStatus".
115
+
func AdminUpdateSubjectStatus(ctx context.Context, c lexutil.LexClient, input *AdminUpdateSubjectStatus_Input) (*AdminUpdateSubjectStatus_Output, error) {
116
+
var out AdminUpdateSubjectStatus_Output
117
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.admin.updateSubjectStatus", nil, input, &out); err != nil {
118
+
return nil, err
119
+
}
120
+
121
+
return &out, nil
122
+
}
+192
api/atproto/cbor_gen.go
+192
api/atproto/cbor_gen.go
···
1
+
// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT.
2
+
3
+
package atproto
4
+
5
+
import (
6
+
"fmt"
7
+
"io"
8
+
"math"
9
+
"sort"
10
+
11
+
cid "github.com/ipfs/go-cid"
12
+
cbg "github.com/whyrusleeping/cbor-gen"
13
+
xerrors "golang.org/x/xerrors"
14
+
)
15
+
16
+
var _ = xerrors.Errorf
17
+
var _ = cid.Undef
18
+
var _ = math.E
19
+
var _ = sort.Sort
20
+
21
+
func (t *RepoStrongRef) MarshalCBOR(w io.Writer) error {
22
+
if t == nil {
23
+
_, err := w.Write(cbg.CborNull)
24
+
return err
25
+
}
26
+
27
+
cw := cbg.NewCborWriter(w)
28
+
fieldCount := 3
29
+
30
+
if t.LexiconTypeID == "" {
31
+
fieldCount--
32
+
}
33
+
34
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
35
+
return err
36
+
}
37
+
38
+
// t.Cid (string) (string)
39
+
if len("cid") > 1000000 {
40
+
return xerrors.Errorf("Value in field \"cid\" was too long")
41
+
}
42
+
43
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("cid"))); err != nil {
44
+
return err
45
+
}
46
+
if _, err := cw.WriteString(string("cid")); err != nil {
47
+
return err
48
+
}
49
+
50
+
if len(t.Cid) > 1000000 {
51
+
return xerrors.Errorf("Value in field t.Cid was too long")
52
+
}
53
+
54
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Cid))); err != nil {
55
+
return err
56
+
}
57
+
if _, err := cw.WriteString(string(t.Cid)); err != nil {
58
+
return err
59
+
}
60
+
61
+
// t.Uri (string) (string)
62
+
if len("uri") > 1000000 {
63
+
return xerrors.Errorf("Value in field \"uri\" was too long")
64
+
}
65
+
66
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("uri"))); err != nil {
67
+
return err
68
+
}
69
+
if _, err := cw.WriteString(string("uri")); err != nil {
70
+
return err
71
+
}
72
+
73
+
if len(t.Uri) > 1000000 {
74
+
return xerrors.Errorf("Value in field t.Uri was too long")
75
+
}
76
+
77
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Uri))); err != nil {
78
+
return err
79
+
}
80
+
if _, err := cw.WriteString(string(t.Uri)); err != nil {
81
+
return err
82
+
}
83
+
84
+
// t.LexiconTypeID (string) (string)
85
+
if t.LexiconTypeID != "" {
86
+
87
+
if len("$type") > 1000000 {
88
+
return xerrors.Errorf("Value in field \"$type\" was too long")
89
+
}
90
+
91
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
92
+
return err
93
+
}
94
+
if _, err := cw.WriteString(string("$type")); err != nil {
95
+
return err
96
+
}
97
+
98
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("com.atproto.repo.strongRef"))); err != nil {
99
+
return err
100
+
}
101
+
if _, err := cw.WriteString(string("com.atproto.repo.strongRef")); err != nil {
102
+
return err
103
+
}
104
+
}
105
+
return nil
106
+
}
107
+
108
+
func (t *RepoStrongRef) UnmarshalCBOR(r io.Reader) (err error) {
109
+
*t = RepoStrongRef{}
110
+
111
+
cr := cbg.NewCborReader(r)
112
+
113
+
maj, extra, err := cr.ReadHeader()
114
+
if err != nil {
115
+
return err
116
+
}
117
+
defer func() {
118
+
if err == io.EOF {
119
+
err = io.ErrUnexpectedEOF
120
+
}
121
+
}()
122
+
123
+
if maj != cbg.MajMap {
124
+
return fmt.Errorf("cbor input should be of type map")
125
+
}
126
+
127
+
if extra > cbg.MaxLength {
128
+
return fmt.Errorf("RepoStrongRef: map struct too large (%d)", extra)
129
+
}
130
+
131
+
n := extra
132
+
133
+
nameBuf := make([]byte, 5)
134
+
for i := uint64(0); i < n; i++ {
135
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
136
+
if err != nil {
137
+
return err
138
+
}
139
+
140
+
if !ok {
141
+
// Field doesn't exist on this type, so ignore it
142
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
143
+
return err
144
+
}
145
+
continue
146
+
}
147
+
148
+
switch string(nameBuf[:nameLen]) {
149
+
// t.Cid (string) (string)
150
+
case "cid":
151
+
152
+
{
153
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
154
+
if err != nil {
155
+
return err
156
+
}
157
+
158
+
t.Cid = string(sval)
159
+
}
160
+
// t.Uri (string) (string)
161
+
case "uri":
162
+
163
+
{
164
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
165
+
if err != nil {
166
+
return err
167
+
}
168
+
169
+
t.Uri = string(sval)
170
+
}
171
+
// t.LexiconTypeID (string) (string)
172
+
case "$type":
173
+
174
+
{
175
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
176
+
if err != nil {
177
+
return err
178
+
}
179
+
180
+
t.LexiconTypeID = string(sval)
181
+
}
182
+
183
+
default:
184
+
// Field doesn't exist on this type, so ignore it
185
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
186
+
return err
187
+
}
188
+
}
189
+
}
190
+
191
+
return nil
192
+
}
+14
api/atproto/identitydefs.go
+14
api/atproto/identitydefs.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.identity.defs
4
+
5
+
package atproto
6
+
7
+
// IdentityDefs_IdentityInfo is a "identityInfo" in the com.atproto.identity.defs schema.
8
+
type IdentityDefs_IdentityInfo struct {
9
+
Did string `json:"did" cborgen:"did"`
10
+
// didDoc: The complete DID document for the identity.
11
+
DidDoc interface{} `json:"didDoc" cborgen:"didDoc"`
12
+
// handle: The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document.
13
+
Handle string `json:"handle" cborgen:"handle"`
14
+
}
+30
api/atproto/identitygetRecommendedDidCredentials.go
+30
api/atproto/identitygetRecommendedDidCredentials.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.identity.getRecommendedDidCredentials
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// IdentityGetRecommendedDidCredentials_Output is the output of a com.atproto.identity.getRecommendedDidCredentials call.
14
+
type IdentityGetRecommendedDidCredentials_Output struct {
15
+
AlsoKnownAs []string `json:"alsoKnownAs,omitempty" cborgen:"alsoKnownAs,omitempty"`
16
+
// rotationKeys: Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs.
17
+
RotationKeys []string `json:"rotationKeys,omitempty" cborgen:"rotationKeys,omitempty"`
18
+
Services *lexutil.LexiconTypeDecoder `json:"services,omitempty" cborgen:"services,omitempty"`
19
+
VerificationMethods *lexutil.LexiconTypeDecoder `json:"verificationMethods,omitempty" cborgen:"verificationMethods,omitempty"`
20
+
}
21
+
22
+
// IdentityGetRecommendedDidCredentials calls the XRPC method "com.atproto.identity.getRecommendedDidCredentials".
23
+
func IdentityGetRecommendedDidCredentials(ctx context.Context, c lexutil.LexClient) (*IdentityGetRecommendedDidCredentials_Output, error) {
24
+
var out IdentityGetRecommendedDidCredentials_Output
25
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.identity.getRecommendedDidCredentials", nil, nil, &out); err != nil {
26
+
return nil, err
27
+
}
28
+
29
+
return &out, nil
30
+
}
+26
api/atproto/identityrefreshIdentity.go
+26
api/atproto/identityrefreshIdentity.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.identity.refreshIdentity
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// IdentityRefreshIdentity_Input is the input argument to a com.atproto.identity.refreshIdentity call.
14
+
type IdentityRefreshIdentity_Input struct {
15
+
Identifier string `json:"identifier" cborgen:"identifier"`
16
+
}
17
+
18
+
// IdentityRefreshIdentity calls the XRPC method "com.atproto.identity.refreshIdentity".
19
+
func IdentityRefreshIdentity(ctx context.Context, c lexutil.LexClient, input *IdentityRefreshIdentity_Input) (*IdentityDefs_IdentityInfo, error) {
20
+
var out IdentityDefs_IdentityInfo
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.identity.refreshIdentity", nil, input, &out); err != nil {
22
+
return nil, err
23
+
}
24
+
25
+
return &out, nil
26
+
}
+20
api/atproto/identityrequestPlcOperationSignature.go
+20
api/atproto/identityrequestPlcOperationSignature.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.identity.requestPlcOperationSignature
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// IdentityRequestPlcOperationSignature calls the XRPC method "com.atproto.identity.requestPlcOperationSignature".
14
+
func IdentityRequestPlcOperationSignature(ctx context.Context, c lexutil.LexClient) error {
15
+
if err := c.LexDo(ctx, lexutil.Procedure, "", "com.atproto.identity.requestPlcOperationSignature", nil, nil, nil); err != nil {
16
+
return err
17
+
}
18
+
19
+
return nil
20
+
}
+32
api/atproto/identityresolveDid.go
+32
api/atproto/identityresolveDid.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.identity.resolveDid
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// IdentityResolveDid_Output is the output of a com.atproto.identity.resolveDid call.
14
+
type IdentityResolveDid_Output struct {
15
+
// didDoc: The complete DID document for the identity.
16
+
DidDoc interface{} `json:"didDoc" cborgen:"didDoc"`
17
+
}
18
+
19
+
// IdentityResolveDid calls the XRPC method "com.atproto.identity.resolveDid".
20
+
//
21
+
// did: DID to resolve.
22
+
func IdentityResolveDid(ctx context.Context, c lexutil.LexClient, did string) (*IdentityResolveDid_Output, error) {
23
+
var out IdentityResolveDid_Output
24
+
25
+
params := map[string]interface{}{}
26
+
params["did"] = did
27
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.identity.resolveDid", params, nil, &out); err != nil {
28
+
return nil, err
29
+
}
30
+
31
+
return &out, nil
32
+
}
+31
api/atproto/identityresolveHandle.go
+31
api/atproto/identityresolveHandle.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.identity.resolveHandle
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// IdentityResolveHandle_Output is the output of a com.atproto.identity.resolveHandle call.
14
+
type IdentityResolveHandle_Output struct {
15
+
Did string `json:"did" cborgen:"did"`
16
+
}
17
+
18
+
// IdentityResolveHandle calls the XRPC method "com.atproto.identity.resolveHandle".
19
+
//
20
+
// handle: The handle to resolve.
21
+
func IdentityResolveHandle(ctx context.Context, c lexutil.LexClient, handle string) (*IdentityResolveHandle_Output, error) {
22
+
var out IdentityResolveHandle_Output
23
+
24
+
params := map[string]interface{}{}
25
+
params["handle"] = handle
26
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.identity.resolveHandle", params, nil, &out); err != nil {
27
+
return nil, err
28
+
}
29
+
30
+
return &out, nil
31
+
}
+26
api/atproto/identityresolveIdentity.go
+26
api/atproto/identityresolveIdentity.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.identity.resolveIdentity
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// IdentityResolveIdentity calls the XRPC method "com.atproto.identity.resolveIdentity".
14
+
//
15
+
// identifier: Handle or DID to resolve.
16
+
func IdentityResolveIdentity(ctx context.Context, c lexutil.LexClient, identifier string) (*IdentityDefs_IdentityInfo, error) {
17
+
var out IdentityDefs_IdentityInfo
18
+
19
+
params := map[string]interface{}{}
20
+
params["identifier"] = identifier
21
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.identity.resolveIdentity", params, nil, &out); err != nil {
22
+
return nil, err
23
+
}
24
+
25
+
return &out, nil
26
+
}
+37
api/atproto/identitysignPlcOperation.go
+37
api/atproto/identitysignPlcOperation.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.identity.signPlcOperation
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// IdentitySignPlcOperation_Input is the input argument to a com.atproto.identity.signPlcOperation call.
14
+
type IdentitySignPlcOperation_Input struct {
15
+
AlsoKnownAs []string `json:"alsoKnownAs,omitempty" cborgen:"alsoKnownAs,omitempty"`
16
+
RotationKeys []string `json:"rotationKeys,omitempty" cborgen:"rotationKeys,omitempty"`
17
+
Services *lexutil.LexiconTypeDecoder `json:"services,omitempty" cborgen:"services,omitempty"`
18
+
// token: A token received through com.atproto.identity.requestPlcOperationSignature
19
+
Token *string `json:"token,omitempty" cborgen:"token,omitempty"`
20
+
VerificationMethods *lexutil.LexiconTypeDecoder `json:"verificationMethods,omitempty" cborgen:"verificationMethods,omitempty"`
21
+
}
22
+
23
+
// IdentitySignPlcOperation_Output is the output of a com.atproto.identity.signPlcOperation call.
24
+
type IdentitySignPlcOperation_Output struct {
25
+
// operation: A signed DID PLC operation.
26
+
Operation *lexutil.LexiconTypeDecoder `json:"operation" cborgen:"operation"`
27
+
}
28
+
29
+
// IdentitySignPlcOperation calls the XRPC method "com.atproto.identity.signPlcOperation".
30
+
func IdentitySignPlcOperation(ctx context.Context, c lexutil.LexClient, input *IdentitySignPlcOperation_Input) (*IdentitySignPlcOperation_Output, error) {
31
+
var out IdentitySignPlcOperation_Output
32
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.identity.signPlcOperation", nil, input, &out); err != nil {
33
+
return nil, err
34
+
}
35
+
36
+
return &out, nil
37
+
}
+25
api/atproto/identitysubmitPlcOperation.go
+25
api/atproto/identitysubmitPlcOperation.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.identity.submitPlcOperation
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// IdentitySubmitPlcOperation_Input is the input argument to a com.atproto.identity.submitPlcOperation call.
14
+
type IdentitySubmitPlcOperation_Input struct {
15
+
Operation *lexutil.LexiconTypeDecoder `json:"operation" cborgen:"operation"`
16
+
}
17
+
18
+
// IdentitySubmitPlcOperation calls the XRPC method "com.atproto.identity.submitPlcOperation".
19
+
func IdentitySubmitPlcOperation(ctx context.Context, c lexutil.LexClient, input *IdentitySubmitPlcOperation_Input) error {
20
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.identity.submitPlcOperation", nil, input, nil); err != nil {
21
+
return err
22
+
}
23
+
24
+
return nil
25
+
}
+26
api/atproto/identityupdateHandle.go
+26
api/atproto/identityupdateHandle.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.identity.updateHandle
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// IdentityUpdateHandle_Input is the input argument to a com.atproto.identity.updateHandle call.
14
+
type IdentityUpdateHandle_Input struct {
15
+
// handle: The new handle.
16
+
Handle string `json:"handle" cborgen:"handle"`
17
+
}
18
+
19
+
// IdentityUpdateHandle calls the XRPC method "com.atproto.identity.updateHandle".
20
+
func IdentityUpdateHandle(ctx context.Context, c lexutil.LexClient, input *IdentityUpdateHandle_Input) error {
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.identity.updateHandle", nil, input, nil); err != nil {
22
+
return err
23
+
}
24
+
25
+
return nil
26
+
}
+78
api/atproto/labeldefs.go
+78
api/atproto/labeldefs.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.label.defs
4
+
5
+
package atproto
6
+
7
+
import (
8
+
lexutil "github.com/bluesky-social/indigo/lex/util"
9
+
)
10
+
11
+
// LabelDefs_Label is a "label" in the com.atproto.label.defs schema.
12
+
//
13
+
// Metadata tag on an atproto resource (eg, repo or record).
14
+
type LabelDefs_Label struct {
15
+
// cid: Optionally, CID specifying the specific version of 'uri' resource this label applies to.
16
+
Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"`
17
+
// cts: Timestamp when this label was created.
18
+
Cts string `json:"cts" cborgen:"cts"`
19
+
// exp: Timestamp at which this label expires (no longer applies).
20
+
Exp *string `json:"exp,omitempty" cborgen:"exp,omitempty"`
21
+
// neg: If true, this is a negation label, overwriting a previous label.
22
+
Neg *bool `json:"neg,omitempty" cborgen:"neg,omitempty"`
23
+
// sig: Signature of dag-cbor encoded label.
24
+
Sig lexutil.LexBytes `json:"sig,omitempty" cborgen:"sig,omitempty"`
25
+
// src: DID of the actor who created this label.
26
+
Src string `json:"src" cborgen:"src"`
27
+
// uri: AT URI of the record, repository (account), or other resource that this label applies to.
28
+
Uri string `json:"uri" cborgen:"uri"`
29
+
// val: The short string name of the value or type of this label.
30
+
Val string `json:"val" cborgen:"val"`
31
+
// ver: The AT Protocol version of the label object.
32
+
Ver *int64 `json:"ver,omitempty" cborgen:"ver,omitempty"`
33
+
}
34
+
35
+
// LabelDefs_LabelValueDefinition is a "labelValueDefinition" in the com.atproto.label.defs schema.
36
+
//
37
+
// Declares a label value and its expected interpretations and behaviors.
38
+
type LabelDefs_LabelValueDefinition struct {
39
+
// adultOnly: Does the user need to have adult content enabled in order to configure this label?
40
+
AdultOnly *bool `json:"adultOnly,omitempty" cborgen:"adultOnly,omitempty"`
41
+
// blurs: What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.
42
+
Blurs string `json:"blurs" cborgen:"blurs"`
43
+
// defaultSetting: The default setting for this label.
44
+
DefaultSetting *string `json:"defaultSetting,omitempty" cborgen:"defaultSetting,omitempty"`
45
+
// identifier: The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).
46
+
Identifier string `json:"identifier" cborgen:"identifier"`
47
+
Locales []*LabelDefs_LabelValueDefinitionStrings `json:"locales" cborgen:"locales"`
48
+
// severity: How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.
49
+
Severity string `json:"severity" cborgen:"severity"`
50
+
}
51
+
52
+
// LabelDefs_LabelValueDefinitionStrings is a "labelValueDefinitionStrings" in the com.atproto.label.defs schema.
53
+
//
54
+
// Strings which describe the label in the UI, localized into a specific language.
55
+
type LabelDefs_LabelValueDefinitionStrings struct {
56
+
// description: A longer description of what the label means and why it might be applied.
57
+
Description string `json:"description" cborgen:"description"`
58
+
// lang: The code of the language these strings are written in.
59
+
Lang string `json:"lang" cborgen:"lang"`
60
+
// name: A short human-readable name for the label.
61
+
Name string `json:"name" cborgen:"name"`
62
+
}
63
+
64
+
// LabelDefs_SelfLabel is a "selfLabel" in the com.atproto.label.defs schema.
65
+
//
66
+
// Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.
67
+
type LabelDefs_SelfLabel struct {
68
+
// val: The short string name of the value or type of this label.
69
+
Val string `json:"val" cborgen:"val"`
70
+
}
71
+
72
+
// LabelDefs_SelfLabels is a "selfLabels" in the com.atproto.label.defs schema.
73
+
//
74
+
// Metadata tags on an atproto record, published by the author within the record.
75
+
type LabelDefs_SelfLabels struct {
76
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.label.defs#selfLabels"`
77
+
Values []*LabelDefs_SelfLabel `json:"values" cborgen:"values,preservenil"`
78
+
}
+42
api/atproto/labelqueryLabels.go
+42
api/atproto/labelqueryLabels.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.label.queryLabels
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// LabelQueryLabels_Output is the output of a com.atproto.label.queryLabels call.
14
+
type LabelQueryLabels_Output struct {
15
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
16
+
Labels []*LabelDefs_Label `json:"labels" cborgen:"labels"`
17
+
}
18
+
19
+
// LabelQueryLabels calls the XRPC method "com.atproto.label.queryLabels".
20
+
//
21
+
// sources: Optional list of label sources (DIDs) to filter on.
22
+
// uriPatterns: List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI.
23
+
func LabelQueryLabels(ctx context.Context, c lexutil.LexClient, cursor string, limit int64, sources []string, uriPatterns []string) (*LabelQueryLabels_Output, error) {
24
+
var out LabelQueryLabels_Output
25
+
26
+
params := map[string]interface{}{}
27
+
if cursor != "" {
28
+
params["cursor"] = cursor
29
+
}
30
+
if limit != 0 {
31
+
params["limit"] = limit
32
+
}
33
+
if len(sources) != 0 {
34
+
params["sources"] = sources
35
+
}
36
+
params["uriPatterns"] = uriPatterns
37
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.label.queryLabels", params, nil, &out); err != nil {
38
+
return nil, err
39
+
}
40
+
41
+
return &out, nil
42
+
}
+17
api/atproto/labelsubscribeLabels.go
+17
api/atproto/labelsubscribeLabels.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.label.subscribeLabels
4
+
5
+
package atproto
6
+
7
+
// LabelSubscribeLabels_Info is a "info" in the com.atproto.label.subscribeLabels schema.
8
+
type LabelSubscribeLabels_Info struct {
9
+
Message *string `json:"message,omitempty" cborgen:"message,omitempty"`
10
+
Name string `json:"name" cborgen:"name"`
11
+
}
12
+
13
+
// LabelSubscribeLabels_Labels is a "labels" in the com.atproto.label.subscribeLabels schema.
14
+
type LabelSubscribeLabels_Labels struct {
15
+
Labels []*LabelDefs_Label `json:"labels" cborgen:"labels"`
16
+
Seq int64 `json:"seq" cborgen:"seq"`
17
+
}
+123
api/atproto/moderationcreateReport.go
+123
api/atproto/moderationcreateReport.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.moderation.createReport
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
"encoding/json"
10
+
"fmt"
11
+
12
+
lexutil "github.com/bluesky-social/indigo/lex/util"
13
+
)
14
+
15
+
// ModerationCreateReport_Input is the input argument to a com.atproto.moderation.createReport call.
16
+
type ModerationCreateReport_Input struct {
17
+
ModTool *ModerationCreateReport_ModTool `json:"modTool,omitempty" cborgen:"modTool,omitempty"`
18
+
// reason: Additional context about the content and violation.
19
+
Reason *string `json:"reason,omitempty" cborgen:"reason,omitempty"`
20
+
// reasonType: Indicates the broad category of violation the report is for.
21
+
ReasonType *string `json:"reasonType" cborgen:"reasonType"`
22
+
Subject *ModerationCreateReport_Input_Subject `json:"subject" cborgen:"subject"`
23
+
}
24
+
25
+
type ModerationCreateReport_Input_Subject struct {
26
+
AdminDefs_RepoRef *AdminDefs_RepoRef
27
+
RepoStrongRef *RepoStrongRef
28
+
}
29
+
30
+
func (t *ModerationCreateReport_Input_Subject) MarshalJSON() ([]byte, error) {
31
+
if t.AdminDefs_RepoRef != nil {
32
+
t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef"
33
+
return json.Marshal(t.AdminDefs_RepoRef)
34
+
}
35
+
if t.RepoStrongRef != nil {
36
+
t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef"
37
+
return json.Marshal(t.RepoStrongRef)
38
+
}
39
+
return nil, fmt.Errorf("can not marshal empty union as JSON")
40
+
}
41
+
42
+
func (t *ModerationCreateReport_Input_Subject) UnmarshalJSON(b []byte) error {
43
+
typ, err := lexutil.TypeExtract(b)
44
+
if err != nil {
45
+
return err
46
+
}
47
+
48
+
switch typ {
49
+
case "com.atproto.admin.defs#repoRef":
50
+
t.AdminDefs_RepoRef = new(AdminDefs_RepoRef)
51
+
return json.Unmarshal(b, t.AdminDefs_RepoRef)
52
+
case "com.atproto.repo.strongRef":
53
+
t.RepoStrongRef = new(RepoStrongRef)
54
+
return json.Unmarshal(b, t.RepoStrongRef)
55
+
default:
56
+
return nil
57
+
}
58
+
}
59
+
60
+
// ModerationCreateReport_ModTool is a "modTool" in the com.atproto.moderation.createReport schema.
61
+
//
62
+
// Moderation tool information for tracing the source of the action
63
+
type ModerationCreateReport_ModTool struct {
64
+
// meta: Additional arbitrary metadata about the source
65
+
Meta *interface{} `json:"meta,omitempty" cborgen:"meta,omitempty"`
66
+
// name: Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome')
67
+
Name string `json:"name" cborgen:"name"`
68
+
}
69
+
70
+
// ModerationCreateReport_Output is the output of a com.atproto.moderation.createReport call.
71
+
type ModerationCreateReport_Output struct {
72
+
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
73
+
Id int64 `json:"id" cborgen:"id"`
74
+
Reason *string `json:"reason,omitempty" cborgen:"reason,omitempty"`
75
+
ReasonType *string `json:"reasonType" cborgen:"reasonType"`
76
+
ReportedBy string `json:"reportedBy" cborgen:"reportedBy"`
77
+
Subject *ModerationCreateReport_Output_Subject `json:"subject" cborgen:"subject"`
78
+
}
79
+
80
+
type ModerationCreateReport_Output_Subject struct {
81
+
AdminDefs_RepoRef *AdminDefs_RepoRef
82
+
RepoStrongRef *RepoStrongRef
83
+
}
84
+
85
+
func (t *ModerationCreateReport_Output_Subject) MarshalJSON() ([]byte, error) {
86
+
if t.AdminDefs_RepoRef != nil {
87
+
t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef"
88
+
return json.Marshal(t.AdminDefs_RepoRef)
89
+
}
90
+
if t.RepoStrongRef != nil {
91
+
t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef"
92
+
return json.Marshal(t.RepoStrongRef)
93
+
}
94
+
return nil, fmt.Errorf("can not marshal empty union as JSON")
95
+
}
96
+
97
+
func (t *ModerationCreateReport_Output_Subject) UnmarshalJSON(b []byte) error {
98
+
typ, err := lexutil.TypeExtract(b)
99
+
if err != nil {
100
+
return err
101
+
}
102
+
103
+
switch typ {
104
+
case "com.atproto.admin.defs#repoRef":
105
+
t.AdminDefs_RepoRef = new(AdminDefs_RepoRef)
106
+
return json.Unmarshal(b, t.AdminDefs_RepoRef)
107
+
case "com.atproto.repo.strongRef":
108
+
t.RepoStrongRef = new(RepoStrongRef)
109
+
return json.Unmarshal(b, t.RepoStrongRef)
110
+
default:
111
+
return nil
112
+
}
113
+
}
114
+
115
+
// ModerationCreateReport calls the XRPC method "com.atproto.moderation.createReport".
116
+
func ModerationCreateReport(ctx context.Context, c lexutil.LexClient, input *ModerationCreateReport_Input) (*ModerationCreateReport_Output, error) {
117
+
var out ModerationCreateReport_Output
118
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.moderation.createReport", nil, input, &out); err != nil {
119
+
return nil, err
120
+
}
121
+
122
+
return &out, nil
123
+
}
+5
api/atproto/moderationdefs.go
+5
api/atproto/moderationdefs.go
+177
api/atproto/repoapplyWrites.go
+177
api/atproto/repoapplyWrites.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.applyWrites
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
"encoding/json"
10
+
"fmt"
11
+
12
+
lexutil "github.com/bluesky-social/indigo/lex/util"
13
+
)
14
+
15
+
// RepoApplyWrites_Create is a "create" in the com.atproto.repo.applyWrites schema.
16
+
//
17
+
// Operation which creates a new record.
18
+
type RepoApplyWrites_Create struct {
19
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.repo.applyWrites#create"`
20
+
Collection string `json:"collection" cborgen:"collection"`
21
+
// rkey: NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility.
22
+
Rkey *string `json:"rkey,omitempty" cborgen:"rkey,omitempty"`
23
+
Value *lexutil.LexiconTypeDecoder `json:"value" cborgen:"value"`
24
+
}
25
+
26
+
// RepoApplyWrites_CreateResult is a "createResult" in the com.atproto.repo.applyWrites schema.
27
+
type RepoApplyWrites_CreateResult struct {
28
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.repo.applyWrites#createResult"`
29
+
Cid string `json:"cid" cborgen:"cid"`
30
+
Uri string `json:"uri" cborgen:"uri"`
31
+
ValidationStatus *string `json:"validationStatus,omitempty" cborgen:"validationStatus,omitempty"`
32
+
}
33
+
34
+
// RepoApplyWrites_Delete is a "delete" in the com.atproto.repo.applyWrites schema.
35
+
//
36
+
// Operation which deletes an existing record.
37
+
type RepoApplyWrites_Delete struct {
38
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.repo.applyWrites#delete"`
39
+
Collection string `json:"collection" cborgen:"collection"`
40
+
Rkey string `json:"rkey" cborgen:"rkey"`
41
+
}
42
+
43
+
// RepoApplyWrites_DeleteResult is a "deleteResult" in the com.atproto.repo.applyWrites schema.
44
+
type RepoApplyWrites_DeleteResult struct {
45
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.repo.applyWrites#deleteResult"`
46
+
}
47
+
48
+
// RepoApplyWrites_Input is the input argument to a com.atproto.repo.applyWrites call.
49
+
type RepoApplyWrites_Input struct {
50
+
// repo: The handle or DID of the repo (aka, current account).
51
+
Repo string `json:"repo" cborgen:"repo"`
52
+
// swapCommit: If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.
53
+
SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"`
54
+
// validate: Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons.
55
+
Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"`
56
+
Writes []*RepoApplyWrites_Input_Writes_Elem `json:"writes" cborgen:"writes"`
57
+
}
58
+
59
+
type RepoApplyWrites_Input_Writes_Elem struct {
60
+
RepoApplyWrites_Create *RepoApplyWrites_Create
61
+
RepoApplyWrites_Update *RepoApplyWrites_Update
62
+
RepoApplyWrites_Delete *RepoApplyWrites_Delete
63
+
}
64
+
65
+
func (t *RepoApplyWrites_Input_Writes_Elem) MarshalJSON() ([]byte, error) {
66
+
if t.RepoApplyWrites_Create != nil {
67
+
t.RepoApplyWrites_Create.LexiconTypeID = "com.atproto.repo.applyWrites#create"
68
+
return json.Marshal(t.RepoApplyWrites_Create)
69
+
}
70
+
if t.RepoApplyWrites_Update != nil {
71
+
t.RepoApplyWrites_Update.LexiconTypeID = "com.atproto.repo.applyWrites#update"
72
+
return json.Marshal(t.RepoApplyWrites_Update)
73
+
}
74
+
if t.RepoApplyWrites_Delete != nil {
75
+
t.RepoApplyWrites_Delete.LexiconTypeID = "com.atproto.repo.applyWrites#delete"
76
+
return json.Marshal(t.RepoApplyWrites_Delete)
77
+
}
78
+
return nil, fmt.Errorf("can not marshal empty union as JSON")
79
+
}
80
+
81
+
func (t *RepoApplyWrites_Input_Writes_Elem) UnmarshalJSON(b []byte) error {
82
+
typ, err := lexutil.TypeExtract(b)
83
+
if err != nil {
84
+
return err
85
+
}
86
+
87
+
switch typ {
88
+
case "com.atproto.repo.applyWrites#create":
89
+
t.RepoApplyWrites_Create = new(RepoApplyWrites_Create)
90
+
return json.Unmarshal(b, t.RepoApplyWrites_Create)
91
+
case "com.atproto.repo.applyWrites#update":
92
+
t.RepoApplyWrites_Update = new(RepoApplyWrites_Update)
93
+
return json.Unmarshal(b, t.RepoApplyWrites_Update)
94
+
case "com.atproto.repo.applyWrites#delete":
95
+
t.RepoApplyWrites_Delete = new(RepoApplyWrites_Delete)
96
+
return json.Unmarshal(b, t.RepoApplyWrites_Delete)
97
+
default:
98
+
return fmt.Errorf("closed unions must match a listed schema")
99
+
}
100
+
}
101
+
102
+
// RepoApplyWrites_Output is the output of a com.atproto.repo.applyWrites call.
103
+
type RepoApplyWrites_Output struct {
104
+
Commit *RepoDefs_CommitMeta `json:"commit,omitempty" cborgen:"commit,omitempty"`
105
+
Results []*RepoApplyWrites_Output_Results_Elem `json:"results,omitempty" cborgen:"results,omitempty"`
106
+
}
107
+
108
+
type RepoApplyWrites_Output_Results_Elem struct {
109
+
RepoApplyWrites_CreateResult *RepoApplyWrites_CreateResult
110
+
RepoApplyWrites_UpdateResult *RepoApplyWrites_UpdateResult
111
+
RepoApplyWrites_DeleteResult *RepoApplyWrites_DeleteResult
112
+
}
113
+
114
+
func (t *RepoApplyWrites_Output_Results_Elem) MarshalJSON() ([]byte, error) {
115
+
if t.RepoApplyWrites_CreateResult != nil {
116
+
t.RepoApplyWrites_CreateResult.LexiconTypeID = "com.atproto.repo.applyWrites#createResult"
117
+
return json.Marshal(t.RepoApplyWrites_CreateResult)
118
+
}
119
+
if t.RepoApplyWrites_UpdateResult != nil {
120
+
t.RepoApplyWrites_UpdateResult.LexiconTypeID = "com.atproto.repo.applyWrites#updateResult"
121
+
return json.Marshal(t.RepoApplyWrites_UpdateResult)
122
+
}
123
+
if t.RepoApplyWrites_DeleteResult != nil {
124
+
t.RepoApplyWrites_DeleteResult.LexiconTypeID = "com.atproto.repo.applyWrites#deleteResult"
125
+
return json.Marshal(t.RepoApplyWrites_DeleteResult)
126
+
}
127
+
return nil, fmt.Errorf("can not marshal empty union as JSON")
128
+
}
129
+
130
+
func (t *RepoApplyWrites_Output_Results_Elem) UnmarshalJSON(b []byte) error {
131
+
typ, err := lexutil.TypeExtract(b)
132
+
if err != nil {
133
+
return err
134
+
}
135
+
136
+
switch typ {
137
+
case "com.atproto.repo.applyWrites#createResult":
138
+
t.RepoApplyWrites_CreateResult = new(RepoApplyWrites_CreateResult)
139
+
return json.Unmarshal(b, t.RepoApplyWrites_CreateResult)
140
+
case "com.atproto.repo.applyWrites#updateResult":
141
+
t.RepoApplyWrites_UpdateResult = new(RepoApplyWrites_UpdateResult)
142
+
return json.Unmarshal(b, t.RepoApplyWrites_UpdateResult)
143
+
case "com.atproto.repo.applyWrites#deleteResult":
144
+
t.RepoApplyWrites_DeleteResult = new(RepoApplyWrites_DeleteResult)
145
+
return json.Unmarshal(b, t.RepoApplyWrites_DeleteResult)
146
+
default:
147
+
return fmt.Errorf("closed unions must match a listed schema")
148
+
}
149
+
}
150
+
151
+
// RepoApplyWrites_Update is a "update" in the com.atproto.repo.applyWrites schema.
152
+
//
153
+
// Operation which updates an existing record.
154
+
type RepoApplyWrites_Update struct {
155
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.repo.applyWrites#update"`
156
+
Collection string `json:"collection" cborgen:"collection"`
157
+
Rkey string `json:"rkey" cborgen:"rkey"`
158
+
Value *lexutil.LexiconTypeDecoder `json:"value" cborgen:"value"`
159
+
}
160
+
161
+
// RepoApplyWrites_UpdateResult is a "updateResult" in the com.atproto.repo.applyWrites schema.
162
+
type RepoApplyWrites_UpdateResult struct {
163
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.repo.applyWrites#updateResult"`
164
+
Cid string `json:"cid" cborgen:"cid"`
165
+
Uri string `json:"uri" cborgen:"uri"`
166
+
ValidationStatus *string `json:"validationStatus,omitempty" cborgen:"validationStatus,omitempty"`
167
+
}
168
+
169
+
// RepoApplyWrites calls the XRPC method "com.atproto.repo.applyWrites".
170
+
func RepoApplyWrites(ctx context.Context, c lexutil.LexClient, input *RepoApplyWrites_Input) (*RepoApplyWrites_Output, error) {
171
+
var out RepoApplyWrites_Output
172
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.repo.applyWrites", nil, input, &out); err != nil {
173
+
return nil, err
174
+
}
175
+
176
+
return &out, nil
177
+
}
+45
api/atproto/repocreateRecord.go
+45
api/atproto/repocreateRecord.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.createRecord
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// RepoCreateRecord_Input is the input argument to a com.atproto.repo.createRecord call.
14
+
type RepoCreateRecord_Input struct {
15
+
// collection: The NSID of the record collection.
16
+
Collection string `json:"collection" cborgen:"collection"`
17
+
// record: The record itself. Must contain a $type field.
18
+
Record *lexutil.LexiconTypeDecoder `json:"record" cborgen:"record"`
19
+
// repo: The handle or DID of the repo (aka, current account).
20
+
Repo string `json:"repo" cborgen:"repo"`
21
+
// rkey: The Record Key.
22
+
Rkey *string `json:"rkey,omitempty" cborgen:"rkey,omitempty"`
23
+
// swapCommit: Compare and swap with the previous commit by CID.
24
+
SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"`
25
+
// validate: Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons.
26
+
Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"`
27
+
}
28
+
29
+
// RepoCreateRecord_Output is the output of a com.atproto.repo.createRecord call.
30
+
type RepoCreateRecord_Output struct {
31
+
Cid string `json:"cid" cborgen:"cid"`
32
+
Commit *RepoDefs_CommitMeta `json:"commit,omitempty" cborgen:"commit,omitempty"`
33
+
Uri string `json:"uri" cborgen:"uri"`
34
+
ValidationStatus *string `json:"validationStatus,omitempty" cborgen:"validationStatus,omitempty"`
35
+
}
36
+
37
+
// RepoCreateRecord calls the XRPC method "com.atproto.repo.createRecord".
38
+
func RepoCreateRecord(ctx context.Context, c lexutil.LexClient, input *RepoCreateRecord_Input) (*RepoCreateRecord_Output, error) {
39
+
var out RepoCreateRecord_Output
40
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.repo.createRecord", nil, input, &out); err != nil {
41
+
return nil, err
42
+
}
43
+
44
+
return &out, nil
45
+
}
+11
api/atproto/repodefs.go
+11
api/atproto/repodefs.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.defs
4
+
5
+
package atproto
6
+
7
+
// RepoDefs_CommitMeta is a "commitMeta" in the com.atproto.repo.defs schema.
8
+
type RepoDefs_CommitMeta struct {
9
+
Cid string `json:"cid" cborgen:"cid"`
10
+
Rev string `json:"rev" cborgen:"rev"`
11
+
}
+40
api/atproto/repodeleteRecord.go
+40
api/atproto/repodeleteRecord.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.deleteRecord
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// RepoDeleteRecord_Input is the input argument to a com.atproto.repo.deleteRecord call.
14
+
type RepoDeleteRecord_Input struct {
15
+
// collection: The NSID of the record collection.
16
+
Collection string `json:"collection" cborgen:"collection"`
17
+
// repo: The handle or DID of the repo (aka, current account).
18
+
Repo string `json:"repo" cborgen:"repo"`
19
+
// rkey: The Record Key.
20
+
Rkey string `json:"rkey" cborgen:"rkey"`
21
+
// swapCommit: Compare and swap with the previous commit by CID.
22
+
SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"`
23
+
// swapRecord: Compare and swap with the previous record by CID.
24
+
SwapRecord *string `json:"swapRecord,omitempty" cborgen:"swapRecord,omitempty"`
25
+
}
26
+
27
+
// RepoDeleteRecord_Output is the output of a com.atproto.repo.deleteRecord call.
28
+
type RepoDeleteRecord_Output struct {
29
+
Commit *RepoDefs_CommitMeta `json:"commit,omitempty" cborgen:"commit,omitempty"`
30
+
}
31
+
32
+
// RepoDeleteRecord calls the XRPC method "com.atproto.repo.deleteRecord".
33
+
func RepoDeleteRecord(ctx context.Context, c lexutil.LexClient, input *RepoDeleteRecord_Input) (*RepoDeleteRecord_Output, error) {
34
+
var out RepoDeleteRecord_Output
35
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.repo.deleteRecord", nil, input, &out); err != nil {
36
+
return nil, err
37
+
}
38
+
39
+
return &out, nil
40
+
}
+38
api/atproto/repodescribeRepo.go
+38
api/atproto/repodescribeRepo.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.describeRepo
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// RepoDescribeRepo_Output is the output of a com.atproto.repo.describeRepo call.
14
+
type RepoDescribeRepo_Output struct {
15
+
// collections: List of all the collections (NSIDs) for which this repo contains at least one record.
16
+
Collections []string `json:"collections" cborgen:"collections"`
17
+
Did string `json:"did" cborgen:"did"`
18
+
// didDoc: The complete DID document for this account.
19
+
DidDoc interface{} `json:"didDoc" cborgen:"didDoc"`
20
+
Handle string `json:"handle" cborgen:"handle"`
21
+
// handleIsCorrect: Indicates if handle is currently valid (resolves bi-directionally)
22
+
HandleIsCorrect bool `json:"handleIsCorrect" cborgen:"handleIsCorrect"`
23
+
}
24
+
25
+
// RepoDescribeRepo calls the XRPC method "com.atproto.repo.describeRepo".
26
+
//
27
+
// repo: The handle or DID of the repo.
28
+
func RepoDescribeRepo(ctx context.Context, c lexutil.LexClient, repo string) (*RepoDescribeRepo_Output, error) {
29
+
var out RepoDescribeRepo_Output
30
+
31
+
params := map[string]interface{}{}
32
+
params["repo"] = repo
33
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.repo.describeRepo", params, nil, &out); err != nil {
34
+
return nil, err
35
+
}
36
+
37
+
return &out, nil
38
+
}
+41
api/atproto/repogetRecord.go
+41
api/atproto/repogetRecord.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.getRecord
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// RepoGetRecord_Output is the output of a com.atproto.repo.getRecord call.
14
+
type RepoGetRecord_Output struct {
15
+
Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"`
16
+
Uri string `json:"uri" cborgen:"uri"`
17
+
Value *lexutil.LexiconTypeDecoder `json:"value" cborgen:"value"`
18
+
}
19
+
20
+
// RepoGetRecord calls the XRPC method "com.atproto.repo.getRecord".
21
+
//
22
+
// cid: The CID of the version of the record. If not specified, then return the most recent version.
23
+
// collection: The NSID of the record collection.
24
+
// repo: The handle or DID of the repo.
25
+
// rkey: The Record Key.
26
+
func RepoGetRecord(ctx context.Context, c lexutil.LexClient, cid string, collection string, repo string, rkey string) (*RepoGetRecord_Output, error) {
27
+
var out RepoGetRecord_Output
28
+
29
+
params := map[string]interface{}{}
30
+
if cid != "" {
31
+
params["cid"] = cid
32
+
}
33
+
params["collection"] = collection
34
+
params["repo"] = repo
35
+
params["rkey"] = rkey
36
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.repo.getRecord", params, nil, &out); err != nil {
37
+
return nil, err
38
+
}
39
+
40
+
return &out, nil
41
+
}
+21
api/atproto/repoimportRepo.go
+21
api/atproto/repoimportRepo.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.importRepo
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
"io"
10
+
11
+
lexutil "github.com/bluesky-social/indigo/lex/util"
12
+
)
13
+
14
+
// RepoImportRepo calls the XRPC method "com.atproto.repo.importRepo".
15
+
func RepoImportRepo(ctx context.Context, c lexutil.LexClient, input io.Reader) error {
16
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/vnd.ipld.car", "com.atproto.repo.importRepo", nil, input, nil); err != nil {
17
+
return err
18
+
}
19
+
20
+
return nil
21
+
}
+41
api/atproto/repolistMissingBlobs.go
+41
api/atproto/repolistMissingBlobs.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.listMissingBlobs
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// RepoListMissingBlobs_Output is the output of a com.atproto.repo.listMissingBlobs call.
14
+
type RepoListMissingBlobs_Output struct {
15
+
Blobs []*RepoListMissingBlobs_RecordBlob `json:"blobs" cborgen:"blobs"`
16
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
17
+
}
18
+
19
+
// RepoListMissingBlobs_RecordBlob is a "recordBlob" in the com.atproto.repo.listMissingBlobs schema.
20
+
type RepoListMissingBlobs_RecordBlob struct {
21
+
Cid string `json:"cid" cborgen:"cid"`
22
+
RecordUri string `json:"recordUri" cborgen:"recordUri"`
23
+
}
24
+
25
+
// RepoListMissingBlobs calls the XRPC method "com.atproto.repo.listMissingBlobs".
26
+
func RepoListMissingBlobs(ctx context.Context, c lexutil.LexClient, cursor string, limit int64) (*RepoListMissingBlobs_Output, error) {
27
+
var out RepoListMissingBlobs_Output
28
+
29
+
params := map[string]interface{}{}
30
+
if cursor != "" {
31
+
params["cursor"] = cursor
32
+
}
33
+
if limit != 0 {
34
+
params["limit"] = limit
35
+
}
36
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.repo.listMissingBlobs", params, nil, &out); err != nil {
37
+
return nil, err
38
+
}
39
+
40
+
return &out, nil
41
+
}
+52
api/atproto/repolistRecords.go
+52
api/atproto/repolistRecords.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.listRecords
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// RepoListRecords_Output is the output of a com.atproto.repo.listRecords call.
14
+
type RepoListRecords_Output struct {
15
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
16
+
Records []*RepoListRecords_Record `json:"records" cborgen:"records"`
17
+
}
18
+
19
+
// RepoListRecords_Record is a "record" in the com.atproto.repo.listRecords schema.
20
+
type RepoListRecords_Record struct {
21
+
Cid string `json:"cid" cborgen:"cid"`
22
+
Uri string `json:"uri" cborgen:"uri"`
23
+
Value *lexutil.LexiconTypeDecoder `json:"value" cborgen:"value"`
24
+
}
25
+
26
+
// RepoListRecords calls the XRPC method "com.atproto.repo.listRecords".
27
+
//
28
+
// collection: The NSID of the record type.
29
+
// limit: The number of records to return.
30
+
// repo: The handle or DID of the repo.
31
+
// reverse: Flag to reverse the order of the returned records.
32
+
func RepoListRecords(ctx context.Context, c lexutil.LexClient, collection string, cursor string, limit int64, repo string, reverse bool) (*RepoListRecords_Output, error) {
33
+
var out RepoListRecords_Output
34
+
35
+
params := map[string]interface{}{}
36
+
params["collection"] = collection
37
+
if cursor != "" {
38
+
params["cursor"] = cursor
39
+
}
40
+
if limit != 0 {
41
+
params["limit"] = limit
42
+
}
43
+
params["repo"] = repo
44
+
if reverse {
45
+
params["reverse"] = reverse
46
+
}
47
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.repo.listRecords", params, nil, &out); err != nil {
48
+
return nil, err
49
+
}
50
+
51
+
return &out, nil
52
+
}
+47
api/atproto/repoputRecord.go
+47
api/atproto/repoputRecord.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.putRecord
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// RepoPutRecord_Input is the input argument to a com.atproto.repo.putRecord call.
14
+
type RepoPutRecord_Input struct {
15
+
// collection: The NSID of the record collection.
16
+
Collection string `json:"collection" cborgen:"collection"`
17
+
// record: The record to write.
18
+
Record *lexutil.LexiconTypeDecoder `json:"record" cborgen:"record"`
19
+
// repo: The handle or DID of the repo (aka, current account).
20
+
Repo string `json:"repo" cborgen:"repo"`
21
+
// rkey: The Record Key.
22
+
Rkey string `json:"rkey" cborgen:"rkey"`
23
+
// swapCommit: Compare and swap with the previous commit by CID.
24
+
SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"`
25
+
// swapRecord: Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation
26
+
SwapRecord *string `json:"swapRecord" cborgen:"swapRecord"`
27
+
// validate: Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons.
28
+
Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"`
29
+
}
30
+
31
+
// RepoPutRecord_Output is the output of a com.atproto.repo.putRecord call.
32
+
type RepoPutRecord_Output struct {
33
+
Cid string `json:"cid" cborgen:"cid"`
34
+
Commit *RepoDefs_CommitMeta `json:"commit,omitempty" cborgen:"commit,omitempty"`
35
+
Uri string `json:"uri" cborgen:"uri"`
36
+
ValidationStatus *string `json:"validationStatus,omitempty" cborgen:"validationStatus,omitempty"`
37
+
}
38
+
39
+
// RepoPutRecord calls the XRPC method "com.atproto.repo.putRecord".
40
+
func RepoPutRecord(ctx context.Context, c lexutil.LexClient, input *RepoPutRecord_Input) (*RepoPutRecord_Output, error) {
41
+
var out RepoPutRecord_Output
42
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.repo.putRecord", nil, input, &out); err != nil {
43
+
return nil, err
44
+
}
45
+
46
+
return &out, nil
47
+
}
+20
api/atproto/repostrongRef.go
+20
api/atproto/repostrongRef.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.strongRef
4
+
5
+
package atproto
6
+
7
+
import (
8
+
lexutil "github.com/bluesky-social/indigo/lex/util"
9
+
)
10
+
11
+
func init() {
12
+
lexutil.RegisterType("com.atproto.repo.strongRef#main", &RepoStrongRef{})
13
+
}
14
+
15
+
// RepoStrongRef is a "main" in the com.atproto.repo.strongRef schema.
16
+
type RepoStrongRef struct {
17
+
LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=com.atproto.repo.strongRef,omitempty"`
18
+
Cid string `json:"cid" cborgen:"cid"`
19
+
Uri string `json:"uri" cborgen:"uri"`
20
+
}
+27
api/atproto/repouploadBlob.go
+27
api/atproto/repouploadBlob.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.repo.uploadBlob
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
"io"
10
+
11
+
lexutil "github.com/bluesky-social/indigo/lex/util"
12
+
)
13
+
14
+
// RepoUploadBlob_Output is the output of a com.atproto.repo.uploadBlob call.
15
+
type RepoUploadBlob_Output struct {
16
+
Blob *lexutil.LexBlob `json:"blob" cborgen:"blob"`
17
+
}
18
+
19
+
// RepoUploadBlob calls the XRPC method "com.atproto.repo.uploadBlob".
20
+
func RepoUploadBlob(ctx context.Context, c lexutil.LexClient, input io.Reader) (*RepoUploadBlob_Output, error) {
21
+
var out RepoUploadBlob_Output
22
+
if err := c.LexDo(ctx, lexutil.Procedure, "*/*", "com.atproto.repo.uploadBlob", nil, input, &out); err != nil {
23
+
return nil, err
24
+
}
25
+
26
+
return &out, nil
27
+
}
+20
api/atproto/serveractivateAccount.go
+20
api/atproto/serveractivateAccount.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.activateAccount
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerActivateAccount calls the XRPC method "com.atproto.server.activateAccount".
14
+
func ServerActivateAccount(ctx context.Context, c lexutil.LexClient) error {
15
+
if err := c.LexDo(ctx, lexutil.Procedure, "", "com.atproto.server.activateAccount", nil, nil, nil); err != nil {
16
+
return err
17
+
}
18
+
19
+
return nil
20
+
}
+34
api/atproto/servercheckAccountStatus.go
+34
api/atproto/servercheckAccountStatus.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.checkAccountStatus
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerCheckAccountStatus_Output is the output of a com.atproto.server.checkAccountStatus call.
14
+
type ServerCheckAccountStatus_Output struct {
15
+
Activated bool `json:"activated" cborgen:"activated"`
16
+
ExpectedBlobs int64 `json:"expectedBlobs" cborgen:"expectedBlobs"`
17
+
ImportedBlobs int64 `json:"importedBlobs" cborgen:"importedBlobs"`
18
+
IndexedRecords int64 `json:"indexedRecords" cborgen:"indexedRecords"`
19
+
PrivateStateValues int64 `json:"privateStateValues" cborgen:"privateStateValues"`
20
+
RepoBlocks int64 `json:"repoBlocks" cborgen:"repoBlocks"`
21
+
RepoCommit string `json:"repoCommit" cborgen:"repoCommit"`
22
+
RepoRev string `json:"repoRev" cborgen:"repoRev"`
23
+
ValidDid bool `json:"validDid" cborgen:"validDid"`
24
+
}
25
+
26
+
// ServerCheckAccountStatus calls the XRPC method "com.atproto.server.checkAccountStatus".
27
+
func ServerCheckAccountStatus(ctx context.Context, c lexutil.LexClient) (*ServerCheckAccountStatus_Output, error) {
28
+
var out ServerCheckAccountStatus_Output
29
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.server.checkAccountStatus", nil, nil, &out); err != nil {
30
+
return nil, err
31
+
}
32
+
33
+
return &out, nil
34
+
}
+26
api/atproto/serverconfirmEmail.go
+26
api/atproto/serverconfirmEmail.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.confirmEmail
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerConfirmEmail_Input is the input argument to a com.atproto.server.confirmEmail call.
14
+
type ServerConfirmEmail_Input struct {
15
+
Email string `json:"email" cborgen:"email"`
16
+
Token string `json:"token" cborgen:"token"`
17
+
}
18
+
19
+
// ServerConfirmEmail calls the XRPC method "com.atproto.server.confirmEmail".
20
+
func ServerConfirmEmail(ctx context.Context, c lexutil.LexClient, input *ServerConfirmEmail_Input) error {
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.confirmEmail", nil, input, nil); err != nil {
22
+
return err
23
+
}
24
+
25
+
return nil
26
+
}
+52
api/atproto/servercreateAccount.go
+52
api/atproto/servercreateAccount.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.createAccount
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerCreateAccount_Input is the input argument to a com.atproto.server.createAccount call.
14
+
type ServerCreateAccount_Input struct {
15
+
// did: Pre-existing atproto DID, being imported to a new account.
16
+
Did *string `json:"did,omitempty" cborgen:"did,omitempty"`
17
+
Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
18
+
// handle: Requested handle for the account.
19
+
Handle string `json:"handle" cborgen:"handle"`
20
+
InviteCode *string `json:"inviteCode,omitempty" cborgen:"inviteCode,omitempty"`
21
+
// password: Initial account password. May need to meet instance-specific password strength requirements.
22
+
Password *string `json:"password,omitempty" cborgen:"password,omitempty"`
23
+
// plcOp: A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented.
24
+
PlcOp *interface{} `json:"plcOp,omitempty" cborgen:"plcOp,omitempty"`
25
+
// recoveryKey: DID PLC rotation key (aka, recovery key) to be included in PLC creation operation.
26
+
RecoveryKey *string `json:"recoveryKey,omitempty" cborgen:"recoveryKey,omitempty"`
27
+
VerificationCode *string `json:"verificationCode,omitempty" cborgen:"verificationCode,omitempty"`
28
+
VerificationPhone *string `json:"verificationPhone,omitempty" cborgen:"verificationPhone,omitempty"`
29
+
}
30
+
31
+
// ServerCreateAccount_Output is the output of a com.atproto.server.createAccount call.
32
+
//
33
+
// Account login session returned on successful account creation.
34
+
type ServerCreateAccount_Output struct {
35
+
AccessJwt string `json:"accessJwt" cborgen:"accessJwt"`
36
+
// did: The DID of the new account.
37
+
Did string `json:"did" cborgen:"did"`
38
+
// didDoc: Complete DID document.
39
+
DidDoc *interface{} `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"`
40
+
Handle string `json:"handle" cborgen:"handle"`
41
+
RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"`
42
+
}
43
+
44
+
// ServerCreateAccount calls the XRPC method "com.atproto.server.createAccount".
45
+
func ServerCreateAccount(ctx context.Context, c lexutil.LexClient, input *ServerCreateAccount_Input) (*ServerCreateAccount_Output, error) {
46
+
var out ServerCreateAccount_Output
47
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.createAccount", nil, input, &out); err != nil {
48
+
return nil, err
49
+
}
50
+
51
+
return &out, nil
52
+
}
+37
api/atproto/servercreateAppPassword.go
+37
api/atproto/servercreateAppPassword.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.createAppPassword
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerCreateAppPassword_AppPassword is a "appPassword" in the com.atproto.server.createAppPassword schema.
14
+
type ServerCreateAppPassword_AppPassword struct {
15
+
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
16
+
Name string `json:"name" cborgen:"name"`
17
+
Password string `json:"password" cborgen:"password"`
18
+
Privileged *bool `json:"privileged,omitempty" cborgen:"privileged,omitempty"`
19
+
}
20
+
21
+
// ServerCreateAppPassword_Input is the input argument to a com.atproto.server.createAppPassword call.
22
+
type ServerCreateAppPassword_Input struct {
23
+
// name: A short name for the App Password, to help distinguish them.
24
+
Name string `json:"name" cborgen:"name"`
25
+
// privileged: If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients.
26
+
Privileged *bool `json:"privileged,omitempty" cborgen:"privileged,omitempty"`
27
+
}
28
+
29
+
// ServerCreateAppPassword calls the XRPC method "com.atproto.server.createAppPassword".
30
+
func ServerCreateAppPassword(ctx context.Context, c lexutil.LexClient, input *ServerCreateAppPassword_Input) (*ServerCreateAppPassword_AppPassword, error) {
31
+
var out ServerCreateAppPassword_AppPassword
32
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.createAppPassword", nil, input, &out); err != nil {
33
+
return nil, err
34
+
}
35
+
36
+
return &out, nil
37
+
}
+32
api/atproto/servercreateInviteCode.go
+32
api/atproto/servercreateInviteCode.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.createInviteCode
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerCreateInviteCode_Input is the input argument to a com.atproto.server.createInviteCode call.
14
+
type ServerCreateInviteCode_Input struct {
15
+
ForAccount *string `json:"forAccount,omitempty" cborgen:"forAccount,omitempty"`
16
+
UseCount int64 `json:"useCount" cborgen:"useCount"`
17
+
}
18
+
19
+
// ServerCreateInviteCode_Output is the output of a com.atproto.server.createInviteCode call.
20
+
type ServerCreateInviteCode_Output struct {
21
+
Code string `json:"code" cborgen:"code"`
22
+
}
23
+
24
+
// ServerCreateInviteCode calls the XRPC method "com.atproto.server.createInviteCode".
25
+
func ServerCreateInviteCode(ctx context.Context, c lexutil.LexClient, input *ServerCreateInviteCode_Input) (*ServerCreateInviteCode_Output, error) {
26
+
var out ServerCreateInviteCode_Output
27
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.createInviteCode", nil, input, &out); err != nil {
28
+
return nil, err
29
+
}
30
+
31
+
return &out, nil
32
+
}
+39
api/atproto/servercreateInviteCodes.go
+39
api/atproto/servercreateInviteCodes.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.createInviteCodes
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerCreateInviteCodes_AccountCodes is a "accountCodes" in the com.atproto.server.createInviteCodes schema.
14
+
type ServerCreateInviteCodes_AccountCodes struct {
15
+
Account string `json:"account" cborgen:"account"`
16
+
Codes []string `json:"codes" cborgen:"codes"`
17
+
}
18
+
19
+
// ServerCreateInviteCodes_Input is the input argument to a com.atproto.server.createInviteCodes call.
20
+
type ServerCreateInviteCodes_Input struct {
21
+
CodeCount int64 `json:"codeCount" cborgen:"codeCount"`
22
+
ForAccounts []string `json:"forAccounts,omitempty" cborgen:"forAccounts,omitempty"`
23
+
UseCount int64 `json:"useCount" cborgen:"useCount"`
24
+
}
25
+
26
+
// ServerCreateInviteCodes_Output is the output of a com.atproto.server.createInviteCodes call.
27
+
type ServerCreateInviteCodes_Output struct {
28
+
Codes []*ServerCreateInviteCodes_AccountCodes `json:"codes" cborgen:"codes"`
29
+
}
30
+
31
+
// ServerCreateInviteCodes calls the XRPC method "com.atproto.server.createInviteCodes".
32
+
func ServerCreateInviteCodes(ctx context.Context, c lexutil.LexClient, input *ServerCreateInviteCodes_Input) (*ServerCreateInviteCodes_Output, error) {
33
+
var out ServerCreateInviteCodes_Output
34
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.createInviteCodes", nil, input, &out); err != nil {
35
+
return nil, err
36
+
}
37
+
38
+
return &out, nil
39
+
}
+46
api/atproto/servercreateSession.go
+46
api/atproto/servercreateSession.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.createSession
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerCreateSession_Input is the input argument to a com.atproto.server.createSession call.
14
+
type ServerCreateSession_Input struct {
15
+
// allowTakendown: When true, instead of throwing error for takendown accounts, a valid response with a narrow scoped token will be returned
16
+
AllowTakendown *bool `json:"allowTakendown,omitempty" cborgen:"allowTakendown,omitempty"`
17
+
AuthFactorToken *string `json:"authFactorToken,omitempty" cborgen:"authFactorToken,omitempty"`
18
+
// identifier: Handle or other identifier supported by the server for the authenticating user.
19
+
Identifier string `json:"identifier" cborgen:"identifier"`
20
+
Password string `json:"password" cborgen:"password"`
21
+
}
22
+
23
+
// ServerCreateSession_Output is the output of a com.atproto.server.createSession call.
24
+
type ServerCreateSession_Output struct {
25
+
AccessJwt string `json:"accessJwt" cborgen:"accessJwt"`
26
+
Active *bool `json:"active,omitempty" cborgen:"active,omitempty"`
27
+
Did string `json:"did" cborgen:"did"`
28
+
DidDoc *interface{} `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"`
29
+
Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
30
+
EmailAuthFactor *bool `json:"emailAuthFactor,omitempty" cborgen:"emailAuthFactor,omitempty"`
31
+
EmailConfirmed *bool `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"`
32
+
Handle string `json:"handle" cborgen:"handle"`
33
+
RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"`
34
+
// status: If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.
35
+
Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
36
+
}
37
+
38
+
// ServerCreateSession calls the XRPC method "com.atproto.server.createSession".
39
+
func ServerCreateSession(ctx context.Context, c lexutil.LexClient, input *ServerCreateSession_Input) (*ServerCreateSession_Output, error) {
40
+
var out ServerCreateSession_Output
41
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.createSession", nil, input, &out); err != nil {
42
+
return nil, err
43
+
}
44
+
45
+
return &out, nil
46
+
}
+26
api/atproto/serverdeactivateAccount.go
+26
api/atproto/serverdeactivateAccount.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.deactivateAccount
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerDeactivateAccount_Input is the input argument to a com.atproto.server.deactivateAccount call.
14
+
type ServerDeactivateAccount_Input struct {
15
+
// deleteAfter: A recommendation to server as to how long they should hold onto the deactivated account before deleting.
16
+
DeleteAfter *string `json:"deleteAfter,omitempty" cborgen:"deleteAfter,omitempty"`
17
+
}
18
+
19
+
// ServerDeactivateAccount calls the XRPC method "com.atproto.server.deactivateAccount".
20
+
func ServerDeactivateAccount(ctx context.Context, c lexutil.LexClient, input *ServerDeactivateAccount_Input) error {
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.deactivateAccount", nil, input, nil); err != nil {
22
+
return err
23
+
}
24
+
25
+
return nil
26
+
}
+22
api/atproto/serverdefs.go
+22
api/atproto/serverdefs.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.defs
4
+
5
+
package atproto
6
+
7
+
// ServerDefs_InviteCode is a "inviteCode" in the com.atproto.server.defs schema.
8
+
type ServerDefs_InviteCode struct {
9
+
Available int64 `json:"available" cborgen:"available"`
10
+
Code string `json:"code" cborgen:"code"`
11
+
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
12
+
CreatedBy string `json:"createdBy" cborgen:"createdBy"`
13
+
Disabled bool `json:"disabled" cborgen:"disabled"`
14
+
ForAccount string `json:"forAccount" cborgen:"forAccount"`
15
+
Uses []*ServerDefs_InviteCodeUse `json:"uses" cborgen:"uses"`
16
+
}
17
+
18
+
// ServerDefs_InviteCodeUse is a "inviteCodeUse" in the com.atproto.server.defs schema.
19
+
type ServerDefs_InviteCodeUse struct {
20
+
UsedAt string `json:"usedAt" cborgen:"usedAt"`
21
+
UsedBy string `json:"usedBy" cborgen:"usedBy"`
22
+
}
+27
api/atproto/serverdeleteAccount.go
+27
api/atproto/serverdeleteAccount.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.deleteAccount
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerDeleteAccount_Input is the input argument to a com.atproto.server.deleteAccount call.
14
+
type ServerDeleteAccount_Input struct {
15
+
Did string `json:"did" cborgen:"did"`
16
+
Password string `json:"password" cborgen:"password"`
17
+
Token string `json:"token" cborgen:"token"`
18
+
}
19
+
20
+
// ServerDeleteAccount calls the XRPC method "com.atproto.server.deleteAccount".
21
+
func ServerDeleteAccount(ctx context.Context, c lexutil.LexClient, input *ServerDeleteAccount_Input) error {
22
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.deleteAccount", nil, input, nil); err != nil {
23
+
return err
24
+
}
25
+
26
+
return nil
27
+
}
+20
api/atproto/serverdeleteSession.go
+20
api/atproto/serverdeleteSession.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.deleteSession
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerDeleteSession calls the XRPC method "com.atproto.server.deleteSession".
14
+
func ServerDeleteSession(ctx context.Context, c lexutil.LexClient) error {
15
+
if err := c.LexDo(ctx, lexutil.Procedure, "", "com.atproto.server.deleteSession", nil, nil, nil); err != nil {
16
+
return err
17
+
}
18
+
19
+
return nil
20
+
}
+47
api/atproto/serverdescribeServer.go
+47
api/atproto/serverdescribeServer.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.describeServer
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerDescribeServer_Contact is a "contact" in the com.atproto.server.describeServer schema.
14
+
type ServerDescribeServer_Contact struct {
15
+
Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
16
+
}
17
+
18
+
// ServerDescribeServer_Links is a "links" in the com.atproto.server.describeServer schema.
19
+
type ServerDescribeServer_Links struct {
20
+
PrivacyPolicy *string `json:"privacyPolicy,omitempty" cborgen:"privacyPolicy,omitempty"`
21
+
TermsOfService *string `json:"termsOfService,omitempty" cborgen:"termsOfService,omitempty"`
22
+
}
23
+
24
+
// ServerDescribeServer_Output is the output of a com.atproto.server.describeServer call.
25
+
type ServerDescribeServer_Output struct {
26
+
// availableUserDomains: List of domain suffixes that can be used in account handles.
27
+
AvailableUserDomains []string `json:"availableUserDomains" cborgen:"availableUserDomains"`
28
+
// contact: Contact information
29
+
Contact *ServerDescribeServer_Contact `json:"contact,omitempty" cborgen:"contact,omitempty"`
30
+
Did string `json:"did" cborgen:"did"`
31
+
// inviteCodeRequired: If true, an invite code must be supplied to create an account on this instance.
32
+
InviteCodeRequired *bool `json:"inviteCodeRequired,omitempty" cborgen:"inviteCodeRequired,omitempty"`
33
+
// links: URLs of service policy documents.
34
+
Links *ServerDescribeServer_Links `json:"links,omitempty" cborgen:"links,omitempty"`
35
+
// phoneVerificationRequired: If true, a phone verification token must be supplied to create an account on this instance.
36
+
PhoneVerificationRequired *bool `json:"phoneVerificationRequired,omitempty" cborgen:"phoneVerificationRequired,omitempty"`
37
+
}
38
+
39
+
// ServerDescribeServer calls the XRPC method "com.atproto.server.describeServer".
40
+
func ServerDescribeServer(ctx context.Context, c lexutil.LexClient) (*ServerDescribeServer_Output, error) {
41
+
var out ServerDescribeServer_Output
42
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.server.describeServer", nil, nil, &out); err != nil {
43
+
return nil, err
44
+
}
45
+
46
+
return &out, nil
47
+
}
+36
api/atproto/servergetAccountInviteCodes.go
+36
api/atproto/servergetAccountInviteCodes.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.getAccountInviteCodes
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerGetAccountInviteCodes_Output is the output of a com.atproto.server.getAccountInviteCodes call.
14
+
type ServerGetAccountInviteCodes_Output struct {
15
+
Codes []*ServerDefs_InviteCode `json:"codes" cborgen:"codes"`
16
+
}
17
+
18
+
// ServerGetAccountInviteCodes calls the XRPC method "com.atproto.server.getAccountInviteCodes".
19
+
//
20
+
// createAvailable: Controls whether any new 'earned' but not 'created' invites should be created.
21
+
func ServerGetAccountInviteCodes(ctx context.Context, c lexutil.LexClient, createAvailable bool, includeUsed bool) (*ServerGetAccountInviteCodes_Output, error) {
22
+
var out ServerGetAccountInviteCodes_Output
23
+
24
+
params := map[string]interface{}{}
25
+
if createAvailable {
26
+
params["createAvailable"] = createAvailable
27
+
}
28
+
if includeUsed {
29
+
params["includeUsed"] = includeUsed
30
+
}
31
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.server.getAccountInviteCodes", params, nil, &out); err != nil {
32
+
return nil, err
33
+
}
34
+
35
+
return &out, nil
36
+
}
+39
api/atproto/servergetServiceAuth.go
+39
api/atproto/servergetServiceAuth.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.getServiceAuth
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerGetServiceAuth_Output is the output of a com.atproto.server.getServiceAuth call.
14
+
type ServerGetServiceAuth_Output struct {
15
+
Token string `json:"token" cborgen:"token"`
16
+
}
17
+
18
+
// ServerGetServiceAuth calls the XRPC method "com.atproto.server.getServiceAuth".
19
+
//
20
+
// aud: The DID of the service that the token will be used to authenticate with
21
+
// exp: The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope.
22
+
// lxm: Lexicon (XRPC) method to bind the requested token to
23
+
func ServerGetServiceAuth(ctx context.Context, c lexutil.LexClient, aud string, exp int64, lxm string) (*ServerGetServiceAuth_Output, error) {
24
+
var out ServerGetServiceAuth_Output
25
+
26
+
params := map[string]interface{}{}
27
+
params["aud"] = aud
28
+
if exp != 0 {
29
+
params["exp"] = exp
30
+
}
31
+
if lxm != "" {
32
+
params["lxm"] = lxm
33
+
}
34
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.server.getServiceAuth", params, nil, &out); err != nil {
35
+
return nil, err
36
+
}
37
+
38
+
return &out, nil
39
+
}
+34
api/atproto/servergetSession.go
+34
api/atproto/servergetSession.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.getSession
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerGetSession_Output is the output of a com.atproto.server.getSession call.
14
+
type ServerGetSession_Output struct {
15
+
Active *bool `json:"active,omitempty" cborgen:"active,omitempty"`
16
+
Did string `json:"did" cborgen:"did"`
17
+
DidDoc *interface{} `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"`
18
+
Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
19
+
EmailAuthFactor *bool `json:"emailAuthFactor,omitempty" cborgen:"emailAuthFactor,omitempty"`
20
+
EmailConfirmed *bool `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"`
21
+
Handle string `json:"handle" cborgen:"handle"`
22
+
// status: If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.
23
+
Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
24
+
}
25
+
26
+
// ServerGetSession calls the XRPC method "com.atproto.server.getSession".
27
+
func ServerGetSession(ctx context.Context, c lexutil.LexClient) (*ServerGetSession_Output, error) {
28
+
var out ServerGetSession_Output
29
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.server.getSession", nil, nil, &out); err != nil {
30
+
return nil, err
31
+
}
32
+
33
+
return &out, nil
34
+
}
+33
api/atproto/serverlistAppPasswords.go
+33
api/atproto/serverlistAppPasswords.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.listAppPasswords
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerListAppPasswords_AppPassword is a "appPassword" in the com.atproto.server.listAppPasswords schema.
14
+
type ServerListAppPasswords_AppPassword struct {
15
+
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
16
+
Name string `json:"name" cborgen:"name"`
17
+
Privileged *bool `json:"privileged,omitempty" cborgen:"privileged,omitempty"`
18
+
}
19
+
20
+
// ServerListAppPasswords_Output is the output of a com.atproto.server.listAppPasswords call.
21
+
type ServerListAppPasswords_Output struct {
22
+
Passwords []*ServerListAppPasswords_AppPassword `json:"passwords" cborgen:"passwords"`
23
+
}
24
+
25
+
// ServerListAppPasswords calls the XRPC method "com.atproto.server.listAppPasswords".
26
+
func ServerListAppPasswords(ctx context.Context, c lexutil.LexClient) (*ServerListAppPasswords_Output, error) {
27
+
var out ServerListAppPasswords_Output
28
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.server.listAppPasswords", nil, nil, &out); err != nil {
29
+
return nil, err
30
+
}
31
+
32
+
return &out, nil
33
+
}
+33
api/atproto/serverrefreshSession.go
+33
api/atproto/serverrefreshSession.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.refreshSession
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerRefreshSession_Output is the output of a com.atproto.server.refreshSession call.
14
+
type ServerRefreshSession_Output struct {
15
+
AccessJwt string `json:"accessJwt" cborgen:"accessJwt"`
16
+
Active *bool `json:"active,omitempty" cborgen:"active,omitempty"`
17
+
Did string `json:"did" cborgen:"did"`
18
+
DidDoc *interface{} `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"`
19
+
Handle string `json:"handle" cborgen:"handle"`
20
+
RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"`
21
+
// status: Hosting status of the account. If not specified, then assume 'active'.
22
+
Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
23
+
}
24
+
25
+
// ServerRefreshSession calls the XRPC method "com.atproto.server.refreshSession".
26
+
func ServerRefreshSession(ctx context.Context, c lexutil.LexClient) (*ServerRefreshSession_Output, error) {
27
+
var out ServerRefreshSession_Output
28
+
if err := c.LexDo(ctx, lexutil.Procedure, "", "com.atproto.server.refreshSession", nil, nil, &out); err != nil {
29
+
return nil, err
30
+
}
31
+
32
+
return &out, nil
33
+
}
+20
api/atproto/serverrequestAccountDelete.go
+20
api/atproto/serverrequestAccountDelete.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.requestAccountDelete
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerRequestAccountDelete calls the XRPC method "com.atproto.server.requestAccountDelete".
14
+
func ServerRequestAccountDelete(ctx context.Context, c lexutil.LexClient) error {
15
+
if err := c.LexDo(ctx, lexutil.Procedure, "", "com.atproto.server.requestAccountDelete", nil, nil, nil); err != nil {
16
+
return err
17
+
}
18
+
19
+
return nil
20
+
}
+20
api/atproto/serverrequestEmailConfirmation.go
+20
api/atproto/serverrequestEmailConfirmation.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.requestEmailConfirmation
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerRequestEmailConfirmation calls the XRPC method "com.atproto.server.requestEmailConfirmation".
14
+
func ServerRequestEmailConfirmation(ctx context.Context, c lexutil.LexClient) error {
15
+
if err := c.LexDo(ctx, lexutil.Procedure, "", "com.atproto.server.requestEmailConfirmation", nil, nil, nil); err != nil {
16
+
return err
17
+
}
18
+
19
+
return nil
20
+
}
+26
api/atproto/serverrequestEmailUpdate.go
+26
api/atproto/serverrequestEmailUpdate.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.requestEmailUpdate
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerRequestEmailUpdate_Output is the output of a com.atproto.server.requestEmailUpdate call.
14
+
type ServerRequestEmailUpdate_Output struct {
15
+
TokenRequired bool `json:"tokenRequired" cborgen:"tokenRequired"`
16
+
}
17
+
18
+
// ServerRequestEmailUpdate calls the XRPC method "com.atproto.server.requestEmailUpdate".
19
+
func ServerRequestEmailUpdate(ctx context.Context, c lexutil.LexClient) (*ServerRequestEmailUpdate_Output, error) {
20
+
var out ServerRequestEmailUpdate_Output
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "", "com.atproto.server.requestEmailUpdate", nil, nil, &out); err != nil {
22
+
return nil, err
23
+
}
24
+
25
+
return &out, nil
26
+
}
+25
api/atproto/serverrequestPasswordReset.go
+25
api/atproto/serverrequestPasswordReset.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.requestPasswordReset
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerRequestPasswordReset_Input is the input argument to a com.atproto.server.requestPasswordReset call.
14
+
type ServerRequestPasswordReset_Input struct {
15
+
Email string `json:"email" cborgen:"email"`
16
+
}
17
+
18
+
// ServerRequestPasswordReset calls the XRPC method "com.atproto.server.requestPasswordReset".
19
+
func ServerRequestPasswordReset(ctx context.Context, c lexutil.LexClient, input *ServerRequestPasswordReset_Input) error {
20
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.requestPasswordReset", nil, input, nil); err != nil {
21
+
return err
22
+
}
23
+
24
+
return nil
25
+
}
+33
api/atproto/serverreserveSigningKey.go
+33
api/atproto/serverreserveSigningKey.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.reserveSigningKey
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerReserveSigningKey_Input is the input argument to a com.atproto.server.reserveSigningKey call.
14
+
type ServerReserveSigningKey_Input struct {
15
+
// did: The DID to reserve a key for.
16
+
Did *string `json:"did,omitempty" cborgen:"did,omitempty"`
17
+
}
18
+
19
+
// ServerReserveSigningKey_Output is the output of a com.atproto.server.reserveSigningKey call.
20
+
type ServerReserveSigningKey_Output struct {
21
+
// signingKey: The public key for the reserved signing key, in did:key serialization.
22
+
SigningKey string `json:"signingKey" cborgen:"signingKey"`
23
+
}
24
+
25
+
// ServerReserveSigningKey calls the XRPC method "com.atproto.server.reserveSigningKey".
26
+
func ServerReserveSigningKey(ctx context.Context, c lexutil.LexClient, input *ServerReserveSigningKey_Input) (*ServerReserveSigningKey_Output, error) {
27
+
var out ServerReserveSigningKey_Output
28
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.reserveSigningKey", nil, input, &out); err != nil {
29
+
return nil, err
30
+
}
31
+
32
+
return &out, nil
33
+
}
+26
api/atproto/serverresetPassword.go
+26
api/atproto/serverresetPassword.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.resetPassword
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerResetPassword_Input is the input argument to a com.atproto.server.resetPassword call.
14
+
type ServerResetPassword_Input struct {
15
+
Password string `json:"password" cborgen:"password"`
16
+
Token string `json:"token" cborgen:"token"`
17
+
}
18
+
19
+
// ServerResetPassword calls the XRPC method "com.atproto.server.resetPassword".
20
+
func ServerResetPassword(ctx context.Context, c lexutil.LexClient, input *ServerResetPassword_Input) error {
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.resetPassword", nil, input, nil); err != nil {
22
+
return err
23
+
}
24
+
25
+
return nil
26
+
}
+25
api/atproto/serverrevokeAppPassword.go
+25
api/atproto/serverrevokeAppPassword.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.revokeAppPassword
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerRevokeAppPassword_Input is the input argument to a com.atproto.server.revokeAppPassword call.
14
+
type ServerRevokeAppPassword_Input struct {
15
+
Name string `json:"name" cborgen:"name"`
16
+
}
17
+
18
+
// ServerRevokeAppPassword calls the XRPC method "com.atproto.server.revokeAppPassword".
19
+
func ServerRevokeAppPassword(ctx context.Context, c lexutil.LexClient, input *ServerRevokeAppPassword_Input) error {
20
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.revokeAppPassword", nil, input, nil); err != nil {
21
+
return err
22
+
}
23
+
24
+
return nil
25
+
}
+28
api/atproto/serverupdateEmail.go
+28
api/atproto/serverupdateEmail.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.server.updateEmail
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// ServerUpdateEmail_Input is the input argument to a com.atproto.server.updateEmail call.
14
+
type ServerUpdateEmail_Input struct {
15
+
Email string `json:"email" cborgen:"email"`
16
+
EmailAuthFactor *bool `json:"emailAuthFactor,omitempty" cborgen:"emailAuthFactor,omitempty"`
17
+
// token: Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed.
18
+
Token *string `json:"token,omitempty" cborgen:"token,omitempty"`
19
+
}
20
+
21
+
// ServerUpdateEmail calls the XRPC method "com.atproto.server.updateEmail".
22
+
func ServerUpdateEmail(ctx context.Context, c lexutil.LexClient, input *ServerUpdateEmail_Input) error {
23
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.server.updateEmail", nil, input, nil); err != nil {
24
+
return err
25
+
}
26
+
27
+
return nil
28
+
}
+5
api/atproto/syncdefs.go
+5
api/atproto/syncdefs.go
+29
api/atproto/syncgetBlob.go
+29
api/atproto/syncgetBlob.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.getBlob
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"bytes"
9
+
"context"
10
+
11
+
lexutil "github.com/bluesky-social/indigo/lex/util"
12
+
)
13
+
14
+
// SyncGetBlob calls the XRPC method "com.atproto.sync.getBlob".
15
+
//
16
+
// cid: The CID of the blob to fetch
17
+
// did: The DID of the account.
18
+
func SyncGetBlob(ctx context.Context, c lexutil.LexClient, cid string, did string) ([]byte, error) {
19
+
buf := new(bytes.Buffer)
20
+
21
+
params := map[string]interface{}{}
22
+
params["cid"] = cid
23
+
params["did"] = did
24
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.getBlob", params, nil, buf); err != nil {
25
+
return nil, err
26
+
}
27
+
28
+
return buf.Bytes(), nil
29
+
}
+28
api/atproto/syncgetBlocks.go
+28
api/atproto/syncgetBlocks.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.getBlocks
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"bytes"
9
+
"context"
10
+
11
+
lexutil "github.com/bluesky-social/indigo/lex/util"
12
+
)
13
+
14
+
// SyncGetBlocks calls the XRPC method "com.atproto.sync.getBlocks".
15
+
//
16
+
// did: The DID of the repo.
17
+
func SyncGetBlocks(ctx context.Context, c lexutil.LexClient, cids []string, did string) ([]byte, error) {
18
+
buf := new(bytes.Buffer)
19
+
20
+
params := map[string]interface{}{}
21
+
params["cids"] = cids
22
+
params["did"] = did
23
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.getBlocks", params, nil, buf); err != nil {
24
+
return nil, err
25
+
}
26
+
27
+
return buf.Bytes(), nil
28
+
}
+27
api/atproto/syncgetCheckout.go
+27
api/atproto/syncgetCheckout.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.getCheckout
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"bytes"
9
+
"context"
10
+
11
+
lexutil "github.com/bluesky-social/indigo/lex/util"
12
+
)
13
+
14
+
// SyncGetCheckout calls the XRPC method "com.atproto.sync.getCheckout".
15
+
//
16
+
// did: The DID of the repo.
17
+
func SyncGetCheckout(ctx context.Context, c lexutil.LexClient, did string) ([]byte, error) {
18
+
buf := new(bytes.Buffer)
19
+
20
+
params := map[string]interface{}{}
21
+
params["did"] = did
22
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.getCheckout", params, nil, buf); err != nil {
23
+
return nil, err
24
+
}
25
+
26
+
return buf.Bytes(), nil
27
+
}
+31
api/atproto/syncgetHead.go
+31
api/atproto/syncgetHead.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.getHead
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// SyncGetHead_Output is the output of a com.atproto.sync.getHead call.
14
+
type SyncGetHead_Output struct {
15
+
Root string `json:"root" cborgen:"root"`
16
+
}
17
+
18
+
// SyncGetHead calls the XRPC method "com.atproto.sync.getHead".
19
+
//
20
+
// did: The DID of the repo.
21
+
func SyncGetHead(ctx context.Context, c lexutil.LexClient, did string) (*SyncGetHead_Output, error) {
22
+
var out SyncGetHead_Output
23
+
24
+
params := map[string]interface{}{}
25
+
params["did"] = did
26
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.getHead", params, nil, &out); err != nil {
27
+
return nil, err
28
+
}
29
+
30
+
return &out, nil
31
+
}
+36
api/atproto/syncgetHostStatus.go
+36
api/atproto/syncgetHostStatus.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.getHostStatus
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// SyncGetHostStatus_Output is the output of a com.atproto.sync.getHostStatus call.
14
+
type SyncGetHostStatus_Output struct {
15
+
// accountCount: Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts.
16
+
AccountCount *int64 `json:"accountCount,omitempty" cborgen:"accountCount,omitempty"`
17
+
Hostname string `json:"hostname" cborgen:"hostname"`
18
+
// seq: Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor).
19
+
Seq *int64 `json:"seq,omitempty" cborgen:"seq,omitempty"`
20
+
Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
21
+
}
22
+
23
+
// SyncGetHostStatus calls the XRPC method "com.atproto.sync.getHostStatus".
24
+
//
25
+
// hostname: Hostname of the host (eg, PDS or relay) being queried.
26
+
func SyncGetHostStatus(ctx context.Context, c lexutil.LexClient, hostname string) (*SyncGetHostStatus_Output, error) {
27
+
var out SyncGetHostStatus_Output
28
+
29
+
params := map[string]interface{}{}
30
+
params["hostname"] = hostname
31
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.getHostStatus", params, nil, &out); err != nil {
32
+
return nil, err
33
+
}
34
+
35
+
return &out, nil
36
+
}
+32
api/atproto/syncgetLatestCommit.go
+32
api/atproto/syncgetLatestCommit.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.getLatestCommit
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// SyncGetLatestCommit_Output is the output of a com.atproto.sync.getLatestCommit call.
14
+
type SyncGetLatestCommit_Output struct {
15
+
Cid string `json:"cid" cborgen:"cid"`
16
+
Rev string `json:"rev" cborgen:"rev"`
17
+
}
18
+
19
+
// SyncGetLatestCommit calls the XRPC method "com.atproto.sync.getLatestCommit".
20
+
//
21
+
// did: The DID of the repo.
22
+
func SyncGetLatestCommit(ctx context.Context, c lexutil.LexClient, did string) (*SyncGetLatestCommit_Output, error) {
23
+
var out SyncGetLatestCommit_Output
24
+
25
+
params := map[string]interface{}{}
26
+
params["did"] = did
27
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.getLatestCommit", params, nil, &out); err != nil {
28
+
return nil, err
29
+
}
30
+
31
+
return &out, nil
32
+
}
+30
api/atproto/syncgetRecord.go
+30
api/atproto/syncgetRecord.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.getRecord
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"bytes"
9
+
"context"
10
+
11
+
lexutil "github.com/bluesky-social/indigo/lex/util"
12
+
)
13
+
14
+
// SyncGetRecord calls the XRPC method "com.atproto.sync.getRecord".
15
+
//
16
+
// did: The DID of the repo.
17
+
// rkey: Record Key
18
+
func SyncGetRecord(ctx context.Context, c lexutil.LexClient, collection string, did string, rkey string) ([]byte, error) {
19
+
buf := new(bytes.Buffer)
20
+
21
+
params := map[string]interface{}{}
22
+
params["collection"] = collection
23
+
params["did"] = did
24
+
params["rkey"] = rkey
25
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.getRecord", params, nil, buf); err != nil {
26
+
return nil, err
27
+
}
28
+
29
+
return buf.Bytes(), nil
30
+
}
+31
api/atproto/syncgetRepo.go
+31
api/atproto/syncgetRepo.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.getRepo
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"bytes"
9
+
"context"
10
+
11
+
lexutil "github.com/bluesky-social/indigo/lex/util"
12
+
)
13
+
14
+
// SyncGetRepo calls the XRPC method "com.atproto.sync.getRepo".
15
+
//
16
+
// did: The DID of the repo.
17
+
// since: The revision ('rev') of the repo to create a diff from.
18
+
func SyncGetRepo(ctx context.Context, c lexutil.LexClient, did string, since string) ([]byte, error) {
19
+
buf := new(bytes.Buffer)
20
+
21
+
params := map[string]interface{}{}
22
+
params["did"] = did
23
+
if since != "" {
24
+
params["since"] = since
25
+
}
26
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.getRepo", params, nil, buf); err != nil {
27
+
return nil, err
28
+
}
29
+
30
+
return buf.Bytes(), nil
31
+
}
+36
api/atproto/syncgetRepoStatus.go
+36
api/atproto/syncgetRepoStatus.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.getRepoStatus
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// SyncGetRepoStatus_Output is the output of a com.atproto.sync.getRepoStatus call.
14
+
type SyncGetRepoStatus_Output struct {
15
+
Active bool `json:"active" cborgen:"active"`
16
+
Did string `json:"did" cborgen:"did"`
17
+
// rev: Optional field, the current rev of the repo, if active=true
18
+
Rev *string `json:"rev,omitempty" cborgen:"rev,omitempty"`
19
+
// status: If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.
20
+
Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
21
+
}
22
+
23
+
// SyncGetRepoStatus calls the XRPC method "com.atproto.sync.getRepoStatus".
24
+
//
25
+
// did: The DID of the repo.
26
+
func SyncGetRepoStatus(ctx context.Context, c lexutil.LexClient, did string) (*SyncGetRepoStatus_Output, error) {
27
+
var out SyncGetRepoStatus_Output
28
+
29
+
params := map[string]interface{}{}
30
+
params["did"] = did
31
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.getRepoStatus", params, nil, &out); err != nil {
32
+
return nil, err
33
+
}
34
+
35
+
return &out, nil
36
+
}
+42
api/atproto/synclistBlobs.go
+42
api/atproto/synclistBlobs.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.listBlobs
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// SyncListBlobs_Output is the output of a com.atproto.sync.listBlobs call.
14
+
type SyncListBlobs_Output struct {
15
+
Cids []string `json:"cids" cborgen:"cids"`
16
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
17
+
}
18
+
19
+
// SyncListBlobs calls the XRPC method "com.atproto.sync.listBlobs".
20
+
//
21
+
// did: The DID of the repo.
22
+
// since: Optional revision of the repo to list blobs since.
23
+
func SyncListBlobs(ctx context.Context, c lexutil.LexClient, cursor string, did string, limit int64, since string) (*SyncListBlobs_Output, error) {
24
+
var out SyncListBlobs_Output
25
+
26
+
params := map[string]interface{}{}
27
+
if cursor != "" {
28
+
params["cursor"] = cursor
29
+
}
30
+
params["did"] = did
31
+
if limit != 0 {
32
+
params["limit"] = limit
33
+
}
34
+
if since != "" {
35
+
params["since"] = since
36
+
}
37
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.listBlobs", params, nil, &out); err != nil {
38
+
return nil, err
39
+
}
40
+
41
+
return &out, nil
42
+
}
+46
api/atproto/synclistHosts.go
+46
api/atproto/synclistHosts.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.listHosts
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// SyncListHosts_Host is a "host" in the com.atproto.sync.listHosts schema.
14
+
type SyncListHosts_Host struct {
15
+
AccountCount *int64 `json:"accountCount,omitempty" cborgen:"accountCount,omitempty"`
16
+
// hostname: hostname of server; not a URL (no scheme)
17
+
Hostname string `json:"hostname" cborgen:"hostname"`
18
+
// seq: Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor).
19
+
Seq *int64 `json:"seq,omitempty" cborgen:"seq,omitempty"`
20
+
Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
21
+
}
22
+
23
+
// SyncListHosts_Output is the output of a com.atproto.sync.listHosts call.
24
+
type SyncListHosts_Output struct {
25
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
26
+
// hosts: Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first.
27
+
Hosts []*SyncListHosts_Host `json:"hosts" cborgen:"hosts"`
28
+
}
29
+
30
+
// SyncListHosts calls the XRPC method "com.atproto.sync.listHosts".
31
+
func SyncListHosts(ctx context.Context, c lexutil.LexClient, cursor string, limit int64) (*SyncListHosts_Output, error) {
32
+
var out SyncListHosts_Output
33
+
34
+
params := map[string]interface{}{}
35
+
if cursor != "" {
36
+
params["cursor"] = cursor
37
+
}
38
+
if limit != 0 {
39
+
params["limit"] = limit
40
+
}
41
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.listHosts", params, nil, &out); err != nil {
42
+
return nil, err
43
+
}
44
+
45
+
return &out, nil
46
+
}
+46
api/atproto/synclistRepos.go
+46
api/atproto/synclistRepos.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.listRepos
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// SyncListRepos_Output is the output of a com.atproto.sync.listRepos call.
14
+
type SyncListRepos_Output struct {
15
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
16
+
Repos []*SyncListRepos_Repo `json:"repos" cborgen:"repos"`
17
+
}
18
+
19
+
// SyncListRepos_Repo is a "repo" in the com.atproto.sync.listRepos schema.
20
+
type SyncListRepos_Repo struct {
21
+
Active *bool `json:"active,omitempty" cborgen:"active,omitempty"`
22
+
Did string `json:"did" cborgen:"did"`
23
+
// head: Current repo commit CID
24
+
Head string `json:"head" cborgen:"head"`
25
+
Rev string `json:"rev" cborgen:"rev"`
26
+
// status: If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.
27
+
Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
28
+
}
29
+
30
+
// SyncListRepos calls the XRPC method "com.atproto.sync.listRepos".
31
+
func SyncListRepos(ctx context.Context, c lexutil.LexClient, cursor string, limit int64) (*SyncListRepos_Output, error) {
32
+
var out SyncListRepos_Output
33
+
34
+
params := map[string]interface{}{}
35
+
if cursor != "" {
36
+
params["cursor"] = cursor
37
+
}
38
+
if limit != 0 {
39
+
params["limit"] = limit
40
+
}
41
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.listRepos", params, nil, &out); err != nil {
42
+
return nil, err
43
+
}
44
+
45
+
return &out, nil
46
+
}
+43
api/atproto/synclistReposByCollection.go
+43
api/atproto/synclistReposByCollection.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.listReposByCollection
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// SyncListReposByCollection_Output is the output of a com.atproto.sync.listReposByCollection call.
14
+
type SyncListReposByCollection_Output struct {
15
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
16
+
Repos []*SyncListReposByCollection_Repo `json:"repos" cborgen:"repos"`
17
+
}
18
+
19
+
// SyncListReposByCollection_Repo is a "repo" in the com.atproto.sync.listReposByCollection schema.
20
+
type SyncListReposByCollection_Repo struct {
21
+
Did string `json:"did" cborgen:"did"`
22
+
}
23
+
24
+
// SyncListReposByCollection calls the XRPC method "com.atproto.sync.listReposByCollection".
25
+
//
26
+
// limit: Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.
27
+
func SyncListReposByCollection(ctx context.Context, c lexutil.LexClient, collection string, cursor string, limit int64) (*SyncListReposByCollection_Output, error) {
28
+
var out SyncListReposByCollection_Output
29
+
30
+
params := map[string]interface{}{}
31
+
params["collection"] = collection
32
+
if cursor != "" {
33
+
params["cursor"] = cursor
34
+
}
35
+
if limit != 0 {
36
+
params["limit"] = limit
37
+
}
38
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.sync.listReposByCollection", params, nil, &out); err != nil {
39
+
return nil, err
40
+
}
41
+
42
+
return &out, nil
43
+
}
+26
api/atproto/syncnotifyOfUpdate.go
+26
api/atproto/syncnotifyOfUpdate.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.notifyOfUpdate
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// SyncNotifyOfUpdate_Input is the input argument to a com.atproto.sync.notifyOfUpdate call.
14
+
type SyncNotifyOfUpdate_Input struct {
15
+
// hostname: Hostname of the current service (usually a PDS) that is notifying of update.
16
+
Hostname string `json:"hostname" cborgen:"hostname"`
17
+
}
18
+
19
+
// SyncNotifyOfUpdate calls the XRPC method "com.atproto.sync.notifyOfUpdate".
20
+
func SyncNotifyOfUpdate(ctx context.Context, c lexutil.LexClient, input *SyncNotifyOfUpdate_Input) error {
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.sync.notifyOfUpdate", nil, input, nil); err != nil {
22
+
return err
23
+
}
24
+
25
+
return nil
26
+
}
+26
api/atproto/syncrequestCrawl.go
+26
api/atproto/syncrequestCrawl.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.requestCrawl
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// SyncRequestCrawl_Input is the input argument to a com.atproto.sync.requestCrawl call.
14
+
type SyncRequestCrawl_Input struct {
15
+
// hostname: Hostname of the current service (eg, PDS) that is requesting to be crawled.
16
+
Hostname string `json:"hostname" cborgen:"hostname"`
17
+
}
18
+
19
+
// SyncRequestCrawl calls the XRPC method "com.atproto.sync.requestCrawl".
20
+
func SyncRequestCrawl(ctx context.Context, c lexutil.LexClient, input *SyncRequestCrawl_Input) error {
21
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.sync.requestCrawl", nil, input, nil); err != nil {
22
+
return err
23
+
}
24
+
25
+
return nil
26
+
}
+95
api/atproto/syncsubscribeRepos.go
+95
api/atproto/syncsubscribeRepos.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.sync.subscribeRepos
4
+
5
+
package atproto
6
+
7
+
import (
8
+
lexutil "github.com/bluesky-social/indigo/lex/util"
9
+
)
10
+
11
+
// SyncSubscribeRepos_Account is a "account" in the com.atproto.sync.subscribeRepos schema.
12
+
//
13
+
// Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.
14
+
type SyncSubscribeRepos_Account struct {
15
+
// active: Indicates that the account has a repository which can be fetched from the host that emitted this event.
16
+
Active bool `json:"active" cborgen:"active"`
17
+
Did string `json:"did" cborgen:"did"`
18
+
Seq int64 `json:"seq" cborgen:"seq"`
19
+
// status: If active=false, this optional field indicates a reason for why the account is not active.
20
+
Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
21
+
Time string `json:"time" cborgen:"time"`
22
+
}
23
+
24
+
// SyncSubscribeRepos_Commit is a "commit" in the com.atproto.sync.subscribeRepos schema.
25
+
//
26
+
// Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature.
27
+
type SyncSubscribeRepos_Commit struct {
28
+
Blobs []lexutil.LexLink `json:"blobs" cborgen:"blobs"`
29
+
// blocks: CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list.
30
+
Blocks lexutil.LexBytes `json:"blocks,omitempty" cborgen:"blocks,omitempty"`
31
+
// commit: Repo commit object CID.
32
+
Commit lexutil.LexLink `json:"commit" cborgen:"commit"`
33
+
Ops []*SyncSubscribeRepos_RepoOp `json:"ops" cborgen:"ops"`
34
+
// prevData: The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose.
35
+
PrevData *lexutil.LexLink `json:"prevData,omitempty" cborgen:"prevData,omitempty"`
36
+
// rebase: DEPRECATED -- unused
37
+
Rebase bool `json:"rebase" cborgen:"rebase"`
38
+
// repo: The repo this event comes from. Note that all other message types name this field 'did'.
39
+
Repo string `json:"repo" cborgen:"repo"`
40
+
// rev: The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event.
41
+
Rev string `json:"rev" cborgen:"rev"`
42
+
// seq: The stream sequence number of this message.
43
+
Seq int64 `json:"seq" cborgen:"seq"`
44
+
// since: The rev of the last emitted commit from this repo (if any).
45
+
Since *string `json:"since" cborgen:"since"`
46
+
// time: Timestamp of when this message was originally broadcast.
47
+
Time string `json:"time" cborgen:"time"`
48
+
// tooBig: DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data.
49
+
TooBig bool `json:"tooBig" cborgen:"tooBig"`
50
+
}
51
+
52
+
// SyncSubscribeRepos_Identity is a "identity" in the com.atproto.sync.subscribeRepos schema.
53
+
//
54
+
// Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache.
55
+
type SyncSubscribeRepos_Identity struct {
56
+
Did string `json:"did" cborgen:"did"`
57
+
// handle: The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details.
58
+
Handle *string `json:"handle,omitempty" cborgen:"handle,omitempty"`
59
+
Seq int64 `json:"seq" cborgen:"seq"`
60
+
Time string `json:"time" cborgen:"time"`
61
+
}
62
+
63
+
// SyncSubscribeRepos_Info is a "info" in the com.atproto.sync.subscribeRepos schema.
64
+
type SyncSubscribeRepos_Info struct {
65
+
Message *string `json:"message,omitempty" cborgen:"message,omitempty"`
66
+
Name string `json:"name" cborgen:"name"`
67
+
}
68
+
69
+
// SyncSubscribeRepos_RepoOp is a "repoOp" in the com.atproto.sync.subscribeRepos schema.
70
+
//
71
+
// A repo operation, ie a mutation of a single record.
72
+
type SyncSubscribeRepos_RepoOp struct {
73
+
Action string `json:"action" cborgen:"action"`
74
+
// cid: For creates and updates, the new record CID. For deletions, null.
75
+
Cid *lexutil.LexLink `json:"cid" cborgen:"cid"`
76
+
Path string `json:"path" cborgen:"path"`
77
+
// prev: For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined.
78
+
Prev *lexutil.LexLink `json:"prev,omitempty" cborgen:"prev,omitempty"`
79
+
}
80
+
81
+
// SyncSubscribeRepos_Sync is a "sync" in the com.atproto.sync.subscribeRepos schema.
82
+
//
83
+
// Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository.
84
+
type SyncSubscribeRepos_Sync struct {
85
+
// blocks: CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'.
86
+
Blocks lexutil.LexBytes `json:"blocks,omitempty" cborgen:"blocks,omitempty"`
87
+
// did: The account this repo event corresponds to. Must match that in the commit object.
88
+
Did string `json:"did" cborgen:"did"`
89
+
// rev: The rev of the commit. This value must match that in the commit object.
90
+
Rev string `json:"rev" cborgen:"rev"`
91
+
// seq: The stream sequence number of this message.
92
+
Seq int64 `json:"seq" cborgen:"seq"`
93
+
// time: Timestamp of when this message was originally broadcast.
94
+
Time string `json:"time" cborgen:"time"`
95
+
}
+30
api/atproto/tempaddReservedHandle.go
+30
api/atproto/tempaddReservedHandle.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.temp.addReservedHandle
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// TempAddReservedHandle_Input is the input argument to a com.atproto.temp.addReservedHandle call.
14
+
type TempAddReservedHandle_Input struct {
15
+
Handle string `json:"handle" cborgen:"handle"`
16
+
}
17
+
18
+
// TempAddReservedHandle_Output is the output of a com.atproto.temp.addReservedHandle call.
19
+
type TempAddReservedHandle_Output struct {
20
+
}
21
+
22
+
// TempAddReservedHandle calls the XRPC method "com.atproto.temp.addReservedHandle".
23
+
func TempAddReservedHandle(ctx context.Context, c lexutil.LexClient, input *TempAddReservedHandle_Input) (*TempAddReservedHandle_Output, error) {
24
+
var out TempAddReservedHandle_Output
25
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.temp.addReservedHandle", nil, input, &out); err != nil {
26
+
return nil, err
27
+
}
28
+
29
+
return &out, nil
30
+
}
+101
api/atproto/tempcheckHandleAvailability.go
+101
api/atproto/tempcheckHandleAvailability.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.temp.checkHandleAvailability
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
"encoding/json"
10
+
"fmt"
11
+
12
+
lexutil "github.com/bluesky-social/indigo/lex/util"
13
+
)
14
+
15
+
// TempCheckHandleAvailability_Output is the output of a com.atproto.temp.checkHandleAvailability call.
16
+
type TempCheckHandleAvailability_Output struct {
17
+
// handle: Echo of the input handle.
18
+
Handle string `json:"handle" cborgen:"handle"`
19
+
Result *TempCheckHandleAvailability_Output_Result `json:"result" cborgen:"result"`
20
+
}
21
+
22
+
type TempCheckHandleAvailability_Output_Result struct {
23
+
TempCheckHandleAvailability_ResultAvailable *TempCheckHandleAvailability_ResultAvailable
24
+
TempCheckHandleAvailability_ResultUnavailable *TempCheckHandleAvailability_ResultUnavailable
25
+
}
26
+
27
+
func (t *TempCheckHandleAvailability_Output_Result) MarshalJSON() ([]byte, error) {
28
+
if t.TempCheckHandleAvailability_ResultAvailable != nil {
29
+
t.TempCheckHandleAvailability_ResultAvailable.LexiconTypeID = "com.atproto.temp.checkHandleAvailability#resultAvailable"
30
+
return json.Marshal(t.TempCheckHandleAvailability_ResultAvailable)
31
+
}
32
+
if t.TempCheckHandleAvailability_ResultUnavailable != nil {
33
+
t.TempCheckHandleAvailability_ResultUnavailable.LexiconTypeID = "com.atproto.temp.checkHandleAvailability#resultUnavailable"
34
+
return json.Marshal(t.TempCheckHandleAvailability_ResultUnavailable)
35
+
}
36
+
return nil, fmt.Errorf("can not marshal empty union as JSON")
37
+
}
38
+
39
+
func (t *TempCheckHandleAvailability_Output_Result) UnmarshalJSON(b []byte) error {
40
+
typ, err := lexutil.TypeExtract(b)
41
+
if err != nil {
42
+
return err
43
+
}
44
+
45
+
switch typ {
46
+
case "com.atproto.temp.checkHandleAvailability#resultAvailable":
47
+
t.TempCheckHandleAvailability_ResultAvailable = new(TempCheckHandleAvailability_ResultAvailable)
48
+
return json.Unmarshal(b, t.TempCheckHandleAvailability_ResultAvailable)
49
+
case "com.atproto.temp.checkHandleAvailability#resultUnavailable":
50
+
t.TempCheckHandleAvailability_ResultUnavailable = new(TempCheckHandleAvailability_ResultUnavailable)
51
+
return json.Unmarshal(b, t.TempCheckHandleAvailability_ResultUnavailable)
52
+
default:
53
+
return nil
54
+
}
55
+
}
56
+
57
+
// TempCheckHandleAvailability_ResultAvailable is a "resultAvailable" in the com.atproto.temp.checkHandleAvailability schema.
58
+
//
59
+
// Indicates the provided handle is available.
60
+
type TempCheckHandleAvailability_ResultAvailable struct {
61
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.temp.checkHandleAvailability#resultAvailable"`
62
+
}
63
+
64
+
// TempCheckHandleAvailability_ResultUnavailable is a "resultUnavailable" in the com.atproto.temp.checkHandleAvailability schema.
65
+
//
66
+
// Indicates the provided handle is unavailable and gives suggestions of available handles.
67
+
type TempCheckHandleAvailability_ResultUnavailable struct {
68
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=com.atproto.temp.checkHandleAvailability#resultUnavailable"`
69
+
// suggestions: List of suggested handles based on the provided inputs.
70
+
Suggestions []*TempCheckHandleAvailability_Suggestion `json:"suggestions" cborgen:"suggestions"`
71
+
}
72
+
73
+
// TempCheckHandleAvailability_Suggestion is a "suggestion" in the com.atproto.temp.checkHandleAvailability schema.
74
+
type TempCheckHandleAvailability_Suggestion struct {
75
+
Handle string `json:"handle" cborgen:"handle"`
76
+
// method: Method used to build this suggestion. Should be considered opaque to clients. Can be used for metrics.
77
+
Method string `json:"method" cborgen:"method"`
78
+
}
79
+
80
+
// TempCheckHandleAvailability calls the XRPC method "com.atproto.temp.checkHandleAvailability".
81
+
//
82
+
// birthDate: User-provided birth date. Might be used to build handle suggestions.
83
+
// email: User-provided email. Might be used to build handle suggestions.
84
+
// handle: Tentative handle. Will be checked for availability or used to build handle suggestions.
85
+
func TempCheckHandleAvailability(ctx context.Context, c lexutil.LexClient, birthDate string, email string, handle string) (*TempCheckHandleAvailability_Output, error) {
86
+
var out TempCheckHandleAvailability_Output
87
+
88
+
params := map[string]interface{}{}
89
+
if birthDate != "" {
90
+
params["birthDate"] = birthDate
91
+
}
92
+
if email != "" {
93
+
params["email"] = email
94
+
}
95
+
params["handle"] = handle
96
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.temp.checkHandleAvailability", params, nil, &out); err != nil {
97
+
return nil, err
98
+
}
99
+
100
+
return &out, nil
101
+
}
+28
api/atproto/tempcheckSignupQueue.go
+28
api/atproto/tempcheckSignupQueue.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.temp.checkSignupQueue
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// TempCheckSignupQueue_Output is the output of a com.atproto.temp.checkSignupQueue call.
14
+
type TempCheckSignupQueue_Output struct {
15
+
Activated bool `json:"activated" cborgen:"activated"`
16
+
EstimatedTimeMs *int64 `json:"estimatedTimeMs,omitempty" cborgen:"estimatedTimeMs,omitempty"`
17
+
PlaceInQueue *int64 `json:"placeInQueue,omitempty" cborgen:"placeInQueue,omitempty"`
18
+
}
19
+
20
+
// TempCheckSignupQueue calls the XRPC method "com.atproto.temp.checkSignupQueue".
21
+
func TempCheckSignupQueue(ctx context.Context, c lexutil.LexClient) (*TempCheckSignupQueue_Output, error) {
22
+
var out TempCheckSignupQueue_Output
23
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.temp.checkSignupQueue", nil, nil, &out); err != nil {
24
+
return nil, err
25
+
}
26
+
27
+
return &out, nil
28
+
}
+32
api/atproto/tempdereferenceScope.go
+32
api/atproto/tempdereferenceScope.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.temp.dereferenceScope
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// TempDereferenceScope_Output is the output of a com.atproto.temp.dereferenceScope call.
14
+
type TempDereferenceScope_Output struct {
15
+
// scope: The full oauth permission scope
16
+
Scope string `json:"scope" cborgen:"scope"`
17
+
}
18
+
19
+
// TempDereferenceScope calls the XRPC method "com.atproto.temp.dereferenceScope".
20
+
//
21
+
// scope: The scope reference (starts with 'ref:')
22
+
func TempDereferenceScope(ctx context.Context, c lexutil.LexClient, scope string) (*TempDereferenceScope_Output, error) {
23
+
var out TempDereferenceScope_Output
24
+
25
+
params := map[string]interface{}{}
26
+
params["scope"] = scope
27
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.temp.dereferenceScope", params, nil, &out); err != nil {
28
+
return nil, err
29
+
}
30
+
31
+
return &out, nil
32
+
}
+34
api/atproto/tempfetchLabels.go
+34
api/atproto/tempfetchLabels.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.temp.fetchLabels
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// TempFetchLabels_Output is the output of a com.atproto.temp.fetchLabels call.
14
+
type TempFetchLabels_Output struct {
15
+
Labels []*LabelDefs_Label `json:"labels" cborgen:"labels"`
16
+
}
17
+
18
+
// TempFetchLabels calls the XRPC method "com.atproto.temp.fetchLabels".
19
+
func TempFetchLabels(ctx context.Context, c lexutil.LexClient, limit int64, since int64) (*TempFetchLabels_Output, error) {
20
+
var out TempFetchLabels_Output
21
+
22
+
params := map[string]interface{}{}
23
+
if limit != 0 {
24
+
params["limit"] = limit
25
+
}
26
+
if since != 0 {
27
+
params["since"] = since
28
+
}
29
+
if err := c.LexDo(ctx, lexutil.Query, "", "com.atproto.temp.fetchLabels", params, nil, &out); err != nil {
30
+
return nil, err
31
+
}
32
+
33
+
return &out, nil
34
+
}
+25
api/atproto/temprequestPhoneVerification.go
+25
api/atproto/temprequestPhoneVerification.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.temp.requestPhoneVerification
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// TempRequestPhoneVerification_Input is the input argument to a com.atproto.temp.requestPhoneVerification call.
14
+
type TempRequestPhoneVerification_Input struct {
15
+
PhoneNumber string `json:"phoneNumber" cborgen:"phoneNumber"`
16
+
}
17
+
18
+
// TempRequestPhoneVerification calls the XRPC method "com.atproto.temp.requestPhoneVerification".
19
+
func TempRequestPhoneVerification(ctx context.Context, c lexutil.LexClient, input *TempRequestPhoneVerification_Input) error {
20
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.temp.requestPhoneVerification", nil, input, nil); err != nil {
21
+
return err
22
+
}
23
+
24
+
return nil
25
+
}
+25
api/atproto/temprevokeAccountCredentials.go
+25
api/atproto/temprevokeAccountCredentials.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: com.atproto.temp.revokeAccountCredentials
4
+
5
+
package atproto
6
+
7
+
import (
8
+
"context"
9
+
10
+
lexutil "github.com/bluesky-social/indigo/lex/util"
11
+
)
12
+
13
+
// TempRevokeAccountCredentials_Input is the input argument to a com.atproto.temp.revokeAccountCredentials call.
14
+
type TempRevokeAccountCredentials_Input struct {
15
+
Account string `json:"account" cborgen:"account"`
16
+
}
17
+
18
+
// TempRevokeAccountCredentials calls the XRPC method "com.atproto.temp.revokeAccountCredentials".
19
+
func TempRevokeAccountCredentials(ctx context.Context, c lexutil.LexClient, input *TempRevokeAccountCredentials_Input) error {
20
+
if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "com.atproto.temp.revokeAccountCredentials", nil, input, nil); err != nil {
21
+
return err
22
+
}
23
+
24
+
return nil
25
+
}
+46
api/vylet/actordefs.go
+46
api/vylet/actordefs.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: app.vylet.actor.defs
4
+
5
+
package vylet
6
+
7
+
import (
8
+
comatproto "github.com/bluesky-social/indigo/api/atproto"
9
+
)
10
+
11
+
// ActorDefs_ProfileView is a "profileView" in the app.vylet.actor.defs schema.
12
+
type ActorDefs_ProfileView struct {
13
+
Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"`
14
+
CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"`
15
+
Description *string `json:"description,omitempty" cborgen:"description,omitempty"`
16
+
Did string `json:"did" cborgen:"did"`
17
+
DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"`
18
+
Handle string `json:"handle" cborgen:"handle"`
19
+
IndexedAt *string `json:"indexedAt,omitempty" cborgen:"indexedAt,omitempty"`
20
+
Labels []*comatproto.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"`
21
+
Pronouns *string `json:"pronouns,omitempty" cborgen:"pronouns,omitempty"`
22
+
Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"`
23
+
}
24
+
25
+
// ActorDefs_ProfileViewBasic is a "profileViewBasic" in the app.vylet.actor.defs schema.
26
+
type ActorDefs_ProfileViewBasic struct {
27
+
Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"`
28
+
CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"`
29
+
Did string `json:"did" cborgen:"did"`
30
+
DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"`
31
+
Handle string `json:"handle" cborgen:"handle"`
32
+
Labels []*comatproto.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"`
33
+
Pronouns *string `json:"pronouns,omitempty" cborgen:"pronouns,omitempty"`
34
+
Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"`
35
+
}
36
+
37
+
// ActorDefs_ViewerState is a "viewerState" in the app.vylet.actor.defs schema.
38
+
//
39
+
// Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.
40
+
type ActorDefs_ViewerState struct {
41
+
BlockedBy *bool `json:"blockedBy,omitempty" cborgen:"blockedBy,omitempty"`
42
+
Blocking *string `json:"blocking,omitempty" cborgen:"blocking,omitempty"`
43
+
FollowedBy *string `json:"followedBy,omitempty" cborgen:"followedBy,omitempty"`
44
+
Following *string `json:"following,omitempty" cborgen:"following,omitempty"`
45
+
Muted *bool `json:"muted,omitempty" cborgen:"muted,omitempty"`
46
+
}
+25
api/vylet/actorprofile.go
+25
api/vylet/actorprofile.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
// Lexicon schema: app.vylet.actor.profile
4
+
5
+
package vylet
6
+
7
+
import (
8
+
lexutil "github.com/bluesky-social/indigo/lex/util"
9
+
)
10
+
11
+
func init() {
12
+
lexutil.RegisterType("app.vylet.actor.profile", &ActorProfile{})
13
+
}
14
+
15
+
type ActorProfile struct {
16
+
LexiconTypeID string `json:"$type" cborgen:"$type,const=app.vylet.actor.profile"`
17
+
// avatar: Small image to be displayed next to posts from account.
18
+
Avatar *lexutil.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"`
19
+
CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"`
20
+
// description: Free-form profile description text.
21
+
Description *string `json:"description,omitempty" cborgen:"description,omitempty"`
22
+
DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"`
23
+
// pronouns: Free-form pronouns text.
24
+
Pronouns *string `json:"pronouns,omitempty" cborgen:"pronouns,omitempty"`
25
+
}
+389
api/vylet/cbor_gen.go
+389
api/vylet/cbor_gen.go
···
1
+
// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT.
2
+
3
+
package vylet
4
+
5
+
import (
6
+
"fmt"
7
+
"io"
8
+
"math"
9
+
"sort"
10
+
11
+
util "github.com/bluesky-social/indigo/lex/util"
12
+
cid "github.com/ipfs/go-cid"
13
+
cbg "github.com/whyrusleeping/cbor-gen"
14
+
xerrors "golang.org/x/xerrors"
15
+
)
16
+
17
+
var _ = xerrors.Errorf
18
+
var _ = cid.Undef
19
+
var _ = math.E
20
+
var _ = sort.Sort
21
+
22
+
func (t *ActorProfile) MarshalCBOR(w io.Writer) error {
23
+
if t == nil {
24
+
_, err := w.Write(cbg.CborNull)
25
+
return err
26
+
}
27
+
28
+
cw := cbg.NewCborWriter(w)
29
+
fieldCount := 6
30
+
31
+
if t.Avatar == nil {
32
+
fieldCount--
33
+
}
34
+
35
+
if t.CreatedAt == nil {
36
+
fieldCount--
37
+
}
38
+
39
+
if t.Description == nil {
40
+
fieldCount--
41
+
}
42
+
43
+
if t.DisplayName == nil {
44
+
fieldCount--
45
+
}
46
+
47
+
if t.Pronouns == nil {
48
+
fieldCount--
49
+
}
50
+
51
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
52
+
return err
53
+
}
54
+
55
+
// t.LexiconTypeID (string) (string)
56
+
if len("$type") > 1000000 {
57
+
return xerrors.Errorf("Value in field \"$type\" was too long")
58
+
}
59
+
60
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
61
+
return err
62
+
}
63
+
if _, err := cw.WriteString(string("$type")); err != nil {
64
+
return err
65
+
}
66
+
67
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.vylet.actor.profile"))); err != nil {
68
+
return err
69
+
}
70
+
if _, err := cw.WriteString(string("app.vylet.actor.profile")); err != nil {
71
+
return err
72
+
}
73
+
74
+
// t.Avatar (util.LexBlob) (struct)
75
+
if t.Avatar != nil {
76
+
77
+
if len("avatar") > 1000000 {
78
+
return xerrors.Errorf("Value in field \"avatar\" was too long")
79
+
}
80
+
81
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("avatar"))); err != nil {
82
+
return err
83
+
}
84
+
if _, err := cw.WriteString(string("avatar")); err != nil {
85
+
return err
86
+
}
87
+
88
+
if err := t.Avatar.MarshalCBOR(cw); err != nil {
89
+
return err
90
+
}
91
+
}
92
+
93
+
// t.Pronouns (string) (string)
94
+
if t.Pronouns != nil {
95
+
96
+
if len("pronouns") > 1000000 {
97
+
return xerrors.Errorf("Value in field \"pronouns\" was too long")
98
+
}
99
+
100
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pronouns"))); err != nil {
101
+
return err
102
+
}
103
+
if _, err := cw.WriteString(string("pronouns")); err != nil {
104
+
return err
105
+
}
106
+
107
+
if t.Pronouns == nil {
108
+
if _, err := cw.Write(cbg.CborNull); err != nil {
109
+
return err
110
+
}
111
+
} else {
112
+
if len(*t.Pronouns) > 1000000 {
113
+
return xerrors.Errorf("Value in field t.Pronouns was too long")
114
+
}
115
+
116
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Pronouns))); err != nil {
117
+
return err
118
+
}
119
+
if _, err := cw.WriteString(string(*t.Pronouns)); err != nil {
120
+
return err
121
+
}
122
+
}
123
+
}
124
+
125
+
// t.CreatedAt (string) (string)
126
+
if t.CreatedAt != nil {
127
+
128
+
if len("createdAt") > 1000000 {
129
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
130
+
}
131
+
132
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
133
+
return err
134
+
}
135
+
if _, err := cw.WriteString(string("createdAt")); err != nil {
136
+
return err
137
+
}
138
+
139
+
if t.CreatedAt == nil {
140
+
if _, err := cw.Write(cbg.CborNull); err != nil {
141
+
return err
142
+
}
143
+
} else {
144
+
if len(*t.CreatedAt) > 1000000 {
145
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
146
+
}
147
+
148
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.CreatedAt))); err != nil {
149
+
return err
150
+
}
151
+
if _, err := cw.WriteString(string(*t.CreatedAt)); err != nil {
152
+
return err
153
+
}
154
+
}
155
+
}
156
+
157
+
// t.Description (string) (string)
158
+
if t.Description != nil {
159
+
160
+
if len("description") > 1000000 {
161
+
return xerrors.Errorf("Value in field \"description\" was too long")
162
+
}
163
+
164
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil {
165
+
return err
166
+
}
167
+
if _, err := cw.WriteString(string("description")); err != nil {
168
+
return err
169
+
}
170
+
171
+
if t.Description == nil {
172
+
if _, err := cw.Write(cbg.CborNull); err != nil {
173
+
return err
174
+
}
175
+
} else {
176
+
if len(*t.Description) > 1000000 {
177
+
return xerrors.Errorf("Value in field t.Description was too long")
178
+
}
179
+
180
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil {
181
+
return err
182
+
}
183
+
if _, err := cw.WriteString(string(*t.Description)); err != nil {
184
+
return err
185
+
}
186
+
}
187
+
}
188
+
189
+
// t.DisplayName (string) (string)
190
+
if t.DisplayName != nil {
191
+
192
+
if len("displayName") > 1000000 {
193
+
return xerrors.Errorf("Value in field \"displayName\" was too long")
194
+
}
195
+
196
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("displayName"))); err != nil {
197
+
return err
198
+
}
199
+
if _, err := cw.WriteString(string("displayName")); err != nil {
200
+
return err
201
+
}
202
+
203
+
if t.DisplayName == nil {
204
+
if _, err := cw.Write(cbg.CborNull); err != nil {
205
+
return err
206
+
}
207
+
} else {
208
+
if len(*t.DisplayName) > 1000000 {
209
+
return xerrors.Errorf("Value in field t.DisplayName was too long")
210
+
}
211
+
212
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.DisplayName))); err != nil {
213
+
return err
214
+
}
215
+
if _, err := cw.WriteString(string(*t.DisplayName)); err != nil {
216
+
return err
217
+
}
218
+
}
219
+
}
220
+
return nil
221
+
}
222
+
223
+
func (t *ActorProfile) UnmarshalCBOR(r io.Reader) (err error) {
224
+
*t = ActorProfile{}
225
+
226
+
cr := cbg.NewCborReader(r)
227
+
228
+
maj, extra, err := cr.ReadHeader()
229
+
if err != nil {
230
+
return err
231
+
}
232
+
defer func() {
233
+
if err == io.EOF {
234
+
err = io.ErrUnexpectedEOF
235
+
}
236
+
}()
237
+
238
+
if maj != cbg.MajMap {
239
+
return fmt.Errorf("cbor input should be of type map")
240
+
}
241
+
242
+
if extra > cbg.MaxLength {
243
+
return fmt.Errorf("ActorProfile: map struct too large (%d)", extra)
244
+
}
245
+
246
+
n := extra
247
+
248
+
nameBuf := make([]byte, 11)
249
+
for i := uint64(0); i < n; i++ {
250
+
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
251
+
if err != nil {
252
+
return err
253
+
}
254
+
255
+
if !ok {
256
+
// Field doesn't exist on this type, so ignore it
257
+
if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
258
+
return err
259
+
}
260
+
continue
261
+
}
262
+
263
+
switch string(nameBuf[:nameLen]) {
264
+
// t.LexiconTypeID (string) (string)
265
+
case "$type":
266
+
267
+
{
268
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
269
+
if err != nil {
270
+
return err
271
+
}
272
+
273
+
t.LexiconTypeID = string(sval)
274
+
}
275
+
// t.Avatar (util.LexBlob) (struct)
276
+
case "avatar":
277
+
278
+
{
279
+
280
+
b, err := cr.ReadByte()
281
+
if err != nil {
282
+
return err
283
+
}
284
+
if b != cbg.CborNull[0] {
285
+
if err := cr.UnreadByte(); err != nil {
286
+
return err
287
+
}
288
+
t.Avatar = new(util.LexBlob)
289
+
if err := t.Avatar.UnmarshalCBOR(cr); err != nil {
290
+
return xerrors.Errorf("unmarshaling t.Avatar pointer: %w", err)
291
+
}
292
+
}
293
+
294
+
}
295
+
// t.Pronouns (string) (string)
296
+
case "pronouns":
297
+
298
+
{
299
+
b, err := cr.ReadByte()
300
+
if err != nil {
301
+
return err
302
+
}
303
+
if b != cbg.CborNull[0] {
304
+
if err := cr.UnreadByte(); err != nil {
305
+
return err
306
+
}
307
+
308
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
309
+
if err != nil {
310
+
return err
311
+
}
312
+
313
+
t.Pronouns = (*string)(&sval)
314
+
}
315
+
}
316
+
// t.CreatedAt (string) (string)
317
+
case "createdAt":
318
+
319
+
{
320
+
b, err := cr.ReadByte()
321
+
if err != nil {
322
+
return err
323
+
}
324
+
if b != cbg.CborNull[0] {
325
+
if err := cr.UnreadByte(); err != nil {
326
+
return err
327
+
}
328
+
329
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
330
+
if err != nil {
331
+
return err
332
+
}
333
+
334
+
t.CreatedAt = (*string)(&sval)
335
+
}
336
+
}
337
+
// t.Description (string) (string)
338
+
case "description":
339
+
340
+
{
341
+
b, err := cr.ReadByte()
342
+
if err != nil {
343
+
return err
344
+
}
345
+
if b != cbg.CborNull[0] {
346
+
if err := cr.UnreadByte(); err != nil {
347
+
return err
348
+
}
349
+
350
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
351
+
if err != nil {
352
+
return err
353
+
}
354
+
355
+
t.Description = (*string)(&sval)
356
+
}
357
+
}
358
+
// t.DisplayName (string) (string)
359
+
case "displayName":
360
+
361
+
{
362
+
b, err := cr.ReadByte()
363
+
if err != nil {
364
+
return err
365
+
}
366
+
if b != cbg.CborNull[0] {
367
+
if err := cr.UnreadByte(); err != nil {
368
+
return err
369
+
}
370
+
371
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
372
+
if err != nil {
373
+
return err
374
+
}
375
+
376
+
t.DisplayName = (*string)(&sval)
377
+
}
378
+
}
379
+
380
+
default:
381
+
// Field doesn't exist on this type, so ignore it
382
+
if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
383
+
return err
384
+
}
385
+
}
386
+
}
387
+
388
+
return nil
389
+
}
+5
-5
cmd/lexgen/vylet.json
+5
-5
cmd/lexgen/vylet.json
···
1
1
[
2
2
{
3
-
"package": "eloge",
4
-
"prefix": "app.eloge",
5
-
"outdir": "gen/vylet",
6
-
"import": "github.com/vylet-app/go/gen/vylet"
3
+
"package": "vylet",
4
+
"prefix": "app.vylet",
5
+
"outdir": "api/vylet",
6
+
"import": "github.com/vylet-app/go/api/vylet"
7
7
},
8
8
{
9
9
"package": "atproto",
10
10
"prefix": "com.atproto",
11
-
"outdir": "gen/atproto",
11
+
"outdir": "api/atproto",
12
12
"import": "github.com/bluesky-social/indigo/api/atproto"
13
13
}
14
14
]
+19
gen/LICENSE
+19
gen/LICENSE
···
1
+
MIT License Bluesky Social
2
+
3
+
Permission is hereby granted, free of charge, to any person obtaining a copy
4
+
of this software and associated documentation files (the "Software"), to deal
5
+
in the Software without restriction, including without limitation the rights
6
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+
copies of the Software, and to permit persons to whom the Software is
8
+
furnished to do so, subject to the following conditions:
9
+
10
+
The above copyright notice and this permission notice shall be included in all
11
+
copies or substantial portions of the Software.
12
+
13
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+
SOFTWARE.
+33
gen/main.go
+33
gen/main.go
···
1
+
package main
2
+
3
+
import (
4
+
"reflect"
5
+
6
+
"github.com/bluesky-social/indigo/api/atproto"
7
+
"github.com/bluesky-social/indigo/mst"
8
+
"github.com/vylet-app/go/api/vylet"
9
+
cbg "github.com/whyrusleeping/cbor-gen"
10
+
)
11
+
12
+
func main() {
13
+
var typVals []any
14
+
for _, typ := range mst.CBORTypes() {
15
+
typVals = append(typVals, reflect.New(typ).Elem().Interface())
16
+
}
17
+
18
+
genCfg := cbg.Gen{
19
+
MaxStringLength: 1_000_000,
20
+
}
21
+
22
+
if err := genCfg.WriteMapEncodersToFile("api/vylet/cbor_gen.go", "vylet",
23
+
vylet.ActorProfile{},
24
+
); err != nil {
25
+
panic(err)
26
+
}
27
+
28
+
if err := genCfg.WriteMapEncodersToFile("api/atproto/cbor_gen.go", "atproto",
29
+
atproto.RepoStrongRef{},
30
+
); err != nil {
31
+
panic(err)
32
+
}
33
+
}