-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break down resolve functions for compression settings
- Loading branch information
Showing
5 changed files
with
67 additions
and
37 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
25 changes: 25 additions & 0 deletions
25
.../common/src/aws/sdk/kotlin/runtime/config/compression/ResolveDisableRequestCompression.kt
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,25 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package aws.sdk.kotlin.runtime.config.compression | ||
|
||
import aws.sdk.kotlin.runtime.config.profile.AwsProfile | ||
import aws.sdk.kotlin.runtime.config.profile.disableRequestCompression | ||
import aws.smithy.kotlin.runtime.InternalApi | ||
import aws.smithy.kotlin.runtime.config.resolve | ||
import aws.smithy.kotlin.runtime.util.LazyAsyncValue | ||
import aws.smithy.kotlin.runtime.util.PlatformProvider | ||
|
||
/** | ||
* Attempts to resolve disableRequestCompression from the specified sources. | ||
* @return disableRequestCompression setting if found, the default value if not. | ||
*/ | ||
@InternalApi | ||
public suspend fun resolveDisableRequestCompression( | ||
platform: PlatformProvider = PlatformProvider.System, | ||
profile: LazyAsyncValue<AwsProfile>, | ||
): Boolean = | ||
CompressionSettings.AwsDisableRequestCompression.resolve(platform) | ||
?: profile.get().disableRequestCompression | ||
?: false |
34 changes: 0 additions & 34 deletions
34
...-config/common/src/aws/sdk/kotlin/runtime/config/compression/ResolveRequestCompression.kt
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
...on/src/aws/sdk/kotlin/runtime/config/compression/ResolveRequestMinCompressionSizeBytes.kt
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,25 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package aws.sdk.kotlin.runtime.config.compression | ||
|
||
import aws.sdk.kotlin.runtime.config.profile.AwsProfile | ||
import aws.sdk.kotlin.runtime.config.profile.requestMinCompressionSizeBytes | ||
import aws.smithy.kotlin.runtime.InternalApi | ||
import aws.smithy.kotlin.runtime.config.resolve | ||
import aws.smithy.kotlin.runtime.util.LazyAsyncValue | ||
import aws.smithy.kotlin.runtime.util.PlatformProvider | ||
|
||
/** | ||
* Attempts to resolve requestMinCompressionSizeBytes from the specified sources. | ||
* @return requestMinCompressionSizeBytes setting if found, the default value if not. | ||
*/ | ||
@InternalApi | ||
public suspend fun resolveRequestMinCompressionSizeBytes( | ||
platform: PlatformProvider = PlatformProvider.System, | ||
profile: LazyAsyncValue<AwsProfile>, | ||
): Long = | ||
CompressionSettings.AwsRequestMinCompressionSizeBytes.resolve(platform) | ||
?: profile.get().requestMinCompressionSizeBytes | ||
?: 10240 |