A fork of https://github.com/teal-fm/piper
at fly 52 lines 2.5 kB view raw
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 3package atproto 4 5// schema: com.atproto.server.createAccount 6 7import ( 8 "context" 9 10 "github.com/bluesky-social/indigo/xrpc" 11) 12 13// ServerCreateAccount_Input is the input argument to a com.atproto.server.createAccount call. 14type 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. 34type 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". 45func ServerCreateAccount(ctx context.Context, c *xrpc.Client, input *ServerCreateAccount_Input) (*ServerCreateAccount_Output, error) { 46 var out ServerCreateAccount_Output 47 if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.server.createAccount", nil, input, &out); err != nil { 48 return nil, err 49 } 50 51 return &out, nil 52}