         return context
     }
 
-    func generateErrorCode() -> String {
-        if errorShapeNames.isEmpty { return "" }
-        var code = ""
-        code += autoGeneratedHeader
-        code += "import AWSSDKSwiftCore"
-        code += "\n\n"
-        code += "/// Error enum for \(serviceName)\n"
-        code += ""
-        code += "public enum \(serviceErrorName): AWSErrorType {\n"
-        for name in errorShapeNames {
-            code += "\(indt(1))case \(name.toSwiftVariableCase())(message: String?)\n"
-        }
-        code += "}"
-        code += "\n\n"
-        code += "extension \(serviceErrorName) {\n"
-        code += "\(indt(1))public init?(errorCode: String, message: String?){\n"
-        code += "\(indt(2))var errorCode = errorCode\n"
-        code += "\(indt(2))if let index = errorCode.index(of: \"#\") {\n"
-            code += "\(indt(3))errorCode = String(errorCode[errorCode.index(index, offsetBy: 1)...])\n"
-        code += "\(indt(2))}\n"
-
-        code += "\(indt(2))switch errorCode {\n"
-        for name in errorShapeNames {
-            code += "\(indt(2))case \"\(name)\":\n"
-            code += "\(indt(3))self = .\(name.toSwiftVariableCase())(message: message)\n"
-        }
-        code += "\(indt(2))default:\n"
-        code += "\(indt(3))return nil\n"
-        code += "\(indt(2))}\n"
-        code += "\(indt(1))}\n"
-        code += "}\n"
-
-        return code
-    }
-
+    /// Generate the context information for outputting the service api calls
     func generateServiceContext() -> [String: Any] {
         var context : [String: Any] = [:]
         

//  AWSSDKSwift
//
//  Created by Yuki Takei on 2017/04/04.
//
//

// TODO should use template engine to generate code

import Foundation
import SwiftyJSON

        context["location"] = member.location?.enumStyleDescription()
        context["parameter"] = member.name.toSwiftLabelCase()
        context["required"] = member.required
        context["type"] = member.shape.swiftTypeName + (member.required ? "" : "?")
        context["typeEnum"] = "\(member.shape.type.memberShapeType)"
        context["encoding"] = member.shapeEncoding?.enumStyleDescription()
        if let comment = shapeDoc[shape.name]?[member.name] {
            context["comment"] = comment.split(separator: "\n")
