// Code generated by Fern. DO NOT EDIT.

package pushnotification

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 configuration details for the multi-factor authentication APNS provider associated with your tenant.
func (c *Client) GetApnsProvider(
	ctx context.Context,
	opts ...option.RequestOption,
) (*management.GetGuardianFactorsProviderApnsResponseContent, error) {
	response, err := c.WithRawResponse.GetApnsProvider(
		ctx,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Modify configuration details of the multi-factor authentication APNS provider associated with your tenant.
func (c *Client) SetApnsProvider(
	ctx context.Context,
	request *management.SetGuardianFactorsProviderPushNotificationApnsRequestContent,
	opts ...option.RequestOption,
) (*management.SetGuardianFactorsProviderPushNotificationApnsResponseContent, error) {
	response, err := c.WithRawResponse.SetApnsProvider(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Modify configuration details of the multi-factor authentication FCM provider associated with your tenant.
func (c *Client) SetFcmProvider(
	ctx context.Context,
	request *management.SetGuardianFactorsProviderPushNotificationFcmRequestContent,
	opts ...option.RequestOption,
) (management.SetGuardianFactorsProviderPushNotificationFcmResponseContent, error) {
	response, err := c.WithRawResponse.SetFcmProvider(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Modify configuration details of the multi-factor authentication FCMV1 provider associated with your tenant.
func (c *Client) SetFcmv1Provider(
	ctx context.Context,
	request *management.SetGuardianFactorsProviderPushNotificationFcmv1RequestContent,
	opts ...option.RequestOption,
) (management.SetGuardianFactorsProviderPushNotificationFcmv1ResponseContent, error) {
	response, err := c.WithRawResponse.SetFcmv1Provider(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>.
func (c *Client) GetSnsProvider(
	ctx context.Context,
	opts ...option.RequestOption,
) (*management.GetGuardianFactorsProviderSnsResponseContent, error) {
	response, err := c.WithRawResponse.GetSnsProvider(
		ctx,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required).
func (c *Client) SetSnsProvider(
	ctx context.Context,
	request *management.SetGuardianFactorsProviderPushNotificationSnsRequestContent,
	opts ...option.RequestOption,
) (*management.SetGuardianFactorsProviderPushNotificationSnsResponseContent, error) {
	response, err := c.WithRawResponse.SetSnsProvider(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Configure the <a href="https://auth0.com/docs/multifactor-authentication/developer/sns-configuration">AWS SNS push notification provider configuration</a> (subscription required).
func (c *Client) UpdateSnsProvider(
	ctx context.Context,
	request *management.UpdateGuardianFactorsProviderPushNotificationSnsRequestContent,
	opts ...option.RequestOption,
) (*management.UpdateGuardianFactorsProviderPushNotificationSnsResponseContent, error) {
	response, err := c.WithRawResponse.UpdateSnsProvider(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>.
func (c *Client) GetSelectedProvider(
	ctx context.Context,
	opts ...option.RequestOption,
) (*management.GetGuardianFactorsProviderPushNotificationResponseContent, error) {
	response, err := c.WithRawResponse.GetSelectedProvider(
		ctx,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Modify the push notification provider configured for your tenant. For more information, review <a href="https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa">Configure Push Notifications for MFA</a>.
func (c *Client) SetProvider(
	ctx context.Context,
	request *management.SetGuardianFactorsProviderPushNotificationRequestContent,
	opts ...option.RequestOption,
) (*management.SetGuardianFactorsProviderPushNotificationResponseContent, error) {
	response, err := c.WithRawResponse.SetProvider(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}
