blpapi.SchemaElementDefinition

class blpapi.SchemaElementDefinition(handle, sessions)

The definition of an individual field within a schema type.

This class implements the definition of an individual field within a schema type. An element is defined by an identifer/name, a type, and the number of values of that type that may be associated with the identifier/name. In addition, this class offers access to metadata providing a description and deprecation status for the field.

SchemaElementDefinition objects are returned by Service and Operation objects to define the content of requests, replies and events. The SchemaTypeDefinition returned by typeDefinition() may itself provide access to SchemaElementDefinition objects when the schema contains nested elements. (See the SchemaTypeDefinition documentation for more information on complex types.)

An optional element has minValues() == 0.

A mandatory element has minValues() >= 1.

An element that must contain a single value has minValues() == maxValues() == 1.

An element containing an array has maxValues() > 1.

An element with no upper limit on the number of values has maxValues() == UNBOUNDED.

SchemaElementDefinition objects are read-only.

Application clients need never create SchemaElementDefinition objects directly; applications will typically work with objects returned by other blpapi components.

UNBOUNDED = -1

Indicates an array has an unbounded number of values.

alternateNames()
Return type:

Sequence[Name]

Returns:

The list of alternate names for this element.

description()
Return type:

str

Returns:

Human readable description of this element.

maxValues()
Return type:

int

Returns:

The maximum number of occurrences of this element.

This value is always greater than or equal to one.

Return value is equal to UNBOUNDED if this item is an unbounded array.

minValues()
Return type:

int

Returns:

The minimum number of occurrences of this element.

This value is always greater than or equal to zero.

name()
Return type:

Name

Returns:

The name identifying this element within its containing structure/type.

status()
Return type:

int

Returns:

The deprecation status of this element.

The possible return values are enumerated in SchemaStatus.

toString(level=0, spacesPerLevel=4)
Parameters:
  • level (int) – Indentation level

  • spacesPerLevel (int) – Number of spaces per indentation level for this and all nested objects

Return type:

str

Returns:

This object formatted as a string

If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level).

typeDefinition()
Return type:

SchemaTypeDefinition

Returns:

The type of values contained in this element.