         case numberOfReplicas = "number_of_replicas"
         case uuid
         case providedName = "provided_name"
+        case autoExpandReplicas = "auto_expand_replicas"
         case version
+        case codec
+        case format
+        case refreshInterval = "refresh_interval"
+        case mapping
     }
     
 }
 
 public struct IndexVersion: Codable {
     public let created: String
-    
-    init(created: String) {
+    public let updated: String?
+    
+    init(created: String, updated: String?) {
         self.created = created
-    }
-}
+        self.updated = updated
+    }
+}
+
+public struct IndexAlias: Codable {
+    
+    public let name: String
+    public let routing: String?
+    public let indexRouting: String?
+    public let searchRouting: String?
+    public let filter: CodableValue?
+    
+    
+    public init(name: String, indexRouting: String?, searchRouting: String?, routing: String?, filter: CodableValue?) {
+        self.name = name
+        self.indexRouting = indexRouting
+        self.searchRouting = searchRouting
+        self.routing = routing
+        self.filter = filter
+    }
+    
+    public init(name: String, metaData: AliasMetaData) {
+        self.name = name
+        self.indexRouting = metaData.indexRouting
+        self.routing = metaData.routing
+        self.searchRouting = metaData.searchRouting
+        self.filter = metaData.filter
+    }
+    
+    public init(from decoder: Decoder) throws {
+        let container = try decoder.singleValueContainer()
+        let dic = try container.decode(Dictionary<String, AliasMetaData>.self)
+        let entry =  dic.first!
+        self.init(name: entry.key, indexRouting: entry.value.indexRouting, searchRouting: entry.value.searchRouting, routing: entry.value.routing, filter: entry.value.filter)
+    }
+    
+    public func encode(to encoder: Encoder) throws {
+        var container = encoder.container(keyedBy: CodingKeys.self)
+        try self.metaData.encode(to: container.superEncoder(forKey: .key(named: self.name)))
+    }
+    
+    public var metaData: AliasMetaData {
+        get {
+            return AliasMetaData(indexRouting: self.indexRouting, searchRouting: self.searchRouting, routing: self.routing, filter: self.filter)
+        }
+    }
+    
+    public struct CodingKeys: CodingKey {
+        public var stringValue: String
+        public var intValue: Int?
+        public init(stringValue: String) {
+            self.stringValue = stringValue
+        }
+        public init?(intValue: Int) {
+            self.intValue = intValue
+            stringValue = "\(intValue)"
+        }
+        static func key(named name: String) -> CodingKeys {
+            return CodingKeys(stringValue: name)
+        }
+    }
+}
+
 
 
 //MARK:- INDEX Exists Response

    
    public let type: String?
    public let fields: Fields?
    
    public struct Fields: Codable {
        public let keyword: Keyword

    
    public let indexRouting: String?
    public let searchRouting: String?
    public let routing: String?
    public let filter: CodableValue?
    
    enum CodingKeys: String, CodingKey {
        case indexRouting = "index_routing"
        case searchRouting = "search_routing"
        case routing
        case filter
    }
}

