flowserv.model.parameter.boolean module

Declarations for Boolean parameter values. Boolean parameters do not add any additional properties to the base parameter class.

class flowserv.model.parameter.boolean.Bool(name: str, index: Optional[int] = 0, label: Optional[str] = None, help: Optional[str] = None, default: Optional[bool] = None, required: Optional[bool] = False, group: Optional[str] = None)

Bases: flowserv.model.parameter.base.Parameter

Boolean parameter type.

cast(value: Any) Any

Convert the given value into a Boolean value. Converts string values to Boolean True if they match either of the string representations ‘1’, ‘t’ or ‘true’ (case-insensitive) and to False if the value is None or it matches ‘’, ‘0’, ‘f’ or ‘false’. Raises an error if a given value is not a valid representation for a Boolean value.

Parameters

value (any) – User-provided value for a template parameter.

Return type

sting

Raises

flowserv.error.InvalidArgumentError

static from_dict(doc: Dict, validate: Optional[bool] = True) flowserv.model.parameter.boolean.Bool

Get Boolean parameter instance from a dictionary serialization.

Parameters
  • doc (dict) – Dictionary serialization for a Boolean parameter declaration.

  • validate (bool, default=True) – Validate the serialized object if True.

Return type

flowserv.model.parameter.boolean.Bool

Raises

flowserv.error.InvalidParameterError