AWS 文档 SDK 示例
将 deleteSignalCatalog 和 AWS SDK 结合使用
以下代码示例演示如何使用 deleteSignalCatalog。
- Java
-
- 适用于 Java 的 SDK 2.x
-
注意
查看 GitHub,了解更多信息。在 AWS 代码示例存储库
中查找完整示例,了解如何进行设置和运行。 /** * Deletes a signal catalog. * * @param name the name of the signal catalog to delete * @return a {@link CompletableFuture} that completes when the signal catalog is deleted */ public CompletableFuture<Void> deleteSignalCatalogAsync(String name) { DeleteSignalCatalogRequest request = DeleteSignalCatalogRequest.builder() .name(name) .build(); return getAsyncClient().deleteSignalCatalog(request) .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 signal catalog: " + cause); } logger.info("{} was successfully deleted", name); return null; }); }-
有关 API 详细信息,请参阅《AWS SDK for Java 2.x API Reference》中的 deleteSignalCatalog。
-
- Kotlin
-
- 适用于 Kotlin 的 SDK
-
注意
查看 GitHub,了解更多信息。在 AWS 代码示例存储库
中查找完整示例,了解如何进行设置和运行。 /** * Deletes a signal catalog. * * @param name the name of the signal catalog to delete */ suspend fun deleteSignalCatalog(catName: String) { val request = DeleteSignalCatalogRequest { name = catName } IotFleetWiseClient.fromEnvironment { region = "us-east-1" }.use { fleetwiseClient -> fleetwiseClient.deleteSignalCatalog(request) println(" $catName was successfully deleted") } }-
有关 API 详细信息,请参阅《AWS SDK for Kotlin API Reference》中的 deleteSignalCatalog
。
-
deleteModelManifest
deleteVehicle