From 4b858e0ae26c867e2b079b75620ed5dfd24b4bfc Mon Sep 17 00:00:00 2001 From: awstools Date: Tue, 5 Mar 2024 19:15:25 +0000 Subject: [PATCH] feat(client-sesv2): Adds support for providing custom headers within SendEmail and SendBulkEmail for SESv2. --- .../CreateDeliverabilityTestReportCommand.ts | 12 ++ ...tEmailIdentityFeedbackAttributesCommand.ts | 6 +- .../src/commands/SendBulkEmailCommand.ts | 6 + .../src/commands/SendEmailCommand.ts | 12 ++ .../src/commands/UpdateContactCommand.ts | 9 +- clients/client-sesv2/src/models/models_0.ts | 111 +++++++++++++----- clients/client-sesv2/src/models/models_1.ts | 27 +++-- .../src/protocols/Aws_restJson1.ts | 5 + codegen/sdk-codegen/aws-models/sesv2.json | 103 +++++++++++++--- 9 files changed, 226 insertions(+), 65 deletions(-) diff --git a/clients/client-sesv2/src/commands/CreateDeliverabilityTestReportCommand.ts b/clients/client-sesv2/src/commands/CreateDeliverabilityTestReportCommand.ts index ee801fa68297..3abf6627e742 100644 --- a/clients/client-sesv2/src/commands/CreateDeliverabilityTestReportCommand.ts +++ b/clients/client-sesv2/src/commands/CreateDeliverabilityTestReportCommand.ts @@ -65,6 +65,12 @@ export interface CreateDeliverabilityTestReportCommandOutput * Charset: "STRING_VALUE", * }, * }, + * Headers: [ // MessageHeaderList + * { // MessageHeader + * Name: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required + * }, + * ], * }, * Raw: { // RawMessage * Data: "BLOB_VALUE", // required @@ -73,6 +79,12 @@ export interface CreateDeliverabilityTestReportCommandOutput * TemplateName: "STRING_VALUE", * TemplateArn: "STRING_VALUE", * TemplateData: "STRING_VALUE", + * Headers: [ + * { + * Name: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required + * }, + * ], * }, * }, * Tags: [ // TagList diff --git a/clients/client-sesv2/src/commands/PutEmailIdentityFeedbackAttributesCommand.ts b/clients/client-sesv2/src/commands/PutEmailIdentityFeedbackAttributesCommand.ts index 645dea779b5f..bbe87175f0d9 100644 --- a/clients/client-sesv2/src/commands/PutEmailIdentityFeedbackAttributesCommand.ts +++ b/clients/client-sesv2/src/commands/PutEmailIdentityFeedbackAttributesCommand.ts @@ -5,10 +5,8 @@ import { Command as $Command } from "@smithy/smithy-client"; import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; -import { - PutEmailIdentityFeedbackAttributesRequest, - PutEmailIdentityFeedbackAttributesResponse, -} from "../models/models_0"; +import { PutEmailIdentityFeedbackAttributesRequest } from "../models/models_0"; +import { PutEmailIdentityFeedbackAttributesResponse } from "../models/models_1"; import { de_PutEmailIdentityFeedbackAttributesCommand, se_PutEmailIdentityFeedbackAttributesCommand, diff --git a/clients/client-sesv2/src/commands/SendBulkEmailCommand.ts b/clients/client-sesv2/src/commands/SendBulkEmailCommand.ts index 73d7dffe59a5..381b5783f3f4 100644 --- a/clients/client-sesv2/src/commands/SendBulkEmailCommand.ts +++ b/clients/client-sesv2/src/commands/SendBulkEmailCommand.ts @@ -54,6 +54,12 @@ export interface SendBulkEmailCommandOutput extends SendBulkEmailResponse, __Met * TemplateName: "STRING_VALUE", * TemplateArn: "STRING_VALUE", * TemplateData: "STRING_VALUE", + * Headers: [ // MessageHeaderList + * { // MessageHeader + * Name: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required + * }, + * ], * }, * }, * BulkEmailEntries: [ // BulkEmailEntryList // required diff --git a/clients/client-sesv2/src/commands/SendEmailCommand.ts b/clients/client-sesv2/src/commands/SendEmailCommand.ts index ef4ef406e2f7..d94694713845 100644 --- a/clients/client-sesv2/src/commands/SendEmailCommand.ts +++ b/clients/client-sesv2/src/commands/SendEmailCommand.ts @@ -93,6 +93,12 @@ export interface SendEmailCommandOutput extends SendEmailResponse, __MetadataBea * Charset: "STRING_VALUE", * }, * }, + * Headers: [ // MessageHeaderList + * { // MessageHeader + * Name: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required + * }, + * ], * }, * Raw: { // RawMessage * Data: "BLOB_VALUE", // required @@ -101,6 +107,12 @@ export interface SendEmailCommandOutput extends SendEmailResponse, __MetadataBea * TemplateName: "STRING_VALUE", * TemplateArn: "STRING_VALUE", * TemplateData: "STRING_VALUE", + * Headers: [ + * { + * Name: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required + * }, + * ], * }, * }, * EmailTags: [ // MessageTagList diff --git a/clients/client-sesv2/src/commands/UpdateContactCommand.ts b/clients/client-sesv2/src/commands/UpdateContactCommand.ts index 4242ffb1429d..4f33eabec67e 100644 --- a/clients/client-sesv2/src/commands/UpdateContactCommand.ts +++ b/clients/client-sesv2/src/commands/UpdateContactCommand.ts @@ -28,9 +28,12 @@ export interface UpdateContactCommandOutput extends UpdateContactResponse, __Met /** * @public - *

Updates a contact's preferences for a list. It is not necessary to specify all - * existing topic preferences in the TopicPreferences object, just the ones that need - * updating.

+ *

Updates a contact's preferences for a list.

+ * + *

You must specify all existing topic preferences in the + * TopicPreferences object, not just the ones that need updating; + * otherwise, all your existing preferences will be removed.

+ *
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-sesv2/src/models/models_0.ts b/clients/client-sesv2/src/models/models_0.ts index 95088e9a795f..aca88ee3e536 100644 --- a/clients/client-sesv2/src/models/models_0.ts +++ b/clients/client-sesv2/src/models/models_0.ts @@ -655,6 +655,42 @@ export interface Bounce { DiagnosticCode?: string; } +/** + * @public + *

Contains the name and value of a message header that you add to an email.

+ */ +export interface MessageHeader { + /** + * @public + *

The name of the message header. The message header name has to meet the following + * criteria:

+ * + */ + Name: string | undefined; + + /** + * @public + *

The value of the message header. The message header value has to meet the following + * criteria:

+ * + */ + Value: string | undefined; +} + /** * @public *

An object that defines the email template to use for an email message, and the values @@ -684,6 +720,12 @@ export interface Template { * The corresponding value defines the value to use for that variable.

*/ TemplateData?: string; + + /** + * @public + *

The list of message headers that will be added to the email message.

+ */ + Headers?: MessageHeader[]; } /** @@ -1231,8 +1273,8 @@ export interface ContactListDestination { /** * @public - *

>The type of action to perform on the addresses. The following are the - * possible values:

+ *

>The type of action to perform on the addresses. The following are the possible + * values:

*