Documentation
¶
Index ¶
- func Int64ConditionalRequirement(dependentPath path.Path, allowedValues []string) validator.Int64
- func Int64ConditionalRequirementSingle(dependentPath path.Path, requiredValue string) validator.Int64
- func IsUUID() validator.String
- func StringConditionalRequirement(dependentPath path.Path, allowedValues []string) validator.String
- func StringConditionalRequirementSingle(dependentPath path.Path, requiredValue string) validator.String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int64ConditionalRequirementSingle ¶
func Int64ConditionalRequirementSingle(dependentPath path.Path, requiredValue string) validator.Int64
Int64ConditionalRequirementSingle is a convenience function for when there's only one allowed value.
func StringConditionalRequirement ¶
StringConditionalRequirement returns a validator which ensures that a string attribute can only be set if another attribute at the specified path equals one of the specified values.
The dependentPath parameter should use path.Root() to specify the attribute path. For example: path.Root("auth_type")
Example usage:
"connection_type": schema.StringAttribute{ Optional: true, Validators: []validator.String{ validators.StringConditionalRequirement( path.Root("auth_type"), []string{"none"}, "connection_type can only be set when auth_type is 'none'", ), }, },
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.