def from_json()

in azure/durable_functions/models/DurableEntityContext.py [0:0]


    def from_json(cls, json_str: str) -> Tuple['DurableEntityContext', List[Dict[str, Any]]]:
        """Instantiate a DurableEntityContext from a JSON-formatted string.

        Parameters
        ----------
        json_string: str
            A JSON-formatted string, returned by the durable-extension,
            which represents the entity context

        Returns
        -------
        DurableEntityContext
            The DurableEntityContext originated from the input string
        """
        json_dict = json.loads(json_str)
        json_dict["name"] = json_dict["self"]["name"]
        json_dict["key"] = json_dict["self"]["key"]
        json_dict.pop("self")

        serialized_state = json_dict["state"]
        if serialized_state is not None:
            json_dict["state"] = from_json_util(serialized_state)

        batch = json_dict.pop("batch")
        return cls(**json_dict), batch