Skip to content

itransformationstrategy

Tranformation Strategy Interface

ITransformationStrategy dataclass

Bases: Protocol

Transformation Strategy Interface.

Source code in oteapi/interfaces/itransformationstrategy.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
36
37
38
39
40
41
42
43
44
45
46
47
@dataclass  # type: ignore[misc]
class ITransformationStrategy(Protocol):
    """Transformation Strategy Interface."""

    transformation_config: "TransformationConfig"

    def status(self, task_id: str) -> "TransformationStatus":
        """Get job status.

        Parameters:
            task_id: The transformation job ID.

        Returns:
            An overview of the transformation job's status, including relevant
            metadata.

        """

    def get(self) -> "AttrDict":
        """Execute the strategy i.e. running a transformation job.

        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 i.e. running a transformation job.

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/itransformationstrategy.py
28
29
30
31
32
33
34
35
def get(self) -> "AttrDict":
    """Execute the strategy i.e. running a transformation job.

    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/itransformationstrategy.py
37
38
39
40
41
42
43
44
45
46
47
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.

    """

status(task_id)

Get job status.

Parameters:

Name Type Description Default
task_id str

The transformation job ID.

required

Returns:

Type Description
TransformationStatus

An overview of the transformation job's status, including relevant

TransformationStatus

metadata.

Source code in oteapi/interfaces/itransformationstrategy.py
16
17
18
19
20
21
22
23
24
25
26
def status(self, task_id: str) -> "TransformationStatus":
    """Get job status.

    Parameters:
        task_id: The transformation job ID.

    Returns:
        An overview of the transformation job's status, including relevant
        metadata.

    """