package utilities

import (
	"context"
	"fmt"

	"github.com/hashicorp/terraform-plugin-log/tflog"
	"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
	"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/client"
)

func AccountAuditsListDataSourceCheckPresence(ctx context.Context, accountId uint64, c *client.Client) (*account.ListAudits, error) {
	tflog.Info(ctx, fmt.Sprintf("AccountAuditsListDataSourceCheckPresence: Get info about account audits with account ID - %v", accountId))

	auditsList, err := c.CloudBroker().Account().Audits(ctx, account.AuditsRequest{AccountID: accountId})
	if err != nil {
		return nil, fmt.Errorf("cannot get info about account audits with error: %w", err)
	}

	return &auditsList, err
}
