From 900a39ed0d8c01d0e6a6e93296ba2bbdb6316e4b Mon Sep 17 00:00:00 2001 From: awstools Date: Wed, 18 Sep 2024 18:19:00 +0000 Subject: [PATCH] feat(client-mailmanager): Introduce a new RuleSet condition evaluation, where customers can set up a StringExpression with a MimeHeader condition. This condition will perform the necessary validation based on the X-header provided by customers. --- clients/client-mailmanager/README.md | 11 ++++---- clients/client-mailmanager/src/MailManager.ts | 11 ++++---- .../src/MailManagerClient.ts | 11 ++++---- .../src/commands/CreateRuleSetCommand.ts | 2 ++ .../src/commands/GetRuleSetCommand.ts | 2 ++ .../src/commands/UpdateRuleSetCommand.ts | 4 ++- clients/client-mailmanager/src/index.ts | 11 ++++---- .../client-mailmanager/src/models/models_0.ts | 19 ++++++++++++- .../sdk-codegen/aws-models/mailmanager.json | 27 ++++++++++++++++--- 9 files changed, 69 insertions(+), 29 deletions(-) diff --git a/clients/client-mailmanager/README.md b/clients/client-mailmanager/README.md index a1ec5fae5c87..bdd173401b5d 100644 --- a/clients/client-mailmanager/README.md +++ b/clients/client-mailmanager/README.md @@ -6,15 +6,14 @@ AWS SDK for JavaScript MailManager Client for Node.js, Browser and React Native. -AWS SES Mail Manager API +Amazon SES Mail Manager API -

-AWS SES Mail Manager API contains operations and data types -that comprise the Mail Manager feature of Amazon Simple Email Service.

+

The Amazon SES Mail Manager API contains operations and data types +that comprise the Mail Manager feature of Amazon Simple Email Service (SES).

Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen your organization's email infrastructure, simplify email workflow management, and -streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer -Guide.

+streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer +Guide.

## Installing diff --git a/clients/client-mailmanager/src/MailManager.ts b/clients/client-mailmanager/src/MailManager.ts index 474a5523ca5e..fcee563f354c 100644 --- a/clients/client-mailmanager/src/MailManager.ts +++ b/clients/client-mailmanager/src/MailManager.ts @@ -961,14 +961,13 @@ export interface MailManager { } /** - * AWS SES Mail Manager API - *

- * AWS SES Mail Manager API contains operations and data types - * that comprise the Mail Manager feature of Amazon Simple Email Service.

+ * Amazon SES Mail Manager API + *

The Amazon SES Mail Manager API contains operations and data types + * that comprise the Mail Manager feature of Amazon Simple Email Service (SES).

*

Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen * your organization's email infrastructure, simplify email workflow management, and - * streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer - * Guide.

+ * streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer + * Guide.

* @public */ export class MailManager extends MailManagerClient implements MailManager {} diff --git a/clients/client-mailmanager/src/MailManagerClient.ts b/clients/client-mailmanager/src/MailManagerClient.ts index e183bf0c0322..0e54bc919936 100644 --- a/clients/client-mailmanager/src/MailManagerClient.ts +++ b/clients/client-mailmanager/src/MailManagerClient.ts @@ -429,14 +429,13 @@ export type MailManagerClientResolvedConfigType = __SmithyResolvedConfiguration< export interface MailManagerClientResolvedConfig extends MailManagerClientResolvedConfigType {} /** - * AWS SES Mail Manager API - *

- * AWS SES Mail Manager API contains operations and data types - * that comprise the Mail Manager feature of Amazon Simple Email Service.

+ * Amazon SES Mail Manager API + *

The Amazon SES Mail Manager API contains operations and data types + * that comprise the Mail Manager feature of Amazon Simple Email Service (SES).

*

Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen * your organization's email infrastructure, simplify email workflow management, and - * streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer - * Guide.

+ * streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer + * Guide.

* @public */ export class MailManagerClient extends __Client< diff --git a/clients/client-mailmanager/src/commands/CreateRuleSetCommand.ts b/clients/client-mailmanager/src/commands/CreateRuleSetCommand.ts index 221b7af974a3..d7b058603cbc 100644 --- a/clients/client-mailmanager/src/commands/CreateRuleSetCommand.ts +++ b/clients/client-mailmanager/src/commands/CreateRuleSetCommand.ts @@ -56,6 +56,7 @@ export interface CreateRuleSetCommandOutput extends CreateRuleSetResponse, __Met * StringExpression: { // RuleStringExpression * Evaluate: { // RuleStringToEvaluate Union: only one key present * Attribute: "MAIL_FROM" || "HELO" || "RECIPIENT" || "SENDER" || "FROM" || "SUBJECT" || "TO" || "CC", + * MimeHeaderAttribute: "STRING_VALUE", * }, * Operator: "EQUALS" || "NOT_EQUALS" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS", // required * Values: [ // RuleStringList // required @@ -110,6 +111,7 @@ export interface CreateRuleSetCommandOutput extends CreateRuleSetResponse, __Met * StringExpression: { * Evaluate: {// Union: only one key present * Attribute: "MAIL_FROM" || "HELO" || "RECIPIENT" || "SENDER" || "FROM" || "SUBJECT" || "TO" || "CC", + * MimeHeaderAttribute: "STRING_VALUE", * }, * Operator: "EQUALS" || "NOT_EQUALS" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS", // required * Values: [ // required diff --git a/clients/client-mailmanager/src/commands/GetRuleSetCommand.ts b/clients/client-mailmanager/src/commands/GetRuleSetCommand.ts index e802d76fd0b7..7ac6773a480b 100644 --- a/clients/client-mailmanager/src/commands/GetRuleSetCommand.ts +++ b/clients/client-mailmanager/src/commands/GetRuleSetCommand.ts @@ -60,6 +60,7 @@ export interface GetRuleSetCommandOutput extends GetRuleSetResponse, __MetadataB * // StringExpression: { // RuleStringExpression * // Evaluate: { // RuleStringToEvaluate Union: only one key present * // Attribute: "MAIL_FROM" || "HELO" || "RECIPIENT" || "SENDER" || "FROM" || "SUBJECT" || "TO" || "CC", + * // MimeHeaderAttribute: "STRING_VALUE", * // }, * // Operator: "EQUALS" || "NOT_EQUALS" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS", // required * // Values: [ // RuleStringList // required @@ -114,6 +115,7 @@ export interface GetRuleSetCommandOutput extends GetRuleSetResponse, __MetadataB * // StringExpression: { * // Evaluate: {// Union: only one key present * // Attribute: "MAIL_FROM" || "HELO" || "RECIPIENT" || "SENDER" || "FROM" || "SUBJECT" || "TO" || "CC", + * // MimeHeaderAttribute: "STRING_VALUE", * // }, * // Operator: "EQUALS" || "NOT_EQUALS" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS", // required * // Values: [ // required diff --git a/clients/client-mailmanager/src/commands/UpdateRuleSetCommand.ts b/clients/client-mailmanager/src/commands/UpdateRuleSetCommand.ts index 3342656a3233..02dd4b9c4160 100644 --- a/clients/client-mailmanager/src/commands/UpdateRuleSetCommand.ts +++ b/clients/client-mailmanager/src/commands/UpdateRuleSetCommand.ts @@ -32,7 +32,7 @@ export interface UpdateRuleSetCommandInput extends UpdateRuleSetRequest {} export interface UpdateRuleSetCommandOutput extends UpdateRuleSetResponse, __MetadataBearer {} /** - *

>Update attributes of an already provisioned rule set.

+ *

Update attributes of an already provisioned rule set.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript @@ -56,6 +56,7 @@ export interface UpdateRuleSetCommandOutput extends UpdateRuleSetResponse, __Met * StringExpression: { // RuleStringExpression * Evaluate: { // RuleStringToEvaluate Union: only one key present * Attribute: "MAIL_FROM" || "HELO" || "RECIPIENT" || "SENDER" || "FROM" || "SUBJECT" || "TO" || "CC", + * MimeHeaderAttribute: "STRING_VALUE", * }, * Operator: "EQUALS" || "NOT_EQUALS" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS", // required * Values: [ // RuleStringList // required @@ -110,6 +111,7 @@ export interface UpdateRuleSetCommandOutput extends UpdateRuleSetResponse, __Met * StringExpression: { * Evaluate: {// Union: only one key present * Attribute: "MAIL_FROM" || "HELO" || "RECIPIENT" || "SENDER" || "FROM" || "SUBJECT" || "TO" || "CC", + * MimeHeaderAttribute: "STRING_VALUE", * }, * Operator: "EQUALS" || "NOT_EQUALS" || "STARTS_WITH" || "ENDS_WITH" || "CONTAINS", // required * Values: [ // required diff --git a/clients/client-mailmanager/src/index.ts b/clients/client-mailmanager/src/index.ts index 847dad821fd1..bdecf40ceb10 100644 --- a/clients/client-mailmanager/src/index.ts +++ b/clients/client-mailmanager/src/index.ts @@ -1,14 +1,13 @@ // smithy-typescript generated code /* eslint-disable */ /** - * AWS SES Mail Manager API - *

- * AWS SES Mail Manager API contains operations and data types - * that comprise the Mail Manager feature of Amazon Simple Email Service.

+ * Amazon SES Mail Manager API + *

The Amazon SES Mail Manager API contains operations and data types + * that comprise the Mail Manager feature of Amazon Simple Email Service (SES).

*

Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen * your organization's email infrastructure, simplify email workflow management, and - * streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer - * Guide.

+ * streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer + * Guide.

* * @packageDocumentation */ diff --git a/clients/client-mailmanager/src/models/models_0.ts b/clients/client-mailmanager/src/models/models_0.ts index 3820e8025c1d..934c0b2b80ca 100644 --- a/clients/client-mailmanager/src/models/models_0.ts +++ b/clients/client-mailmanager/src/models/models_0.ts @@ -2083,7 +2083,10 @@ export type RuleStringEmailAttribute = (typeof RuleStringEmailAttribute)[keyof t *

The string to evaluate in a string condition expression.

* @public */ -export type RuleStringToEvaluate = RuleStringToEvaluate.AttributeMember | RuleStringToEvaluate.$UnknownMember; +export type RuleStringToEvaluate = + | RuleStringToEvaluate.AttributeMember + | RuleStringToEvaluate.MimeHeaderAttributeMember + | RuleStringToEvaluate.$UnknownMember; /** * @public @@ -2095,6 +2098,17 @@ export namespace RuleStringToEvaluate { */ export interface AttributeMember { Attribute: RuleStringEmailAttribute; + MimeHeaderAttribute?: never; + $unknown?: never; + } + + /** + *

The email MIME X-Header attribute to evaluate in a string condition expression.

+ * @public + */ + export interface MimeHeaderAttributeMember { + Attribute?: never; + MimeHeaderAttribute: string; $unknown?: never; } @@ -2103,16 +2117,19 @@ export namespace RuleStringToEvaluate { */ export interface $UnknownMember { Attribute?: never; + MimeHeaderAttribute?: never; $unknown: [string, any]; } export interface Visitor { Attribute: (value: RuleStringEmailAttribute) => T; + MimeHeaderAttribute: (value: string) => T; _: (name: string, value: any) => T; } export const visit = (value: RuleStringToEvaluate, visitor: Visitor): T => { if (value.Attribute !== undefined) return visitor.Attribute(value.Attribute); + if (value.MimeHeaderAttribute !== undefined) return visitor.MimeHeaderAttribute(value.MimeHeaderAttribute); return visitor._(value.$unknown[0], value.$unknown[1]); }; } diff --git a/codegen/sdk-codegen/aws-models/mailmanager.json b/codegen/sdk-codegen/aws-models/mailmanager.json index a0cb42f3d970..2fad64c06ebd 100644 --- a/codegen/sdk-codegen/aws-models/mailmanager.json +++ b/codegen/sdk-codegen/aws-models/mailmanager.json @@ -4410,7 +4410,7 @@ }, "aws.protocols#awsJson1_0": {}, "smithy.api#cors": {}, - "smithy.api#documentation": "AWS SES Mail Manager API\n

\n AWS SES Mail Manager API contains operations and data types\n that comprise the Mail Manager feature of Amazon Simple Email Service.

\n

Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen\n your organization's email infrastructure, simplify email workflow management, and\n streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer\n Guide.

", + "smithy.api#documentation": "Amazon SES Mail Manager API\n

The Amazon SES Mail Manager API contains operations and data types\n that comprise the Mail Manager feature of Amazon Simple Email Service (SES).

\n

Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen\n your organization's email infrastructure, simplify email workflow management, and\n streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer\n Guide.

", "smithy.api#externalDocumentation": { "API Reference": "https://w.amazon.com/bin/view/AWS/Border" }, @@ -5115,6 +5115,12 @@ "smithy.api#documentation": "

The textual body content of an email message.

" } }, + "com.amazonaws.mailmanager#MimeHeaderAttribute": { + "type": "string", + "traits": { + "smithy.api#pattern": "^X-[a-zA-Z0-9-]{1,256}$" + } + }, "com.amazonaws.mailmanager#NameOrArn": { "type": "string", "traits": { @@ -6395,6 +6401,12 @@ "traits": { "smithy.api#documentation": "

The email attribute to evaluate in a string condition expression.

" } + }, + "MimeHeaderAttribute": { + "target": "com.amazonaws.mailmanager#MimeHeaderAttribute", + "traits": { + "smithy.api#documentation": "

The email MIME X-Header attribute to evaluate in a string condition expression.

" + } } }, "traits": { @@ -7078,10 +7090,19 @@ "target": "smithy.api#String" } }, + "com.amazonaws.mailmanager#StringValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + } + } + }, "com.amazonaws.mailmanager#StringValueList": { "type": "list", "member": { - "target": "smithy.api#String" + "target": "com.amazonaws.mailmanager#StringValue" }, "traits": { "smithy.api#length": { @@ -7653,7 +7674,7 @@ } ], "traits": { - "smithy.api#documentation": "

>Update attributes of an already provisioned rule set.

", + "smithy.api#documentation": "

Update attributes of an already provisioned rule set.

", "smithy.api#idempotent": {} } },