def from_dict()

in greengrasssdk/stream_manager/data/__init__.py [0:0]


    def from_dict(d):
        v = {}
        if "requestId" in d:
            v["request_id"] = (
                str.from_dict(d["requestId"])
                if hasattr(str, "from_dict")
                else d["requestId"]
            )
        if "status" in d:
            v["status"] = (
                ResponseStatusCode.from_dict(d["status"])
                if hasattr(ResponseStatusCode, "from_dict")
                else d["status"]
            )
        if "errorMessage" in d:
            v["error_message"] = (
                str.from_dict(d["errorMessage"])
                if hasattr(str, "from_dict")
                else d["errorMessage"]
            )
        if "protocolVersion" in d:
            v["protocol_version"] = (
                str.from_dict(d["protocolVersion"])
                if hasattr(str, "from_dict")
                else d["protocolVersion"]
            )
        if "supportedProtocolVersions" in d:
            v["supported_protocol_versions"] = [
                str.from_dict(p) if hasattr(str, "from_dict") else p
                for p in d["supportedProtocolVersions"]
            ]
        if "serverVersion" in d:
            v["server_version"] = (
                str.from_dict(d["serverVersion"])
                if hasattr(str, "from_dict")
                else d["serverVersion"]
            )
        if "clientIdentifier" in d:
            v["client_identifier"] = (
                str.from_dict(d["clientIdentifier"])
                if hasattr(str, "from_dict")
                else d["clientIdentifier"]
            )
        return ConnectResponse(**v)