sharedValidators

package
v0.15.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SettingsCatalogValidator

func SettingsCatalogValidator() validator.String

SettingsCatalogValidator returns a validator which ensures settings catalog json is valid

func SingleIncludeExcludeAssignment

func SingleIncludeExcludeAssignment() validator.List

Factory function

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

type SingleIncludeExcludeAssignmentValidator

type SingleIncludeExcludeAssignmentValidator struct{}

SingleIncludeExcludeAssignmentValidator ensures only one include and one exclude assignment block exist

func (SingleIncludeExcludeAssignmentValidator) Description

Description of the validator

func (SingleIncludeExcludeAssignmentValidator) MarkdownDescription

MarkdownDescription of the validator

func (SingleIncludeExcludeAssignmentValidator) ValidateList

ValidateList performs the actual validation

Jump to

Keyboard shortcuts

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