-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-pinpoint-sms-voice-v2): Amazon Pinpoint now offers additi…
…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
Showing
80 changed files
with
21,668 additions
and
4,585 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
612 changes: 610 additions & 2 deletions
612
clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2.ts
Large diffs are not rendered by default.
Oops, something went wrong.
168 changes: 164 additions & 4 deletions
168
clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2Client.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
186 changes: 186 additions & 0 deletions
186
clients/client-pinpoint-sms-voice-v2/src/commands/CreateRegistrationAssociationCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.