001package com.box.sdk;
002
003import com.eclipsesource.json.JsonObject;
004import com.eclipsesource.json.JsonValue;
005
006/**
007 * Represents items that have naming conflicts when creating a zip file.
008 */
009public class BoxZipConflictItem extends BoxJSONObject {
010    private String id;
011    private String type;
012    private String originalName;
013    private String downloadName;
014
015    /**
016     * Constructs a BoxZipNameConflict with default settings.
017     */
018    public BoxZipConflictItem() {
019    }
020
021    /**
022     * Constructs a BoxZipNameConflict from a JSON string.
023     *
024     * @param json the JSON encoded enterprise.
025     */
026    public BoxZipConflictItem(String json) {
027        super(json);
028    }
029
030    BoxZipConflictItem(JsonObject jsonObject) {
031        super(jsonObject);
032    }
033
034    /**
035     * Gets the ID of the item that has the conflict.
036     *
037     * @return the ID of the item that has the conflict.
038     */
039    public String getID() {
040        return this.id;
041    }
042
043    /**
044     * Gets the type of the item that has the conflict.
045     *
046     * @return the type of the item that has the conflict.
047     */
048    public String getType() {
049        return this.type;
050    }
051
052    /**
053     * Gets the original name of the item that has the conflict.
054     *
055     * @return the original name of the item that has the conflict.
056     */
057    public String getOriginalName() {
058        return this.originalName;
059    }
060
061    /**
062     * Gets the new name of the item when it downloads that resolves the conflict.
063     *
064     * @return the new name of the item when it downloads that resolves the conflict.
065     */
066    public String getDownloadName() {
067        return this.downloadName;
068    }
069
070    @Override
071    void parseJSONMember(JsonObject.Member member) {
072        JsonValue value = member.getValue();
073        String memberName = member.getName();
074        if (memberName.equals("id")) {
075            this.id = value.asString();
076        } else if (memberName.equals("type")) {
077            this.type = value.asString();
078        } else if (memberName.equals("original_name")) {
079            this.originalName = value.asString();
080        } else if (memberName.equals("download_name")) {
081            this.downloadName = value.asString();
082        }
083    }
084}