package com.box.boxandroidlibv2.jacksonparser;

import com.box.boxandroidlibv2.dao.BoxAndroidCollaboration;
import com.box.boxandroidlibv2.dao.BoxAndroidCollection;
import com.box.boxandroidlibv2.dao.BoxAndroidComment;
import com.box.boxandroidlibv2.dao.BoxAndroidEmailAlias;
import com.box.boxandroidlibv2.dao.BoxAndroidFile;
import com.box.boxandroidlibv2.dao.BoxAndroidFileVersion;
import com.box.boxandroidlibv2.dao.BoxAndroidFolder;
import com.box.boxandroidlibv2.dao.BoxAndroidOAuthData;
import com.box.boxandroidlibv2.dao.BoxAndroidUser;
import com.box.boxandroidlibv2.dao.BoxAndroidWebLink;
import com.box.boxjavalibv2.dao.BoxItem;
import com.box.boxjavalibv2.dao.BoxPreview;
import com.box.boxjavalibv2.dao.BoxResourceType;
import com.box.boxjavalibv2.dao.BoxTypedObject;
import com.box.boxjavalibv2.jacksonparser.BoxResourceHub;

/**
 * Resource hub to direct the parsing of the api responses into our android sdk data objects.
 */
public class AndroidBoxResourceHub extends BoxResourceHub {

    @SuppressWarnings("rawtypes")
    @Override
    public Class getClass(BoxResourceType type) {
        switch (type) {
            case FILE:
                return BoxAndroidFile.class;
            case PREVIEW:
                return BoxPreview.class;
            case FOLDER:
                return BoxAndroidFolder.class;
            case USER:
                return BoxAndroidUser.class;
            case FILE_VERSION:
                return BoxAndroidFileVersion.class;
            case ITEM:
                return BoxItem.class;
            case COMMENT:
                return BoxAndroidComment.class;
            case COLLABORATION:
                return BoxAndroidCollaboration.class;
            case EMAIL_ALIAS:
                return BoxAndroidEmailAlias.class;
            case OAUTH_DATA:
                return BoxAndroidOAuthData.class;
            case WEB_LINK:
                return BoxAndroidWebLink.class;
            case ITEMS:
            case FILES:
            case USERS:
            case COMMENTS:
            case FILE_VERSIONS:
            case COLLABORATIONS:
            case EMAIL_ALIASES:
            case WEB_LINKS:
                return BoxAndroidCollection.class;
            default:
                return BoxTypedObject.class;
        }
    }

}

@@ -269,16 +269,68 @@
 lAlias;%0A
+import com.box.boxandroidlibv2.dao.BoxAndroidEvent;%0A
 import c
@@ -372,16 +372,16 @@
 idFile;%0A
-
 import c
@@ -648,93 +648,8 @@
 nk;%0A
-import com.box.boxjavalibv2.dao.BoxItem;%0Aimport com.box.boxjavalibv2.dao.BoxPreview;%0A
 impo
@@ -697,56 +697,8 @@
 pe;%0A
-import com.box.boxjavalibv2.dao.BoxTypedObject;%0A
 impo
@@ -1109,75 +1109,8 @@
 ss;%0A
-            case PREVIEW:%0A                return BoxPreview.class;%0A
     
@@ -1332,69 +1332,8 @@
 ss;%0A
-            case ITEM:%0A                return BoxItem.class;%0A
     
@@ -1715,32 +1715,102 @@
 dWebLink.class;%0A
+            case EVENT:%0A                return BoxAndroidEvent.class;%0A
             case
@@ -2116,28 +2116,28 @@
 urn 
-BoxTypedObject.class
+super.getClass(type)
 ;%0A  

Fix an issue that event is not parsed into BoxAndroidEvent class.