Skip to content

Commit 72ea473

Browse files
author
awstools
committed
feat(client-sesv2): This release includes support for interacting with the Virtual Deliverability Manager, allowing you to opt in/out of the feature and to retrieve recommendations and metric data.
1 parent cce87ac commit 72ea473

15 files changed

+2911
-87
lines changed

Diff for: clients/client-sesv2/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ using your favorite package manager:
3333

3434
The AWS SDK is modulized by clients and commands.
3535
To send a request, you only need to import the `SESv2Client` and
36-
the commands you need, for example `CreateConfigurationSetCommand`:
36+
the commands you need, for example `BatchGetMetricDataCommand`:
3737

3838
```js
3939
// ES5 example
40-
const { SESv2Client, CreateConfigurationSetCommand } = require("@aws-sdk/client-sesv2");
40+
const { SESv2Client, BatchGetMetricDataCommand } = require("@aws-sdk/client-sesv2");
4141
```
4242

4343
```ts
4444
// ES6+ example
45-
import { SESv2Client, CreateConfigurationSetCommand } from "@aws-sdk/client-sesv2";
45+
import { SESv2Client, BatchGetMetricDataCommand } from "@aws-sdk/client-sesv2";
4646
```
4747

4848
### Usage
@@ -61,7 +61,7 @@ const client = new SESv2Client({ region: "REGION" });
6161
const params = {
6262
/** input parameters */
6363
};
64-
const command = new CreateConfigurationSetCommand(params);
64+
const command = new BatchGetMetricDataCommand(params);
6565
```
6666

6767
#### Async/await
@@ -140,15 +140,15 @@ const client = new AWS.SESv2({ region: "REGION" });
140140

141141
// async/await.
142142
try {
143-
const data = await client.createConfigurationSet(params);
143+
const data = await client.batchGetMetricData(params);
144144
// process data.
145145
} catch (error) {
146146
// error handling.
147147
}
148148

149149
// Promises.
150150
client
151-
.createConfigurationSet(params)
151+
.batchGetMetricData(params)
152152
.then((data) => {
153153
// process data.
154154
})
@@ -157,7 +157,7 @@ client
157157
});
158158

159159
// callbacks.
160-
client.createConfigurationSet(params, (err, data) => {
160+
client.batchGetMetricData(params, (err, data) => {
161161
// process err and data.
162162
});
163163
```

Diff for: clients/client-sesv2/src/SESv2.ts

+153
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// smithy-typescript generated code
22
import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
33

4+
import {
5+
BatchGetMetricDataCommand,
6+
BatchGetMetricDataCommandInput,
7+
BatchGetMetricDataCommandOutput,
8+
} from "./commands/BatchGetMetricDataCommand";
49
import {
510
CreateConfigurationSetCommand,
611
CreateConfigurationSetCommandInput,
@@ -243,6 +248,11 @@ import {
243248
ListImportJobsCommandInput,
244249
ListImportJobsCommandOutput,
245250
} from "./commands/ListImportJobsCommand";
251+
import {
252+
ListRecommendationsCommand,
253+
ListRecommendationsCommandInput,
254+
ListRecommendationsCommandOutput,
255+
} from "./commands/ListRecommendationsCommand";
246256
import {
247257
ListSuppressedDestinationsCommand,
248258
ListSuppressedDestinationsCommandInput,
@@ -273,6 +283,11 @@ import {
273283
PutAccountSuppressionAttributesCommandInput,
274284
PutAccountSuppressionAttributesCommandOutput,
275285
} from "./commands/PutAccountSuppressionAttributesCommand";
286+
import {
287+
PutAccountVdmAttributesCommand,
288+
PutAccountVdmAttributesCommandInput,
289+
PutAccountVdmAttributesCommandOutput,
290+
} from "./commands/PutAccountVdmAttributesCommand";
276291
import {
277292
PutConfigurationSetDeliveryOptionsCommand,
278293
PutConfigurationSetDeliveryOptionsCommandInput,
@@ -298,6 +313,11 @@ import {
298313
PutConfigurationSetTrackingOptionsCommandInput,
299314
PutConfigurationSetTrackingOptionsCommandOutput,
300315
} from "./commands/PutConfigurationSetTrackingOptionsCommand";
316+
import {
317+
PutConfigurationSetVdmOptionsCommand,
318+
PutConfigurationSetVdmOptionsCommandInput,
319+
PutConfigurationSetVdmOptionsCommandOutput,
320+
} from "./commands/PutConfigurationSetVdmOptionsCommand";
301321
import {
302322
PutDedicatedIpInPoolCommand,
303323
PutDedicatedIpInPoolCommandInput,
@@ -408,6 +428,40 @@ import { SESv2Client } from "./SESv2Client";
408428
* and code samples that demonstrate how to use Amazon SES API v2 features programmatically.</p>
409429
*/
410430
export class SESv2 extends SESv2Client {
431+
/**
432+
* <p>Retrieves batches of metric data collected based on your sending activity.</p>
433+
* <p>You can execute this operation no more than 16 times per second,
434+
* and with at most 160 queries from the batches per second (cumulative).</p>
435+
*/
436+
public batchGetMetricData(
437+
args: BatchGetMetricDataCommandInput,
438+
options?: __HttpHandlerOptions
439+
): Promise<BatchGetMetricDataCommandOutput>;
440+
public batchGetMetricData(
441+
args: BatchGetMetricDataCommandInput,
442+
cb: (err: any, data?: BatchGetMetricDataCommandOutput) => void
443+
): void;
444+
public batchGetMetricData(
445+
args: BatchGetMetricDataCommandInput,
446+
options: __HttpHandlerOptions,
447+
cb: (err: any, data?: BatchGetMetricDataCommandOutput) => void
448+
): void;
449+
public batchGetMetricData(
450+
args: BatchGetMetricDataCommandInput,
451+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: BatchGetMetricDataCommandOutput) => void),
452+
cb?: (err: any, data?: BatchGetMetricDataCommandOutput) => void
453+
): Promise<BatchGetMetricDataCommandOutput> | void {
454+
const command = new BatchGetMetricDataCommand(args);
455+
if (typeof optionsOrCb === "function") {
456+
this.send(command, optionsOrCb);
457+
} else if (typeof cb === "function") {
458+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
459+
this.send(command, optionsOrCb || {}, cb);
460+
} else {
461+
return this.send(command, optionsOrCb);
462+
}
463+
}
464+
411465
/**
412466
* <p>Create a configuration set. <i>Configuration sets</i> are groups of
413467
* rules that you can apply to the emails that you send. You apply a configuration set to
@@ -2164,6 +2218,39 @@ export class SESv2 extends SESv2Client {
21642218
}
21652219
}
21662220

2221+
/**
2222+
* <p>Lists the recommendations present in your Amazon SES account in the current Amazon Web Services Region.</p>
2223+
* <p>You can execute this operation no more than once per second.</p>
2224+
*/
2225+
public listRecommendations(
2226+
args: ListRecommendationsCommandInput,
2227+
options?: __HttpHandlerOptions
2228+
): Promise<ListRecommendationsCommandOutput>;
2229+
public listRecommendations(
2230+
args: ListRecommendationsCommandInput,
2231+
cb: (err: any, data?: ListRecommendationsCommandOutput) => void
2232+
): void;
2233+
public listRecommendations(
2234+
args: ListRecommendationsCommandInput,
2235+
options: __HttpHandlerOptions,
2236+
cb: (err: any, data?: ListRecommendationsCommandOutput) => void
2237+
): void;
2238+
public listRecommendations(
2239+
args: ListRecommendationsCommandInput,
2240+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListRecommendationsCommandOutput) => void),
2241+
cb?: (err: any, data?: ListRecommendationsCommandOutput) => void
2242+
): Promise<ListRecommendationsCommandOutput> | void {
2243+
const command = new ListRecommendationsCommand(args);
2244+
if (typeof optionsOrCb === "function") {
2245+
this.send(command, optionsOrCb);
2246+
} else if (typeof cb === "function") {
2247+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
2248+
this.send(command, optionsOrCb || {}, cb);
2249+
} else {
2250+
return this.send(command, optionsOrCb);
2251+
}
2252+
}
2253+
21672254
/**
21682255
* <p>Retrieves a list of email addresses that are on the suppression list for your
21692256
* account.</p>
@@ -2364,6 +2451,39 @@ export class SESv2 extends SESv2Client {
23642451
}
23652452
}
23662453

2454+
/**
2455+
* <p>Update your Amazon SES account VDM attributes.</p>
2456+
* <p>You can execute this operation no more than once per second.</p>
2457+
*/
2458+
public putAccountVdmAttributes(
2459+
args: PutAccountVdmAttributesCommandInput,
2460+
options?: __HttpHandlerOptions
2461+
): Promise<PutAccountVdmAttributesCommandOutput>;
2462+
public putAccountVdmAttributes(
2463+
args: PutAccountVdmAttributesCommandInput,
2464+
cb: (err: any, data?: PutAccountVdmAttributesCommandOutput) => void
2465+
): void;
2466+
public putAccountVdmAttributes(
2467+
args: PutAccountVdmAttributesCommandInput,
2468+
options: __HttpHandlerOptions,
2469+
cb: (err: any, data?: PutAccountVdmAttributesCommandOutput) => void
2470+
): void;
2471+
public putAccountVdmAttributes(
2472+
args: PutAccountVdmAttributesCommandInput,
2473+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PutAccountVdmAttributesCommandOutput) => void),
2474+
cb?: (err: any, data?: PutAccountVdmAttributesCommandOutput) => void
2475+
): Promise<PutAccountVdmAttributesCommandOutput> | void {
2476+
const command = new PutAccountVdmAttributesCommand(args);
2477+
if (typeof optionsOrCb === "function") {
2478+
this.send(command, optionsOrCb);
2479+
} else if (typeof cb === "function") {
2480+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
2481+
this.send(command, optionsOrCb || {}, cb);
2482+
} else {
2483+
return this.send(command, optionsOrCb);
2484+
}
2485+
}
2486+
23672487
/**
23682488
* <p>Associate a configuration set with a dedicated IP pool. You can use dedicated IP pools
23692489
* to create groups of dedicated IP addresses for sending specific types of email.</p>
@@ -2530,6 +2650,39 @@ export class SESv2 extends SESv2Client {
25302650
}
25312651
}
25322652

2653+
/**
2654+
* <p>Specify VDM preferences for email that you send using the configuration set.</p>
2655+
* <p>You can execute this operation no more than once per second.</p>
2656+
*/
2657+
public putConfigurationSetVdmOptions(
2658+
args: PutConfigurationSetVdmOptionsCommandInput,
2659+
options?: __HttpHandlerOptions
2660+
): Promise<PutConfigurationSetVdmOptionsCommandOutput>;
2661+
public putConfigurationSetVdmOptions(
2662+
args: PutConfigurationSetVdmOptionsCommandInput,
2663+
cb: (err: any, data?: PutConfigurationSetVdmOptionsCommandOutput) => void
2664+
): void;
2665+
public putConfigurationSetVdmOptions(
2666+
args: PutConfigurationSetVdmOptionsCommandInput,
2667+
options: __HttpHandlerOptions,
2668+
cb: (err: any, data?: PutConfigurationSetVdmOptionsCommandOutput) => void
2669+
): void;
2670+
public putConfigurationSetVdmOptions(
2671+
args: PutConfigurationSetVdmOptionsCommandInput,
2672+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PutConfigurationSetVdmOptionsCommandOutput) => void),
2673+
cb?: (err: any, data?: PutConfigurationSetVdmOptionsCommandOutput) => void
2674+
): Promise<PutConfigurationSetVdmOptionsCommandOutput> | void {
2675+
const command = new PutConfigurationSetVdmOptionsCommand(args);
2676+
if (typeof optionsOrCb === "function") {
2677+
this.send(command, optionsOrCb);
2678+
} else if (typeof cb === "function") {
2679+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
2680+
this.send(command, optionsOrCb || {}, cb);
2681+
} else {
2682+
return this.send(command, optionsOrCb);
2683+
}
2684+
}
2685+
25332686
/**
25342687
* <p>Move a dedicated IP address to an existing dedicated IP pool.</p>
25352688
* <note>

Diff for: clients/client-sesv2/src/SESv2Client.ts

+21
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import {
4747
UserAgent as __UserAgent,
4848
} from "@aws-sdk/types";
4949

50+
import { BatchGetMetricDataCommandInput, BatchGetMetricDataCommandOutput } from "./commands/BatchGetMetricDataCommand";
5051
import {
5152
CreateConfigurationSetCommandInput,
5253
CreateConfigurationSetCommandOutput,
@@ -193,6 +194,10 @@ import {
193194
} from "./commands/ListEmailIdentitiesCommand";
194195
import { ListEmailTemplatesCommandInput, ListEmailTemplatesCommandOutput } from "./commands/ListEmailTemplatesCommand";
195196
import { ListImportJobsCommandInput, ListImportJobsCommandOutput } from "./commands/ListImportJobsCommand";
197+
import {
198+
ListRecommendationsCommandInput,
199+
ListRecommendationsCommandOutput,
200+
} from "./commands/ListRecommendationsCommand";
196201
import {
197202
ListSuppressedDestinationsCommandInput,
198203
ListSuppressedDestinationsCommandOutput,
@@ -214,6 +219,10 @@ import {
214219
PutAccountSuppressionAttributesCommandInput,
215220
PutAccountSuppressionAttributesCommandOutput,
216221
} from "./commands/PutAccountSuppressionAttributesCommand";
222+
import {
223+
PutAccountVdmAttributesCommandInput,
224+
PutAccountVdmAttributesCommandOutput,
225+
} from "./commands/PutAccountVdmAttributesCommand";
217226
import {
218227
PutConfigurationSetDeliveryOptionsCommandInput,
219228
PutConfigurationSetDeliveryOptionsCommandOutput,
@@ -234,6 +243,10 @@ import {
234243
PutConfigurationSetTrackingOptionsCommandInput,
235244
PutConfigurationSetTrackingOptionsCommandOutput,
236245
} from "./commands/PutConfigurationSetTrackingOptionsCommand";
246+
import {
247+
PutConfigurationSetVdmOptionsCommandInput,
248+
PutConfigurationSetVdmOptionsCommandOutput,
249+
} from "./commands/PutConfigurationSetVdmOptionsCommand";
237250
import {
238251
PutDedicatedIpInPoolCommandInput,
239252
PutDedicatedIpInPoolCommandOutput,
@@ -309,6 +322,7 @@ import {
309322
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
310323

311324
export type ServiceInputTypes =
325+
| BatchGetMetricDataCommandInput
312326
| CreateConfigurationSetCommandInput
313327
| CreateConfigurationSetEventDestinationCommandInput
314328
| CreateContactCommandInput
@@ -359,17 +373,20 @@ export type ServiceInputTypes =
359373
| ListEmailIdentitiesCommandInput
360374
| ListEmailTemplatesCommandInput
361375
| ListImportJobsCommandInput
376+
| ListRecommendationsCommandInput
362377
| ListSuppressedDestinationsCommandInput
363378
| ListTagsForResourceCommandInput
364379
| PutAccountDedicatedIpWarmupAttributesCommandInput
365380
| PutAccountDetailsCommandInput
366381
| PutAccountSendingAttributesCommandInput
367382
| PutAccountSuppressionAttributesCommandInput
383+
| PutAccountVdmAttributesCommandInput
368384
| PutConfigurationSetDeliveryOptionsCommandInput
369385
| PutConfigurationSetReputationOptionsCommandInput
370386
| PutConfigurationSetSendingOptionsCommandInput
371387
| PutConfigurationSetSuppressionOptionsCommandInput
372388
| PutConfigurationSetTrackingOptionsCommandInput
389+
| PutConfigurationSetVdmOptionsCommandInput
373390
| PutDedicatedIpInPoolCommandInput
374391
| PutDedicatedIpWarmupAttributesCommandInput
375392
| PutDeliverabilityDashboardOptionCommandInput
@@ -393,6 +410,7 @@ export type ServiceInputTypes =
393410
| UpdateEmailTemplateCommandInput;
394411

395412
export type ServiceOutputTypes =
413+
| BatchGetMetricDataCommandOutput
396414
| CreateConfigurationSetCommandOutput
397415
| CreateConfigurationSetEventDestinationCommandOutput
398416
| CreateContactCommandOutput
@@ -443,17 +461,20 @@ export type ServiceOutputTypes =
443461
| ListEmailIdentitiesCommandOutput
444462
| ListEmailTemplatesCommandOutput
445463
| ListImportJobsCommandOutput
464+
| ListRecommendationsCommandOutput
446465
| ListSuppressedDestinationsCommandOutput
447466
| ListTagsForResourceCommandOutput
448467
| PutAccountDedicatedIpWarmupAttributesCommandOutput
449468
| PutAccountDetailsCommandOutput
450469
| PutAccountSendingAttributesCommandOutput
451470
| PutAccountSuppressionAttributesCommandOutput
471+
| PutAccountVdmAttributesCommandOutput
452472
| PutConfigurationSetDeliveryOptionsCommandOutput
453473
| PutConfigurationSetReputationOptionsCommandOutput
454474
| PutConfigurationSetSendingOptionsCommandOutput
455475
| PutConfigurationSetSuppressionOptionsCommandOutput
456476
| PutConfigurationSetTrackingOptionsCommandOutput
477+
| PutConfigurationSetVdmOptionsCommandOutput
457478
| PutDedicatedIpInPoolCommandOutput
458479
| PutDedicatedIpWarmupAttributesCommandOutput
459480
| PutDeliverabilityDashboardOptionCommandOutput

0 commit comments

Comments
 (0)