diff --git a/Sources/AWSLambdaEvents/ALB.swift b/Sources/AWSLambdaEvents/ALB.swift index 2d4cb2e..d45eb77 100644 --- a/Sources/AWSLambdaEvents/ALB.swift +++ b/Sources/AWSLambdaEvents/ALB.swift @@ -14,7 +14,11 @@ import HTTPTypes -import class Foundation.JSONEncoder +#if canImport(FoundationEssentials) +import FoundationEssentials +#else +import Foundation +#endif // https://github.com/aws/aws-lambda-go/blob/master/events/alb.go /// `ALBTargetGroupRequest` contains data originating from the ALB Lambda target group integration. diff --git a/Sources/AWSLambdaEvents/APIGateway.swift b/Sources/AWSLambdaEvents/APIGateway.swift index 87e0251..e2a18f1 100644 --- a/Sources/AWSLambdaEvents/APIGateway.swift +++ b/Sources/AWSLambdaEvents/APIGateway.swift @@ -14,7 +14,11 @@ import HTTPTypes -import class Foundation.JSONEncoder +#if canImport(FoundationEssentials) +import FoundationEssentials +#else +import Foundation +#endif // https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html // https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html diff --git a/Sources/AWSLambdaEvents/Cloudwatch.swift b/Sources/AWSLambdaEvents/Cloudwatch.swift index d814266..36e4010 100644 --- a/Sources/AWSLambdaEvents/Cloudwatch.swift +++ b/Sources/AWSLambdaEvents/Cloudwatch.swift @@ -12,10 +12,10 @@ // //===----------------------------------------------------------------------===// -#if canImport(Darwin) -import struct Foundation.Date +#if canImport(FoundationEssentials) +import FoundationEssentials #else -@preconcurrency import struct Foundation.Date +import Foundation #endif /// EventBridge has the same events/notification types as CloudWatch diff --git a/Sources/AWSLambdaEvents/DynamoDB.swift b/Sources/AWSLambdaEvents/DynamoDB.swift index 438b920..df27642 100644 --- a/Sources/AWSLambdaEvents/DynamoDB.swift +++ b/Sources/AWSLambdaEvents/DynamoDB.swift @@ -12,10 +12,10 @@ // //===----------------------------------------------------------------------===// -#if canImport(Darwin) -import struct Foundation.Date +#if canImport(FoundationEssentials) +import FoundationEssentials #else -@preconcurrency import struct Foundation.Date +import Foundation #endif // https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html diff --git a/Sources/AWSLambdaEvents/FunctionURL.swift b/Sources/AWSLambdaEvents/FunctionURL.swift index b469e89..d267a9a 100644 --- a/Sources/AWSLambdaEvents/FunctionURL.swift +++ b/Sources/AWSLambdaEvents/FunctionURL.swift @@ -13,7 +13,11 @@ //===----------------------------------------------------------------------===// import HTTPTypes -import class Foundation.JSONEncoder +#if canImport(FoundationEssentials) +import FoundationEssentials +#else +import Foundation +#endif // https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html diff --git a/Sources/AWSLambdaEvents/S3.swift b/Sources/AWSLambdaEvents/S3.swift index 5a64cb6..40e0525 100644 --- a/Sources/AWSLambdaEvents/S3.swift +++ b/Sources/AWSLambdaEvents/S3.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// -import struct Foundation.Date +#if canImport(FoundationEssentials) +import FoundationEssentials +#else +import Foundation +#endif // https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html diff --git a/Sources/AWSLambdaEvents/SES.swift b/Sources/AWSLambdaEvents/SES.swift index b099c8a..caff43a 100644 --- a/Sources/AWSLambdaEvents/SES.swift +++ b/Sources/AWSLambdaEvents/SES.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// -import struct Foundation.Date +#if canImport(FoundationEssentials) +import FoundationEssentials +#else +import Foundation +#endif // https://docs.aws.amazon.com/lambda/latest/dg/services-ses.html diff --git a/Sources/AWSLambdaEvents/SNS.swift b/Sources/AWSLambdaEvents/SNS.swift index 1ef0a30..31fa291 100644 --- a/Sources/AWSLambdaEvents/SNS.swift +++ b/Sources/AWSLambdaEvents/SNS.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// -import struct Foundation.Date +#if canImport(FoundationEssentials) +import FoundationEssentials +#else +import Foundation +#endif // https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html diff --git a/Sources/AWSLambdaEvents/Utils/DateWrappers.swift b/Sources/AWSLambdaEvents/Utils/DateWrappers.swift index 3daa93f..afcd22a 100644 --- a/Sources/AWSLambdaEvents/Utils/DateWrappers.swift +++ b/Sources/AWSLambdaEvents/Utils/DateWrappers.swift @@ -12,14 +12,11 @@ // //===----------------------------------------------------------------------===// -#if canImport(Darwin) -import struct Foundation.Date +#if canImport(FoundationEssentials) +import FoundationEssentials #else -@preconcurrency import struct Foundation.Date +import Foundation #endif -import class Foundation.DateFormatter -import struct Foundation.Locale -import struct Foundation.TimeZone @propertyWrapper public struct ISO8601Coding: Decodable, Sendable {