

As traduções são geradas por tradução automática. Em caso de conflito entre o conteúdo da tradução e da versão original em inglês, a versão em inglês prevalecerá.

# Uso `DeleteConfigurationSet` com um AWS SDK

O código de exemplo a seguir mostra como usar `DeleteConfigurationSet`.

Exemplos de ações são trechos de código de programas maiores e devem ser executados em contexto. É possível ver essa ação em contexto no seguinte exemplo de código: 
+  [Pesquisar e filtrar recursos do SES](sesv2_example_sesv2_SearchFilterBasics_section.md) 

------
#### [ Python ]

**SDK para Python (Boto3)**  
 Há mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/sesv2/search_filter_scenario#code-examples). 
Exclua um conjunto de configurações que foi criado pelo cenário de pesquisa e filtro da API Amazon SES v2.  

```
class SearchFilterWrapper:
    """Encapsulates Amazon SES v2 search-and-filter operations."""

    def __init__(self, sesv2_client: boto3.client):
        """
        Initializes the SearchFilterWrapper with an Amazon SES v2 client.

        :param sesv2_client: A Boto3 Amazon SES v2 client.
        """
        self.sesv2_client = sesv2_client

    @classmethod
    def from_client(cls) -> "SearchFilterWrapper":
        """
        Creates a SearchFilterWrapper instance with a default Boto3 SES v2 client.

        :return: An initialized SearchFilterWrapper instance.
        """
        sesv2_client = boto3.client("sesv2")
        return cls(sesv2_client)


    def delete_configuration_set(self, configuration_set_name: str) -> None:
        """
        Deletes a configuration set.

        :param configuration_set_name: The name of the configuration set to
            delete.
        """
        try:
            self.sesv2_client.delete_configuration_set(
                ConfigurationSetName=configuration_set_name
            )
            logger.info("Deleted configuration set '%s'.", configuration_set_name)
        except ClientError as err:
            if err.response["Error"]["Code"] == "NotFoundException":
                logger.warning(
                    "Configuration set '%s' not found. Skipping deletion.",
                    configuration_set_name,
                )
            else:
                logger.error(
                    "Error deleting configuration set '%s': %s",
                    configuration_set_name,
                    err.response["Error"]["Message"],
                )
                raise
```
+  Para obter detalhes da API, consulte [DeleteConfigurationSet](https://docs.aws.amazon.com/goto/boto3/sesv2-2019-09-27/DeleteConfigurationSet) em *AWS Referência da API SDK para Python (Boto3)*. 

------

Para obter uma lista completa de AWS Guias para desenvolvedores e exemplos de código do SDK, consulte [Usando o Amazon SES com um AWS SDK](sdk-general-information-section.md). Este tópico também inclui informações sobre como começar e detalhes sobre versões anteriores do SDK.