Skip to content

Commit

Permalink
feat(client-chime): Chime VoiceConnector will now support ValidateE91…
Browse files Browse the repository at this point in the history
…1Address which will allow customers to prevalidate their addresses included in their SIP invites for emergency calling
  • Loading branch information
awstools committed Jul 27, 2022
1 parent b30346b commit a5a02f7
Show file tree
Hide file tree
Showing 9 changed files with 838 additions and 51 deletions.
42 changes: 41 additions & 1 deletion clients/client-chime/src/Chime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,11 @@ import {
UpdateVoiceConnectorGroupCommandInput,
UpdateVoiceConnectorGroupCommandOutput,
} from "./commands/UpdateVoiceConnectorGroupCommand";
import {
ValidateE911AddressCommand,
ValidateE911AddressCommandInput,
ValidateE911AddressCommandOutput,
} from "./commands/ValidateE911AddressCommand";

/**
* <p>The Amazon Chime API (application programming interface) is designed for developers to
Expand Down Expand Up @@ -6075,7 +6080,7 @@ export class Chime extends ChimeClient {

/**
* <p>Adds a streaming configuration for the specified Amazon Chime Voice Connector. The streaming
* configuration specifies whether media streaming is enabled for sending to Indonesians.
* configuration specifies whether media streaming is enabled for sending to Kinesis.
* It also sets the retention period, in hours, for the Amazon Kinesis data.</p>
*/
public putVoiceConnectorStreamingConfiguration(
Expand Down Expand Up @@ -7376,4 +7381,39 @@ export class Chime extends ChimeClient {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Validates an address to be used for 911 calls made with Amazon
* Chime Voice Connectors. You can use validated addresses
* in a Presence Information Data Format Location Object file that you include in SIP requests.
* That helps ensure that addresses are routed to the appropriate Public Safety Answering Point.</p>
*/
public validateE911Address(
args: ValidateE911AddressCommandInput,
options?: __HttpHandlerOptions
): Promise<ValidateE911AddressCommandOutput>;
public validateE911Address(
args: ValidateE911AddressCommandInput,
cb: (err: any, data?: ValidateE911AddressCommandOutput) => void
): void;
public validateE911Address(
args: ValidateE911AddressCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ValidateE911AddressCommandOutput) => void
): void;
public validateE911Address(
args: ValidateE911AddressCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ValidateE911AddressCommandOutput) => void),
cb?: (err: any, data?: ValidateE911AddressCommandOutput) => void
): Promise<ValidateE911AddressCommandOutput> | void {
const command = new ValidateE911AddressCommand(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);
}
}
}
10 changes: 8 additions & 2 deletions clients/client-chime/src/ChimeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,10 @@ import {
UpdateVoiceConnectorGroupCommandInput,
UpdateVoiceConnectorGroupCommandOutput,
} from "./commands/UpdateVoiceConnectorGroupCommand";
import {
ValidateE911AddressCommandInput,
ValidateE911AddressCommandOutput,
} from "./commands/ValidateE911AddressCommand";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";

export type ServiceInputTypes =
Expand Down Expand Up @@ -777,7 +781,8 @@ export type ServiceInputTypes =
| UpdateUserCommandInput
| UpdateUserSettingsCommandInput
| UpdateVoiceConnectorCommandInput
| UpdateVoiceConnectorGroupCommandInput;
| UpdateVoiceConnectorGroupCommandInput
| ValidateE911AddressCommandInput;

export type ServiceOutputTypes =
| AssociatePhoneNumberWithUserCommandOutput
Expand Down Expand Up @@ -969,7 +974,8 @@ export type ServiceOutputTypes =
| UpdateUserCommandOutput
| UpdateUserSettingsCommandOutput
| UpdateVoiceConnectorCommandOutput
| UpdateVoiceConnectorGroupCommandOutput;
| UpdateVoiceConnectorGroupCommandOutput
| ValidateE911AddressCommandOutput;

export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface PutVoiceConnectorStreamingConfigurationCommandOutput

/**
* <p>Adds a streaming configuration for the specified Amazon Chime Voice Connector. The streaming
* configuration specifies whether media streaming is enabled for sending to Indonesians.
* configuration specifies whether media streaming is enabled for sending to Kinesis.
* It also sets the retention period, in hours, for the Amazon Kinesis data.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
104 changes: 104 additions & 0 deletions clients/client-chime/src/commands/ValidateE911AddressCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// smithy-typescript generated code
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 { ChimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ChimeClient";
import {
ValidateE911AddressRequest,
ValidateE911AddressRequestFilterSensitiveLog,
ValidateE911AddressResponse,
ValidateE911AddressResponseFilterSensitiveLog,
} from "../models/models_1";
import {
deserializeAws_restJson1ValidateE911AddressCommand,
serializeAws_restJson1ValidateE911AddressCommand,
} from "../protocols/Aws_restJson1";

export interface ValidateE911AddressCommandInput extends ValidateE911AddressRequest {}
export interface ValidateE911AddressCommandOutput extends ValidateE911AddressResponse, __MetadataBearer {}

/**
* <p>Validates an address to be used for 911 calls made with Amazon
* Chime Voice Connectors. You can use validated addresses
* in a Presence Information Data Format Location Object file that you include in SIP requests.
* That helps ensure that addresses are routed to the appropriate Public Safety Answering Point.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ChimeClient, ValidateE911AddressCommand } from "@aws-sdk/client-chime"; // ES Modules import
* // const { ChimeClient, ValidateE911AddressCommand } = require("@aws-sdk/client-chime"); // CommonJS import
* const client = new ChimeClient(config);
* const command = new ValidateE911AddressCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ValidateE911AddressCommandInput} for command's `input` shape.
* @see {@link ValidateE911AddressCommandOutput} for command's `response` shape.
* @see {@link ChimeClientResolvedConfig | config} for ChimeClient's `config` shape.
*
*/
export class ValidateE911AddressCommand extends $Command<
ValidateE911AddressCommandInput,
ValidateE911AddressCommandOutput,
ChimeClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: ValidateE911AddressCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: ChimeClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ValidateE911AddressCommandInput, ValidateE911AddressCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

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

private serialize(input: ValidateE911AddressCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1ValidateE911AddressCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ValidateE911AddressCommandOutput> {
return deserializeAws_restJson1ValidateE911AddressCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
1 change: 1 addition & 0 deletions clients/client-chime/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,4 @@ export * from "./UpdateUserCommand";
export * from "./UpdateUserSettingsCommand";
export * from "./UpdateVoiceConnectorCommand";
export * from "./UpdateVoiceConnectorGroupCommand";
export * from "./ValidateE911AddressCommand";
Loading

0 comments on commit a5a02f7

Please sign in to comment.