* feat: add NTP setting resource support with `unifi_setting_ntp` resource * linting * fix missing method * add missing validators
19 lines
453 B
Go
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)
|
|
}
|