/// <summary>parses json into a ConfigurationGroup</summary>
        /// <param name="json">json to parse</param>
        /// <returns>ConfigurationGroup corresponding to the json</returns>
        public static ConfigurationGroup Parse(JObject json)
        {
            ConfigurationGroup configurationGroup = new ConfigurationGroup();
            configurationGroup.ID = (ulong)json["id"];
            configurationGroup.Name = (string)json["name"];
            configurationGroup.ProjectID = (ulong)json["project_id"];

            JArray jarray = json["configs"] as JArray;
            if (null != jarray)
            {
                configurationGroup.Configurations = JsonUtility.ConvertJArrayToList<Configuration>(jarray, Configuration.Parse);
            }
            return configurationGroup;
        }
Ejemplo n.º 2
0
        /// <summary>parses json into a ConfigurationGroup</summary>
        /// <param name="json">json to parse</param>
        /// <returns>ConfigurationGroup corresponding to the json</returns>
        public static ConfigurationGroup Parse(JObject json)
        {
            ConfigurationGroup configurationGroup = new ConfigurationGroup();

            configurationGroup.ID        = (ulong)json["id"];
            configurationGroup.Name      = (string)json["name"];
            configurationGroup.ProjectID = (ulong)json["project_id"];

            JArray jarray = json["configs"] as JArray;

            if (null != jarray)
            {
                configurationGroup.Configurations = JsonUtility.ConvertJArrayToList <Configuration>(jarray, Configuration.Parse);
            }
            return(configurationGroup);
        }
Ejemplo n.º 3
0
        /// <summary>parses json into a ConfigurationGroup</summary>
        /// <param name="json">json to parse</param>
        /// <returns>ConfigurationGroup corresponding to the json</returns>
        public static ConfigurationGroup Parse(JObject json)
        {
            var configurationGroup = new ConfigurationGroup
            {
                JsonFromResponse = json,
                ID = (ulong) json["id"],
                Name = (string) json["name"],
                ProjectID = (ulong) json["project_id"],
            };

            var jarray = json["configs"] as JArray;
            if (null != jarray)
            {
                configurationGroup.Configurations = JsonUtility.ConvertJArrayToList<Configuration>(jarray, Configuration.Parse);
            }
            return configurationGroup;
        }        
        /// <summary>parses json into a ConfigurationGroup</summary>
        /// <param name="json">json to parse</param>
        /// <returns>ConfigurationGroup corresponding to the json</returns>
        public static ConfigurationGroup Parse(JObject json)
        {
            var configurationGroup = new ConfigurationGroup
            {
                JsonFromResponse = json,
                ID        = (ulong)json["id"],
                Name      = (string)json["name"],
                ProjectID = (ulong)json["project_id"],
            };

            var jarray = json["configs"] as JArray;

            if (null != jarray)
            {
                configurationGroup.Configurations = JsonUtility.ConvertJArrayToList(jarray, Configuration.Parse);
            }
            return(configurationGroup);
        }