Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK Examples. GitHub
Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Utilizzalo updateDecoderManifest con un SDK AWS
Gli esempi di codice seguenti mostrano come utilizzare updateDecoderManifest.
Gli esempi di operazioni sono estratti di codice da programmi più grandi e devono essere eseguiti nel contesto. È possibile visualizzare questa operazione nel contesto nel seguente esempio di codice:
- Java
-
- SDK per Java 2.x
-
/**
* 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 per Kotlin
-
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")
}
}