Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 AWS
翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
AWS SDK deleteModelManifestで を使用する
次のサンプルコードは、deleteModelManifest を使用する方法を説明しています。
アクション例は、より大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。次のコード例で、このアクションのコンテキストを確認できます。
- Java
-
- SDK for Java 2.x
-
GitHub には、その他のリソースもあります。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。
/**
* Deletes a model manifest.
*
* @param name the name of the model manifest to delete
* @return a {@link CompletableFuture} that completes when the model manifest has been deleted
*/
public CompletableFuture<Void> deleteModelManifestAsync(String name) {
DeleteModelManifestRequest request = DeleteModelManifestRequest.builder()
.name(name)
.build();
return getAsyncClient().deleteModelManifest(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 model manifest: " + cause);
}
logger.info("{} was successfully deleted", name);
return null;
});
}
- Kotlin
-
- SDK for Kotlin
-
GitHub には、その他のリソースもあります。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。
/**
* Deletes a model manifest.
*
* @param nameVal the name of the model manifest to delete
*/
suspend fun deleteModelManifest(nameVal: String) {
val request = DeleteModelManifestRequest {
name = nameVal
}
IotFleetWiseClient.fromEnvironment { region = "us-east-1" }.use { fleetwiseClient ->
fleetwiseClient.deleteModelManifest(request)
println(" $nameVal was successfully deleted")
}
}