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

package atproto

// schema: com.atproto.server.describeServer

import (
	"context"

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

// ServerDescribeServer_Contact is a "contact" in the com.atproto.server.describeServer schema.
type ServerDescribeServer_Contact struct {
	Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
}

// ServerDescribeServer_Links is a "links" in the com.atproto.server.describeServer schema.
type ServerDescribeServer_Links struct {
	PrivacyPolicy  *string `json:"privacyPolicy,omitempty" cborgen:"privacyPolicy,omitempty"`
	TermsOfService *string `json:"termsOfService,omitempty" cborgen:"termsOfService,omitempty"`
}

// ServerDescribeServer_Output is the output of a com.atproto.server.describeServer call.
type ServerDescribeServer_Output struct {
	// availableUserDomains: List of domain suffixes that can be used in account handles.
	AvailableUserDomains []string `json:"availableUserDomains" cborgen:"availableUserDomains"`
	// contact: Contact information
	Contact *ServerDescribeServer_Contact `json:"contact,omitempty" cborgen:"contact,omitempty"`
	Did     string                        `json:"did" cborgen:"did"`
	// inviteCodeRequired: If true, an invite code must be supplied to create an account on this instance.
	InviteCodeRequired *bool `json:"inviteCodeRequired,omitempty" cborgen:"inviteCodeRequired,omitempty"`
	// links: URLs of service policy documents.
	Links *ServerDescribeServer_Links `json:"links,omitempty" cborgen:"links,omitempty"`
	// phoneVerificationRequired: If true, a phone verification token must be supplied to create an account on this instance.
	PhoneVerificationRequired *bool `json:"phoneVerificationRequired,omitempty" cborgen:"phoneVerificationRequired,omitempty"`
}

// ServerDescribeServer calls the XRPC method "com.atproto.server.describeServer".
func ServerDescribeServer(ctx context.Context, c util.LexClient) (*ServerDescribeServer_Output, error) {
	var out ServerDescribeServer_Output
	if err := c.LexDo(ctx, util.Query, "", "com.atproto.server.describeServer", nil, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
