<commit_before>//
//  API.swift
//  Peach
//
//  Created by <NAME> on 10/01/2016.
//  Copyright © 2016 Cocoon Development Ltd. All rights reserved.
//

import Alamofire

enum API: URLRequestConvertible {
    
    // MARK: - Cases
    
    case Authenticate(String, String)
    case Activity
    case MarkActivityRead
    case Connections
    case Explore
    case Stream(String)
    case CreatePost([String:AnyObject]?)
    case MarkStreamRead(String)
    case FriendRequests
    case AcceptFriendRequest(String)
    case DeclineFriendRequest(String)
    case IgnoreFriendRequest(String)
    case LikePost(String)
    case UnlikePost(String)
    
    // MARK: - URLRequestConvertible
    
    static let base = "https://v1.peachapi.com"
    
    var method: Alamofire.Method {
        switch self {
            case .Authenticate, .CreatePost, .LikePost:
                return .POST
            case .MarkStreamRead, .MarkActivityRead, .AcceptFriendRequest, .DeclineFriendRequest, .IgnoreFriendRequest:
                return .PUT
            case .UnlikePost:
                return .DELETE
            default:
                return .GET
        }
    }
    
    var path: String {
        switch self {
            case .Authenticate:
                return "/login"
            case .Activity:
                return "/activity"
            case .MarkActivityRead:
                return "/activity"
            case .Connections:
                return "/connections"
            case .Explore:
                return "/connections/explore"
            case .Stream(let id):
                return "/stream/id/\(id)"
            case .MarkStreamRead(let id):
                return "/stream/id/\(id)/read"
            case .CreatePost:
                return "/post"
            case .FriendRequests:
                return "/connections/requests/inbound"<commit_msg>Add the correct endpoint for marking activity read<commit_after>//
//  API.swift
//  Peach
//
//  Created by <NAME> on 10/01/2016.
//  Copyright © 2016 Cocoon Development Ltd. All rights reserved.
//

import Alamofire

enum API: URLRequestConvertible {
    
    // MARK: - Cases
    
    case Authenticate(String, String)
    case Activity
    case MarkActivityRead
    case Connections
    case Explore
    case Stream(String)
    case CreatePost([String:AnyObject]?)
    case MarkStreamRead(String)
    case FriendRequests
    case AcceptFriendRequest(String)
    case DeclineFriendRequest(String)
    case IgnoreFriendRequest(String)
    case LikePost(String)
    case UnlikePost(String)
    
    // MARK: - URLRequestConvertible
    
    static let base = "https://v1.peachapi.com"
    
    var method: Alamofire.Method {
        switch self {
            case .Authenticate, .CreatePost, .LikePost:
                return .POST
            case .MarkStreamRead, .MarkActivityRead, .AcceptFriendRequest, .DeclineFriendRequest, .IgnoreFriendRequest:
                return .PUT
            case .UnlikePost:
                return .DELETE
            default:
                return .GET
        }
    }
    
    var path: String {
        switch self {
            case .Authenticate:
                return "/login"
            case .Activity:
                return "/activity"
            case .MarkActivityRead:
                return "/activity/read"
            case .Connections:
                return "/connections"
            case .Explore:
                return "/connections/explore"
            case .Stream(let id):
                return "/stream/id/\(id)"
            case .MarkStreamRead(let id):
                return "/stream/id/\(id)/read"
            case .CreatePost:
                return "/post"
            case .FriendRequests:
                return "/connections/requests/inbound"
{'fraction_non_alphanumeric': 0.08575197889182058, 'fraction_numerical': 0.006860158311345646, 'mean_word_length': 1.6126809097174362, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6016514', 'n_tokens_mistral': 1041, 'n_tokens_neox': 977, 'n_words': 262}