[WIP] music platform user data scraper
teal-fm atproto
at main 2.3 kB view raw
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 3package ozone 4 5// schema: tools.ozone.moderation.getRecords 6 7import ( 8 "context" 9 "encoding/json" 10 "fmt" 11 12 "github.com/bluesky-social/indigo/lex/util" 13 "github.com/bluesky-social/indigo/xrpc" 14) 15 16// ModerationGetRecords_Output is the output of a tools.ozone.moderation.getRecords call. 17type ModerationGetRecords_Output struct { 18 Records []*ModerationGetRecords_Output_Records_Elem `json:"records" cborgen:"records"` 19} 20 21type ModerationGetRecords_Output_Records_Elem struct { 22 ModerationDefs_RecordViewDetail *ModerationDefs_RecordViewDetail 23 ModerationDefs_RecordViewNotFound *ModerationDefs_RecordViewNotFound 24} 25 26func (t *ModerationGetRecords_Output_Records_Elem) MarshalJSON() ([]byte, error) { 27 if t.ModerationDefs_RecordViewDetail != nil { 28 t.ModerationDefs_RecordViewDetail.LexiconTypeID = "tools.ozone.moderation.defs#recordViewDetail" 29 return json.Marshal(t.ModerationDefs_RecordViewDetail) 30 } 31 if t.ModerationDefs_RecordViewNotFound != nil { 32 t.ModerationDefs_RecordViewNotFound.LexiconTypeID = "tools.ozone.moderation.defs#recordViewNotFound" 33 return json.Marshal(t.ModerationDefs_RecordViewNotFound) 34 } 35 return nil, fmt.Errorf("cannot marshal empty enum") 36} 37func (t *ModerationGetRecords_Output_Records_Elem) UnmarshalJSON(b []byte) error { 38 typ, err := util.TypeExtract(b) 39 if err != nil { 40 return err 41 } 42 43 switch typ { 44 case "tools.ozone.moderation.defs#recordViewDetail": 45 t.ModerationDefs_RecordViewDetail = new(ModerationDefs_RecordViewDetail) 46 return json.Unmarshal(b, t.ModerationDefs_RecordViewDetail) 47 case "tools.ozone.moderation.defs#recordViewNotFound": 48 t.ModerationDefs_RecordViewNotFound = new(ModerationDefs_RecordViewNotFound) 49 return json.Unmarshal(b, t.ModerationDefs_RecordViewNotFound) 50 51 default: 52 return nil 53 } 54} 55 56// ModerationGetRecords calls the XRPC method "tools.ozone.moderation.getRecords". 57func ModerationGetRecords(ctx context.Context, c *xrpc.Client, uris []string) (*ModerationGetRecords_Output, error) { 58 var out ModerationGetRecords_Output 59 60 params := map[string]interface{}{ 61 "uris": uris, 62 } 63 if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.getRecords", params, nil, &out); err != nil { 64 return nil, err 65 } 66 67 return &out, nil 68}