 import Foundation
 import Alamofire
 
-public enum BSRouter: URLRequestConvertible {
+internal enum BSRouter {
     case Services
     case Stations(BSService)
     case ServiceImage(String)

    private static let API_BASE_URL: String = "\(API_BASE)/v1/"
    private static let IMAGE_BASE_URL: String = "\(API_BASE)/images/"

    public var URLRequest: NSMutableURLRequest {
        let (method, base, path): (Alamofire.Method, String, String) = {
            switch self {
            case .Services:
                return (.GET, BSRouter.API_BASE_URL, "services")
            case .Stations(let service):
                return (.GET, BSRouter.API_BASE_URL, "services/\(service.id)/stations")
            case .ServiceImage(let imageName):
                return (.GET, BSRouter.IMAGE_BASE_URL, imageName)
            }
        }()

        let URL = NSURL(string: base)
        let URLRequest = NSMutableURLRequest(URL: URL!.URLByAppendingPathComponent(path))
        URLRequest.HTTPMethod = method.rawValue
        let encoding = Alamofire.ParameterEncoding.URL
        return encoding.encode(URLRequest, parameters: BSRouter.authorizedParameters).0
    }

    static var authorizedParameters: [String: AnyObject] = [
        "token": _token,
        "uuid": BSManager.sharedManager()._uuid,
        "version": (NSBundle.mainBundle().infoDictionary?["CFBundleShortVersionString"] as? String) ?? "unknown",
        "build": (NSBundle.mainBundle().infoDictionary?["CFBundleVersion"] as? String) ?? ""
    ]

}


}

enum BSRouterMethod: String {
    case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT
}