<commit_before>//
//  XcodeServerEndpoints.swift
//  Buildasaur
//
//  Created by <NAME> on 14/12/2014.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation
import BuildaUtils

public class XcodeServerEndpoints {
    
    enum Endpoint {
        case Bots
        case Integrations
        case CancelIntegration
        case UserCanCreateBots
        case Devices
        case Login
        case Logout
        case Platforms
        case SCM_Branches
        case Repositories
    }
    
    let serverConfig: XcodeServerConfig
    
    /**
    Designated initializer.
    
    - parameter serverConfig: Object of XcodeServerConfig class
    
    - returns: Initialized object of XcodeServer endpoints
    */
    public init(serverConfig: XcodeServerConfig) {
        self.serverConfig = serverConfig
    }
    
    private func endpointURL(endpoint: Endpoint, params: [String: String]? = nil) -> String {
        
        let base = "/api"
        
        switch endpoint {
            
        case .Bots:
            
            let bots = "\(base)/bots"
            if let bot = params?["bot"] {
                let bot = "\(bots)/\(bot)"
                if let rev = params?["rev"] {
                    let rev = "\(bot)/\(rev)"
                    return rev<commit_msg>Set access level of XcodeServerEndpoints.endpointURL method as internal<commit_after>//
//  XcodeServerEndpoints.swift
//  Buildasaur
//
//  Created by <NAME> on 14/12/2014.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation
import BuildaUtils

public class XcodeServerEndpoints {
    
    enum Endpoint {
        case Bots
        case Integrations
        case CancelIntegration
        case UserCanCreateBots
        case Devices
        case Login
        case Logout
        case Platforms
        case SCM_Branches
        case Repositories
    }
    
    let serverConfig: XcodeServerConfig
    
    /**
    Designated initializer.
    
    - parameter serverConfig: Object of XcodeServerConfig class
    
    - returns: Initialized object of XcodeServer endpoints
    */
    public init(serverConfig: XcodeServerConfig) {
        self.serverConfig = serverConfig
    }
    
    func endpointURL(endpoint: Endpoint, params: [String: String]? = nil) -> String {
        
        let base = "/api"
        
        switch endpoint {
            
        case .Bots:
            
            let bots = "\(base)/bots"
            if let bot = params?["bot"] {
                let bot = "\(bots)/\(bot)"
                if let rev = params?["rev"] {
                    let rev = "\(bot)/\(rev)"
                    return rev
{'fraction_non_alphanumeric': 0.0840241145440844, 'fraction_numerical': 0.00904295403165034, 'mean_word_length': 1.6497005988023952, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '3618014', 'n_tokens_mistral': 754, 'n_tokens_neox': 717, 'n_words': 207}