Files
terraform-provider-unifi/internal/provider/validators/helpers.go
Mateusz Filipowicz 8b5ed14d8d feat: add NTP setting resource support with unifi_setting_ntp resource (#36)
* feat: add NTP setting resource support with `unifi_setting_ntp` resource

* linting

* fix missing method

* add missing validators
2025-03-02 01:10:41 +01:00

19 lines
453 B
Go

package validators
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/attr"
)
// conditionValueMatches checks if the condition value matches the expected value
func conditionValueMatches(ctx context.Context, condition, expected attr.Value) bool {
// If types don't match, can't be equal
if condition.Type(ctx) != expected.Type(ctx) {
return false
}
if condition.IsNull() {
return true
}
return condition.Equal(expected)
}