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

package org_tangled

// schema: org.tangled.temp.account.completeSignup

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

const (
	TempAccountCompleteSignupNSID = "org.tangled.temp.account.completeSignup"
)

// TempAccountCompleteSignup_Authorization is a "authorization" in the org.tangled.temp.account.completeSignup schema.
//
// The OAuth authorization response for requestUri, as the PDS would have put it in the redirect.
type TempAccountCompleteSignup_Authorization struct {
	Code  string `json:"code" cborgen:"code"`
	Iss   string `json:"iss" cborgen:"iss"`
	State string `json:"state" cborgen:"state"`
}

// TempAccountCompleteSignup_Input is the input argument to a org.tangled.temp.account.completeSignup call.
type TempAccountCompleteSignup_Input struct {
	// password: Password for the new account.
	Password string `json:"password" cborgen:"password"`
	// requestUri: request_uri of the browser's pushed OAuth authorization request at the PDS. When the PDS supports it, the new account authorizes that request without the PDS sign-in and consent screens.
	RequestUri *string `json:"requestUri,omitempty" cborgen:"requestUri,omitempty"`
	// token: Verification token from the emailed link.
	Token string `json:"token" cborgen:"token"`
	// username: Desired username; the handle is <username>.<pds domain>.
	Username string `json:"username" cborgen:"username"`
}

// TempAccountCompleteSignup_Output is the output of a org.tangled.temp.account.completeSignup call.
type TempAccountCompleteSignup_Output struct {
	// authorization: Present when the PDS authorized requestUri for the new account. Without it the browser signs in through the PDS.
	Authorization *TempAccountCompleteSignup_Authorization `json:"authorization,omitempty" cborgen:"authorization,omitempty"`
	// did: DID of the newly provisioned account.
	Did string `json:"did" cborgen:"did"`
	// handle: The assigned handle, <username>.<pds domain>.
	Handle string `json:"handle" cborgen:"handle"`
}

// TempAccountCompleteSignup calls the XRPC method "org.tangled.temp.account.completeSignup".
func TempAccountCompleteSignup(ctx context.Context, c util.LexClient, input *TempAccountCompleteSignup_Input) (*TempAccountCompleteSignup_Output, error) {
	var out TempAccountCompleteSignup_Output
	if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.completeSignup", nil, input, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
