A fork of https://github.com/teal-fm/piper
at main 46 lines 2.4 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.createSession 6 7import ( 8 "context" 9 10 "github.com/bluesky-social/indigo/xrpc" 11) 12 13// ServerCreateSession_Input is the input argument to a com.atproto.server.createSession call. 14type 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. 24type 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". 39func ServerCreateSession(ctx context.Context, c *xrpc.Client, input *ServerCreateSession_Input) (*ServerCreateSession_Output, error) { 40 var out ServerCreateSession_Output 41 if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.server.createSession", nil, input, &out); err != nil { 42 return nil, err 43 } 44 45 return &out, nil 46}