1 | import { STSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../STSClient";
|
2 | import { GetCallerIdentityRequest, GetCallerIdentityResponse } from "../models/models_0";
|
3 | import {
|
4 | deserializeAws_queryGetCallerIdentityCommand,
|
5 | serializeAws_queryGetCallerIdentityCommand,
|
6 | } from "../protocols/Aws_query";
|
7 | import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
8 | import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
|
9 | import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
10 | import { Command as $Command } from "@aws-sdk/smithy-client";
|
11 | import {
|
12 | FinalizeHandlerArguments,
|
13 | Handler,
|
14 | HandlerExecutionContext,
|
15 | MiddlewareStack,
|
16 | HttpHandlerOptions as __HttpHandlerOptions,
|
17 | MetadataBearer as __MetadataBearer,
|
18 | SerdeContext as __SerdeContext,
|
19 | } from "@aws-sdk/types";
|
20 |
|
21 | export interface GetCallerIdentityCommandInput extends GetCallerIdentityRequest {}
|
22 | export interface GetCallerIdentityCommandOutput extends GetCallerIdentityResponse, __MetadataBearer {}
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | export class GetCallerIdentityCommand extends $Command<
|
51 | GetCallerIdentityCommandInput,
|
52 | GetCallerIdentityCommandOutput,
|
53 | STSClientResolvedConfig
|
54 | > {
|
55 |
|
56 |
|
57 |
|
58 | constructor(readonly input: GetCallerIdentityCommandInput) {
|
59 |
|
60 | super();
|
61 |
|
62 | }
|
63 |
|
64 | |
65 |
|
66 |
|
67 | resolveMiddleware(
|
68 | clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
|
69 | configuration: STSClientResolvedConfig,
|
70 | options?: __HttpHandlerOptions
|
71 | ): Handler<GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput> {
|
72 | this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
73 | this.middlewareStack.use(getAwsAuthPlugin(configuration));
|
74 |
|
75 | const stack = clientStack.concat(this.middlewareStack);
|
76 |
|
77 | const { logger } = configuration;
|
78 | const clientName = "STSClient";
|
79 | const commandName = "GetCallerIdentityCommand";
|
80 | const handlerExecutionContext: HandlerExecutionContext = {
|
81 | logger,
|
82 | clientName,
|
83 | commandName,
|
84 | inputFilterSensitiveLog: GetCallerIdentityRequest.filterSensitiveLog,
|
85 | outputFilterSensitiveLog: GetCallerIdentityResponse.filterSensitiveLog,
|
86 | };
|
87 | const { requestHandler } = configuration;
|
88 | return stack.resolve(
|
89 | (request: FinalizeHandlerArguments<any>) =>
|
90 | requestHandler.handle(request.request as __HttpRequest, options || {}),
|
91 | handlerExecutionContext
|
92 | );
|
93 | }
|
94 |
|
95 | private serialize(input: GetCallerIdentityCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
|
96 | return serializeAws_queryGetCallerIdentityCommand(input, context);
|
97 | }
|
98 |
|
99 | private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetCallerIdentityCommandOutput> {
|
100 | return deserializeAws_queryGetCallerIdentityCommand(output, context);
|
101 | }
|
102 |
|
103 |
|
104 |
|
105 | }
|