1515import HTTPTypes
1616
1717/// `APIGatewayV2Request` contains data coming from the new HTTP API Gateway.
18- public struct APIGatewayV2Request : Codable {
18+ public struct APIGatewayV2Request : Codable , Sendable {
1919 /// `Context` contains information to identify the AWS account and resources invoking the Lambda function.
20- public struct Context : Codable {
21- public struct HTTP : Codable {
20+ public struct Context : Codable , Sendable {
21+ public struct HTTP : Codable , Sendable {
2222 public let method : HTTPRequest . Method
2323 public let path : String
2424 public let `protocol` : String
@@ -27,18 +27,18 @@ public struct APIGatewayV2Request: Codable {
2727 }
2828
2929 /// `Authorizer` contains authorizer information for the request context.
30- public struct Authorizer : Codable {
30+ public struct Authorizer : Codable , Sendable {
3131 /// `JWT` contains JWT authorizer information for the request context.
32- public struct JWT : Codable {
32+ public struct JWT : Codable , Sendable {
3333 public let claims : [ String : String ] ?
3434 public let scopes : [ String ] ?
3535 }
3636
3737 public let jwt : JWT ?
3838
3939 // `IAM` contains AWS IAM authorizer information for the request context.
40- public struct IAM : Codable {
41- public struct CognitoIdentity : Codable {
40+ public struct IAM : Codable , Sendable {
41+ public struct CognitoIdentity : Codable , Sendable {
4242 public let amr : [ String ] ?
4343 public let identityId : String ?
4444 public let identityPoolId : String ?
@@ -58,9 +58,9 @@ public struct APIGatewayV2Request: Codable {
5858 public let lambda : LambdaAuthorizerContext ?
5959 }
6060
61- public struct Authentication : Codable {
62- public struct ClientCert : Codable {
63- public struct Validity : Codable {
61+ public struct Authentication : Codable , Sendable {
62+ public struct ClientCert : Codable , Sendable {
63+ public struct Validity : Codable , Sendable {
6464 public let notBefore : String
6565 public let notAfter : String
6666 }
@@ -126,7 +126,7 @@ public struct APIGatewayV2Request: Codable {
126126 }
127127}
128128
129- public struct APIGatewayV2Response : Codable {
129+ public struct APIGatewayV2Response : Codable , Sendable {
130130 public var statusCode : HTTPResponse . Status
131131 public var headers : HTTPHeaders ?
132132 public var body : String ?
@@ -147,17 +147,3 @@ public struct APIGatewayV2Response: Codable {
147147 self . cookies = cookies
148148 }
149149}
150-
151- #if swift(>=5.6)
152- extension APIGatewayV2Request : Sendable { }
153- extension APIGatewayV2Request . Context : Sendable { }
154- extension APIGatewayV2Request . Context . HTTP : Sendable { }
155- extension APIGatewayV2Request . Context . Authorizer : Sendable { }
156- extension APIGatewayV2Request . Context . Authorizer . JWT : Sendable { }
157- extension APIGatewayV2Request . Context . Authorizer . IAM : Sendable { }
158- extension APIGatewayV2Request . Context . Authorizer . IAM . CognitoIdentity : Sendable { }
159- extension APIGatewayV2Request . Context . Authentication : Sendable { }
160- extension APIGatewayV2Request . Context . Authentication . ClientCert : Sendable { }
161- extension APIGatewayV2Request . Context . Authentication . ClientCert . Validity : Sendable { }
162- extension APIGatewayV2Response : Sendable { }
163- #endif
0 commit comments