<commit_before>//
//  LoginService.swift
//  Rocket.Chat
//
//  Created by <NAME> on 10/17/17.
//  Copyright © 2017 Rocket.Chat. All rights reserved.
//

import Foundation
import RealmSwift

enum LoginServiceType {
    case google
    case github
    case facebook
    case linkedin
    case gitlab
    case wordpress
    case saml
    case cas
    case custom
    case invalid

    init(string: String) {
        switch string {
        case "google": self = .google
        case "facebook": self = .facebook
        case "github": self = .github
        case "gitlab": self = .gitlab
        case "linkedin": self = .linkedin
        case "wordpress": self = .wordpress
        case "saml": self = .saml
        case "cas": self = .cas
        default: self = .invalid
        }
    }
}

class LoginService: BaseModel {
    @objc dynamic var service: String?
    @objc dynamic var clientId: String?<commit_msg>Make icon a property of LoginServiceType instead of testing for it everytime we need to use it<commit_after>//
//  LoginService.swift
//  Rocket.Chat
//
//  Created by <NAME> on 10/17/17.
//  Copyright © 2017 Rocket.Chat. All rights reserved.
//

import Foundation
import RealmSwift

enum LoginServiceType {
    case google
    case github
    case facebook
    case linkedin
    case gitlab
    case wordpress
    case saml
    case cas
    case custom
    case invalid

    init(string: String) {
        switch string {
        case "google": self = .google
        case "facebook": self = .facebook
        case "github": self = .github
        case "gitlab": self = .gitlab
        case "linkedin": self = .linkedin
        case "wordpress": self = .wordpress
        case "saml": self = .saml
        case "cas": self = .cas
        default: self = .invalid
        }
    }

    var icon: UIImage? {
        switch self {
        case .google: return #imageLiteral(resourceName: "google")
        case .facebook: return #imageLiteral(resourceName: "facebook")
        case .github: return #imageLiteral(resourceName: "github")
        case .gitlab: return #imageLiteral(resourceName: "gitlab")
        case .linkedin: return #imageLiteral(resourceName: "linkedin")
        case .wordpress: return #imageLiteral(resourceName: "wordpress")
        default: return nil
        }
    }
}

class LoginService: BaseModel {
    @objc dynamic var service: String?
    @objc dynamic var clientId: String?
{'fraction_non_alphanumeric': 0.09573145462080399, 'fraction_numerical': 0.008288437629506838, 'mean_word_length': 2.2621621621621624, 'pattern_counts': {'":': 16, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4024931', 'n_tokens_mistral': 715, 'n_tokens_neox': 681, 'n_words': 239}