|
| 1 | +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; |
| 2 | +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; |
| 3 | +import { Command as $Command } from "@aws-sdk/smithy-client"; |
| 4 | +import { |
| 5 | + FinalizeHandlerArguments, |
| 6 | + Handler, |
| 7 | + HandlerExecutionContext, |
| 8 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 9 | + MetadataBearer as __MetadataBearer, |
| 10 | + MiddlewareStack, |
| 11 | + SerdeContext as __SerdeContext, |
| 12 | +} from "@aws-sdk/types"; |
| 13 | + |
| 14 | +import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; |
| 15 | +import { PutUserStatusRequest, PutUserStatusResponse } from "../models/models_0"; |
| 16 | +import { |
| 17 | + deserializeAws_restJson1PutUserStatusCommand, |
| 18 | + serializeAws_restJson1PutUserStatusCommand, |
| 19 | +} from "../protocols/Aws_restJson1"; |
| 20 | + |
| 21 | +export interface PutUserStatusCommandInput extends PutUserStatusRequest {} |
| 22 | +export interface PutUserStatusCommandOutput extends PutUserStatusResponse, __MetadataBearer {} |
| 23 | + |
| 24 | +/** |
| 25 | + * <p>Changes the current status of a user or agent in Amazon Connect. |
| 26 | + * If the agent is currently handling a contact, this sets the agent's next status.</p> |
| 27 | + * <p>For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-agent-status.html">Agent status</a> |
| 28 | + * and <a href="https://docs.aws.amazon.com/connect/latest/adminguide/set-next-status.html">Set your next status</a> |
| 29 | + * in the <i>Amazon Connect Administrator Guide</i>.</p> |
| 30 | + * @example |
| 31 | + * Use a bare-bones client and the command you need to make an API call. |
| 32 | + * ```javascript |
| 33 | + * import { ConnectClient, PutUserStatusCommand } from "@aws-sdk/client-connect"; // ES Modules import |
| 34 | + * // const { ConnectClient, PutUserStatusCommand } = require("@aws-sdk/client-connect"); // CommonJS import |
| 35 | + * const client = new ConnectClient(config); |
| 36 | + * const command = new PutUserStatusCommand(input); |
| 37 | + * const response = await client.send(command); |
| 38 | + * ``` |
| 39 | + * |
| 40 | + * @see {@link PutUserStatusCommandInput} for command's `input` shape. |
| 41 | + * @see {@link PutUserStatusCommandOutput} for command's `response` shape. |
| 42 | + * @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape. |
| 43 | + * |
| 44 | + */ |
| 45 | +export class PutUserStatusCommand extends $Command< |
| 46 | + PutUserStatusCommandInput, |
| 47 | + PutUserStatusCommandOutput, |
| 48 | + ConnectClientResolvedConfig |
| 49 | +> { |
| 50 | + // Start section: command_properties |
| 51 | + // End section: command_properties |
| 52 | + |
| 53 | + constructor(readonly input: PutUserStatusCommandInput) { |
| 54 | + // Start section: command_constructor |
| 55 | + super(); |
| 56 | + // End section: command_constructor |
| 57 | + } |
| 58 | + |
| 59 | + /** |
| 60 | + * @internal |
| 61 | + */ |
| 62 | + resolveMiddleware( |
| 63 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 64 | + configuration: ConnectClientResolvedConfig, |
| 65 | + options?: __HttpHandlerOptions |
| 66 | + ): Handler<PutUserStatusCommandInput, PutUserStatusCommandOutput> { |
| 67 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 68 | + |
| 69 | + const stack = clientStack.concat(this.middlewareStack); |
| 70 | + |
| 71 | + const { logger } = configuration; |
| 72 | + const clientName = "ConnectClient"; |
| 73 | + const commandName = "PutUserStatusCommand"; |
| 74 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 75 | + logger, |
| 76 | + clientName, |
| 77 | + commandName, |
| 78 | + inputFilterSensitiveLog: PutUserStatusRequest.filterSensitiveLog, |
| 79 | + outputFilterSensitiveLog: PutUserStatusResponse.filterSensitiveLog, |
| 80 | + }; |
| 81 | + const { requestHandler } = configuration; |
| 82 | + return stack.resolve( |
| 83 | + (request: FinalizeHandlerArguments<any>) => |
| 84 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 85 | + handlerExecutionContext |
| 86 | + ); |
| 87 | + } |
| 88 | + |
| 89 | + private serialize(input: PutUserStatusCommandInput, context: __SerdeContext): Promise<__HttpRequest> { |
| 90 | + return serializeAws_restJson1PutUserStatusCommand(input, context); |
| 91 | + } |
| 92 | + |
| 93 | + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<PutUserStatusCommandOutput> { |
| 94 | + return deserializeAws_restJson1PutUserStatusCommand(output, context); |
| 95 | + } |
| 96 | + |
| 97 | + // Start section: command_body_extra |
| 98 | + // End section: command_body_extra |
| 99 | +} |
0 commit comments