Skip to content

Commit

Permalink
feat(client-sesv2): This release includes support for interacting wit…
Browse files Browse the repository at this point in the history
…h the Virtual Deliverability Manager, allowing you to opt in/out of the feature and to retrieve recommendations and metric data.
  • Loading branch information
awstools committed Oct 31, 2022
1 parent cce87ac commit 72ea473
Show file tree
Hide file tree
Showing 15 changed files with 2,911 additions and 87 deletions.
14 changes: 7 additions & 7 deletions clients/client-sesv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ using your favorite package manager:

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

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

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

### Usage
Expand All @@ -61,7 +61,7 @@ const client = new SESv2Client({ region: "REGION" });
const params = {
/** input parameters */
};
const command = new CreateConfigurationSetCommand(params);
const command = new BatchGetMetricDataCommand(params);
```

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

// async/await.
try {
const data = await client.createConfigurationSet(params);
const data = await client.batchGetMetricData(params);
// process data.
} catch (error) {
// error handling.
}

// Promises.
client
.createConfigurationSet(params)
.batchGetMetricData(params)
.then((data) => {
// process data.
})
Expand All @@ -157,7 +157,7 @@ client
});

// callbacks.
client.createConfigurationSet(params, (err, data) => {
client.batchGetMetricData(params, (err, data) => {
// process err and data.
});
```
Expand Down
153 changes: 153 additions & 0 deletions clients/client-sesv2/src/SESv2.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// smithy-typescript generated code
import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";

import {
BatchGetMetricDataCommand,
BatchGetMetricDataCommandInput,
BatchGetMetricDataCommandOutput,
} from "./commands/BatchGetMetricDataCommand";
import {
CreateConfigurationSetCommand,
CreateConfigurationSetCommandInput,
Expand Down Expand Up @@ -243,6 +248,11 @@ import {
ListImportJobsCommandInput,
ListImportJobsCommandOutput,
} from "./commands/ListImportJobsCommand";
import {
ListRecommendationsCommand,
ListRecommendationsCommandInput,
ListRecommendationsCommandOutput,
} from "./commands/ListRecommendationsCommand";
import {
ListSuppressedDestinationsCommand,
ListSuppressedDestinationsCommandInput,
Expand Down Expand Up @@ -273,6 +283,11 @@ import {
PutAccountSuppressionAttributesCommandInput,
PutAccountSuppressionAttributesCommandOutput,
} from "./commands/PutAccountSuppressionAttributesCommand";
import {
PutAccountVdmAttributesCommand,
PutAccountVdmAttributesCommandInput,
PutAccountVdmAttributesCommandOutput,
} from "./commands/PutAccountVdmAttributesCommand";
import {
PutConfigurationSetDeliveryOptionsCommand,
PutConfigurationSetDeliveryOptionsCommandInput,
Expand All @@ -298,6 +313,11 @@ import {
PutConfigurationSetTrackingOptionsCommandInput,
PutConfigurationSetTrackingOptionsCommandOutput,
} from "./commands/PutConfigurationSetTrackingOptionsCommand";
import {
PutConfigurationSetVdmOptionsCommand,
PutConfigurationSetVdmOptionsCommandInput,
PutConfigurationSetVdmOptionsCommandOutput,
} from "./commands/PutConfigurationSetVdmOptionsCommand";
import {
PutDedicatedIpInPoolCommand,
PutDedicatedIpInPoolCommandInput,
Expand Down Expand Up @@ -408,6 +428,40 @@ import { SESv2Client } from "./SESv2Client";
* and code samples that demonstrate how to use Amazon SES API v2 features programmatically.</p>
*/
export class SESv2 extends SESv2Client {
/**
* <p>Retrieves batches of metric data collected based on your sending activity.</p>
* <p>You can execute this operation no more than 16 times per second,
* and with at most 160 queries from the batches per second (cumulative).</p>
*/
public batchGetMetricData(
args: BatchGetMetricDataCommandInput,
options?: __HttpHandlerOptions
): Promise<BatchGetMetricDataCommandOutput>;
public batchGetMetricData(
args: BatchGetMetricDataCommandInput,
cb: (err: any, data?: BatchGetMetricDataCommandOutput) => void
): void;
public batchGetMetricData(
args: BatchGetMetricDataCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchGetMetricDataCommandOutput) => void
): void;
public batchGetMetricData(
args: BatchGetMetricDataCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: BatchGetMetricDataCommandOutput) => void),
cb?: (err: any, data?: BatchGetMetricDataCommandOutput) => void
): Promise<BatchGetMetricDataCommandOutput> | void {
const command = new BatchGetMetricDataCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Create a configuration set. <i>Configuration sets</i> are groups of
* rules that you can apply to the emails that you send. You apply a configuration set to
Expand Down Expand Up @@ -2164,6 +2218,39 @@ export class SESv2 extends SESv2Client {
}
}

/**
* <p>Lists the recommendations present in your Amazon SES account in the current Amazon Web Services Region.</p>
* <p>You can execute this operation no more than once per second.</p>
*/
public listRecommendations(
args: ListRecommendationsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListRecommendationsCommandOutput>;
public listRecommendations(
args: ListRecommendationsCommandInput,
cb: (err: any, data?: ListRecommendationsCommandOutput) => void
): void;
public listRecommendations(
args: ListRecommendationsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListRecommendationsCommandOutput) => void
): void;
public listRecommendations(
args: ListRecommendationsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListRecommendationsCommandOutput) => void),
cb?: (err: any, data?: ListRecommendationsCommandOutput) => void
): Promise<ListRecommendationsCommandOutput> | void {
const command = new ListRecommendationsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Retrieves a list of email addresses that are on the suppression list for your
* account.</p>
Expand Down Expand Up @@ -2364,6 +2451,39 @@ export class SESv2 extends SESv2Client {
}
}

/**
* <p>Update your Amazon SES account VDM attributes.</p>
* <p>You can execute this operation no more than once per second.</p>
*/
public putAccountVdmAttributes(
args: PutAccountVdmAttributesCommandInput,
options?: __HttpHandlerOptions
): Promise<PutAccountVdmAttributesCommandOutput>;
public putAccountVdmAttributes(
args: PutAccountVdmAttributesCommandInput,
cb: (err: any, data?: PutAccountVdmAttributesCommandOutput) => void
): void;
public putAccountVdmAttributes(
args: PutAccountVdmAttributesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PutAccountVdmAttributesCommandOutput) => void
): void;
public putAccountVdmAttributes(
args: PutAccountVdmAttributesCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PutAccountVdmAttributesCommandOutput) => void),
cb?: (err: any, data?: PutAccountVdmAttributesCommandOutput) => void
): Promise<PutAccountVdmAttributesCommandOutput> | void {
const command = new PutAccountVdmAttributesCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Associate a configuration set with a dedicated IP pool. You can use dedicated IP pools
* to create groups of dedicated IP addresses for sending specific types of email.</p>
Expand Down Expand Up @@ -2530,6 +2650,39 @@ export class SESv2 extends SESv2Client {
}
}

/**
* <p>Specify VDM preferences for email that you send using the configuration set.</p>
* <p>You can execute this operation no more than once per second.</p>
*/
public putConfigurationSetVdmOptions(
args: PutConfigurationSetVdmOptionsCommandInput,
options?: __HttpHandlerOptions
): Promise<PutConfigurationSetVdmOptionsCommandOutput>;
public putConfigurationSetVdmOptions(
args: PutConfigurationSetVdmOptionsCommandInput,
cb: (err: any, data?: PutConfigurationSetVdmOptionsCommandOutput) => void
): void;
public putConfigurationSetVdmOptions(
args: PutConfigurationSetVdmOptionsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PutConfigurationSetVdmOptionsCommandOutput) => void
): void;
public putConfigurationSetVdmOptions(
args: PutConfigurationSetVdmOptionsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PutConfigurationSetVdmOptionsCommandOutput) => void),
cb?: (err: any, data?: PutConfigurationSetVdmOptionsCommandOutput) => void
): Promise<PutConfigurationSetVdmOptionsCommandOutput> | void {
const command = new PutConfigurationSetVdmOptionsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Move a dedicated IP address to an existing dedicated IP pool.</p>
* <note>
Expand Down
21 changes: 21 additions & 0 deletions clients/client-sesv2/src/SESv2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
UserAgent as __UserAgent,
} from "@aws-sdk/types";

import { BatchGetMetricDataCommandInput, BatchGetMetricDataCommandOutput } from "./commands/BatchGetMetricDataCommand";
import {
CreateConfigurationSetCommandInput,
CreateConfigurationSetCommandOutput,
Expand Down Expand Up @@ -193,6 +194,10 @@ import {
} from "./commands/ListEmailIdentitiesCommand";
import { ListEmailTemplatesCommandInput, ListEmailTemplatesCommandOutput } from "./commands/ListEmailTemplatesCommand";
import { ListImportJobsCommandInput, ListImportJobsCommandOutput } from "./commands/ListImportJobsCommand";
import {
ListRecommendationsCommandInput,
ListRecommendationsCommandOutput,
} from "./commands/ListRecommendationsCommand";
import {
ListSuppressedDestinationsCommandInput,
ListSuppressedDestinationsCommandOutput,
Expand All @@ -214,6 +219,10 @@ import {
PutAccountSuppressionAttributesCommandInput,
PutAccountSuppressionAttributesCommandOutput,
} from "./commands/PutAccountSuppressionAttributesCommand";
import {
PutAccountVdmAttributesCommandInput,
PutAccountVdmAttributesCommandOutput,
} from "./commands/PutAccountVdmAttributesCommand";
import {
PutConfigurationSetDeliveryOptionsCommandInput,
PutConfigurationSetDeliveryOptionsCommandOutput,
Expand All @@ -234,6 +243,10 @@ import {
PutConfigurationSetTrackingOptionsCommandInput,
PutConfigurationSetTrackingOptionsCommandOutput,
} from "./commands/PutConfigurationSetTrackingOptionsCommand";
import {
PutConfigurationSetVdmOptionsCommandInput,
PutConfigurationSetVdmOptionsCommandOutput,
} from "./commands/PutConfigurationSetVdmOptionsCommand";
import {
PutDedicatedIpInPoolCommandInput,
PutDedicatedIpInPoolCommandOutput,
Expand Down Expand Up @@ -309,6 +322,7 @@ import {
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";

export type ServiceInputTypes =
| BatchGetMetricDataCommandInput
| CreateConfigurationSetCommandInput
| CreateConfigurationSetEventDestinationCommandInput
| CreateContactCommandInput
Expand Down Expand Up @@ -359,17 +373,20 @@ export type ServiceInputTypes =
| ListEmailIdentitiesCommandInput
| ListEmailTemplatesCommandInput
| ListImportJobsCommandInput
| ListRecommendationsCommandInput
| ListSuppressedDestinationsCommandInput
| ListTagsForResourceCommandInput
| PutAccountDedicatedIpWarmupAttributesCommandInput
| PutAccountDetailsCommandInput
| PutAccountSendingAttributesCommandInput
| PutAccountSuppressionAttributesCommandInput
| PutAccountVdmAttributesCommandInput
| PutConfigurationSetDeliveryOptionsCommandInput
| PutConfigurationSetReputationOptionsCommandInput
| PutConfigurationSetSendingOptionsCommandInput
| PutConfigurationSetSuppressionOptionsCommandInput
| PutConfigurationSetTrackingOptionsCommandInput
| PutConfigurationSetVdmOptionsCommandInput
| PutDedicatedIpInPoolCommandInput
| PutDedicatedIpWarmupAttributesCommandInput
| PutDeliverabilityDashboardOptionCommandInput
Expand All @@ -393,6 +410,7 @@ export type ServiceInputTypes =
| UpdateEmailTemplateCommandInput;

export type ServiceOutputTypes =
| BatchGetMetricDataCommandOutput
| CreateConfigurationSetCommandOutput
| CreateConfigurationSetEventDestinationCommandOutput
| CreateContactCommandOutput
Expand Down Expand Up @@ -443,17 +461,20 @@ export type ServiceOutputTypes =
| ListEmailIdentitiesCommandOutput
| ListEmailTemplatesCommandOutput
| ListImportJobsCommandOutput
| ListRecommendationsCommandOutput
| ListSuppressedDestinationsCommandOutput
| ListTagsForResourceCommandOutput
| PutAccountDedicatedIpWarmupAttributesCommandOutput
| PutAccountDetailsCommandOutput
| PutAccountSendingAttributesCommandOutput
| PutAccountSuppressionAttributesCommandOutput
| PutAccountVdmAttributesCommandOutput
| PutConfigurationSetDeliveryOptionsCommandOutput
| PutConfigurationSetReputationOptionsCommandOutput
| PutConfigurationSetSendingOptionsCommandOutput
| PutConfigurationSetSuppressionOptionsCommandOutput
| PutConfigurationSetTrackingOptionsCommandOutput
| PutConfigurationSetVdmOptionsCommandOutput
| PutDedicatedIpInPoolCommandOutput
| PutDedicatedIpWarmupAttributesCommandOutput
| PutDeliverabilityDashboardOptionCommandOutput
Expand Down
Loading

0 comments on commit 72ea473

Please sign in to comment.