blpapi.SchemaElementDefinition

class blpapi.SchemaElementDefinition

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 constain 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 = 4294967295

Indicates an array has an unbounded number of values.

alternateNames()
Returns

The list of alternate names for this element.

Return type

[Name]

description()
Returns

Human readable description of this element.

Return type

str

maxValues()
Returns

The maximum number of occurences of this element.

Return type

int

This value is always greater than or equal to one.

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

minValues()
Returns

The minimum number of occurences of this element.

Return type

int

This value is always greater than or equal to zero.

name()
Returns

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

Return type

Name

status()
Returns

The deprecation status of this element.

Return type

int

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

Returns

This object formatted as a string

Return type

str

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()
Returns

The type of values contained in this element.

Return type

SchemaTypeDefinition