Skip to content

Commit

Permalink
feat(client-sesv2): This release allows customers to update scaling m…
Browse files Browse the repository at this point in the history
…ode property of dedicated IP pools with PutDedicatedIpPoolScalingAttributes call.
  • Loading branch information
awstools committed May 19, 2023
1 parent 08dff77 commit 502ebd2
Show file tree
Hide file tree
Showing 8 changed files with 527 additions and 89 deletions.
8 changes: 8 additions & 0 deletions clients/client-sesv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,14 @@ PutDedicatedIpInPool

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sesv2/classes/putdedicatedipinpoolcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sesv2/interfaces/putdedicatedipinpoolcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sesv2/interfaces/putdedicatedipinpoolcommandoutput.html)

</details>
<details>
<summary>
PutDedicatedIpPoolScalingAttributes
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sesv2/classes/putdedicatedippoolscalingattributescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sesv2/interfaces/putdedicatedippoolscalingattributescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sesv2/interfaces/putdedicatedippoolscalingattributescommandoutput.html)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-sesv2/src/SESv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ import {
PutDedicatedIpInPoolCommandInput,
PutDedicatedIpInPoolCommandOutput,
} from "./commands/PutDedicatedIpInPoolCommand";
import {
PutDedicatedIpPoolScalingAttributesCommand,
PutDedicatedIpPoolScalingAttributesCommandInput,
PutDedicatedIpPoolScalingAttributesCommandOutput,
} from "./commands/PutDedicatedIpPoolScalingAttributesCommand";
import {
PutDedicatedIpWarmupAttributesCommand,
PutDedicatedIpWarmupAttributesCommandInput,
Expand Down Expand Up @@ -485,6 +490,7 @@ const commands = {
PutConfigurationSetTrackingOptionsCommand,
PutConfigurationSetVdmOptionsCommand,
PutDedicatedIpInPoolCommand,
PutDedicatedIpPoolScalingAttributesCommand,
PutDedicatedIpWarmupAttributesCommand,
PutDeliverabilityDashboardOptionCommand,
PutEmailIdentityConfigurationSetAttributesCommand,
Expand Down Expand Up @@ -1579,6 +1585,23 @@ export interface SESv2 {
cb: (err: any, data?: PutDedicatedIpInPoolCommandOutput) => void
): void;

/**
* @see {@link PutDedicatedIpPoolScalingAttributesCommand}
*/
putDedicatedIpPoolScalingAttributes(
args: PutDedicatedIpPoolScalingAttributesCommandInput,
options?: __HttpHandlerOptions
): Promise<PutDedicatedIpPoolScalingAttributesCommandOutput>;
putDedicatedIpPoolScalingAttributes(
args: PutDedicatedIpPoolScalingAttributesCommandInput,
cb: (err: any, data?: PutDedicatedIpPoolScalingAttributesCommandOutput) => void
): void;
putDedicatedIpPoolScalingAttributes(
args: PutDedicatedIpPoolScalingAttributesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PutDedicatedIpPoolScalingAttributesCommandOutput) => void
): void;

/**
* @see {@link PutDedicatedIpWarmupAttributesCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-sesv2/src/SESv2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ import {
PutDedicatedIpInPoolCommandInput,
PutDedicatedIpInPoolCommandOutput,
} from "./commands/PutDedicatedIpInPoolCommand";
import {
PutDedicatedIpPoolScalingAttributesCommandInput,
PutDedicatedIpPoolScalingAttributesCommandOutput,
} from "./commands/PutDedicatedIpPoolScalingAttributesCommand";
import {
PutDedicatedIpWarmupAttributesCommandInput,
PutDedicatedIpWarmupAttributesCommandOutput,
Expand Down Expand Up @@ -395,6 +399,7 @@ export type ServiceInputTypes =
| PutConfigurationSetTrackingOptionsCommandInput
| PutConfigurationSetVdmOptionsCommandInput
| PutDedicatedIpInPoolCommandInput
| PutDedicatedIpPoolScalingAttributesCommandInput
| PutDedicatedIpWarmupAttributesCommandInput
| PutDeliverabilityDashboardOptionCommandInput
| PutEmailIdentityConfigurationSetAttributesCommandInput
Expand Down Expand Up @@ -486,6 +491,7 @@ export type ServiceOutputTypes =
| PutConfigurationSetTrackingOptionsCommandOutput
| PutConfigurationSetVdmOptionsCommandOutput
| PutDedicatedIpInPoolCommandOutput
| PutDedicatedIpPoolScalingAttributesCommandOutput
| PutDedicatedIpWarmupAttributesCommandOutput
| PutDeliverabilityDashboardOptionCommandOutput
| PutEmailIdentityConfigurationSetAttributesCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
} from "@aws-sdk/types";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import {
PutDedicatedIpPoolScalingAttributesRequest,
PutDedicatedIpPoolScalingAttributesResponse,
} from "../models/models_0";
import {
de_PutDedicatedIpPoolScalingAttributesCommand,
se_PutDedicatedIpPoolScalingAttributesCommand,
} from "../protocols/Aws_restJson1";
import { ServiceInputTypes, ServiceOutputTypes, SESv2ClientResolvedConfig } from "../SESv2Client";

/**
* @public
*
* The input for {@link PutDedicatedIpPoolScalingAttributesCommand}.
*/
export interface PutDedicatedIpPoolScalingAttributesCommandInput extends PutDedicatedIpPoolScalingAttributesRequest {}
/**
* @public
*
* The output of {@link PutDedicatedIpPoolScalingAttributesCommand}.
*/
export interface PutDedicatedIpPoolScalingAttributesCommandOutput
extends PutDedicatedIpPoolScalingAttributesResponse,
__MetadataBearer {}

/**
* @public
* <p>Used to convert a dedicated IP pool to a different scaling mode.</p>
* <note>
* <p>
* <code>MANAGED</code> pools cannot be converted to <code>STANDARD</code> scaling mode.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { SESv2Client, PutDedicatedIpPoolScalingAttributesCommand } from "@aws-sdk/client-sesv2"; // ES Modules import
* // const { SESv2Client, PutDedicatedIpPoolScalingAttributesCommand } = require("@aws-sdk/client-sesv2"); // CommonJS import
* const client = new SESv2Client(config);
* const input = { // PutDedicatedIpPoolScalingAttributesRequest
* PoolName: "STRING_VALUE", // required
* ScalingMode: "STANDARD" || "MANAGED", // required
* };
* const command = new PutDedicatedIpPoolScalingAttributesCommand(input);
* const response = await client.send(command);
* // {};
*
* ```
*
* @param PutDedicatedIpPoolScalingAttributesCommandInput - {@link PutDedicatedIpPoolScalingAttributesCommandInput}
* @returns {@link PutDedicatedIpPoolScalingAttributesCommandOutput}
* @see {@link PutDedicatedIpPoolScalingAttributesCommandInput} for command's `input` shape.
* @see {@link PutDedicatedIpPoolScalingAttributesCommandOutput} for command's `response` shape.
* @see {@link SESv2ClientResolvedConfig | config} for SESv2Client's `config` shape.
*
* @throws {@link BadRequestException} (client fault)
* <p>The input you provided is invalid.</p>
*
* @throws {@link ConcurrentModificationException} (server fault)
* <p>The resource is being modified by another operation or thread.</p>
*
* @throws {@link NotFoundException} (client fault)
* <p>The resource you attempted to access doesn't exist.</p>
*
* @throws {@link TooManyRequestsException} (client fault)
* <p>Too many requests have been made to the operation.</p>
*
* @throws {@link SESv2ServiceException}
* <p>Base exception class for all service exceptions from SESv2 service.</p>
*
*/
export class PutDedicatedIpPoolScalingAttributesCommand extends $Command<
PutDedicatedIpPoolScalingAttributesCommandInput,
PutDedicatedIpPoolScalingAttributesCommandOutput,
SESv2ClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: PutDedicatedIpPoolScalingAttributesCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: SESv2ClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<PutDedicatedIpPoolScalingAttributesCommandInput, PutDedicatedIpPoolScalingAttributesCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, PutDedicatedIpPoolScalingAttributesCommand.getEndpointParameterInstructions())
);

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "SESv2Client";
const commandName = "PutDedicatedIpPoolScalingAttributesCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(
input: PutDedicatedIpPoolScalingAttributesCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> {
return se_PutDedicatedIpPoolScalingAttributesCommand(input, context);
}

/**
* @internal
*/
private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<PutDedicatedIpPoolScalingAttributesCommandOutput> {
return de_PutDedicatedIpPoolScalingAttributesCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
1 change: 1 addition & 0 deletions clients/client-sesv2/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export * from "./PutConfigurationSetSuppressionOptionsCommand";
export * from "./PutConfigurationSetTrackingOptionsCommand";
export * from "./PutConfigurationSetVdmOptionsCommand";
export * from "./PutDedicatedIpInPoolCommand";
export * from "./PutDedicatedIpPoolScalingAttributesCommand";
export * from "./PutDedicatedIpWarmupAttributesCommand";
export * from "./PutDeliverabilityDashboardOptionCommand";
export * from "./PutEmailIdentityConfigurationSetAttributesCommand";
Expand Down
38 changes: 33 additions & 5 deletions clients/client-sesv2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2669,11 +2669,13 @@ export interface DedicatedIpPool {
* <ul>
* <li>
* <p>
* <code>STANDARD</code> – A dedicated IP pool where the customer can control which IPs are part of the pool.</p>
* <code>STANDARD</code> – A dedicated IP pool where you can
* control which IPs are part of the pool.</p>
* </li>
* <li>
* <p>
* <code>MANAGED</code> – A dedicated IP pool where the reputation and number of IPs is automatically managed by Amazon SES.</p>
* <code>MANAGED</code> – A dedicated IP pool where the reputation and
* number of IPs are automatically managed by Amazon SES.</p>
* </li>
* </ul>
*/
Expand Down Expand Up @@ -3545,7 +3547,7 @@ export interface GetContactRequest {
ContactListName: string | undefined;

/**
* <p>The contact's email addres.</p>
* <p>The contact's email address.</p>
*/
EmailAddress: string | undefined;
}
Expand All @@ -3560,7 +3562,7 @@ export interface GetContactResponse {
ContactListName?: string;

/**
* <p>The contact's email addres.</p>
* <p>The contact's email address.</p>
*/
EmailAddress?: string;

Expand Down Expand Up @@ -5647,6 +5649,32 @@ export interface PutDedicatedIpInPoolRequest {
*/
export interface PutDedicatedIpInPoolResponse {}

/**
* @public
* <p>A request to convert a dedicated IP pool to a different scaling mode.</p>
*/
export interface PutDedicatedIpPoolScalingAttributesRequest {
/**
* <p>The name of the dedicated IP pool.</p>
*/
PoolName: string | undefined;

/**
* <p>The scaling mode to apply to the dedicated IP pool.</p>
* <note>
* <p>Changing the scaling mode from <code>MANAGED</code> to <code>STANDARD</code> is not supported.</p>
* </note>
*/
ScalingMode: ScalingMode | string | undefined;
}

/**
* @public
* <p>An HTTP 200 response if the request succeeds, or an error message if the request
* fails.</p>
*/
export interface PutDedicatedIpPoolScalingAttributesResponse {}

/**
* @public
* <p>A request to change the warm-up attributes for a dedicated IP address. This operation
Expand Down Expand Up @@ -6311,7 +6339,7 @@ export interface UpdateContactRequest {
ContactListName: string | undefined;

/**
* <p>The contact's email addres.</p>
* <p>The contact's email address.</p>
*/
EmailAddress: string | undefined;

Expand Down
Loading

0 comments on commit 502ebd2

Please sign in to comment.