             }
         }
     }
-    
+
     /**
      Delete a thread subscription
-     - parameter session: RequestKitURLSession, defaults to URLSession.sharedSession()
+     - parameter session: RequestKitURLSession, defaults to URLSession.shared
      - parameter threadId: The ID of the Thread.
      - parameter completion: Callback for the outcome of the fetch.
      */
     @discardableResult
-    func deleteThreadSubscription(_ session: RequestKitURLSession = URLSession.shared,threadId: String, completion: @escaping (_ response: Error?) -> Void) -> URLSessionDataTaskProtocol? {
+    func deleteThreadSubscription(_ session: RequestKitURLSession = URLSession.shared, threadId: String, completion: @escaping (_ response: Error?) -> Void) -> URLSessionDataTaskProtocol? {
         let router = NotificationRouter.deleteThreadSubscription(configuration, threadId)
-        return router.load(session,completion: completion)
-    }
-    
+        return router.load(session, completion: completion)
+    }
+
     /**
      List all repository notifications for the current user, sorted by most recently updated.
-     - parameter session: RequestKitURLSession, defaults to URLSession.sharedSession()
+     - parameter session: RequestKitURLSession, defaults to URLSession.shared
      - parameter owner: The name of the owner of the repository.
      - parameter repository: The name of the repository.
      - parameter all: show notifications marked as read `false` by default.

     - parameter completion: Callback for the outcome of the fetch.
     */
    @discardableResult
    func markRepositoryNotificationsRead(_ session: RequestKitURLSession = URLSession.shared,owner: String,repository: String,lastReadAt: String? = nil, completion: @escaping (_ response: Error?) -> Void) -> URLSessionDataTaskProtocol? {
        let router = NotificationRouter.markRepositoryNotificationsRead(configuration,owner,repository,lastReadAt)
        return router.load(session,completion: completion)
    }
    
    
    
}

// MARK: - Router

enum NotificationRouter: Router {
    case readNotifications(Configuration,Bool,Bool,String,String)
    case markNotificationsRead(Configuration,String,Bool)
    case getNotificationThread(Configuration,String)
    case markNotificationThreadAsRead(Configuration,String)
    case getThreadSubscription(Configuration,String)
    case setThreadSubscription(Configuration,String,Bool)
    case deleteThreadSubscription(Configuration,String)
    case listRepositoryNotifications(Configuration,String,String,Bool,Bool,String?,String?,String,String)
    case markRepositoryNotificationsRead(Configuration,String,String,String?)
    
    var configuration: Configuration {
        switch self {
            case .readNotifications(let config,_,_,_,_): return config
            case .markNotificationsRead(let config, _, _): return config
            case .getNotificationThread(let config, _),.markNotificationThreadAsRead(let config, _): return config
            case .getThreadSubscription(let config, _): return config
            case .setThreadSubscription(let config, _, _): return config
            case .deleteThreadSubscription(let config, _): return config
            case .listRepositoryNotifications(let config, _, _, _, _, _, _, _, _): return config
            case .markRepositoryNotificationsRead(let config, _, _, _): return config
        }
    }
    
    var method: HTTPMethod {
        switch self {
            case .readNotifications(_, _, _, _, _),
                 .getNotificationThread(_, _),
                 .getThreadSubscription(_, _),
                 .listRepositoryNotifications(_, _, _, _, _, _, _, _, _):
                return .GET
            case .markNotificationsRead(_, _, _),
                 .setThreadSubscription(_, _, _),
                 .markRepositoryNotificationsRead(_, _, _, _):
                return .PUT
            case .markNotificationThreadAsRead(_, _):
                return .POST
            case .deleteThreadSubscription(_, _):
                return .DELETE
        }
    }
    
    var encoding: HTTPEncoding {
        return .url
    }
    
    var path: String {
        switch self {
            case .readNotifications(_, _, _, _, _),
                 .markNotificationsRead(_, _, _):
                return "notifications"
            case .getNotificationThread(_, let threadID):
                return "notifications/threads/\(threadID)"
            case .markNotificationThreadAsRead(_, _):
                return "notifications/threads/"
            case .getThreadSubscription(_, let threadId),
                 .setThreadSubscription(_, let threadId, _),
                 .deleteThreadSubscription(_, let threadId):
                return "notifications/threads/\(threadId)/subscription"
            case .listRepositoryNotifications(_, let owner, let repo, _, _, _, _, _, _),
                 .markRepositoryNotificationsRead(_, let owner, let repo, _):
                return "/repos/\(owner)/\(repo)/notifications"
        }
    }
    
    var params: [String: Any] {
        switch self {
            case .readNotifications(_, let all, let participating, let page, let perPage):
                return ["all": "\(all)","participating": "\(participating)","page":page,"per_page":perPage]
            case .markNotificationsRead(_, let lastReadAt, let read):
                return ["last_read_at": lastReadAt,"read": "\(read)"]
            case .getNotificationThread(_, _):
                return [:]
            case .markNotificationThreadAsRead(_, let threadID):
                return ["thread_id": threadID]
            case .getThreadSubscription(_, _):
                return [:]
            case .setThreadSubscription(_, _, _):
                return [:]
            case .deleteThreadSubscription(_, _):
                return [:]
            case .listRepositoryNotifications(_, _, _, let all, let participating, let since, let before, let perPage, let page):
                var params: [String: String] = [
                    "all": all.description,
                    "participating": participating.description,
                    "perPage": perPage,
                    "page": page
                ]
                if let since = since {
                    params["since"] = since
                }
                if let before = before {
                    params["before"] = before
                }
                return params
            case .markRepositoryNotificationsRead(_, _, _, let lastReadAt):
                var params: [String: String] = [:]
                if let lastReadAt = lastReadAt {
                    params["last_read_at"] = lastReadAt
                }
                return params
        }
    }
    
}

        case subject
        case repository
    }

    class Subject: Codable {
        open internal(set) var id: Int = -1
        open var title: String?
        open var url: String?
        open var latestCommentUrl: String?
        open var type: String?

        enum CodingKeys: String, CodingKey {
            case title
            case url
            case latestCommentUrl = "latest_comment_url"
            case type
        }

    }

}


