-
Notifications
You must be signed in to change notification settings - Fork 553
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-connect): This release adds APIs to search, claim, releas…
…e, list, update, and describe phone numbers. You can also use them to associate and disassociate contact flows to phone numbers.
- Loading branch information
awstools
committed
Apr 20, 2022
1 parent
ee4defd
commit 78e0c59
Showing
23 changed files
with
4,710 additions
and
1,091 deletions.
There are no files selected for viewing
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
101 changes: 101 additions & 0 deletions
101
clients/client-connect/src/commands/AssociatePhoneNumberContactFlowCommand.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,101 @@ | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; | ||
import { AssociatePhoneNumberContactFlowRequest } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1AssociatePhoneNumberContactFlowCommand, | ||
serializeAws_restJson1AssociatePhoneNumberContactFlowCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface AssociatePhoneNumberContactFlowCommandInput extends AssociatePhoneNumberContactFlowRequest {} | ||
export interface AssociatePhoneNumberContactFlowCommandOutput extends __MetadataBearer {} | ||
|
||
/** | ||
* <p>Associates a contact flow with a phone number claimed to your Amazon Connect instance.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { ConnectClient, AssociatePhoneNumberContactFlowCommand } from "@aws-sdk/client-connect"; // ES Modules import | ||
* // const { ConnectClient, AssociatePhoneNumberContactFlowCommand } = require("@aws-sdk/client-connect"); // CommonJS import | ||
* const client = new ConnectClient(config); | ||
* const command = new AssociatePhoneNumberContactFlowCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link AssociatePhoneNumberContactFlowCommandInput} for command's `input` shape. | ||
* @see {@link AssociatePhoneNumberContactFlowCommandOutput} for command's `response` shape. | ||
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape. | ||
* | ||
*/ | ||
export class AssociatePhoneNumberContactFlowCommand extends $Command< | ||
AssociatePhoneNumberContactFlowCommandInput, | ||
AssociatePhoneNumberContactFlowCommandOutput, | ||
ConnectClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: AssociatePhoneNumberContactFlowCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: ConnectClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<AssociatePhoneNumberContactFlowCommandInput, AssociatePhoneNumberContactFlowCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "ConnectClient"; | ||
const commandName = "AssociatePhoneNumberContactFlowCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: AssociatePhoneNumberContactFlowRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: (output: any) => output, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize( | ||
input: AssociatePhoneNumberContactFlowCommandInput, | ||
context: __SerdeContext | ||
): Promise<__HttpRequest> { | ||
return serializeAws_restJson1AssociatePhoneNumberContactFlowCommand(input, context); | ||
} | ||
|
||
private deserialize( | ||
output: __HttpResponse, | ||
context: __SerdeContext | ||
): Promise<AssociatePhoneNumberContactFlowCommandOutput> { | ||
return deserializeAws_restJson1AssociatePhoneNumberContactFlowCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
95 changes: 95 additions & 0 deletions
95
clients/client-connect/src/commands/ClaimPhoneNumberCommand.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,95 @@ | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; | ||
import { ClaimPhoneNumberRequest, ClaimPhoneNumberResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1ClaimPhoneNumberCommand, | ||
serializeAws_restJson1ClaimPhoneNumberCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface ClaimPhoneNumberCommandInput extends ClaimPhoneNumberRequest {} | ||
export interface ClaimPhoneNumberCommandOutput extends ClaimPhoneNumberResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Claims an available phone number to your Amazon Connect instance.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { ConnectClient, ClaimPhoneNumberCommand } from "@aws-sdk/client-connect"; // ES Modules import | ||
* // const { ConnectClient, ClaimPhoneNumberCommand } = require("@aws-sdk/client-connect"); // CommonJS import | ||
* const client = new ConnectClient(config); | ||
* const command = new ClaimPhoneNumberCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link ClaimPhoneNumberCommandInput} for command's `input` shape. | ||
* @see {@link ClaimPhoneNumberCommandOutput} for command's `response` shape. | ||
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape. | ||
* | ||
*/ | ||
export class ClaimPhoneNumberCommand extends $Command< | ||
ClaimPhoneNumberCommandInput, | ||
ClaimPhoneNumberCommandOutput, | ||
ConnectClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: ClaimPhoneNumberCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: ConnectClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<ClaimPhoneNumberCommandInput, ClaimPhoneNumberCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "ConnectClient"; | ||
const commandName = "ClaimPhoneNumberCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: ClaimPhoneNumberRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: ClaimPhoneNumberResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: ClaimPhoneNumberCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1ClaimPhoneNumberCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ClaimPhoneNumberCommandOutput> { | ||
return deserializeAws_restJson1ClaimPhoneNumberCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
Oops, something went wrong.