-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Auth): Adding network preferences (#3379)
* feat(Auth): Adding network preferences * adding tests * Update AWSCognitoNetworkPreferences.swift * Update AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/AWSCognitoNetworkPreferences.swift Co-authored-by: Sebastian Villena <[email protected]> * worked on review comments --------- Co-authored-by: Sebastian Villena <[email protected]>
- Loading branch information
Showing
4 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Models/AWSCognitoNetworkPreferences.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
|
||
public struct AWSCognitoNetworkPreferences { | ||
|
||
/// The maximum number of retries for failed requests. | ||
public let maxRetryCount: UInt32 | ||
|
||
/// The timeout interval to use when waiting for additional data. | ||
public let timeoutIntervalForRequest: TimeInterval | ||
|
||
/// The maximum amount of time that a resource request should be allowed to take. | ||
/// | ||
/// NOTE: This value is only applicable to HostedUI because the underlying Swift SDK does | ||
/// not support resource timeouts | ||
public let timeoutIntervalForResource: TimeInterval? | ||
|
||
public init(maxRetryCount: UInt32, | ||
timeoutIntervalForRequest: TimeInterval, | ||
timeoutIntervalForResource: TimeInterval? = nil) { | ||
self.maxRetryCount = maxRetryCount | ||
self.timeoutIntervalForRequest = timeoutIntervalForRequest | ||
self.timeoutIntervalForResource = timeoutIntervalForResource | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters