Gunakan DeleteReceiptFilter dengan AWS SDK atau CLI - AWS SDKContoh Kode

Ada lebih banyak AWS SDK contoh yang tersedia di GitHub repo SDKContoh AWS Dokumen.

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Gunakan DeleteReceiptFilter dengan AWS SDK atau CLI

Contoh kode berikut menunjukkan cara menggunakanDeleteReceiptFilter.

C++
SDKuntuk C ++
catatan

Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara pengaturan dan menjalankannya di Repositori Contoh Kode AWS.

//! Delete an Amazon Simple Email Service (Amazon SES) receipt filter. /*! \param receiptFilterName: The name for the receipt filter. \param clientConfiguration: AWS client configuration. \return bool: Function succeeded. */ bool AwsDoc::SES::deleteReceiptFilter(const Aws::String &receiptFilterName, const Aws::Client::ClientConfiguration &clientConfiguration) { Aws::SES::SESClient sesClient(clientConfiguration); Aws::SES::Model::DeleteReceiptFilterRequest deleteReceiptFilterRequest; deleteReceiptFilterRequest.SetFilterName(receiptFilterName); Aws::SES::Model::DeleteReceiptFilterOutcome outcome = sesClient.DeleteReceiptFilter( deleteReceiptFilterRequest); if (outcome.IsSuccess()) { std::cout << "Successfully deleted receipt filter." << std::endl; } else { std::cerr << "Error deleting receipt filter. " << outcome.GetError().GetMessage() << std::endl; } return outcome.IsSuccess(); }
JavaScript
SDKuntuk JavaScript (v3)
catatan

Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara pengaturan dan menjalankannya di Repositori Contoh Kode AWS.

import { DeleteReceiptFilterCommand } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; const RECEIPT_FILTER_NAME = getUniqueName("ReceiptFilterName"); const createDeleteReceiptFilterCommand = (filterName) => { return new DeleteReceiptFilterCommand({ FilterName: filterName }); }; const run = async () => { const deleteReceiptFilterCommand = createDeleteReceiptFilterCommand(RECEIPT_FILTER_NAME); try { return await sesClient.send(deleteReceiptFilterCommand); } catch (err) { console.log("Error deleting receipt filter.", err); return err; } };
Python
SDKuntuk Python (Boto3)
catatan

Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara pengaturan dan menjalankannya di Repositori Contoh Kode AWS.

class SesReceiptHandler: """Encapsulates Amazon SES receipt handling functions.""" def __init__(self, ses_client, s3_resource): """ :param ses_client: A Boto3 Amazon SES client. :param s3_resource: A Boto3 Amazon S3 resource. """ self.ses_client = ses_client self.s3_resource = s3_resource def delete_receipt_filter(self, filter_name): """ Deletes a receipt filter. :param filter_name: The name of the filter to delete. """ try: self.ses_client.delete_receipt_filter(FilterName=filter_name) logger.info("Deleted receipt filter %s.", filter_name) except ClientError: logger.exception("Couldn't delete receipt filter %s.", filter_name) raise