// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package atproto

// schema: com.atproto.server.createSession

import (
	"context"

	"github.com/bluesky-social/indigo/xrpc"
)

// ServerCreateSession_Input is the input argument to a com.atproto.server.createSession call.
type ServerCreateSession_Input struct {
	AuthFactorToken *string `json:"authFactorToken,omitempty" cborgen:"authFactorToken,omitempty"`
	// identifier: Handle or other identifier supported by the server for the authenticating user.
	Identifier string `json:"identifier" cborgen:"identifier"`
	Password   string `json:"password" cborgen:"password"`
}

// ServerCreateSession_Output is the output of a com.atproto.server.createSession call.
type ServerCreateSession_Output struct {
	AccessJwt       string       `json:"accessJwt" cborgen:"accessJwt"`
	Active          *bool        `json:"active,omitempty" cborgen:"active,omitempty"`
	Did             string       `json:"did" cborgen:"did"`
	DidDoc          *interface{} `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"`
	Email           *string      `json:"email,omitempty" cborgen:"email,omitempty"`
	EmailAuthFactor *bool        `json:"emailAuthFactor,omitempty" cborgen:"emailAuthFactor,omitempty"`
	EmailConfirmed  *bool        `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"`
	Handle          string       `json:"handle" cborgen:"handle"`
	RefreshJwt      string       `json:"refreshJwt" cborgen:"refreshJwt"`
	// 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.
	Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
}

// ServerCreateSession calls the XRPC method "com.atproto.server.createSession".
func ServerCreateSession(ctx context.Context, c *xrpc.Client, input *ServerCreateSession_Input) (*ServerCreateSession_Output, error) {
	var out ServerCreateSession_Output
	if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.server.createSession", nil, input, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
