Source code for kappa_sdk.user_tasks.input_parameters
from .parameters_dictionary import ParametersDictionary
from typing import Union, Optional, ItemsView, Any
from uuid import UUID
from datetime import datetime
[docs]
class InputParameters:
"""Input parameters container.
Provides access to input (read-only) parameters of the user task.
.. note:: Should not be instantiated directly.
.. automethod:: __getitem__
"""
def __init__(self, parameters_dictionary: ParametersDictionary) -> None:
self.__parameters_dictionary: ParametersDictionary = parameters_dictionary
[docs]
def __getitem__(self, parameter_name: str) -> Optional[Union[bool, UUID, datetime, float, int, str]]:
"""Gets the value of the user task parameter identified by its name.
Parameters
----------
parameter_name:
The name of the User Task parameter.
"""
return self.__parameters_dictionary[parameter_name.lower()]
def items(self) -> ItemsView[str, Any]:
"""
Access to the class like a real dictionary
Returns
-------
key, values of the class
"""
return self.__parameters_dictionary.items()