package disks

import (
	"context"

	"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/dc"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/service/cloudbroker/ic"

	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
	"repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
)

func checkParamsExistence(ctx context.Context, d *schema.ResourceData, c *controller.ControllerCfg) diag.Diagnostics {
	var errs []error

	accountID := uint64(d.Get("account_id").(int))

	if err := ic.ExistAccount(ctx, accountID, c); err != nil {
		errs = append(errs, err)
	}

	return dc.ErrorsToDiagnostics(errs)
}
