Esempio n. 1
0
        public static Call FromJSON(object jsonObj)
        {
            Call call = new Call();

            Message.FromJSON(call, jsonObj);

            IDictionary <string, object> json = jsonObj as IDictionary <string, object>;

            call.driver      = Util.JsonOptString(json, "driver");
            call.service     = Util.JsonOptString(json, "service");
            call.parameters  = Util.JsonOptField(json, "parameters") as IDictionary <string, object>;
            call.instanceId  = Util.JsonOptString(json, "instanceId");
            call.serviceType = Util.JsonOptEnum <ServiceType>(json, "serviceType", call.serviceType);
            call.channels    = Util.JsonOptInt(json, "channels", call.channels);

            List <string> ids = Util.JsonOptField(json, "channelIDs") as List <string>;

            if (ids != null)
            {
                call.channelIDs = new string[ids.Count];
                ids.CopyTo(call.channelIDs, 0);
            }

            call.channelType  = Util.JsonOptString(json, "channelType");
            call.securityType = Util.JsonOptString(json, "securityType");

            return(call);
        }
Esempio n. 2
0
        public static Response FromJSON(object json)
        {
            Response r = new Response();

            Message.FromJSON(r, json);

            r.responseData = Util.JsonOptField(json as IDictionary <string, object>, "responseData") as IDictionary <string, object>;

            return(r);
        }
Esempio n. 3
0
        public static Notify FromJSON(object jsonObj)
        {
            Notify e = new Notify();

            Message.FromJSON(e, jsonObj);

            IDictionary <string, object> json = jsonObj as IDictionary <string, object>;

            e.eventKey   = Util.JsonOptString(json, "eventKey");
            e.driver     = Util.JsonOptString(json, "driver");
            e.instanceId = Util.JsonOptString(json, "instanceId");
            e.parameters = Util.JsonOptField(json, "parameters") as IDictionary <string, object>;

            return(e);
        }