|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 5 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 6 | + |
| 7 | +import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; |
| 8 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 9 | +import { |
| 10 | + CreatePushNotificationRegistrationRequest, |
| 11 | + CreatePushNotificationRegistrationResponse, |
| 12 | +} from "../models/models_0"; |
| 13 | +import { |
| 14 | + de_CreatePushNotificationRegistrationCommand, |
| 15 | + se_CreatePushNotificationRegistrationCommand, |
| 16 | +} from "../protocols/Aws_restJson1"; |
| 17 | + |
| 18 | +/** |
| 19 | + * @public |
| 20 | + */ |
| 21 | +export type { __MetadataBearer }; |
| 22 | +export { $Command }; |
| 23 | +/** |
| 24 | + * @public |
| 25 | + * |
| 26 | + * The input for {@link CreatePushNotificationRegistrationCommand}. |
| 27 | + */ |
| 28 | +export interface CreatePushNotificationRegistrationCommandInput extends CreatePushNotificationRegistrationRequest {} |
| 29 | +/** |
| 30 | + * @public |
| 31 | + * |
| 32 | + * The output of {@link CreatePushNotificationRegistrationCommand}. |
| 33 | + */ |
| 34 | +export interface CreatePushNotificationRegistrationCommandOutput |
| 35 | + extends CreatePushNotificationRegistrationResponse, |
| 36 | + __MetadataBearer {} |
| 37 | + |
| 38 | +/** |
| 39 | + * <p>Creates registration for a device token and a chat contact to receive real-time push |
| 40 | + * notifications. For more information about push notifications, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/set-up-push-notifications-for-mobile-chat.html">Set up push |
| 41 | + * notifications in Amazon Connect for mobile chat</a> in the <i>Amazon Connect |
| 42 | + * Administrator Guide</i>.</p> |
| 43 | + * @example |
| 44 | + * Use a bare-bones client and the command you need to make an API call. |
| 45 | + * ```javascript |
| 46 | + * import { ConnectClient, CreatePushNotificationRegistrationCommand } from "@aws-sdk/client-connect"; // ES Modules import |
| 47 | + * // const { ConnectClient, CreatePushNotificationRegistrationCommand } = require("@aws-sdk/client-connect"); // CommonJS import |
| 48 | + * const client = new ConnectClient(config); |
| 49 | + * const input = { // CreatePushNotificationRegistrationRequest |
| 50 | + * InstanceId: "STRING_VALUE", // required |
| 51 | + * ClientToken: "STRING_VALUE", |
| 52 | + * PinpointAppArn: "STRING_VALUE", // required |
| 53 | + * DeviceToken: "STRING_VALUE", // required |
| 54 | + * DeviceType: "GCM" || "APNS" || "APNS_SANDBOX", // required |
| 55 | + * ContactConfiguration: { // ContactConfiguration |
| 56 | + * ContactId: "STRING_VALUE", // required |
| 57 | + * ParticipantRole: "AGENT" || "CUSTOMER" || "SYSTEM" || "CUSTOM_BOT" || "SUPERVISOR", |
| 58 | + * IncludeRawMessage: true || false, |
| 59 | + * }, |
| 60 | + * }; |
| 61 | + * const command = new CreatePushNotificationRegistrationCommand(input); |
| 62 | + * const response = await client.send(command); |
| 63 | + * // { // CreatePushNotificationRegistrationResponse |
| 64 | + * // RegistrationId: "STRING_VALUE", // required |
| 65 | + * // }; |
| 66 | + * |
| 67 | + * ``` |
| 68 | + * |
| 69 | + * @param CreatePushNotificationRegistrationCommandInput - {@link CreatePushNotificationRegistrationCommandInput} |
| 70 | + * @returns {@link CreatePushNotificationRegistrationCommandOutput} |
| 71 | + * @see {@link CreatePushNotificationRegistrationCommandInput} for command's `input` shape. |
| 72 | + * @see {@link CreatePushNotificationRegistrationCommandOutput} for command's `response` shape. |
| 73 | + * @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape. |
| 74 | + * |
| 75 | + * @throws {@link AccessDeniedException} (client fault) |
| 76 | + * <p>You do not have sufficient permissions to perform this action.</p> |
| 77 | + * |
| 78 | + * @throws {@link InternalServiceException} (server fault) |
| 79 | + * <p>Request processing failed because of an error or failure with the service.</p> |
| 80 | + * |
| 81 | + * @throws {@link InvalidParameterException} (client fault) |
| 82 | + * <p>One or more of the specified parameters are not valid.</p> |
| 83 | + * |
| 84 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 85 | + * <p>The specified resource was not found.</p> |
| 86 | + * |
| 87 | + * @throws {@link ServiceQuotaExceededException} (client fault) |
| 88 | + * <p>The service quota has been exceeded.</p> |
| 89 | + * |
| 90 | + * @throws {@link ThrottlingException} (client fault) |
| 91 | + * <p>The throttling limit has been exceeded.</p> |
| 92 | + * |
| 93 | + * @throws {@link ConnectServiceException} |
| 94 | + * <p>Base exception class for all service exceptions from Connect service.</p> |
| 95 | + * |
| 96 | + * @public |
| 97 | + */ |
| 98 | +export class CreatePushNotificationRegistrationCommand extends $Command |
| 99 | + .classBuilder< |
| 100 | + CreatePushNotificationRegistrationCommandInput, |
| 101 | + CreatePushNotificationRegistrationCommandOutput, |
| 102 | + ConnectClientResolvedConfig, |
| 103 | + ServiceInputTypes, |
| 104 | + ServiceOutputTypes |
| 105 | + >() |
| 106 | + .ep(commonParams) |
| 107 | + .m(function (this: any, Command: any, cs: any, config: ConnectClientResolvedConfig, o: any) { |
| 108 | + return [ |
| 109 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 110 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 111 | + ]; |
| 112 | + }) |
| 113 | + .s("AmazonConnectService", "CreatePushNotificationRegistration", {}) |
| 114 | + .n("ConnectClient", "CreatePushNotificationRegistrationCommand") |
| 115 | + .f(void 0, void 0) |
| 116 | + .ser(se_CreatePushNotificationRegistrationCommand) |
| 117 | + .de(de_CreatePushNotificationRegistrationCommand) |
| 118 | + .build() { |
| 119 | + /** @internal type navigation helper, not in runtime. */ |
| 120 | + protected declare static __types: { |
| 121 | + api: { |
| 122 | + input: CreatePushNotificationRegistrationRequest; |
| 123 | + output: CreatePushNotificationRegistrationResponse; |
| 124 | + }; |
| 125 | + sdk: { |
| 126 | + input: CreatePushNotificationRegistrationCommandInput; |
| 127 | + output: CreatePushNotificationRegistrationCommandOutput; |
| 128 | + }; |
| 129 | + }; |
| 130 | +} |
0 commit comments