     invalidAuthorizationHeader = "invalid-authorization-header"
 }
 
+public enum BadRequestCode: String {
+    case alreadyExists = "already-exists",
+    unhandledErrorCode
+}
+
 public enum SDException: ErrorType {
     case Unauthorized(code: UnauthorizedCode)
     case Forbidden

import AlamofireObjectMapper
import PromiseKit

//TODO: handle headers.

public enum UnauthorizedCode: String {
    case invalidCredentials = "invalid-credentials",
    expiredAccessToken = "expired-access-token",

    case NotFound
    case ServerFailed
    case UnhandledHttpError(code: Int)
    case BadRequest(code: BadRequestCode)
    case DeviceNotReadyForInstallation
}

