0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-05 05:24:01 +00:00
terraform-provider-proxmox/internal/validators/ha_resource_validator.go
Pavel Boldyrev 5ecf135398
chore(code): fix proxmox package dependencies (#536)
move `types` back from `internal` to `proxmox` and adjust a few other types, to make sure `proxmox` package is not dependent on anything else, and therefore can be extracted to a separate repo (#423)
2023-09-03 00:40:47 +00:00

29 lines
1.0 KiB
Go

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package validators
import (
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/bpg/terraform-provider-proxmox/proxmox/types"
)
// HAResourceIDValidator returns a new HA resource identifier validator.
func HAResourceIDValidator() validator.String {
return NewParseValidator(types.ParseHAResourceID, "value must be a valid HA resource identifier")
}
// HAResourceStateValidator returns a new HA resource state validator.
func HAResourceStateValidator() validator.String {
return NewParseValidator(types.ParseHAResourceState, "value must be a valid HA resource state")
}
// HAResourceTypeValidator returns a new HA resource type validator.
func HAResourceTypeValidator() validator.String {
return NewParseValidator(types.ParseHAResourceType, "value must be a valid HA resource type")
}