yawning_titan.config.item_types.str_item.StrProperties#

class yawning_titan.config.item_types.str_item.StrProperties(_allowed_types=None, allow_null=None, default=None, options=None)[source]#

Bases: ItemTypeProperties

The BoolProperties class holds the properties relevant for defining and validating a bool value.

Methods

to_dict

An abstract method that returns the properties as a dict.

validate

Validates a bool against the properties set in BoolProperties.

Attributes

allow_null

True if the config value can be left empty, otherwise False.

default

The default value.

options

A list of allowed values for the item.

allow_null = None#

True if the config value can be left empty, otherwise False.

default = None#

The default value.

options = None#

A list of allowed values for the item.

to_dict()#

An abstract method that returns the properties as a dict.

Returns:

A dict.

validate(val)[source]#

Validates a bool against the properties set in BoolProperties.

Parameters:

val – A bool to be validated.

Returns:

An instance of config_toolbox.config.types.ValueValidation.

Raise:

config_toolbox.exceptions.ValidationError when validation fails.