Skip to content

Commit b362bcb

Browse files
tomerdGitHub Enterprise
authored and
GitHub Enterprise
committed
add public constructor to LambdaContext (#7)
motivation: default ctor is internal, which means we cant use it in external programs changes: add public ctor
1 parent a93ed90 commit b362bcb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/SwiftAwsLambda/Lambda.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ public struct LambdaContext {
155155
public let cognitoIdentity: String?
156156
public let clientContext: String?
157157
public let deadline: String?
158+
159+
public init(requestId: String, traceId: String? = nil, invokedFunctionArn: String? = nil, cognitoIdentity: String? = nil, clientContext: String? = nil, deadline: String? = nil) {
160+
self.requestId = requestId
161+
self.traceId = traceId
162+
self.invokedFunctionArn = invokedFunctionArn
163+
self.cognitoIdentity = cognitoIdentity
164+
self.clientContext = clientContext
165+
self.deadline = deadline
166+
}
158167
}
159168

160169
private struct LambdaClosureWrapper: LambdaHandler {

0 commit comments

Comments
 (0)