package dpdknet

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

	gid := uint64(d.Get("gid").(int))

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

	return dc.ErrorsToDiagnostics(errs)
}
