// Code generated by Fern. DO NOT EDIT.

package phone

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 list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant.
func (c *Client) GetMessageTypes(
	ctx context.Context,
	opts ...option.RequestOption,
) (*management.GetGuardianFactorPhoneMessageTypesResponseContent, error) {
	response, err := c.WithRawResponse.GetMessageTypes(
		ctx,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Replace the list of <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">phone-type MFA factors</a> (i.e., sms and voice) that are enabled for your tenant.
func (c *Client) SetMessageTypes(
	ctx context.Context,
	request *management.SetGuardianFactorPhoneMessageTypesRequestContent,
	opts ...option.RequestOption,
) (*management.SetGuardianFactorPhoneMessageTypesResponseContent, error) {
	response, err := c.WithRawResponse.SetMessageTypes(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Retrieve configuration details for a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>.
func (c *Client) GetTwilioProvider(
	ctx context.Context,
	opts ...option.RequestOption,
) (*management.GetGuardianFactorsProviderPhoneTwilioResponseContent, error) {
	response, err := c.WithRawResponse.GetTwilioProvider(
		ctx,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Update the configuration of a Twilio phone provider that has been set up in your tenant. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa">Configure SMS and Voice Notifications for MFA</a>.
func (c *Client) SetTwilioProvider(
	ctx context.Context,
	request *management.SetGuardianFactorsProviderPhoneTwilioRequestContent,
	opts ...option.RequestOption,
) (*management.SetGuardianFactorsProviderPhoneTwilioResponseContent, error) {
	response, err := c.WithRawResponse.SetTwilioProvider(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Retrieve details of the multi-factor authentication phone provider configured for your tenant.
func (c *Client) GetSelectedProvider(
	ctx context.Context,
	opts ...option.RequestOption,
) (*management.GetGuardianFactorsProviderPhoneResponseContent, error) {
	response, err := c.WithRawResponse.GetSelectedProvider(
		ctx,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

func (c *Client) SetProvider(
	ctx context.Context,
	request *management.SetGuardianFactorsProviderPhoneRequestContent,
	opts ...option.RequestOption,
) (*management.SetGuardianFactorsProviderPhoneResponseContent, error) {
	response, err := c.WithRawResponse.SetProvider(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant.
func (c *Client) GetTemplates(
	ctx context.Context,
	opts ...option.RequestOption,
) (*management.GetGuardianFactorPhoneTemplatesResponseContent, error) {
	response, err := c.WithRawResponse.GetTemplates(
		ctx,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Customize the messages sent to complete phone enrollment and verification (subscription required).
func (c *Client) SetTemplates(
	ctx context.Context,
	request *management.SetGuardianFactorPhoneTemplatesRequestContent,
	opts ...option.RequestOption,
) (*management.SetGuardianFactorPhoneTemplatesResponseContent, error) {
	response, err := c.WithRawResponse.SetTemplates(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}
