-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
730 additions
and
266 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
applies_to: ["client", "aws-sdk-rust"] | ||
authors: ["Velfi"] | ||
references: ["smithy-rs#3820"] | ||
breaking: false | ||
new_feature: false | ||
bug_fix: true | ||
--- | ||
|
||
Fixed a bug with the content length of compressed payloads that caused such requests to hang. |
This file was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
45 changes: 45 additions & 0 deletions
45
...tware/amazon/smithy/rustsdk/customize/transcribestreaming/TranscribeStreamingDecorator.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,45 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package software.amazon.smithy.rustsdk.customize.transcribestreaming | ||
|
||
import software.amazon.smithy.model.Model | ||
import software.amazon.smithy.model.shapes.OperationShape | ||
import software.amazon.smithy.model.shapes.ServiceShape | ||
import software.amazon.smithy.model.shapes.ShapeId | ||
import software.amazon.smithy.model.transform.ModelTransformer | ||
import software.amazon.smithy.rust.codegen.client.smithy.ClientRustSettings | ||
import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator | ||
import software.amazon.smithy.rust.codegen.client.smithy.traits.IncompatibleWithStalledStreamProtectionTrait | ||
import software.amazon.smithy.rust.codegen.core.util.letIf | ||
import java.util.logging.Logger | ||
|
||
/** | ||
* Top level decorator for TranscribeStreaming | ||
*/ | ||
class TranscribeStreamingDecorator : ClientCodegenDecorator { | ||
private val operationsIncompatibleWithStalledStreamProtection = | ||
setOf( | ||
ShapeId.from("com.amazonaws.transcribestreaming#StartCallAnalyticsStreamTranscription"), | ||
ShapeId.from("com.amazonaws.transcribestreaming#StartMedicalStreamTranscription"), | ||
ShapeId.from("com.amazonaws.transcribestreaming#StartStreamTranscription"), | ||
) | ||
|
||
override val name: String = "TranscribeStreamingDecorator" | ||
override val order: Byte = 0 | ||
private val logger = Logger.getLogger(javaClass.name) | ||
|
||
override fun transformModel( | ||
service: ServiceShape, | ||
model: Model, | ||
settings: ClientRustSettings, | ||
): Model = | ||
ModelTransformer.create().mapShapes(model) { shape -> | ||
shape.letIf(shape.id in operationsIncompatibleWithStalledStreamProtection) { | ||
logger.info("Adding IncompatibleWithStalledStreamProtection trait to $it") | ||
(it as OperationShape).toBuilder().addTrait(IncompatibleWithStalledStreamProtectionTrait()).build() | ||
} | ||
} | ||
} |
Oops, something went wrong.