<commit_before>//
//  TwitterAPIConfiguration.swift
//  NetworkingServiceKit
//
//  Created by <NAME> on 5/4/17.
//  Copyright © 2017 Makespace Inc. All rights reserved.
//

import Foundation
import NetworkingServiceKit

public enum TwitterApp: Int, APIConfigurationAuth {
    case twitterClient = 0

    public init(bundleId: String?) {
        /// For this example lets default into our twitter client, otherwise here where you check your bundleID for your app
        self.init(rawValue: 0)!
    }

    /// Twitter Developer Key and Secret, create your own here: https://apps.twitter.com
    public var key: String {
        switch self {
        case .twitterClient:
            return "<KEY>"
        }
    }
    public var secret: String {
        switch self {
        case .twitterClient:
            return "<KEY>"
        }
    }
}

/// Server information for our twtter servers, in this case we dont have a staging URL for twitter API
public enum TwitterAPIConfigurationType: String, APIConfigurationType {
    case staging = "STAGING"
    case production = "PRODUCTION"
    case custom = "CUSTOM"

    /// Custom init for a key (makes it non failable as opposed to (rawValue:)
    public init(stringKey: String) {
        switch stringKey {
        case "STAGING":
            self = .staging
        case "PRODUCTION":
            self = .production
        case "CUSTOM":
            self = .custom
        default:
            self = .staging
        }
    }

    /// URL for given server
    public var URL: String {
        switch self {
        case .staging:
            return "https://api.twitter.com"
        case .production:
            return "https://api.twitter.com"
        case .custom:
            return "https://api.twitter.com"
        }
    }

    /// Web URL for given server
    public var webURL: String {
        switch self {
        case .staging:
            return "https://twitter.com"
        case .production:
            return "https://twitter.com"
        case .custom:
            return "https://twitter.com"
        }
    }

    /// Display name for given server
    public var displayName: String {
        return self.rawValue.capitalized
    }

    /// Explicitly tells our protocol which is our staging configuration
    public static var stagingConfiguration: APIConfigurationType {
        return TwitterAPIConfigurationType.staging
    }

    /// Explicitly tells our protocol which is our production configuration
    public static var productionConfiguration: APIConfigurationType {
        return TwitterAPIConfigurationType.production<commit_msg>Use new defaultConfiguration<commit_after>//
//  TwitterAPIConfiguration.swift
//  NetworkingServiceKit
//
//  Created by <NAME> on 5/4/17.
//  Copyright © 2017 Makespace Inc. All rights reserved.
//

import Foundation
import NetworkingServiceKit

public enum TwitterApp: Int, APIConfigurationAuth {
    case twitterClient = 0

    public init(bundleId: String?) {
        /// For this example lets default into our twitter client, otherwise here where you check your bundleID for your app
        self.init(rawValue: 0)!
    }

    /// Twitter Developer Key and Secret, create your own here: https://apps.twitter.com
    public var key: String {
        switch self {
        case .twitterClient:
            return "<KEY>"
        }
    }
    public var secret: String {
        switch self {
        case .twitterClient:
            return "<KEY>"
        }
    }
}

/// Server information for our twtter servers, in this case we dont have a staging URL for twitter API
public enum TwitterAPIConfigurationType: String, APIConfigurationType {
    case staging = "STAGING"
    case production = "PRODUCTION"
    case custom = "CUSTOM"

    /// Custom init for a key (makes it non failable as opposed to (rawValue:)
    public init(stringKey: String) {
        switch stringKey {
        case "STAGING":
            self = .staging
        case "PRODUCTION":
            self = .production
        case "CUSTOM":
            self = .custom
        default:
            self = .staging
        }
    }

    /// URL for given server
    public var URL: String {
        switch self {
        case .staging:
            return "https://api.twitter.com"
        case .production:
            return "https://api.twitter.com"
        case .custom:
            return "https://api.twitter.com"
        }
    }

    /// Web URL for given server
    public var webURL: String {
        switch self {
        case .staging:
            return "https://twitter.com"
        case .production:
            return "https://twitter.com"
        case .custom:
            return "https://twitter.com"
        }
    }

    /// Display name for given server
    public var displayName: String {
        return self.rawValue.capitalized
    }

    /// Explicitly tells our protocol which is our default configuration
    public static var defaultConfiguration: APIConfigurationType {
        return TwitterAPIConfigurationType.production
{'fraction_non_alphanumeric': 0.0837477620847424, 'fraction_numerical': 0.003978516013526954, 'mean_word_length': 1.9839762611275964, 'pattern_counts': {'":': 6, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 14, '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': '1215053', 'n_tokens_mistral': 1324, 'n_tokens_neox': 1262, 'n_words': 455}