Seleziona le tue preferenze relative ai cookie

Utilizziamo cookie essenziali e strumenti simili necessari per fornire il nostro sito e i nostri servizi. Utilizziamo i cookie prestazionali per raccogliere statistiche anonime in modo da poter capire come i clienti utilizzano il nostro sito e apportare miglioramenti. I cookie essenziali non possono essere disattivati, ma puoi fare clic su \"Personalizza\" o \"Rifiuta\" per rifiutare i cookie prestazionali.

Se sei d'accordo, AWS e le terze parti approvate utilizzeranno i cookie anche per fornire utili funzionalità del sito, ricordare le tue preferenze e visualizzare contenuti pertinenti, inclusa la pubblicità pertinente. Per continuare senza accettare questi cookie, fai clic su \"Continua\" o \"Rifiuta\". Per effettuare scelte più dettagliate o saperne di più, fai clic su \"Personalizza\".

Use DeleteSchemaMapping with an AWS SDK - AWS SDK Code Examples
Questa pagina non è tradotta nella tua lingua. Richiedi traduzione

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); } }); }
PrivacyCondizioni del sitoPreferenze cookie
© 2025, Amazon Web Services, Inc. o società affiliate. Tutti i diritti riservati.