@@ -23,12 +23,12 @@ extension Lambda {
23
23
public var requestId : String
24
24
public var traceId : String
25
25
public var invokedFunctionArn : String
26
- public var timeout : Double
26
+ public var timeout : DispatchTimeInterval
27
27
28
28
public init ( requestId: String = " \( DispatchTime . now ( ) . uptimeNanoseconds) " ,
29
29
traceId: String = " Root= \( DispatchTime . now ( ) . uptimeNanoseconds) ;Parent= \( DispatchTime . now ( ) . uptimeNanoseconds) ;Sampled=1 " ,
30
30
invokedFunctionArn: String = " arn:aws:lambda:us-west-1: \( DispatchTime . now ( ) . uptimeNanoseconds) :function:custom-runtime " ,
31
- timeout: Double = 5 ) {
31
+ timeout: DispatchTimeInterval = . seconds ( 5 ) ) {
32
32
self . requestId = requestId
33
33
self . traceId = traceId
34
34
self . invokedFunctionArn = invokedFunctionArn
@@ -37,28 +37,30 @@ extension Lambda {
37
37
}
38
38
39
39
public static func test( _ closure: @escaping StringLambdaClosure ,
40
- config : TestConfig = . init ( ) ,
41
- with payload : String ) throws -> String {
40
+ with payload : String ,
41
+ using config : TestConfig = . init ( ) ) throws -> String {
42
42
try Self . test ( StringLambdaClosureWrapper ( closure) , config: config, with: payload)
43
43
}
44
44
45
45
public static func test( _ closure: @escaping StringVoidLambdaClosure ,
46
- config : TestConfig = . init ( ) ,
47
- with payload : String ) throws {
46
+ with payload : String ,
47
+ using config : TestConfig = . init ( ) ) throws {
48
48
_ = try Self . test ( StringVoidLambdaClosureWrapper ( closure) , config: config, with: payload)
49
49
}
50
50
51
51
public static func test< In: Decodable , Out: Encodable > (
52
52
_ closure: @escaping CodableLambdaClosure < In , Out > ,
53
- config : TestConfig = . init ( ) ,
54
- with payload : In
53
+ with payload : In ,
54
+ using config : TestConfig = . init ( )
55
55
) throws -> Out {
56
56
try Self . test ( CodableLambdaClosureWrapper ( closure) , config: config, with: payload)
57
57
}
58
58
59
- public static func test< In: Decodable > ( _ closure: @escaping CodableVoidLambdaClosure < In > ,
60
- config: TestConfig = . init( ) ,
61
- with payload: In ) throws {
59
+ public static func test< In: Decodable > (
60
+ _ closure: @escaping CodableVoidLambdaClosure < In > ,
61
+ with payload: In ,
62
+ using config: TestConfig = . init( )
63
+ ) throws {
62
64
_ = try Self . test ( CodableVoidLambdaClosureWrapper ( closure) , config: config, with: payload)
63
65
}
64
66
0 commit comments