// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/noppoMan/aws-sdk-swift/blob/master/Sources/CodeGenerator/main.swift. DO NOT EDIT.

import AWSSDKSwiftCore

/// Error enum for Macie
public enum MacieError: AWSErrorType {
    case invalidInputException(message: String?)
    case accessDeniedException(message: String?)
    case internalException(message: String?)
    case limitExceededException(message: String?)
}

extension MacieError {
    public init?(errorCode: String, message: String?){
        var errorCode = errorCode
        if let index = errorCode.index(of: "#") {
            errorCode = String(errorCode[errorCode.index(index, offsetBy: 1)...])
        }
        switch errorCode {
        case "InvalidInputException":
            self = .invalidInputException(message: message)
        case "AccessDeniedException":
            self = .accessDeniedException(message: message)
        case "InternalException":
            self = .internalException(message: message)
        case "LimitExceededException":
            self = .limitExceededException(message: message)
        default:
            return nil
        }
    }
}