|
| 1 | +// smithy-typescript generated code |
| 2 | +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; |
| 5 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 6 | +import { |
| 7 | + FinalizeHandlerArguments, |
| 8 | + Handler, |
| 9 | + HandlerExecutionContext, |
| 10 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 11 | + MetadataBearer as __MetadataBearer, |
| 12 | + MiddlewareStack, |
| 13 | + SerdeContext as __SerdeContext, |
| 14 | + SMITHY_CONTEXT_KEY, |
| 15 | +} from "@smithy/types"; |
| 16 | + |
| 17 | +import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; |
| 18 | +import { |
| 19 | + CreatePersistentContactAssociationRequest, |
| 20 | + CreatePersistentContactAssociationResponse, |
| 21 | +} from "../models/models_0"; |
| 22 | +import { |
| 23 | + de_CreatePersistentContactAssociationCommand, |
| 24 | + se_CreatePersistentContactAssociationCommand, |
| 25 | +} from "../protocols/Aws_restJson1"; |
| 26 | + |
| 27 | +/** |
| 28 | + * @public |
| 29 | + */ |
| 30 | +export { __MetadataBearer, $Command }; |
| 31 | +/** |
| 32 | + * @public |
| 33 | + * |
| 34 | + * The input for {@link CreatePersistentContactAssociationCommand}. |
| 35 | + */ |
| 36 | +export interface CreatePersistentContactAssociationCommandInput extends CreatePersistentContactAssociationRequest {} |
| 37 | +/** |
| 38 | + * @public |
| 39 | + * |
| 40 | + * The output of {@link CreatePersistentContactAssociationCommand}. |
| 41 | + */ |
| 42 | +export interface CreatePersistentContactAssociationCommandOutput |
| 43 | + extends CreatePersistentContactAssociationResponse, |
| 44 | + __MetadataBearer {} |
| 45 | + |
| 46 | +/** |
| 47 | + * @public |
| 48 | + * <p>Enables rehydration of chats for the lifespan of a contact. For more information about chat rehydration, see |
| 49 | + * <a href="https://docs.aws.amazon.com/connect/latest/adminguide/chat-persistence.html">Enable persistent chat</a> in the |
| 50 | + * <i>Amazon Connect Administrator Guide</i>. |
| 51 | + * </p> |
| 52 | + * @example |
| 53 | + * Use a bare-bones client and the command you need to make an API call. |
| 54 | + * ```javascript |
| 55 | + * import { ConnectClient, CreatePersistentContactAssociationCommand } from "@aws-sdk/client-connect"; // ES Modules import |
| 56 | + * // const { ConnectClient, CreatePersistentContactAssociationCommand } = require("@aws-sdk/client-connect"); // CommonJS import |
| 57 | + * const client = new ConnectClient(config); |
| 58 | + * const input = { // CreatePersistentContactAssociationRequest |
| 59 | + * InstanceId: "STRING_VALUE", // required |
| 60 | + * InitialContactId: "STRING_VALUE", // required |
| 61 | + * RehydrationType: "ENTIRE_PAST_SESSION" || "FROM_SEGMENT", // required |
| 62 | + * SourceContactId: "STRING_VALUE", // required |
| 63 | + * ClientToken: "STRING_VALUE", |
| 64 | + * }; |
| 65 | + * const command = new CreatePersistentContactAssociationCommand(input); |
| 66 | + * const response = await client.send(command); |
| 67 | + * // { // CreatePersistentContactAssociationResponse |
| 68 | + * // ContinuedFromContactId: "STRING_VALUE", |
| 69 | + * // }; |
| 70 | + * |
| 71 | + * ``` |
| 72 | + * |
| 73 | + * @param CreatePersistentContactAssociationCommandInput - {@link CreatePersistentContactAssociationCommandInput} |
| 74 | + * @returns {@link CreatePersistentContactAssociationCommandOutput} |
| 75 | + * @see {@link CreatePersistentContactAssociationCommandInput} for command's `input` shape. |
| 76 | + * @see {@link CreatePersistentContactAssociationCommandOutput} for command's `response` shape. |
| 77 | + * @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape. |
| 78 | + * |
| 79 | + * @throws {@link AccessDeniedException} (client fault) |
| 80 | + * <p>You do not have sufficient permissions to perform this action.</p> |
| 81 | + * |
| 82 | + * @throws {@link InternalServiceException} (server fault) |
| 83 | + * <p>Request processing failed because of an error or failure with the service.</p> |
| 84 | + * |
| 85 | + * @throws {@link InvalidParameterException} (client fault) |
| 86 | + * <p>One or more of the specified parameters are not valid.</p> |
| 87 | + * |
| 88 | + * @throws {@link InvalidRequestException} (client fault) |
| 89 | + * <p>The request is not valid.</p> |
| 90 | + * |
| 91 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 92 | + * <p>The specified resource was not found.</p> |
| 93 | + * |
| 94 | + * @throws {@link ThrottlingException} (client fault) |
| 95 | + * <p>The throttling limit has been exceeded.</p> |
| 96 | + * |
| 97 | + * @throws {@link ConnectServiceException} |
| 98 | + * <p>Base exception class for all service exceptions from Connect service.</p> |
| 99 | + * |
| 100 | + */ |
| 101 | +export class CreatePersistentContactAssociationCommand extends $Command< |
| 102 | + CreatePersistentContactAssociationCommandInput, |
| 103 | + CreatePersistentContactAssociationCommandOutput, |
| 104 | + ConnectClientResolvedConfig |
| 105 | +> { |
| 106 | + // Start section: command_properties |
| 107 | + // End section: command_properties |
| 108 | + |
| 109 | + public static getEndpointParameterInstructions(): EndpointParameterInstructions { |
| 110 | + return { |
| 111 | + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, |
| 112 | + Endpoint: { type: "builtInParams", name: "endpoint" }, |
| 113 | + Region: { type: "builtInParams", name: "region" }, |
| 114 | + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, |
| 115 | + }; |
| 116 | + } |
| 117 | + |
| 118 | + /** |
| 119 | + * @public |
| 120 | + */ |
| 121 | + constructor(readonly input: CreatePersistentContactAssociationCommandInput) { |
| 122 | + // Start section: command_constructor |
| 123 | + super(); |
| 124 | + // End section: command_constructor |
| 125 | + } |
| 126 | + |
| 127 | + /** |
| 128 | + * @internal |
| 129 | + */ |
| 130 | + resolveMiddleware( |
| 131 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 132 | + configuration: ConnectClientResolvedConfig, |
| 133 | + options?: __HttpHandlerOptions |
| 134 | + ): Handler<CreatePersistentContactAssociationCommandInput, CreatePersistentContactAssociationCommandOutput> { |
| 135 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 136 | + this.middlewareStack.use( |
| 137 | + getEndpointPlugin(configuration, CreatePersistentContactAssociationCommand.getEndpointParameterInstructions()) |
| 138 | + ); |
| 139 | + |
| 140 | + const stack = clientStack.concat(this.middlewareStack); |
| 141 | + |
| 142 | + const { logger } = configuration; |
| 143 | + const clientName = "ConnectClient"; |
| 144 | + const commandName = "CreatePersistentContactAssociationCommand"; |
| 145 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 146 | + logger, |
| 147 | + clientName, |
| 148 | + commandName, |
| 149 | + inputFilterSensitiveLog: (_: any) => _, |
| 150 | + outputFilterSensitiveLog: (_: any) => _, |
| 151 | + [SMITHY_CONTEXT_KEY]: { |
| 152 | + service: "AmazonConnectService", |
| 153 | + operation: "CreatePersistentContactAssociation", |
| 154 | + }, |
| 155 | + }; |
| 156 | + const { requestHandler } = configuration; |
| 157 | + return stack.resolve( |
| 158 | + (request: FinalizeHandlerArguments<any>) => |
| 159 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 160 | + handlerExecutionContext |
| 161 | + ); |
| 162 | + } |
| 163 | + |
| 164 | + /** |
| 165 | + * @internal |
| 166 | + */ |
| 167 | + private serialize( |
| 168 | + input: CreatePersistentContactAssociationCommandInput, |
| 169 | + context: __SerdeContext |
| 170 | + ): Promise<__HttpRequest> { |
| 171 | + return se_CreatePersistentContactAssociationCommand(input, context); |
| 172 | + } |
| 173 | + |
| 174 | + /** |
| 175 | + * @internal |
| 176 | + */ |
| 177 | + private deserialize( |
| 178 | + output: __HttpResponse, |
| 179 | + context: __SerdeContext |
| 180 | + ): Promise<CreatePersistentContactAssociationCommandOutput> { |
| 181 | + return de_CreatePersistentContactAssociationCommand(output, context); |
| 182 | + } |
| 183 | + |
| 184 | + // Start section: command_body_extra |
| 185 | + // End section: command_body_extra |
| 186 | +} |
0 commit comments