Skip to content

Commit

Permalink
feat(client-pinpoint-sms-voice-v2): Amazon Pinpoint now offers additi…
Browse files Browse the repository at this point in the history
…onal operations as part of version 2 of the SMS and voice APIs. This release includes 26 new APIs to create and manage phone number registrations, add verified destination numbers, and request sender IDs.
  • Loading branch information
awstools committed Nov 16, 2023
1 parent ff5bef6 commit 8f6ad5b
Show file tree
Hide file tree
Showing 80 changed files with 21,668 additions and 4,585 deletions.
227 changes: 227 additions & 0 deletions clients/client-pinpoint-sms-voice-v2/README.md

Large diffs are not rendered by default.

612 changes: 610 additions & 2 deletions clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2.ts

Large diffs are not rendered by default.

168 changes: 164 additions & 4 deletions clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2Client.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export interface AssociateOriginationIdentityCommandOutput
/**
* @public
* <p>Associates the specified origination identity with a pool.</p>
* <p>If the origination identity is a phone number and is already associated with another
* pool, an Error is returned. A sender ID can be associated with multiple pools.</p>
* <p>If the origination identity configuration doesn't match the pool's configuration, an
* Error is returned.</p>
* <p>If the origination identity is a phone number and is already associated with another
* pool, an error is returned. A sender ID can be associated with multiple pools.</p>
* <p>If the origination identity configuration doesn't match the pool's configuration, an
* error is returned.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export interface CreateConfigurationSetCommandOutput extends CreateConfiguration
* @public
* <p>Creates a new configuration set. After you create the configuration set, you can add
* one or more event destinations to it.</p>
* <p>A configuration set is a set of rules that you apply to the SMS and voice messages
* <p>A configuration set is a set of rules that you apply to the SMS and voice messages
* that you send.</p>
* <p>When you send a message, you can optionally specify a single configuration set.</p>
* <p>When you send a message, you can optionally specify a single configuration set.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export interface CreateEventDestinationCommandOutput extends CreateEventDestinat
/**
* @public
* <p>Creates a new event destination in a configuration set.</p>
* <p>An event destination is a location where you send message events. The event options
* <p>An event destination is a location where you send message events. The event options
* are Amazon CloudWatch, Amazon Kinesis Data Firehose, or Amazon SNS. For example,
* when a message is delivered successfully, you can send information about that event to
* an event destination, or send notifications to endpoints that are subscribed to an
* Amazon SNS topic.</p>
* <p>Each configuration set can contain between 0 and 5 event destinations. Each event
* <p>Each configuration set can contain between 0 and 5 event destinations. Each event
* destination can contain a reference to a single destination, such as a CloudWatch
* or Kinesis Data Firehose destination.</p>
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export interface CreateOptOutListCommandOutput extends CreateOptOutListResult, _
/**
* @public
* <p>Creates a new opt-out list.</p>
* <p>If the opt-out list name already exists, an Error is returned.</p>
* <p>An opt-out list is a list of phone numbers that are opted out, meaning you can't send
* <p>If the opt-out list name already exists, an error is returned.</p>
* <p>An opt-out list is a list of phone numbers that are opted out, meaning you can't send
* SMS or voice messages to them. If end user replies with the keyword "STOP," an entry for
* the phone number is added to the opt-out list. In addition to STOP, your recipients can
* use any supported opt-out keyword, such as CANCEL or OPTOUT. For a list of supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ export interface CreatePoolCommandOutput extends CreatePoolResult, __MetadataBea
* <p>Creates a new pool and associates the specified origination identity to the pool. A
* pool can include one or more phone numbers and SenderIds that are associated with your
* Amazon Web Services account.</p>
* <p>The new pool inherits its configuration from the specified origination identity. This
* <p>The new pool inherits its configuration from the specified origination identity. This
* includes keywords, message type, opt-out list, two-way configuration, and self-managed
* opt-out configuration. Deletion protection isn't inherited from the origination identity
* and defaults to false.</p>
* <p>If the origination identity is a phone number and is already associated with another
* pool, an Error is returned. A sender ID can be associated with multiple pools.</p>
* <p>If the origination identity is a phone number and is already associated with another
* pool, an error is returned. A sender ID can be associated with multiple pools.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -78,6 +78,7 @@ export interface CreatePoolCommandOutput extends CreatePoolResult, __MetadataBea
* // MessageType: "STRING_VALUE",
* // TwoWayEnabled: true || false,
* // TwoWayChannelArn: "STRING_VALUE",
* // TwoWayChannelRole: "STRING_VALUE",
* // SelfManagedOptOutsEnabled: true || false,
* // OptOutListName: "STRING_VALUE",
* // SharedRoutesEnabled: true || false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
SMITHY_CONTEXT_KEY,
} from "@smithy/types";

import { CreateRegistrationAssociationRequest, CreateRegistrationAssociationResult } from "../models/models_0";
import {
PinpointSMSVoiceV2ClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../PinpointSMSVoiceV2Client";
import {
de_CreateRegistrationAssociationCommand,
se_CreateRegistrationAssociationCommand,
} from "../protocols/Aws_json1_0";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link CreateRegistrationAssociationCommand}.
*/
export interface CreateRegistrationAssociationCommandInput extends CreateRegistrationAssociationRequest {}
/**
* @public
*
* The output of {@link CreateRegistrationAssociationCommand}.
*/
export interface CreateRegistrationAssociationCommandOutput
extends CreateRegistrationAssociationResult,
__MetadataBearer {}

/**
* @public
* <p>Associate the registration with an origination identity such as a phone number or sender ID.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { PinpointSMSVoiceV2Client, CreateRegistrationAssociationCommand } from "@aws-sdk/client-pinpoint-sms-voice-v2"; // ES Modules import
* // const { PinpointSMSVoiceV2Client, CreateRegistrationAssociationCommand } = require("@aws-sdk/client-pinpoint-sms-voice-v2"); // CommonJS import
* const client = new PinpointSMSVoiceV2Client(config);
* const input = { // CreateRegistrationAssociationRequest
* RegistrationId: "STRING_VALUE", // required
* ResourceId: "STRING_VALUE", // required
* };
* const command = new CreateRegistrationAssociationCommand(input);
* const response = await client.send(command);
* // { // CreateRegistrationAssociationResult
* // RegistrationArn: "STRING_VALUE", // required
* // RegistrationId: "STRING_VALUE", // required
* // RegistrationType: "STRING_VALUE", // required
* // ResourceArn: "STRING_VALUE", // required
* // ResourceId: "STRING_VALUE", // required
* // ResourceType: "STRING_VALUE", // required
* // IsoCountryCode: "STRING_VALUE",
* // PhoneNumber: "STRING_VALUE",
* // };
*
* ```
*
* @param CreateRegistrationAssociationCommandInput - {@link CreateRegistrationAssociationCommandInput}
* @returns {@link CreateRegistrationAssociationCommandOutput}
* @see {@link CreateRegistrationAssociationCommandInput} for command's `input` shape.
* @see {@link CreateRegistrationAssociationCommandOutput} for command's `response` shape.
* @see {@link PinpointSMSVoiceV2ClientResolvedConfig | config} for PinpointSMSVoiceV2Client's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>The request was denied because you don't have sufficient permissions to access the
* resource.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>Your request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time or it could be that the
* requested action isn't valid for the current state or configuration of the
* resource.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>The API encountered an unexpected error and couldn't complete the request. You might
* be able to successfully issue the request again in the future.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>A requested resource couldn't be found.</p>
*
* @throws {@link ServiceQuotaExceededException} (client fault)
* <p>The request would cause a service quota to be exceeded.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>An error that occurred because too many requests were sent during a certain amount of
* time.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>A validation exception for a field.</p>
*
* @throws {@link PinpointSMSVoiceV2ServiceException}
* <p>Base exception class for all service exceptions from PinpointSMSVoiceV2 service.</p>
*
*/
export class CreateRegistrationAssociationCommand extends $Command<
CreateRegistrationAssociationCommandInput,
CreateRegistrationAssociationCommandOutput,
PinpointSMSVoiceV2ClientResolvedConfig
> {
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: CreateRegistrationAssociationCommandInput) {
super();
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: PinpointSMSVoiceV2ClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<CreateRegistrationAssociationCommandInput, CreateRegistrationAssociationCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, CreateRegistrationAssociationCommand.getEndpointParameterInstructions())
);

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

const { logger } = configuration;
const clientName = "PinpointSMSVoiceV2Client";
const commandName = "CreateRegistrationAssociationCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
[SMITHY_CONTEXT_KEY]: {
service: "PinpointSMSVoiceV2",
operation: "CreateRegistrationAssociation",
},
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

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

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

0 comments on commit 8f6ad5b

Please sign in to comment.