Skip to content

Commit afe90c7

Browse files
shepazonford-at-aws
authored andcommitted
Swift: Updates for Swift SDK 0.28.0 (#5498)
Updates for Swift SDK 0.28.0 Updated tests to use the new names for return structs. The old *OutputResponse types are now *Output.
1 parent c5f809d commit afe90c7

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

swift/example_code/ddb/ListTables/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let package = Package(
2020
// Dependencies declare other packages that this package depends on.
2121
.package(
2222
url: "https://github.com/awslabs/aws-sdk-swift",
23-
from: "0.10.0"
23+
from: "0.28.0"
2424
),
2525
.package(
2626
url: "https://github.com/apple/swift-argument-parser.git",

swift/example_code/ddb/ListTables/Sources/DatabaseManager.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ public protocol DatabaseSession {
1414
/// A mockable entry point for the Amazon DynamoDB function
1515
/// `listTables()`. A DynamoDB implementation of `DatabaseSession` should
1616
/// call through to `DynamoDBClient.listTables()`, while a mocked
17-
/// implementation should generate and return a `ListTablesOutputResponse`
17+
/// implementation should generate and return a `ListTablesOutput`
1818
/// object with the desired results for testing purposes.
1919
///
2020
/// - Parameter input: A `ListTablesInput` object specifying the input
2121
/// parameters for the call to `listTables()`.
2222
///
23-
/// - Returns: A `ListTablesOutputResponse` structure with the results.
24-
func listTables(input: ListTablesInput) async throws -> ListTablesOutputResponse
23+
/// - Returns: A `ListTablesOutput` structure with the results.
24+
func listTables(input: ListTablesInput) async throws -> ListTablesOutput
2525
}
2626

2727
// snippet-start:[ddb.swift.dynamodbsession]
@@ -49,10 +49,10 @@ public struct DynamoDBSession: DatabaseSession {
4949
/// - Parameter input: The `input` parameter for `listTables()` as a
5050
/// `ListTablesInput` object.
5151
///
52-
/// - Returns: The `ListTablesOutputResponse` returned by `listTables()`.
52+
/// - Returns: The `ListTablesOutput` returned by `listTables()`.
5353
///
5454
/// - Throws: Errors from DynamoDB are thrown as usual.
55-
public func listTables(input: ListTablesInput) async throws -> ListTablesOutputResponse {
55+
public func listTables(input: ListTablesInput) async throws -> ListTablesOutput {
5656
return try await client.listTables(input: input)
5757
}
5858
// snippet-end:[ddb.swift.dynamodbsession.listtables]

swift/example_code/ddb/ListTables/Tests/ListTablesTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public struct MockDBSession: DatabaseSession {
8181
/// Mock version of the DynamoDB client's `listTables()` function. Returns
8282
/// values from the string array `fakeTableNames` or the one specified as
8383
/// an optional input when creating the `MockDBSession`.
84-
public func listTables(input: ListTablesInput) async throws -> ListTablesOutputResponse {
85-
var output = ListTablesOutputResponse(
84+
public func listTables(input: ListTablesInput) async throws -> ListTablesOutput {
85+
var output = ListTablesOutput(
8686
lastEvaluatedTableName: nil,
8787
tableNames: nil
8888
)

swift/example_code/s3/ListBuckets/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let package = Package(
2020
// Dependencies declare other packages that this package depends on.
2121
.package(
2222
url: "https://github.com/awslabs/aws-sdk-swift",
23-
from: "0.20.0"
23+
from: "0.28.0"
2424
),
2525
.package(
2626
url: "https://github.com/apple/swift-argument-parser.git",

swift/example_code/s3/ListBuckets/Sources/ListBuckets/S3Session.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import AWSS3
1717
/// A protocol defining the Amazon S3 functions we want to mock
1818
/// during testing.
1919
public protocol S3SessionProtocol {
20-
func listBuckets(input: ListBucketsInput) async throws -> ListBucketsOutputResponse
20+
func listBuckets(input: ListBucketsInput) async throws -> ListBucketsOutput
2121
}
2222
// snippet-end:[s3.swift.listbuckets.s3sessionprotocol]
2323

@@ -41,9 +41,9 @@ public struct S3Session: S3SessionProtocol {
4141
/// Call through to the ``S3Client`` function `listBuckets()`.
4242
/// - Parameter input: The input to pass through to the SDK function
4343
/// `listBuckets()`.
44-
/// - Returns: A ``ListBucketsOutputResponse`` with the returned data.
44+
/// - Returns: A ``ListBucketsOutput`` with the returned data.
4545
public func listBuckets(input: ListBucketsInput) async throws
46-
-> ListBucketsOutputResponse {
46+
-> ListBucketsOutput {
4747
return try await self.client.listBuckets(input: input)
4848
}
4949
}

swift/example_code/s3/ListBuckets/Tests/ListBucketsTests/ListBucketsTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public struct MockS3Session: S3SessionProtocol {
4444
///
4545
/// - Parameter input: The input to the `listBuckets()` function.
4646
///
47-
/// - Returns: A `ListBucketsOutputResponse` object containing the list of
47+
/// - Returns: A `ListBucketsOutput` object containing the list of
4848
/// buckets.
4949
public func listBuckets(input: ListBucketsInput) async throws
50-
-> ListBucketsOutputResponse {
50+
-> ListBucketsOutput {
5151
var bucketList: [S3ClientTypes.Bucket] = []
5252
let df = DateFormatter()
5353
df.dateFormat = "M/d/yy, h:mm:ss a z"
@@ -62,10 +62,10 @@ public struct MockS3Session: S3SessionProtocol {
6262
bucketList.append(bucket)
6363
}
6464

65-
// Create and return the `ListBucketsOutputResponse` object containing
65+
// Create and return the `ListBucketsOutput` object containing
6666
// the results.
6767

68-
let response = ListBucketsOutputResponse(
68+
let response = ListBucketsOutput(
6969
buckets: bucketList,
7070
owner: nil
7171
)

swift/example_code/swift-sdk/mocking/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let package = Package(
1313
// Dependencies declare other packages that this package depends on.
1414
.package(
1515
url: "https://github.com/awslabs/aws-sdk-swift",
16-
from: "0.20.0"
16+
from: "0.28.0"
1717
)
1818
],
1919
// snippet-start:[mocking.swift.package.targets]

swift/example_code/swift-sdk/mocking/Sources/S3Session.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import AWSS3
1717
/// instead return mock results.
1818
public protocol S3SessionProtocol {
1919
func listBuckets(input: ListBucketsInput) async throws
20-
-> ListBucketsOutputResponse
20+
-> ListBucketsOutput
2121
}
2222
// snippet-end:[mocking.swift.protocol]
2323

@@ -44,11 +44,11 @@ public class S3Session: S3SessionProtocol {
4444
/// - Parameter input: The input to pass through to the SDK function
4545
/// `listBuckets()`.
4646
///
47-
/// - Returns: A ``ListBucketsOutputResponse`` with the returned data.
47+
/// - Returns: A ``ListBucketsOutput`` with the returned data.
4848
///
4949
// snippet-start:[mocking.swift.implement-real]
5050
public func listBuckets(input: ListBucketsInput) async throws
51-
-> ListBucketsOutputResponse {
51+
-> ListBucketsOutput {
5252
return try await self.client.listBuckets(input: input)
5353
}
5454
// snippet-end:[mocking.swift.implement-real]

swift/example_code/swift-sdk/mocking/Tests/MockS3Session.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ public class MockS3Session: S3SessionProtocol {
8080
///
8181
/// - Parameter input: The input to the `listBuckets()` function.
8282
///
83-
/// - Returns: A `ListBucketsOutputResponse` object containing the list of
83+
/// - Returns: A `ListBucketsOutput` object containing the list of
8484
/// buckets.
8585
public func listBuckets(input: ListBucketsInput) async throws
86-
-> ListBucketsOutputResponse {
87-
let response = ListBucketsOutputResponse(
86+
-> ListBucketsOutput {
87+
let response = ListBucketsOutput(
8888
buckets: self.mockBuckets,
8989
owner: nil
9090
)

0 commit comments

Comments
 (0)