validators

package
v0.6.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONSchemaValidator

func JSONSchemaValidator() validator.String

JSONSchemaValidator returns a validator which ensures that a string attribute is a valid JSON and doesn't exceed the maximum allowed nesting depth

func RegexMatches

func RegexMatches(regexp *regexp.Regexp, message string) validator.String

RegexMatches returns a validator.String that ensures any configured value matches the provided regular expression pattern. Null and unknown values are skipped. An optional message can be provided to customize the error output.

func StringListAllowedValues

func StringListAllowedValues(values ...string) validator.List

StringListAllowedValues returns a validator that ensures each string in a list matches one of the allowed values.

func ValidateDeviceConfiguationAssignmentSettings

func ValidateDeviceConfiguationAssignmentSettings(config *sharedmodels.SettingsCatalogSettingsAssignmentResourceModel) error

ValidateDeviceConfiguationAssignmentSettings validates the assignment configuration - if all_devices is false, device filter settings should not be set - if all_users is false, user filter settings should not be set - if all_devices is true and all_devices_filter_id is nil, then all_devices_filter_type must set to "none" - if all_users is true and all_users_filter_id is nil, then all_users_filter_type must set to "none" - if all_devices is true and all_devices_filter_id is set, then all_devices_filter_type must be either "include" or "exclude" - if all_users is true and all_users_filter_id is set, then all_users_filter_type must be either "include" or "exclude" - if group_id is provided in include_groups, include_groups_filter_type must be set - if group_id is provided in include_groups and include_groups_filter_id is nil, then include_groups_filter_type must be "none" - if group_id is provided in include_groups and include_groups_filter_id is set, then include_groups_filter_type must be either "include" or "exclude" - AllDevicesFilterType must be one of: include, exclude, none - AllUsersFilterType must be one of: include, exclude, none - IncludeGroupsFilterType must be one of: include, exclude, none - ExcludeGroupIds must be in alphanumeric order by group_id - IncludeGroups must be in alphanumeric order by group_id - No group is used more than once across include and exclude assignments - AllDevices and IncludeGroups cannot be used at the same time - AllUsers and IncludeGroups cannot be used at the same time

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL