import Foundation struct Configuration { let contentFolder: String let trainingIterations: Int let serverPath: String let authenticationToken: String let minimumImagesPerCap: Int } extension Configuration { func serverUrl() throws -> URL { guard let serverUrl = URL(string: serverPath) else { throw TrainingError.invalidServerPath(serverPath) } return serverUrl } }