-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-iam): Support for a new API "GetMFADevice" to present MFA…
… device metadata such as device certifications
- Loading branch information
awstools
committed
Jun 26, 2023
1 parent
6c8730a
commit 46a6009
Showing
25 changed files
with
949 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
// smithy-typescript generated code | ||
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
} from "@aws-sdk/types"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; | ||
import { SerdeContext as __SerdeContext } from "@smithy/types"; | ||
|
||
import { IAMClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IAMClient"; | ||
import { GetMFADeviceRequest, GetMFADeviceResponse } from "../models/models_0"; | ||
import { de_GetMFADeviceCommand, se_GetMFADeviceCommand } from "../protocols/Aws_query"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link GetMFADeviceCommand}. | ||
*/ | ||
export interface GetMFADeviceCommandInput extends GetMFADeviceRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link GetMFADeviceCommand}. | ||
*/ | ||
export interface GetMFADeviceCommandOutput extends GetMFADeviceResponse, __MetadataBearer {} | ||
|
||
/** | ||
* @public | ||
* <p>Retrieves information about an MFA device for a specified user.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { IAMClient, GetMFADeviceCommand } from "@aws-sdk/client-iam"; // ES Modules import | ||
* // const { IAMClient, GetMFADeviceCommand } = require("@aws-sdk/client-iam"); // CommonJS import | ||
* const client = new IAMClient(config); | ||
* const input = { // GetMFADeviceRequest | ||
* SerialNumber: "STRING_VALUE", // required | ||
* UserName: "STRING_VALUE", | ||
* }; | ||
* const command = new GetMFADeviceCommand(input); | ||
* const response = await client.send(command); | ||
* // { // GetMFADeviceResponse | ||
* // UserName: "STRING_VALUE", | ||
* // SerialNumber: "STRING_VALUE", // required | ||
* // EnableDate: new Date("TIMESTAMP"), | ||
* // Certifications: { // CertificationMapType | ||
* // "<keys>": "STRING_VALUE", | ||
* // }, | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param GetMFADeviceCommandInput - {@link GetMFADeviceCommandInput} | ||
* @returns {@link GetMFADeviceCommandOutput} | ||
* @see {@link GetMFADeviceCommandInput} for command's `input` shape. | ||
* @see {@link GetMFADeviceCommandOutput} for command's `response` shape. | ||
* @see {@link IAMClientResolvedConfig | config} for IAMClient's `config` shape. | ||
* | ||
* @throws {@link NoSuchEntityException} (client fault) | ||
* <p>The request was rejected because it referenced a resource entity that does not exist. The | ||
* error message describes the resource.</p> | ||
* | ||
* @throws {@link ServiceFailureException} (server fault) | ||
* <p>The request processing has failed because of an unknown error, exception or | ||
* failure.</p> | ||
* | ||
* @throws {@link IAMServiceException} | ||
* <p>Base exception class for all service exceptions from IAM service.</p> | ||
* | ||
*/ | ||
export class GetMFADeviceCommand extends $Command< | ||
GetMFADeviceCommandInput, | ||
GetMFADeviceCommandOutput, | ||
IAMClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
public static getEndpointParameterInstructions(): EndpointParameterInstructions { | ||
return { | ||
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, | ||
Endpoint: { type: "builtInParams", name: "endpoint" }, | ||
Region: { type: "builtInParams", name: "region" }, | ||
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, | ||
}; | ||
} | ||
|
||
/** | ||
* @public | ||
*/ | ||
constructor(readonly input: GetMFADeviceCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: IAMClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<GetMFADeviceCommandInput, GetMFADeviceCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
this.middlewareStack.use(getEndpointPlugin(configuration, GetMFADeviceCommand.getEndpointParameterInstructions())); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "IAMClient"; | ||
const commandName = "GetMFADeviceCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: (_: any) => _, | ||
outputFilterSensitiveLog: (_: any) => _, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private serialize(input: GetMFADeviceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return se_GetMFADeviceCommand(input, context); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetMFADeviceCommandOutput> { | ||
return de_GetMFADeviceCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.