// Code generated by Fern. DO NOT EDIT.

package policies

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,
			},
		),
	}
}

// Retrieve the <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> configured for your tenant.
//
// The following policies are supported:
// <ul>
// <li><code>all-applications</code> policy prompts with MFA for all logins.</li>
// <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li>
// </ul>
//
// <b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.
func (c *Client) List(
	ctx context.Context,
	opts ...option.RequestOption,
) (management.ListGuardianPoliciesResponseContent, error) {
	response, err := c.WithRawResponse.List(
		ctx,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Set <a href="https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa">multi-factor authentication (MFA) policies</a> for your tenant.
//
// The following policies are supported:
// <ul>
// <li><code>all-applications</code> policy prompts with MFA for all logins.</li>
// <li><code>confidence-score</code> policy prompts with MFA only for low confidence logins.</li>
// </ul>
//
// <b>Note</b>: The <code>confidence-score</code> policy is part of the <a href="https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa">Adaptive MFA feature</a>. Adaptive MFA requires an add-on for the Enterprise plan; review <a href="https://auth0.com/pricing">Auth0 Pricing</a> for more details.
func (c *Client) Set(
	ctx context.Context,
	request management.SetGuardianPoliciesRequestContent,
	opts ...option.RequestOption,
) (management.SetGuardianPoliciesResponseContent, error) {
	response, err := c.WithRawResponse.Set(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}
