public void FromJsonObject()

in src/main/java/com/aliyun/openservices/log/common/LogStore.java [266:325]


    public void FromJsonObject(JSONObject dict) throws LogException {
        try {
            SetLogStoreName(dict.getString("logstoreName"));
            SetTtl(dict.getIntValue("ttl"));
            SetShardCount(dict.getIntValue("shardCount"));
            if (dict.containsKey("enable_tracking")) {
                this.setEnableWebTracking(dict.getBoolean("enable_tracking"));
            }
            if (dict.containsKey("createTime")) {
                createTime = dict.getIntValue("createTime");
            }

            if (dict.containsKey("lastModifyTime")) {
                lastModifyTime = dict.getIntValue("lastModifyTime");
            }

            if (dict.containsKey("autoSplit")) {
                mAutoSplit = dict.getBoolean("autoSplit");
            }
            if (dict.containsKey("maxSplitShard")) {
                mMaxSplitShard = dict.getIntValue("maxSplitShard");
            }
            appendMeta = dict.containsKey("appendMeta") && dict.getBoolean("appendMeta");
            if (dict.containsKey("productType")) {
                productType = dict.getString("productType");
            }
            if (dict.containsKey("telemetryType")) {
                telemetryType = dict.getString("telemetryType");
            }
            // set resourceQuota
            if (dict.containsKey("resourceQuota")) {
                JSONObject resourceQuotaJson = dict.getJSONObject("resourceQuota");
                if (resourceQuotaJson.containsKey("storage")) {
                    JSONObject storageJson = resourceQuotaJson.getJSONObject("storage");
                    if (storageJson.containsKey("preserved")) {
                        preserveStorage = storageJson.getLong("preserved");
                    }
                    if (storageJson.containsKey("used")) {
                        usedStorage = storageJson.getLong("used");
                    }
                }
            }
            if (dict.containsKey("encrypt_conf")) {
                EncryptConf encypt_config = new EncryptConf();
                encypt_config.FromJsonObject(dict.getJSONObject("encrypt_conf"));
                this.encryptConf = encypt_config;
            }
            if (dict.containsKey("hot_ttl")) {
                this.hotTTL = dict.getInteger("hot_ttl");
            }
            if (dict.containsKey("infrequentAccessTTL")) {
                this.infrequentAccessTTL = dict.getInteger("infrequentAccessTTL");
            }
            if (dict.containsKey("mode")) {
                this.mode = dict.getString("mode");
            }
        } catch (JSONException e) {
            throw new LogException("FailToGenerateLogStore", e.getMessage(), e, "");
        }
    }