Skip to content

Commit 1f6506b

Browse files
author
awstools
committed
feat(client-mailmanager): Mail Manager support for viewing and exporting metadata of archived messages.
1 parent f2da7b7 commit 1f6506b

File tree

9 files changed

+380
-14
lines changed

9 files changed

+380
-14
lines changed

clients/client-mailmanager/src/commands/GetArchiveExportCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface GetArchiveExportCommandOutput extends GetArchiveExportResponse,
4747
* // { // ArchiveFilterCondition Union: only one key present
4848
* // StringExpression: { // ArchiveStringExpression
4949
* // Evaluate: { // ArchiveStringToEvaluate Union: only one key present
50-
* // Attribute: "TO" || "FROM" || "CC" || "SUBJECT",
50+
* // Attribute: "TO" || "FROM" || "CC" || "SUBJECT" || "ENVELOPE_TO" || "ENVELOPE_FROM",
5151
* // },
5252
* // Operator: "CONTAINS", // required
5353
* // Values: [ // StringValueList // required
@@ -66,7 +66,7 @@ export interface GetArchiveExportCommandOutput extends GetArchiveExportResponse,
6666
* // {// Union: only one key present
6767
* // StringExpression: {
6868
* // Evaluate: {// Union: only one key present
69-
* // Attribute: "TO" || "FROM" || "CC" || "SUBJECT",
69+
* // Attribute: "TO" || "FROM" || "CC" || "SUBJECT" || "ENVELOPE_TO" || "ENVELOPE_FROM",
7070
* // },
7171
* // Operator: "CONTAINS", // required
7272
* // Values: [ // required

clients/client-mailmanager/src/commands/GetArchiveMessageCommand.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { MailManagerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MailManagerClient";
9-
import { GetArchiveMessageRequest, GetArchiveMessageResponse } from "../models/models_0";
9+
import {
10+
GetArchiveMessageRequest,
11+
GetArchiveMessageResponse,
12+
GetArchiveMessageResponseFilterSensitiveLog,
13+
} from "../models/models_0";
1014
import { de_GetArchiveMessageCommand, se_GetArchiveMessageCommand } from "../protocols/Aws_json1_0";
1115

1216
/**
@@ -44,6 +48,23 @@ export interface GetArchiveMessageCommandOutput extends GetArchiveMessageRespons
4448
* const response = await client.send(command);
4549
* // { // GetArchiveMessageResponse
4650
* // MessageDownloadLink: "STRING_VALUE",
51+
* // Metadata: { // Metadata
52+
* // Timestamp: new Date("TIMESTAMP"),
53+
* // IngressPointId: "STRING_VALUE",
54+
* // TrafficPolicyId: "STRING_VALUE",
55+
* // RuleSetId: "STRING_VALUE",
56+
* // SenderHostname: "STRING_VALUE",
57+
* // SenderIpAddress: "STRING_VALUE",
58+
* // TlsCipherSuite: "STRING_VALUE",
59+
* // TlsProtocol: "STRING_VALUE",
60+
* // },
61+
* // Envelope: { // Envelope
62+
* // Helo: "STRING_VALUE",
63+
* // From: "STRING_VALUE",
64+
* // To: [ // StringList
65+
* // "STRING_VALUE",
66+
* // ],
67+
* // },
4768
* // };
4869
*
4970
* ```
@@ -85,7 +106,7 @@ export class GetArchiveMessageCommand extends $Command
85106
})
86107
.s("MailManagerSvc", "GetArchiveMessage", {})
87108
.n("MailManagerClient", "GetArchiveMessageCommand")
88-
.f(void 0, void 0)
109+
.f(void 0, GetArchiveMessageResponseFilterSensitiveLog)
89110
.ser(se_GetArchiveMessageCommand)
90111
.de(de_GetArchiveMessageCommand)
91112
.build() {

clients/client-mailmanager/src/commands/GetArchiveSearchCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface GetArchiveSearchCommandOutput extends GetArchiveSearchResponse,
4747
* // { // ArchiveFilterCondition Union: only one key present
4848
* // StringExpression: { // ArchiveStringExpression
4949
* // Evaluate: { // ArchiveStringToEvaluate Union: only one key present
50-
* // Attribute: "TO" || "FROM" || "CC" || "SUBJECT",
50+
* // Attribute: "TO" || "FROM" || "CC" || "SUBJECT" || "ENVELOPE_TO" || "ENVELOPE_FROM",
5151
* // },
5252
* // Operator: "CONTAINS", // required
5353
* // Values: [ // StringValueList // required
@@ -66,7 +66,7 @@ export interface GetArchiveSearchCommandOutput extends GetArchiveSearchResponse,
6666
* // {// Union: only one key present
6767
* // StringExpression: {
6868
* // Evaluate: {// Union: only one key present
69-
* // Attribute: "TO" || "FROM" || "CC" || "SUBJECT",
69+
* // Attribute: "TO" || "FROM" || "CC" || "SUBJECT" || "ENVELOPE_TO" || "ENVELOPE_FROM",
7070
* // },
7171
* // Operator: "CONTAINS", // required
7272
* // Values: [ // required

clients/client-mailmanager/src/commands/GetArchiveSearchResultsCommand.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { MailManagerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MailManagerClient";
9-
import { GetArchiveSearchResultsRequest, GetArchiveSearchResultsResponse } from "../models/models_0";
9+
import {
10+
GetArchiveSearchResultsRequest,
11+
GetArchiveSearchResultsResponse,
12+
GetArchiveSearchResultsResponseFilterSensitiveLog,
13+
} from "../models/models_0";
1014
import { de_GetArchiveSearchResultsCommand, se_GetArchiveSearchResultsCommand } from "../protocols/Aws_json1_0";
1115

1216
/**
@@ -59,6 +63,16 @@ export interface GetArchiveSearchResultsCommandOutput extends GetArchiveSearchRe
5963
* // XMailer: "STRING_VALUE",
6064
* // XOriginalMailer: "STRING_VALUE",
6165
* // XPriority: "STRING_VALUE",
66+
* // IngressPointId: "STRING_VALUE",
67+
* // SenderHostname: "STRING_VALUE",
68+
* // SenderIpAddress: "STRING_VALUE",
69+
* // Envelope: { // Envelope
70+
* // Helo: "STRING_VALUE",
71+
* // From: "STRING_VALUE",
72+
* // To: [ // StringList
73+
* // "STRING_VALUE",
74+
* // ],
75+
* // },
6276
* // },
6377
* // ],
6478
* // };
@@ -105,7 +119,7 @@ export class GetArchiveSearchResultsCommand extends $Command
105119
})
106120
.s("MailManagerSvc", "GetArchiveSearchResults", {})
107121
.n("MailManagerClient", "GetArchiveSearchResultsCommand")
108-
.f(void 0, void 0)
122+
.f(void 0, GetArchiveSearchResultsResponseFilterSensitiveLog)
109123
.ser(se_GetArchiveSearchResultsCommand)
110124
.de(de_GetArchiveSearchResultsCommand)
111125
.build() {

clients/client-mailmanager/src/commands/StartArchiveExportCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface StartArchiveExportCommandOutput extends StartArchiveExportRespo
4242
* { // ArchiveFilterCondition Union: only one key present
4343
* StringExpression: { // ArchiveStringExpression
4444
* Evaluate: { // ArchiveStringToEvaluate Union: only one key present
45-
* Attribute: "TO" || "FROM" || "CC" || "SUBJECT",
45+
* Attribute: "TO" || "FROM" || "CC" || "SUBJECT" || "ENVELOPE_TO" || "ENVELOPE_FROM",
4646
* },
4747
* Operator: "CONTAINS", // required
4848
* Values: [ // StringValueList // required
@@ -61,7 +61,7 @@ export interface StartArchiveExportCommandOutput extends StartArchiveExportRespo
6161
* {// Union: only one key present
6262
* StringExpression: {
6363
* Evaluate: {// Union: only one key present
64-
* Attribute: "TO" || "FROM" || "CC" || "SUBJECT",
64+
* Attribute: "TO" || "FROM" || "CC" || "SUBJECT" || "ENVELOPE_TO" || "ENVELOPE_FROM",
6565
* },
6666
* Operator: "CONTAINS", // required
6767
* Values: [ // required
@@ -85,6 +85,7 @@ export interface StartArchiveExportCommandOutput extends StartArchiveExportRespo
8585
* S3Location: "STRING_VALUE",
8686
* },
8787
* },
88+
* IncludeMetadata: true || false,
8889
* };
8990
* const command = new StartArchiveExportCommand(input);
9091
* const response = await client.send(command);

clients/client-mailmanager/src/commands/StartArchiveSearchCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface StartArchiveSearchCommandOutput extends StartArchiveSearchRespo
4242
* { // ArchiveFilterCondition Union: only one key present
4343
* StringExpression: { // ArchiveStringExpression
4444
* Evaluate: { // ArchiveStringToEvaluate Union: only one key present
45-
* Attribute: "TO" || "FROM" || "CC" || "SUBJECT",
45+
* Attribute: "TO" || "FROM" || "CC" || "SUBJECT" || "ENVELOPE_TO" || "ENVELOPE_FROM",
4646
* },
4747
* Operator: "CONTAINS", // required
4848
* Values: [ // StringValueList // required
@@ -61,7 +61,7 @@ export interface StartArchiveSearchCommandOutput extends StartArchiveSearchRespo
6161
* {// Union: only one key present
6262
* StringExpression: {
6363
* Evaluate: {// Union: only one key present
64-
* Attribute: "TO" || "FROM" || "CC" || "SUBJECT",
64+
* Attribute: "TO" || "FROM" || "CC" || "SUBJECT" || "ENVELOPE_TO" || "ENVELOPE_FROM",
6565
* },
6666
* Operator: "CONTAINS", // required
6767
* Values: [ // required

clients/client-mailmanager/src/models/models_0.ts

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,8 @@ export interface ArchiveBooleanExpression {
681681
*/
682682
export const ArchiveStringEmailAttribute = {
683683
CC: "CC",
684+
ENVELOPE_FROM: "ENVELOPE_FROM",
685+
ENVELOPE_TO: "ENVELOPE_TO",
684686
FROM: "FROM",
685687
SUBJECT: "SUBJECT",
686688
TO: "TO",
@@ -3146,6 +3148,30 @@ export interface DeleteTrafficPolicyRequest {
31463148
*/
31473149
export interface DeleteTrafficPolicyResponse {}
31483150

3151+
/**
3152+
* <p>The SMTP envelope information of the email.</p>
3153+
* @public
3154+
*/
3155+
export interface Envelope {
3156+
/**
3157+
* <p>The HELO used by the host from which the email was received.</p>
3158+
* @public
3159+
*/
3160+
Helo?: string;
3161+
3162+
/**
3163+
* <p>The RCPT FROM given by the host from which the email was received.</p>
3164+
* @public
3165+
*/
3166+
From?: string;
3167+
3168+
/**
3169+
* <p>All SMTP TO entries given by the host from which the email was received.</p>
3170+
* @public
3171+
*/
3172+
To?: string[];
3173+
}
3174+
31493175
/**
31503176
* <p>The configuration for exporting email data to an Amazon S3 bucket.</p>
31513177
* @public
@@ -3336,6 +3362,60 @@ export interface GetArchiveMessageRequest {
33363362
ArchivedMessageId: string | undefined;
33373363
}
33383364

3365+
/**
3366+
* <p>The metadata about the email.</p>
3367+
* @public
3368+
*/
3369+
export interface Metadata {
3370+
/**
3371+
* <p>The timestamp of when the email was received.</p>
3372+
* @public
3373+
*/
3374+
Timestamp?: Date;
3375+
3376+
/**
3377+
* <p>The ID of the ingress endpoint through which the email was received.</p>
3378+
* @public
3379+
*/
3380+
IngressPointId?: string;
3381+
3382+
/**
3383+
* <p>The ID of the traffic policy that was in effect when the email was received.</p>
3384+
* @public
3385+
*/
3386+
TrafficPolicyId?: string;
3387+
3388+
/**
3389+
* <p>The ID of the rule set that processed the email.</p>
3390+
* @public
3391+
*/
3392+
RuleSetId?: string;
3393+
3394+
/**
3395+
* <p>The name of the host from which the email was received.</p>
3396+
* @public
3397+
*/
3398+
SenderHostname?: string;
3399+
3400+
/**
3401+
* <p>The IP address of the host from which the email was received.</p>
3402+
* @public
3403+
*/
3404+
SenderIpAddress?: string;
3405+
3406+
/**
3407+
* <p>The TLS cipher suite used to communicate with the host from which the email was received.</p>
3408+
* @public
3409+
*/
3410+
TlsCipherSuite?: string;
3411+
3412+
/**
3413+
* <p>The TLS protocol used to communicate with the host from which the email was received.</p>
3414+
* @public
3415+
*/
3416+
TlsProtocol?: string;
3417+
}
3418+
33393419
/**
33403420
* <p>The response containing details about the requested archived email message.</p>
33413421
* @public
@@ -3346,6 +3426,18 @@ export interface GetArchiveMessageResponse {
33463426
* @public
33473427
*/
33483428
MessageDownloadLink?: string;
3429+
3430+
/**
3431+
* <p>The metadata about the email.</p>
3432+
* @public
3433+
*/
3434+
Metadata?: Metadata;
3435+
3436+
/**
3437+
* <p>The SMTP envelope information of the email.</p>
3438+
* @public
3439+
*/
3440+
Envelope?: Envelope;
33493441
}
33503442

33513443
/**
@@ -3597,6 +3689,30 @@ export interface Row {
35973689
* @public
35983690
*/
35993691
XPriority?: string;
3692+
3693+
/**
3694+
* <p>The ID of the ingress endpoint through which the email was received.</p>
3695+
* @public
3696+
*/
3697+
IngressPointId?: string;
3698+
3699+
/**
3700+
* <p>The name of the host from which the email was received.</p>
3701+
* @public
3702+
*/
3703+
SenderHostname?: string;
3704+
3705+
/**
3706+
* <p>The IP address of the host from which the email was received.</p>
3707+
* @public
3708+
*/
3709+
SenderIpAddress?: string;
3710+
3711+
/**
3712+
* <p>The SMTP envelope information of the email.</p>
3713+
* @public
3714+
*/
3715+
Envelope?: Envelope;
36003716
}
36013717

36023718
/**
@@ -4496,6 +4612,12 @@ export interface StartArchiveExportRequest {
44964612
* @public
44974613
*/
44984614
ExportDestinationConfiguration: ExportDestinationConfiguration | undefined;
4615+
4616+
/**
4617+
* <p>Whether to include message metadata as JSON files in the export.</p>
4618+
* @public
4619+
*/
4620+
IncludeMetadata?: boolean;
44994621
}
45004622

45014623
/**
@@ -4797,6 +4919,38 @@ export const CreateTrafficPolicyRequestFilterSensitiveLog = (obj: CreateTrafficP
47974919
...(obj.Tags && { Tags: obj.Tags.map((item) => TagFilterSensitiveLog(item)) }),
47984920
});
47994921

4922+
/**
4923+
* @internal
4924+
*/
4925+
export const MetadataFilterSensitiveLog = (obj: Metadata): any => ({
4926+
...obj,
4927+
...(obj.SenderIpAddress && { SenderIpAddress: SENSITIVE_STRING }),
4928+
});
4929+
4930+
/**
4931+
* @internal
4932+
*/
4933+
export const GetArchiveMessageResponseFilterSensitiveLog = (obj: GetArchiveMessageResponse): any => ({
4934+
...obj,
4935+
...(obj.Metadata && { Metadata: MetadataFilterSensitiveLog(obj.Metadata) }),
4936+
});
4937+
4938+
/**
4939+
* @internal
4940+
*/
4941+
export const RowFilterSensitiveLog = (obj: Row): any => ({
4942+
...obj,
4943+
...(obj.SenderIpAddress && { SenderIpAddress: SENSITIVE_STRING }),
4944+
});
4945+
4946+
/**
4947+
* @internal
4948+
*/
4949+
export const GetArchiveSearchResultsResponseFilterSensitiveLog = (obj: GetArchiveSearchResultsResponse): any => ({
4950+
...obj,
4951+
...(obj.Rows && { Rows: obj.Rows.map((item) => RowFilterSensitiveLog(item)) }),
4952+
});
4953+
48004954
/**
48014955
* @internal
48024956
*/

0 commit comments

Comments
 (0)