Skip to content

Commit

Permalink
feat(client-mailmanager): Introduce a new RuleSet condition evaluatio…
Browse files Browse the repository at this point in the history
…n, 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.
  • Loading branch information
awstools committed Sep 18, 2024
1 parent 8c9372b commit 900a39e
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 29 deletions.
11 changes: 5 additions & 6 deletions clients/client-mailmanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

AWS SDK for JavaScript MailManager Client for Node.js, Browser and React Native.

<fullname>AWS SES Mail Manager API</fullname>
<fullname>Amazon SES Mail Manager API</fullname>

<p>
<a href="http://aws.amazon.com/ses">AWS SES Mail Manager API</a> contains operations and data types
that comprise the Mail Manager feature of Amazon Simple Email Service.</p>
<p>The Amazon SES Mail Manager API contains operations and data types
that comprise the Mail Manager feature of <a href="http://aws.amazon.com/ses">Amazon Simple Email Service (SES)</a>.</p>
<p>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 <a href="https://docs.aws.amazon.com/ses/latest/dg/eb.html">Mail Manager chapter</a> in the Amazon SES Developer
Guide.</p>
streamline email compliance control. To learn more, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/eb.html">Mail Manager chapter</a> in the <i>Amazon SES Developer
Guide</i>.</p>

## Installing

Expand Down
11 changes: 5 additions & 6 deletions clients/client-mailmanager/src/MailManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -961,14 +961,13 @@ export interface MailManager {
}

/**
* <fullname>AWS SES Mail Manager API</fullname>
* <p>
* <a href="http://aws.amazon.com/ses">AWS SES Mail Manager API</a> contains operations and data types
* that comprise the Mail Manager feature of Amazon Simple Email Service.</p>
* <fullname>Amazon SES Mail Manager API</fullname>
* <p>The Amazon SES Mail Manager API contains operations and data types
* that comprise the Mail Manager feature of <a href="http://aws.amazon.com/ses">Amazon Simple Email Service (SES)</a>.</p>
* <p>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 <a href="https://docs.aws.amazon.com/ses/latest/dg/eb.html">Mail Manager chapter</a> in the Amazon SES Developer
* Guide.</p>
* streamline email compliance control. To learn more, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/eb.html">Mail Manager chapter</a> in the <i>Amazon SES Developer
* Guide</i>.</p>
* @public
*/
export class MailManager extends MailManagerClient implements MailManager {}
Expand Down
11 changes: 5 additions & 6 deletions clients/client-mailmanager/src/MailManagerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,13 @@ export type MailManagerClientResolvedConfigType = __SmithyResolvedConfiguration<
export interface MailManagerClientResolvedConfig extends MailManagerClientResolvedConfigType {}

/**
* <fullname>AWS SES Mail Manager API</fullname>
* <p>
* <a href="http://aws.amazon.com/ses">AWS SES Mail Manager API</a> contains operations and data types
* that comprise the Mail Manager feature of Amazon Simple Email Service.</p>
* <fullname>Amazon SES Mail Manager API</fullname>
* <p>The Amazon SES Mail Manager API contains operations and data types
* that comprise the Mail Manager feature of <a href="http://aws.amazon.com/ses">Amazon Simple Email Service (SES)</a>.</p>
* <p>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 <a href="https://docs.aws.amazon.com/ses/latest/dg/eb.html">Mail Manager chapter</a> in the Amazon SES Developer
* Guide.</p>
* streamline email compliance control. To learn more, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/eb.html">Mail Manager chapter</a> in the <i>Amazon SES Developer
* Guide</i>.</p>
* @public
*/
export class MailManagerClient extends __Client<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions clients/client-mailmanager/src/commands/GetRuleSetCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface UpdateRuleSetCommandInput extends UpdateRuleSetRequest {}
export interface UpdateRuleSetCommandOutput extends UpdateRuleSetResponse, __MetadataBearer {}

/**
* <p>&gt;Update attributes of an already provisioned rule set.</p>
* <p>Update attributes of an already provisioned rule set.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions clients/client-mailmanager/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// smithy-typescript generated code
/* eslint-disable */
/**
* <fullname>AWS SES Mail Manager API</fullname>
* <p>
* <a href="http://aws.amazon.com/ses">AWS SES Mail Manager API</a> contains operations and data types
* that comprise the Mail Manager feature of Amazon Simple Email Service.</p>
* <fullname>Amazon SES Mail Manager API</fullname>
* <p>The Amazon SES Mail Manager API contains operations and data types
* that comprise the Mail Manager feature of <a href="http://aws.amazon.com/ses">Amazon Simple Email Service (SES)</a>.</p>
* <p>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 <a href="https://docs.aws.amazon.com/ses/latest/dg/eb.html">Mail Manager chapter</a> in the Amazon SES Developer
* Guide.</p>
* streamline email compliance control. To learn more, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/eb.html">Mail Manager chapter</a> in the <i>Amazon SES Developer
* Guide</i>.</p>
*
* @packageDocumentation
*/
Expand Down
19 changes: 18 additions & 1 deletion clients/client-mailmanager/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2083,7 +2083,10 @@ export type RuleStringEmailAttribute = (typeof RuleStringEmailAttribute)[keyof t
* <p>The string to evaluate in a string condition expression.</p>
* @public
*/
export type RuleStringToEvaluate = RuleStringToEvaluate.AttributeMember | RuleStringToEvaluate.$UnknownMember;
export type RuleStringToEvaluate =
| RuleStringToEvaluate.AttributeMember
| RuleStringToEvaluate.MimeHeaderAttributeMember
| RuleStringToEvaluate.$UnknownMember;

/**
* @public
Expand All @@ -2095,6 +2098,17 @@ export namespace RuleStringToEvaluate {
*/
export interface AttributeMember {
Attribute: RuleStringEmailAttribute;
MimeHeaderAttribute?: never;
$unknown?: never;
}

/**
* <p>The email MIME X-Header attribute to evaluate in a string condition expression.</p>
* @public
*/
export interface MimeHeaderAttributeMember {
Attribute?: never;
MimeHeaderAttribute: string;
$unknown?: never;
}

Expand All @@ -2103,16 +2117,19 @@ export namespace RuleStringToEvaluate {
*/
export interface $UnknownMember {
Attribute?: never;
MimeHeaderAttribute?: never;
$unknown: [string, any];
}

export interface Visitor<T> {
Attribute: (value: RuleStringEmailAttribute) => T;
MimeHeaderAttribute: (value: string) => T;
_: (name: string, value: any) => T;
}

export const visit = <T>(value: RuleStringToEvaluate, visitor: Visitor<T>): 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]);
};
}
Expand Down
27 changes: 24 additions & 3 deletions codegen/sdk-codegen/aws-models/mailmanager.json
Original file line number Diff line number Diff line change
Expand Up @@ -4410,7 +4410,7 @@
},
"aws.protocols#awsJson1_0": {},
"smithy.api#cors": {},
"smithy.api#documentation": "<fullname>AWS SES Mail Manager API</fullname>\n <p>\n <a href=\"http://aws.amazon.com/ses\">AWS SES Mail Manager API</a> contains operations and data types\n that comprise the Mail Manager feature of Amazon Simple Email Service.</p>\n <p>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 <a href=\"https://docs.aws.amazon.com/ses/latest/dg/eb.html\">Mail Manager chapter</a> in the Amazon SES Developer\n Guide.</p>",
"smithy.api#documentation": "<fullname>Amazon SES Mail Manager API</fullname>\n <p>The Amazon SES Mail Manager API contains operations and data types\n that comprise the Mail Manager feature of <a href=\"http://aws.amazon.com/ses\">Amazon Simple Email Service (SES)</a>.</p>\n <p>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 <a href=\"https://docs.aws.amazon.com/ses/latest/dg/eb.html\">Mail Manager chapter</a> in the <i>Amazon SES Developer\n Guide</i>.</p>",
"smithy.api#externalDocumentation": {
"API Reference": "https://w.amazon.com/bin/view/AWS/Border"
},
Expand Down Expand Up @@ -5115,6 +5115,12 @@
"smithy.api#documentation": "<p>The textual body content of an email message.</p>"
}
},
"com.amazonaws.mailmanager#MimeHeaderAttribute": {
"type": "string",
"traits": {
"smithy.api#pattern": "^X-[a-zA-Z0-9-]{1,256}$"
}
},
"com.amazonaws.mailmanager#NameOrArn": {
"type": "string",
"traits": {
Expand Down Expand Up @@ -6395,6 +6401,12 @@
"traits": {
"smithy.api#documentation": "<p>The email attribute to evaluate in a string condition expression.</p>"
}
},
"MimeHeaderAttribute": {
"target": "com.amazonaws.mailmanager#MimeHeaderAttribute",
"traits": {
"smithy.api#documentation": "<p>The email MIME X-Header attribute to evaluate in a string condition expression.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -7653,7 +7674,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>&gt;Update attributes of an already provisioned rule set.</p>",
"smithy.api#documentation": "<p>Update attributes of an already provisioned rule set.</p>",
"smithy.api#idempotent": {}
}
},
Expand Down

0 comments on commit 900a39e

Please sign in to comment.