package utilities

import (
	"context"

	"github.com/hashicorp/terraform-plugin-framework/diag"
	"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/client"
	"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/service/cloudapi/ic"
	"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/service/cloudapi/image/models"
)

func CheckParamsExistenceImage(ctx context.Context, plan *models.ImageResourceModel, c *client.Client) diag.Diagnostics {
	diags := diag.Diagnostics{}

	// if err := ic.ExistGID(ctx, uint64(plan.GID.ValueInt64()), c); err != nil {
	// 	diags.AddError("Error check input values", err.Error())
	// }

	if !plan.AccountID.IsUnknown() {
		if err := ic.ExistAccount(ctx, uint64(plan.AccountID.ValueInt64()), c); err != nil {
			diags.AddError("Error check input values", err.Error())
		}
	}

	return diags
}
