blpapi.SchemaTypeDefinition¶
- class blpapi.SchemaTypeDefinition¶
Representation of a “type” that can be used within a schema.
This class implements a representation of a “type” that can be used within a schema, including both plain types (integers, dates, strings, etc.) and “complex” types. The latter may be a “sequence” or a “choice” allowing either all or one of the named elements respectively. Those elements in turn are each described by a type. In addition to accessors for the type’s structure, this class also offers access to metadata providing a description and deprecation status for the type.
Each
SchemaElementDefinitionobject is associated with a singleSchemaTypeDefinition; oneSchemaTypeDefinitionmay be used by zero, one, or manySchemaElementDefinitionobjects.SchemaTypeDefinitionobjects are read-only.Application clients need never create
SchemaTypeDefinitionobjects directly; applications will typically work with objects returned by other blpapi components.- datatype()¶
- Returns
The data type of this
SchemaTypeDefinition.- Return type
The possible return values are enumerated in
DataType.
- description()¶
- Returns
Human readable description of this
SchemaTypeDefinition.- Return type
- elementDefinitions()¶
- Returns
Iterator over
SchemaElementDefinitions defined by thisSchemaTypeDefinition.
- enumeration()¶
- Returns
All possible values of the enumeration defined by this type.
Nonein case thisSchemaTypeDefinitionis not a enumeration.- Return type
- getElementDefinition(nameOrIndex)¶
- Parameters
nameOrIndex (Name or str or int) – Name or index of the element
- Returns
The definition of a specified element.
- Return type
- Raises
NotFoundException – If
nameOrIndexis a string andhasElement(nameOrIndex) != True.IndexOutOfRangeException – If
nameOrIndexis an integer andnameOrIndex >= numElementDefinitions()
- hasElementDefinition(name)¶
- isComplexType()¶
- Returns
Trueif thisSchemaTypeDefinitionrepresents a sequence or choice type.- Return type
- isEnumerationType()¶
- Returns
Trueif thisSchemaTypeDefinitionrepresents an enumeration type,Falseotherwise.- Return type
- isSimpleType()¶
- Returns
True if this
SchemaTypeDefinitionrepresents neither a sequence nor a choice type.- Return type
- name()¶
- Returns
The name of this
SchemaTypeDefinition.- Return type
- numElementDefinitions()¶
- Returns
The number of
SchemaElementDefinitionobjects.- Return type
If this
SchemaTypeDefinitionis neither a choice nor a sequence this will return0.
- status()¶
- Returns
The deprecation status of this
SchemaTypeDefinition.- Return type
The possible return values are enumerated in
SchemaStatus.
- toString(level=0, spacesPerLevel=4)¶
- Parameters
- Returns
This object formatted as a string
- Return type
If
levelis negative, suppress indentation of the first line. IfspacesPerLevelis negative, format the entire output on one line, suppressing all but the initial indentation (as governed bylevel).