ChoiceAttributeDef

class ChoiceAttributeDef

API facade for a choice attribute definition.

Returned by

AddOption(option)

Adds a child option.

Parameters:
option

Child option definition

Raises:

ApiError – If argument option has invalid type.

Clone()

Call this method if you want to use API-objects in multiple contexts, e.g. if you want to insert a specific test step in multiple blocks.

Returns:

A copy of this object

Return type:

ChoiceAttributeDef

GetGroup()

Returns the group of the attribute definition.

Returns:

Group name of the attribute definition or None

Return type:

str

GetIdentifier()

Returns the identifier of the attribute definition.

Returns:

Identifier of the attribute definition

Return type:

str

GetLabel()

Returns the label of the attribute definition.

Returns:

Display label of the attribute definition or None

Return type:

str

GetOption(identifier)

Returns the first option that matches the given identifier.

Parameters:
identifier : str

Option identifier

Returns:

Matching option or None

Return type:

AttributeOptionDef

Raises:

ApiError – If argument identifier has invalid type.

GetOptions()

Returns all direct child options.

Returns:

Child option definitions

Return type:

list[AttributeOptionDef]

IsMultiSelect()

Returns whether multiselect is enabled for this choice definition.

Returns:

True if multiselect is enabled, otherwise False

Return type:

bool

IsReadOnly()

Returns if the attribute is read-only.

Returns:

True if read-only, otherwise False

Return type:

bool

IsRequired()

Returns if the attribute is required.

Returns:

True if required, otherwise False

Return type:

bool

SetGroup(group)

Sets the group of the attribute definition.

Parameters:
group : str

Group name of the attribute definition

SetLabel(label)

Sets the label of the attribute definition.

Parameters:
label : str

Display label of the attribute definition

SetMultiSelect(value)

Enables or disables multiselect for this choice definition.

Parameters:
value : bool

True enables multiselect, False disables it

SetReadOnly(readOnly)

Sets if the attribute is read-only.

Parameters:
readOnly : bool

True if read-only, otherwise False

SetRequired(required)

Sets if the attribute is required.

Parameters:
required : bool

True if required, otherwise False