Pilih preferensi cookie Anda

Kami menggunakan cookie penting serta alat serupa yang diperlukan untuk menyediakan situs dan layanan. Kami menggunakan cookie performa untuk mengumpulkan statistik anonim sehingga kami dapat memahami cara pelanggan menggunakan situs dan melakukan perbaikan. Cookie penting tidak dapat dinonaktifkan, tetapi Anda dapat mengklik “Kustom” atau “Tolak” untuk menolak cookie performa.

Jika Anda setuju, AWS dan pihak ketiga yang disetujui juga akan menggunakan cookie untuk menyediakan fitur situs yang berguna, mengingat preferensi Anda, dan menampilkan konten yang relevan, termasuk iklan yang relevan. Untuk menerima atau menolak semua cookie yang tidak penting, klik “Terima” atau “Tolak”. Untuk membuat pilihan yang lebih detail, klik “Kustomisasi”.

Use DeleteSchemaMapping with an AWS SDK - AWS SDK Code Examples
Halaman ini belum diterjemahkan ke dalam bahasa Anda. Minta terjemahan

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use DeleteSchemaMapping with an AWS SDK

The following code example shows how to use DeleteSchemaMapping.

Java
SDK for Java 2.x
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

/** * Deletes the schema mapping asynchronously. * * @param schemaName the name of the schema to delete * @return a {@link CompletableFuture} that completes when the schema mapping is deleted successfully, * or throws a {@link RuntimeException} if the deletion fails */ public CompletableFuture<DeleteSchemaMappingResponse> deleteSchemaMappingAsync(String schemaName) { DeleteSchemaMappingRequest request = DeleteSchemaMappingRequest.builder() .schemaName(schemaName) .build(); return getResolutionAsyncClient().deleteSchemaMapping(request) .whenComplete((response, exception) -> { if (response != null) { // Successfully deleted the schema mapping, log the success message. logger.info("Schema mapping '{}' deleted successfully.", schemaName); } else { // Ensure exception is not null before accessing its cause. if (exception == null) { throw new CompletionException("An unknown error occurred while deleting the schema mapping.", null); } Throwable cause = exception.getCause(); if (cause instanceof ResourceNotFoundException) { throw new CompletionException("The schema mapping was not found to delete: " + schemaName, cause); } // Wrap other AWS exceptions in a CompletionException. throw new CompletionException("Failed to delete schema mapping: " + schemaName, exception); } }); }
SDK for Java 2.x
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

/** * Deletes the schema mapping asynchronously. * * @param schemaName the name of the schema to delete * @return a {@link CompletableFuture} that completes when the schema mapping is deleted successfully, * or throws a {@link RuntimeException} if the deletion fails */ public CompletableFuture<DeleteSchemaMappingResponse> deleteSchemaMappingAsync(String schemaName) { DeleteSchemaMappingRequest request = DeleteSchemaMappingRequest.builder() .schemaName(schemaName) .build(); return getResolutionAsyncClient().deleteSchemaMapping(request) .whenComplete((response, exception) -> { if (response != null) { // Successfully deleted the schema mapping, log the success message. logger.info("Schema mapping '{}' deleted successfully.", schemaName); } else { // Ensure exception is not null before accessing its cause. if (exception == null) { throw new CompletionException("An unknown error occurred while deleting the schema mapping.", null); } Throwable cause = exception.getCause(); if (cause instanceof ResourceNotFoundException) { throw new CompletionException("The schema mapping was not found to delete: " + schemaName, cause); } // Wrap other AWS exceptions in a CompletionException. throw new CompletionException("Failed to delete schema mapping: " + schemaName, exception); } }); }
PrivasiSyarat situsPreferensi cookie
© 2025, Amazon Web Services, Inc. atau afiliasinya. Semua hak dilindungi undang-undang.