|
| 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 { |
| 18 | + MigrationHubStrategyClientResolvedConfig, |
| 19 | + ServiceInputTypes, |
| 20 | + ServiceOutputTypes, |
| 21 | +} from "../MigrationHubStrategyClient"; |
| 22 | +import { ListAnalyzableServersRequest, ListAnalyzableServersResponse } from "../models/models_0"; |
| 23 | +import { de_ListAnalyzableServersCommand, se_ListAnalyzableServersCommand } from "../protocols/Aws_restJson1"; |
| 24 | + |
| 25 | +/** |
| 26 | + * @public |
| 27 | + */ |
| 28 | +export { __MetadataBearer, $Command }; |
| 29 | +/** |
| 30 | + * @public |
| 31 | + * |
| 32 | + * The input for {@link ListAnalyzableServersCommand}. |
| 33 | + */ |
| 34 | +export interface ListAnalyzableServersCommandInput extends ListAnalyzableServersRequest {} |
| 35 | +/** |
| 36 | + * @public |
| 37 | + * |
| 38 | + * The output of {@link ListAnalyzableServersCommand}. |
| 39 | + */ |
| 40 | +export interface ListAnalyzableServersCommandOutput extends ListAnalyzableServersResponse, __MetadataBearer {} |
| 41 | + |
| 42 | +/** |
| 43 | + * @public |
| 44 | + * Retrieves a list of all the servers fetched from customer vCenter using Strategy Recommendation Collector. |
| 45 | + * @example |
| 46 | + * Use a bare-bones client and the command you need to make an API call. |
| 47 | + * ```javascript |
| 48 | + * import { MigrationHubStrategyClient, ListAnalyzableServersCommand } from "@aws-sdk/client-migrationhubstrategy"; // ES Modules import |
| 49 | + * // const { MigrationHubStrategyClient, ListAnalyzableServersCommand } = require("@aws-sdk/client-migrationhubstrategy"); // CommonJS import |
| 50 | + * const client = new MigrationHubStrategyClient(config); |
| 51 | + * const input = { // ListAnalyzableServersRequest |
| 52 | + * sort: "STRING_VALUE", |
| 53 | + * nextToken: "STRING_VALUE", |
| 54 | + * maxResults: Number("int"), |
| 55 | + * }; |
| 56 | + * const command = new ListAnalyzableServersCommand(input); |
| 57 | + * const response = await client.send(command); |
| 58 | + * // { // ListAnalyzableServersResponse |
| 59 | + * // analyzableServers: [ // AnalyzableServerSummaryList |
| 60 | + * // { // AnalyzableServerSummary |
| 61 | + * // hostname: "STRING_VALUE", |
| 62 | + * // ipAddress: "STRING_VALUE", |
| 63 | + * // source: "STRING_VALUE", |
| 64 | + * // vmId: "STRING_VALUE", |
| 65 | + * // }, |
| 66 | + * // ], |
| 67 | + * // nextToken: "STRING_VALUE", |
| 68 | + * // }; |
| 69 | + * |
| 70 | + * ``` |
| 71 | + * |
| 72 | + * @param ListAnalyzableServersCommandInput - {@link ListAnalyzableServersCommandInput} |
| 73 | + * @returns {@link ListAnalyzableServersCommandOutput} |
| 74 | + * @see {@link ListAnalyzableServersCommandInput} for command's `input` shape. |
| 75 | + * @see {@link ListAnalyzableServersCommandOutput} for command's `response` shape. |
| 76 | + * @see {@link MigrationHubStrategyClientResolvedConfig | config} for MigrationHubStrategyClient's `config` shape. |
| 77 | + * |
| 78 | + * @throws {@link AccessDeniedException} (client fault) |
| 79 | + * <p> The user does not have permission to perform the action. Check the |
| 80 | + * AWS Identity and Access Management (IAM) policy associated with this user.</p> |
| 81 | + * |
| 82 | + * @throws {@link InternalServerException} (server fault) |
| 83 | + * <p> The server experienced an internal error. Try again. </p> |
| 84 | + * |
| 85 | + * @throws {@link ThrottlingException} (client fault) |
| 86 | + * <p> The request was denied due to request throttling. </p> |
| 87 | + * |
| 88 | + * @throws {@link ValidationException} (client fault) |
| 89 | + * <p> The request body isn't valid. </p> |
| 90 | + * |
| 91 | + * @throws {@link MigrationHubStrategyServiceException} |
| 92 | + * <p>Base exception class for all service exceptions from MigrationHubStrategy service.</p> |
| 93 | + * |
| 94 | + */ |
| 95 | +export class ListAnalyzableServersCommand extends $Command< |
| 96 | + ListAnalyzableServersCommandInput, |
| 97 | + ListAnalyzableServersCommandOutput, |
| 98 | + MigrationHubStrategyClientResolvedConfig |
| 99 | +> { |
| 100 | + // Start section: command_properties |
| 101 | + // End section: command_properties |
| 102 | + |
| 103 | + public static getEndpointParameterInstructions(): EndpointParameterInstructions { |
| 104 | + return { |
| 105 | + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, |
| 106 | + Endpoint: { type: "builtInParams", name: "endpoint" }, |
| 107 | + Region: { type: "builtInParams", name: "region" }, |
| 108 | + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, |
| 109 | + }; |
| 110 | + } |
| 111 | + |
| 112 | + /** |
| 113 | + * @public |
| 114 | + */ |
| 115 | + constructor(readonly input: ListAnalyzableServersCommandInput) { |
| 116 | + // Start section: command_constructor |
| 117 | + super(); |
| 118 | + // End section: command_constructor |
| 119 | + } |
| 120 | + |
| 121 | + /** |
| 122 | + * @internal |
| 123 | + */ |
| 124 | + resolveMiddleware( |
| 125 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 126 | + configuration: MigrationHubStrategyClientResolvedConfig, |
| 127 | + options?: __HttpHandlerOptions |
| 128 | + ): Handler<ListAnalyzableServersCommandInput, ListAnalyzableServersCommandOutput> { |
| 129 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 130 | + this.middlewareStack.use( |
| 131 | + getEndpointPlugin(configuration, ListAnalyzableServersCommand.getEndpointParameterInstructions()) |
| 132 | + ); |
| 133 | + |
| 134 | + const stack = clientStack.concat(this.middlewareStack); |
| 135 | + |
| 136 | + const { logger } = configuration; |
| 137 | + const clientName = "MigrationHubStrategyClient"; |
| 138 | + const commandName = "ListAnalyzableServersCommand"; |
| 139 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 140 | + logger, |
| 141 | + clientName, |
| 142 | + commandName, |
| 143 | + inputFilterSensitiveLog: (_: any) => _, |
| 144 | + outputFilterSensitiveLog: (_: any) => _, |
| 145 | + [SMITHY_CONTEXT_KEY]: { |
| 146 | + service: "AWSMigrationHubStrategyRecommendation", |
| 147 | + operation: "ListAnalyzableServers", |
| 148 | + }, |
| 149 | + }; |
| 150 | + const { requestHandler } = configuration; |
| 151 | + return stack.resolve( |
| 152 | + (request: FinalizeHandlerArguments<any>) => |
| 153 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 154 | + handlerExecutionContext |
| 155 | + ); |
| 156 | + } |
| 157 | + |
| 158 | + /** |
| 159 | + * @internal |
| 160 | + */ |
| 161 | + private serialize(input: ListAnalyzableServersCommandInput, context: __SerdeContext): Promise<__HttpRequest> { |
| 162 | + return se_ListAnalyzableServersCommand(input, context); |
| 163 | + } |
| 164 | + |
| 165 | + /** |
| 166 | + * @internal |
| 167 | + */ |
| 168 | + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListAnalyzableServersCommandOutput> { |
| 169 | + return de_ListAnalyzableServersCommand(output, context); |
| 170 | + } |
| 171 | + |
| 172 | + // Start section: command_body_extra |
| 173 | + // End section: command_body_extra |
| 174 | +} |
0 commit comments