Source code for kappa_sdk.user_tasks.input_parameters

from .parameters_dictionary import ParametersDictionary
from typing import Union, Optional, ItemsView, Any, KeysView, List
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__ """
[docs] 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()]
[docs] 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()
[docs] def keys(self) -> KeysView[str]: """ Get only the keys (parameter names) of the parameters Returns ------- Keys of the parameters """ return self.__parameters_dictionary.keys()
[docs] def values(self) -> List[Any]: """ Get only the values of the parameters Returns ------- Values of the parameters """ return self.__parameters_dictionary.values()