Skip to content

Commit 6a9e839

Browse files
committed
using AWSRegion
1 parent 1e35d1d commit 6a9e839

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/AWSLambdaEvents/SQS.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public enum SQS {
3939
public let messageAttributes: [String: Attribute]
4040
public let eventSourceArn: String
4141
public let eventSource: String
42-
public let awsRegion: String
42+
public let awsRegion: AWSRegion
4343
}
4444
}
4545

@@ -67,7 +67,7 @@ extension SQS.Message: Decodable {
6767
self.messageAttributes = try container.decode([String: Attribute].self, forKey: .messageAttributes)
6868
self.eventSourceArn = try container.decode(String.self, forKey: .eventSourceArn)
6969
self.eventSource = try container.decode(String.self, forKey: .eventSource)
70-
self.awsRegion = try container.decode(String.self, forKey: .awsRegion)
70+
self.awsRegion = try container.decode(AWSRegion.self, forKey: .awsRegion)
7171

7272
let body = try container.decode(String?.self, forKey: .body)
7373
self.body = body != "" ? body : nil

Tests/AWSLambdaEventsTests/SQSTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ class SQSTests: XCTestCase {
8282
XCTAssertEqual(message.md5OfBody, "7b270e59b47ff90a553787216d55d91d")
8383
XCTAssertEqual(message.eventSource, "aws:sqs")
8484
XCTAssertEqual(message.eventSourceArn, "arn:aws:sqs:us-east-1:123456789012:MyQueue")
85-
XCTAssertEqual(message.awsRegion, "us-east-1")
85+
XCTAssertEqual(message.awsRegion, .us_east_1)
8686
}
8787
}

0 commit comments

Comments
 (0)