// Code generated by Fern. DO NOT EDIT.

package client

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"
	customtext "github.com/auth0/go-auth0/v2/management/prompts/customtext"
	partials "github.com/auth0/go-auth0/v2/management/prompts/partials"
	rendering "github.com/auth0/go-auth0/v2/management/prompts/rendering"
)

type Client struct {
	WithRawResponse *RawClient
	Rendering       *rendering.Client
	CustomText      *customtext.Client
	Partials        *partials.Client

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

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

// Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features.
func (c *Client) GetSettings(
	ctx context.Context,
	opts ...option.RequestOption,
) (*management.GetSettingsResponseContent, error) {
	response, err := c.WithRawResponse.GetSettings(
		ctx,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features.
func (c *Client) UpdateSettings(
	ctx context.Context,
	request *management.UpdateSettingsRequestContent,
	opts ...option.RequestOption,
) (*management.UpdateSettingsResponseContent, error) {
	response, err := c.WithRawResponse.UpdateSettings(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}
