File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
swift/example_code/swift-sdk/config Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
- // swift-tools-version: 5.8
1
+ // swift-tools-version: 5.6
2
2
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
// SPDX-License-Identifier: Apache-2.0
4
4
// The swift-tools-version declares the minimum version of Swift required to build this package.
@@ -16,7 +16,7 @@ let package = Package(
16
16
// Dependencies declare other packages that this package depends on.
17
17
. package (
18
18
url: " https://github.com/awslabs/aws-sdk-swift " ,
19
- from: " 0.36 .0 "
19
+ from: " 0.75 .0 "
20
20
) ,
21
21
] ,
22
22
targets: [
Original file line number Diff line number Diff line change 5
5
// SDK for Swift. The same principle applies to all services.
6
6
7
7
import Foundation
8
- import ClientRuntime
8
+ import AWSClientRuntime
9
9
import AWSS3
10
+ import SmithyRetries
11
+ import SmithyRetriesAPI
10
12
11
13
@main
12
14
struct ConfigExample {
13
15
static func main( ) async {
14
16
// snippet-start:[config.swift.use-custom-configuration]
15
17
// Create an Amazon S3 client configuration object that specifies the
16
- // region as "us-east-1", the adaptive retry mode, and the maximum
17
- // number of retries as 5.
18
+ // region as "us-east-1", an exponential backoff strategy, the
19
+ // adaptive retry mode, and the maximum number of retries as 5.
18
20
19
21
let config : S3Client . S3ClientConfiguration
20
22
@@ -23,8 +25,9 @@ struct ConfigExample {
23
25
config = try await S3Client . S3ClientConfiguration (
24
26
region: " us-east-1 " ,
25
27
retryStrategyOptions: RetryStrategyOptions (
28
+ backoffStrategy: SmithyRetries . ExponentialBackoffStrategy ( ) ,
26
29
maxRetriesBase: 5 ,
27
- rateLimitingMode: . adaptive
30
+ rateLimitingMode: RetryStrategyOptions . RateLimitingMode . adaptive
28
31
)
29
32
)
30
33
// snippet-end:[config.swift.create-configuration]
You can’t perform that action at this time.
0 commit comments