// Code generated by Fern. DO NOT EDIT.

package multifactor

import (
	context "context"
	management "github.com/auth0/go-auth0/v2/management"
	core "github.com/auth0/go-auth0/v2/management/core"
	internal "github.com/auth0/go-auth0/v2/management/internal"
	option "github.com/auth0/go-auth0/v2/management/option"
)

type Client struct {
	WithRawResponse *RawClient

	options *core.RequestOptions
	baseURL string
	caller  *internal.Caller
}

func NewClient(options *core.RequestOptions) *Client {
	return &Client{
		WithRawResponse: NewRawClient(options),
		options:         options,
		baseURL:         options.BaseURL,
		caller: internal.NewCaller(
			&internal.CallerParams{
				Client:      options.HTTPClient,
				MaxAttempts: options.MaxAttempts,
			},
		),
	}
}

// Invalidate all remembered browsers across all <a href="https://auth0.com/docs/multifactor-authentication">authentication factors</a> for a user.
func (c *Client) InvalidateRememberBrowser(
	ctx context.Context,
	// ID of the user to invalidate all remembered browsers and authentication factors for.
	id string,
	opts ...option.RequestOption,
) error {
	_, err := c.WithRawResponse.InvalidateRememberBrowser(
		ctx,
		id,
		opts...,
	)
	if err != nil {
		return err
	}
	return nil
}

// Remove a <a href="https://auth0.com/docs/multifactor-authentication">multifactor</a> authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider.
func (c *Client) DeleteProvider(
	ctx context.Context,
	// ID of the user to remove a multifactor configuration from.
	id string,
	// The multi-factor provider. Supported values 'duo' or 'google-authenticator'
	provider *management.UserMultifactorProviderEnum,
	opts ...option.RequestOption,
) error {
	_, err := c.WithRawResponse.DeleteProvider(
		ctx,
		id,
		provider,
		opts...,
	)
	if err != nil {
		return err
	}
	return nil
}
