Skip to content

Use FoundationEssentials if possible #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Sources/AWSLambdaEvents/ALB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion Sources/AWSLambdaEvents/APIGateway.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Sources/AWSLambdaEvents/Cloudwatch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Sources/AWSLambdaEvents/DynamoDB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion Sources/AWSLambdaEvents/FunctionURL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion Sources/AWSLambdaEvents/S3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion Sources/AWSLambdaEvents/SES.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion Sources/AWSLambdaEvents/SNS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 3 additions & 6 deletions Sources/AWSLambdaEvents/Utils/DateWrappers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down