package com.mojang.realmsclient.dto;

import org.apache.logging.log4j.LogManager;
import java.util.Iterator;
import com.google.gson.JsonElement;
import com.google.common.collect.Lists;
import com.google.gson.JsonParser;
import java.util.List;
import org.apache.logging.log4j.Logger;

public class BackupList extends ValueObject {
    private static final Logger LOGGER;
    public List<Backup> backups;
    
    public static BackupList parse(final String string) {
        final JsonParser jsonParser2 = new JsonParser();
        final BackupList dig3 = new BackupList();
        dig3.backups = Lists.newArrayList();
        try {
            final JsonElement jsonElement4 = jsonParser2.parse(string).getAsJsonObject().get("backups");
            if (jsonElement4.isJsonArray()) {
                final Iterator<JsonElement> iterator5 = jsonElement4.getAsJsonArray().iterator();
                while (iterator5.hasNext()) {
                    dig3.backups.add(Backup.parse(iterator5.next()));
                }
            }
        }
        catch (Exception exception4) {
            BackupList.LOGGER.error("Could not parse BackupList: " + exception4.getMessage());
        }
        return dig3;
    }
    
    static {
        LOGGER = LogManager.getLogger();
    }
}
