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à.
Utilizzare deleteDecoderManifest con un AWS SDK
Gli esempi di codice seguenti mostrano come utilizzare deleteDecoderManifest.
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
-
/**
* Deletes a decoder manifest.
*
* @param name the name of the decoder manifest to delete
* @return a {@link CompletableFuture} that completes when the decoder manifest has been deleted
*/
public CompletableFuture<Void> deleteDecoderManifestAsync(String name) {
return getAsyncClient().deleteDecoderManifest(DeleteDecoderManifestRequest.builder().name(name).build())
.handle((response, exception) -> {
if (exception != null) {
Throwable cause = exception.getCause() != null ? exception.getCause() : exception;
if (cause instanceof ResourceNotFoundException) {
throw (ResourceNotFoundException) cause;
}
throw new RuntimeException("Failed to delete the decoder manifest: " + cause);
}
return null;
});
}
- Kotlin
-
- SDK per Kotlin
-
suspend fun deleteDecoderManifest(nameVal: String) {
val request = DeleteDecoderManifestRequest {
name = nameVal
}
IotFleetWiseClient.fromEnvironment { region = "us-east-1" }.use { fleetwiseClient ->
fleetwiseClient.deleteDecoderManifest(request)
println("$nameVal was successfully deleted")
}
}