@@ -34,16 +34,17 @@ import FoundationXML
34
34
#endif
35
35
import Logging
36
36
37
- // MARK: - Run Lambda
37
+ // MARK: - Run SCF function
38
38
39
- Lambda . run { ( context: Lambda . Context , _: Request , callback: @escaping ( Result < [ Exchange ] , Error > ) -> Void ) in
39
+ SCF . run { ( context: SCF . Context , _: Request , callback: @escaping ( Result < [ Exchange ] , Error > ) -> Void ) in
40
40
let calculator = ExchangeRatesCalculator ( )
41
41
calculator. run ( logger: context. logger, callback: callback)
42
42
}
43
43
44
44
// MARK: - Business Logic
45
45
46
- // This is a contrived example performing currency exchange rate lookup and conversion using URLSession and XML parsing
46
+ // This is a contrived example performing currency exchange rate lookup and conversion using
47
+ // URLSession and XML parsing.
47
48
struct ExchangeRatesCalculator {
48
49
static let currencies = [ " EUR " , " USD " , " JPY " ]
49
50
static let currenciesEmojies = [
@@ -56,7 +57,8 @@ struct ExchangeRatesCalculator {
56
57
let calendar : Calendar
57
58
58
59
init ( ) {
59
- // This is data from HMRC, the UK tax authority. Therefore we want to use their locale when interpreting data from the server.
60
+ // This is data from HMRC, the UK tax authority. Therefore we want to use their
61
+ // locale when interpreting data from the server.
60
62
self . locale = Locale ( identifier: " en_GB " )
61
63
// Use the UK calendar, not the system one.
62
64
var calendar = self . locale. calendar
0 commit comments