Skip to content

imappingstrategy

Mapping Strategy Interface

IMappingStrategy dataclass

Bases: Protocol

Mapping Strategy Interface.

Source code in oteapi/interfaces/imappingstrategy.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@dataclass  # type: ignore[misc]
class IMappingStrategy(Protocol):
    """Mapping Strategy Interface."""

    mapping_config: "MappingConfig"

    def get(self) -> "AttrDict":
        """Execute the strategy.

        Returns:
            An update model of key/value-pairs to be stored in the
            session-specific context from services.

        """

    def initialize(self) -> "AttrDict":
        """Initialize data class.

        This method will be called through the `/initialize` endpoint of the OTE-API
        Services.

        Returns:
            An update model of key/value-pairs to be stored in the
            session-specific context from services.

        """

get()

Execute the strategy.

Returns:

Type Description
AttrDict

An update model of key/value-pairs to be stored in the

AttrDict

session-specific context from services.

Source code in oteapi/interfaces/imappingstrategy.py
16
17
18
19
20
21
22
23
def get(self) -> "AttrDict":
    """Execute the strategy.

    Returns:
        An update model of key/value-pairs to be stored in the
        session-specific context from services.

    """

initialize()

Initialize data class.

This method will be called through the /initialize endpoint of the OTE-API Services.

Returns:

Type Description
AttrDict

An update model of key/value-pairs to be stored in the

AttrDict

session-specific context from services.

Source code in oteapi/interfaces/imappingstrategy.py
25
26
27
28
29
30
31
32
33
34
35
def initialize(self) -> "AttrDict":
    """Initialize data class.

    This method will be called through the `/initialize` endpoint of the OTE-API
    Services.

    Returns:
        An update model of key/value-pairs to be stored in the
        session-specific context from services.

    """