Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 AWS
翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
AWS SDK updateDecoderManifestで を使用する
次のサンプルコードは、updateDecoderManifest を使用する方法を説明しています。
アクション例は、より大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。次のコード例で、このアクションのコンテキストを確認できます。
- Java
-
- SDK for Java 2.x
-
GitHub には、その他のリソースもあります。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。
/**
* Updates the decoder manifest with the given name.
*
* @param name the name of the decoder manifest to update
* @return a {@link CompletableFuture} that completes when the update operation is finished
*/
public CompletableFuture<Void> updateDecoderManifestAsync(String name) {
UpdateDecoderManifestRequest request = UpdateDecoderManifestRequest.builder()
.name(name)
.status(ManifestStatus.ACTIVE)
.build();
return getAsyncClient().updateDecoderManifest(request)
.whenComplete((response, exception) -> {
if (exception != null) {
throw new CompletionException("Failed to update decoder manifest: " + exception.getMessage(), exception);
}
})
.thenApply(response -> null);
}
- Kotlin
-
- SDK for Kotlin
-
GitHub には、その他のリソースもあります。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。
suspend fun updateDecoderManifest(nameVal: String) {
val request = UpdateDecoderManifestRequest {
name = nameVal
status = ManifestStatus.Active
}
IotFleetWiseClient.fromEnvironment { region = "us-east-1" }.use { fleetwiseClient ->
fleetwiseClient.updateDecoderManifest(request)
println("$nameVal was successfully updated")
}
}