package com.podio.hook;

import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonValue;

public enum HookType {

	ITEM_CREATE("item.create"),
        ITEM_UPDATE("item.update"),
        ITEM_DELETE("item.delete"),
        COMMENT_CREATE("comment.create"),
        COMMENT_DELETE("comment.delete"),
        FILE_CHANGE("file.change"),
        APP_UPDATE("app.update"),
        APP_DELETE("app.delete");

	private final String externalName;

	private HookType(String externalName) {
		this.externalName = externalName;
	}

	@Override
	@JsonValue
	public String toString() {
		return externalName;
	}

	@JsonCreator
	public static HookType getByName(String value) {
		for (HookType type : values()) {
			if (type.externalName.equals(value)) {
				return type;
			}
		}

		return null;
	}
}

@@ -166,32 +166,25 @@
 m.create%22),%0A
-        
+%09
 ITEM_UPDATE(
@@ -199,24 +199,17 @@
 date%22),%0A
-        
+%09
 ITEM_DEL
@@ -224,32 +224,25 @@
 m.delete%22),%0A
-        
+%09
 COMMENT_CREA
@@ -263,24 +263,17 @@
 eate%22),%0A
-        
+%09
 COMMENT_
@@ -298,24 +298,17 @@
 lete%22),%0A
-        
+%09
 FILE_CHA
@@ -323,32 +323,25 @@
 e.change%22),%0A
-        
+%09
 APP_UPDATE(%22
@@ -358,16 +358,9 @@
 %22),%0A
-        
+%09
 APP_

fix indentation