···11+// Copied from indigo:api/atproto/identitysignPlcOperation.go
22+33+package agnostic
44+55+// schema: com.atproto.identity.signPlcOperation
66+77+import (
88+ "context"
99+ "encoding/json"
1010+1111+ "github.com/bluesky-social/indigo/xrpc"
1212+)
1313+1414+// IdentitySignPlcOperation_Input is the input argument to a com.atproto.identity.signPlcOperation call.
1515+type IdentitySignPlcOperation_Input struct {
1616+ AlsoKnownAs []string `json:"alsoKnownAs,omitempty" cborgen:"alsoKnownAs,omitempty"`
1717+ RotationKeys []string `json:"rotationKeys,omitempty" cborgen:"rotationKeys,omitempty"`
1818+ Services *json.RawMessage `json:"services,omitempty" cborgen:"services,omitempty"`
1919+ // token: A token received through com.atproto.identity.requestPlcOperationSignature
2020+ Token *string `json:"token,omitempty" cborgen:"token,omitempty"`
2121+ VerificationMethods *json.RawMessage `json:"verificationMethods,omitempty" cborgen:"verificationMethods,omitempty"`
2222+}
2323+2424+// IdentitySignPlcOperation_Output is the output of a com.atproto.identity.signPlcOperation call.
2525+type IdentitySignPlcOperation_Output struct {
2626+ // operation: A signed DID PLC operation.
2727+ Operation *json.RawMessage `json:"operation" cborgen:"operation"`
2828+}
2929+3030+// IdentitySignPlcOperation calls the XRPC method "com.atproto.identity.signPlcOperation".
3131+func IdentitySignPlcOperation(ctx context.Context, c *xrpc.Client, input *IdentitySignPlcOperation_Input) (*IdentitySignPlcOperation_Output, error) {
3232+ var out IdentitySignPlcOperation_Output
3333+ if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.identity.signPlcOperation", nil, input, &out); err != nil {
3434+ return nil, err
3535+ }
3636+3737+ return &out, nil
3838+}
+26
api/agnostic/identitysubmitPlcOperation.go
···11+// Copied from indigo:api/atproto/identitysubmitPlcOperation.go
22+33+package agnostic
44+55+// schema: com.atproto.identity.submitPlcOperation
66+77+import (
88+ "context"
99+ "encoding/json"
1010+1111+ "github.com/bluesky-social/indigo/xrpc"
1212+)
1313+1414+// IdentitySubmitPlcOperation_Input is the input argument to a com.atproto.identity.submitPlcOperation call.
1515+type IdentitySubmitPlcOperation_Input struct {
1616+ Operation *json.RawMessage `json:"operation" cborgen:"operation"`
1717+}
1818+1919+// IdentitySubmitPlcOperation calls the XRPC method "com.atproto.identity.submitPlcOperation".
2020+func IdentitySubmitPlcOperation(ctx context.Context, c *xrpc.Client, input *IdentitySubmitPlcOperation_Input) error {
2121+ if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.identity.submitPlcOperation", nil, input, nil); err != nil {
2222+ return err
2323+ }
2424+2525+ return nil
2626+}
+51
api/agnostic/repocreateRecord.go
···11+// Copied from indigo:api/atproto/repocreateRecords.go
22+33+package agnostic
44+55+// schema: com.atproto.repo.createRecord
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/xrpc"
1111+)
1212+1313+// RepoDefs_CommitMeta is a "commitMeta" in the com.atproto.repo.defs schema.
1414+type RepoDefs_CommitMeta struct {
1515+ Cid string `json:"cid" cborgen:"cid"`
1616+ Rev string `json:"rev" cborgen:"rev"`
1717+}
1818+1919+// RepoCreateRecord_Input is the input argument to a com.atproto.repo.createRecord call.
2020+type RepoCreateRecord_Input struct {
2121+ // collection: The NSID of the record collection.
2222+ Collection string `json:"collection" cborgen:"collection"`
2323+ // record: The record itself. Must contain a $type field.
2424+ Record map[string]any `json:"record" cborgen:"record"`
2525+ // repo: The handle or DID of the repo (aka, current account).
2626+ Repo string `json:"repo" cborgen:"repo"`
2727+ // rkey: The Record Key.
2828+ Rkey *string `json:"rkey,omitempty" cborgen:"rkey,omitempty"`
2929+ // swapCommit: Compare and swap with the previous commit by CID.
3030+ SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"`
3131+ // 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.
3232+ Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"`
3333+}
3434+3535+// RepoCreateRecord_Output is the output of a com.atproto.repo.createRecord call.
3636+type RepoCreateRecord_Output struct {
3737+ Cid string `json:"cid" cborgen:"cid"`
3838+ Commit *RepoDefs_CommitMeta `json:"commit,omitempty" cborgen:"commit,omitempty"`
3939+ Uri string `json:"uri" cborgen:"uri"`
4040+ ValidationStatus *string `json:"validationStatus,omitempty" cborgen:"validationStatus,omitempty"`
4141+}
4242+4343+// RepoCreateRecord calls the XRPC method "com.atproto.repo.createRecord".
4444+func RepoCreateRecord(ctx context.Context, c *xrpc.Client, input *RepoCreateRecord_Input) (*RepoCreateRecord_Output, error) {
4545+ var out RepoCreateRecord_Output
4646+ if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.repo.createRecord", nil, input, &out); err != nil {
4747+ return nil, err
4848+ }
4949+5050+ return &out, nil
5151+}
+42
api/agnostic/repogetRecord.go
···11+// Copied from indigo:api/atproto/repolistRecords.go
22+33+package agnostic
44+55+// schema: com.atproto.repo.getRecord
66+77+import (
88+ "context"
99+ "encoding/json"
1010+1111+ "github.com/bluesky-social/indigo/xrpc"
1212+)
1313+1414+// RepoGetRecord_Output is the output of a com.atproto.repo.getRecord call.
1515+type RepoGetRecord_Output struct {
1616+ Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"`
1717+ Uri string `json:"uri" cborgen:"uri"`
1818+ // NOTE: changed from lex decoder to json.RawMessage
1919+ Value *json.RawMessage `json:"value" cborgen:"value"`
2020+}
2121+2222+// RepoGetRecord calls the XRPC method "com.atproto.repo.getRecord".
2323+//
2424+// cid: The CID of the version of the record. If not specified, then return the most recent version.
2525+// collection: The NSID of the record collection.
2626+// repo: The handle or DID of the repo.
2727+// rkey: The Record Key.
2828+func RepoGetRecord(ctx context.Context, c *xrpc.Client, cid string, collection string, repo string, rkey string) (*RepoGetRecord_Output, error) {
2929+ var out RepoGetRecord_Output
3030+3131+ params := map[string]interface{}{
3232+ "cid": cid,
3333+ "collection": collection,
3434+ "repo": repo,
3535+ "rkey": rkey,
3636+ }
3737+ if err := c.Do(ctx, xrpc.Query, "", "com.atproto.repo.getRecord", params, nil, &out); err != nil {
3838+ return nil, err
3939+ }
4040+4141+ return &out, nil
4242+}
+53
api/agnostic/repolistRecords.go
···11+// Copied from indigo:api/atproto/repolistRecords.go
22+33+package agnostic
44+55+// schema: com.atproto.repo.listRecords
66+77+import (
88+ "context"
99+ "encoding/json"
1010+1111+ "github.com/bluesky-social/indigo/xrpc"
1212+)
1313+1414+// RepoListRecords_Output is the output of a com.atproto.repo.listRecords call.
1515+type RepoListRecords_Output struct {
1616+ Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
1717+ Records []*RepoListRecords_Record `json:"records" cborgen:"records"`
1818+}
1919+2020+// RepoListRecords_Record is a "record" in the com.atproto.repo.listRecords schema.
2121+type RepoListRecords_Record struct {
2222+ Cid string `json:"cid" cborgen:"cid"`
2323+ Uri string `json:"uri" cborgen:"uri"`
2424+ // NOTE: changed from lex decoder to json.RawMessage
2525+ Value *json.RawMessage `json:"value" cborgen:"value"`
2626+}
2727+2828+// RepoListRecords calls the XRPC method "com.atproto.repo.listRecords".
2929+//
3030+// collection: The NSID of the record type.
3131+// limit: The number of records to return.
3232+// repo: The handle or DID of the repo.
3333+// reverse: Flag to reverse the order of the returned records.
3434+// rkeyEnd: DEPRECATED: The highest sort-ordered rkey to stop at (exclusive)
3535+// rkeyStart: DEPRECATED: The lowest sort-ordered rkey to start from (exclusive)
3636+func RepoListRecords(ctx context.Context, c *xrpc.Client, collection string, cursor string, limit int64, repo string, reverse bool, rkeyEnd string, rkeyStart string) (*RepoListRecords_Output, error) {
3737+ var out RepoListRecords_Output
3838+3939+ params := map[string]interface{}{
4040+ "collection": collection,
4141+ "cursor": cursor,
4242+ "limit": limit,
4343+ "repo": repo,
4444+ "reverse": reverse,
4545+ "rkeyEnd": rkeyEnd,
4646+ "rkeyStart": rkeyStart,
4747+ }
4848+ if err := c.Do(ctx, xrpc.Query, "", "com.atproto.repo.listRecords", params, nil, &out); err != nil {
4949+ return nil, err
5050+ }
5151+5252+ return &out, nil
5353+}
+47
api/agnostic/repoputRecord.go
···11+// Copied from indigo:api/atproto/repoputRecords.go
22+33+package agnostic
44+55+// schema: com.atproto.repo.putRecord
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/xrpc"
1111+)
1212+1313+// RepoPutRecord_Input is the input argument to a com.atproto.repo.putRecord call.
1414+type RepoPutRecord_Input struct {
1515+ // collection: The NSID of the record collection.
1616+ Collection string `json:"collection" cborgen:"collection"`
1717+ // record: The record to write.
1818+ Record map[string]any `json:"record" cborgen:"record"`
1919+ // repo: The handle or DID of the repo (aka, current account).
2020+ Repo string `json:"repo" cborgen:"repo"`
2121+ // rkey: The Record Key.
2222+ Rkey string `json:"rkey" cborgen:"rkey"`
2323+ // swapCommit: Compare and swap with the previous commit by CID.
2424+ SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"`
2525+ // swapRecord: Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation
2626+ SwapRecord *string `json:"swapRecord" cborgen:"swapRecord"`
2727+ // 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.
2828+ Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"`
2929+}
3030+3131+// RepoPutRecord_Output is the output of a com.atproto.repo.putRecord call.
3232+type RepoPutRecord_Output struct {
3333+ Cid string `json:"cid" cborgen:"cid"`
3434+ Commit *RepoDefs_CommitMeta `json:"commit,omitempty" cborgen:"commit,omitempty"`
3535+ Uri string `json:"uri" cborgen:"uri"`
3636+ ValidationStatus *string `json:"validationStatus,omitempty" cborgen:"validationStatus,omitempty"`
3737+}
3838+3939+// RepoPutRecord calls the XRPC method "com.atproto.repo.putRecord".
4040+func RepoPutRecord(ctx context.Context, c *xrpc.Client, input *RepoPutRecord_Input) (*RepoPutRecord_Output, error) {
4141+ var out RepoPutRecord_Output
4242+ if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.repo.putRecord", nil, input, &out); err != nil {
4343+ return nil, err
4444+ }
4545+4646+ return &out, nil
4747+}