|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 5 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 6 | + |
| 7 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 8 | +import { StartDirectoryListingRequest, StartDirectoryListingResponse } from "../models/models_0"; |
| 9 | +import { de_StartDirectoryListingCommand, se_StartDirectoryListingCommand } from "../protocols/Aws_json1_1"; |
| 10 | +import { ServiceInputTypes, ServiceOutputTypes, TransferClientResolvedConfig } from "../TransferClient"; |
| 11 | + |
| 12 | +/** |
| 13 | + * @public |
| 14 | + */ |
| 15 | +export { __MetadataBearer, $Command }; |
| 16 | +/** |
| 17 | + * @public |
| 18 | + * |
| 19 | + * The input for {@link StartDirectoryListingCommand}. |
| 20 | + */ |
| 21 | +export interface StartDirectoryListingCommandInput extends StartDirectoryListingRequest {} |
| 22 | +/** |
| 23 | + * @public |
| 24 | + * |
| 25 | + * The output of {@link StartDirectoryListingCommand}. |
| 26 | + */ |
| 27 | +export interface StartDirectoryListingCommandOutput extends StartDirectoryListingResponse, __MetadataBearer {} |
| 28 | + |
| 29 | +/** |
| 30 | + * <p>Retrieves a list of the contents of a directory from a remote SFTP server. You specify the |
| 31 | + * connector ID, the output path, and the remote directory path. You can also specify the |
| 32 | + * optional <code>MaxItems</code> value to control the maximum number of items that are listed |
| 33 | + * from the remote directory. This API returns a list of all files and directories in the remote |
| 34 | + * directory (up to the maximum value), but does not return files or folders in sub-directories. |
| 35 | + * That is, it only returns a list of files and directories one-level deep.</p> |
| 36 | + * <p>After you receive the listing file, you can provide the files that you want to transfer to |
| 37 | + * the <code>RetrieveFilePaths</code> parameter of the <code>StartFileTransfer</code> API |
| 38 | + * call.</p> |
| 39 | + * <p>The naming convention for the output file is |
| 40 | + * <code> |
| 41 | + * <i>connector-ID</i>-<i>listing-ID</i>.json</code>. The |
| 42 | + * output file contains the following information:</p> |
| 43 | + * <ul> |
| 44 | + * <li> |
| 45 | + * <p> |
| 46 | + * <code>filePath</code>: the complete path of a remote file, relative to the directory |
| 47 | + * of the listing request for your SFTP connector on the remote server.</p> |
| 48 | + * </li> |
| 49 | + * <li> |
| 50 | + * <p> |
| 51 | + * <code>modifiedTimestamp</code>: the last time the file was modified, in UTC time |
| 52 | + * format. This field is optional. If the remote file attributes don't contain a timestamp, |
| 53 | + * it is omitted from the file listing.</p> |
| 54 | + * </li> |
| 55 | + * <li> |
| 56 | + * <p> |
| 57 | + * <code>size</code>: the size of the file, in bytes. This field is optional. If the |
| 58 | + * remote file attributes don't contain a file size, it is omitted from the file |
| 59 | + * listing.</p> |
| 60 | + * </li> |
| 61 | + * <li> |
| 62 | + * <p> |
| 63 | + * <code>path</code>: the complete path of a remote directory, relative to the directory |
| 64 | + * of the listing request for your SFTP connector on the remote server.</p> |
| 65 | + * </li> |
| 66 | + * <li> |
| 67 | + * <p> |
| 68 | + * <code>truncated</code>: a flag indicating whether the list output contains all of the |
| 69 | + * items contained in the remote directory or not. If your <code>Truncated</code> output |
| 70 | + * value is true, you can increase the value provided in the optional <code>max-items</code> |
| 71 | + * input attribute to be able to list more items (up to the maximum allowed list size of |
| 72 | + * 10,000 items).</p> |
| 73 | + * </li> |
| 74 | + * </ul> |
| 75 | + * @example |
| 76 | + * Use a bare-bones client and the command you need to make an API call. |
| 77 | + * ```javascript |
| 78 | + * import { TransferClient, StartDirectoryListingCommand } from "@aws-sdk/client-transfer"; // ES Modules import |
| 79 | + * // const { TransferClient, StartDirectoryListingCommand } = require("@aws-sdk/client-transfer"); // CommonJS import |
| 80 | + * const client = new TransferClient(config); |
| 81 | + * const input = { // StartDirectoryListingRequest |
| 82 | + * ConnectorId: "STRING_VALUE", // required |
| 83 | + * RemoteDirectoryPath: "STRING_VALUE", // required |
| 84 | + * MaxItems: Number("int"), |
| 85 | + * OutputDirectoryPath: "STRING_VALUE", // required |
| 86 | + * }; |
| 87 | + * const command = new StartDirectoryListingCommand(input); |
| 88 | + * const response = await client.send(command); |
| 89 | + * // { // StartDirectoryListingResponse |
| 90 | + * // ListingId: "STRING_VALUE", // required |
| 91 | + * // OutputFileName: "STRING_VALUE", // required |
| 92 | + * // }; |
| 93 | + * |
| 94 | + * ``` |
| 95 | + * |
| 96 | + * @param StartDirectoryListingCommandInput - {@link StartDirectoryListingCommandInput} |
| 97 | + * @returns {@link StartDirectoryListingCommandOutput} |
| 98 | + * @see {@link StartDirectoryListingCommandInput} for command's `input` shape. |
| 99 | + * @see {@link StartDirectoryListingCommandOutput} for command's `response` shape. |
| 100 | + * @see {@link TransferClientResolvedConfig | config} for TransferClient's `config` shape. |
| 101 | + * |
| 102 | + * @throws {@link InternalServiceError} (server fault) |
| 103 | + * <p>This exception is thrown when an error occurs in the Transfer Family service.</p> |
| 104 | + * |
| 105 | + * @throws {@link InvalidRequestException} (client fault) |
| 106 | + * <p>This exception is thrown when the client submits a malformed request.</p> |
| 107 | + * |
| 108 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 109 | + * <p>This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family |
| 110 | + * service.</p> |
| 111 | + * |
| 112 | + * @throws {@link ServiceUnavailableException} (server fault) |
| 113 | + * <p>The request has failed because the Amazon Web ServicesTransfer Family service is not available.</p> |
| 114 | + * |
| 115 | + * @throws {@link ThrottlingException} (client fault) |
| 116 | + * <p>The request was denied due to request throttling.</p> |
| 117 | + * |
| 118 | + * @throws {@link TransferServiceException} |
| 119 | + * <p>Base exception class for all service exceptions from Transfer service.</p> |
| 120 | + * |
| 121 | + * @public |
| 122 | + */ |
| 123 | +export class StartDirectoryListingCommand extends $Command |
| 124 | + .classBuilder< |
| 125 | + StartDirectoryListingCommandInput, |
| 126 | + StartDirectoryListingCommandOutput, |
| 127 | + TransferClientResolvedConfig, |
| 128 | + ServiceInputTypes, |
| 129 | + ServiceOutputTypes |
| 130 | + >() |
| 131 | + .ep({ |
| 132 | + ...commonParams, |
| 133 | + }) |
| 134 | + .m(function (this: any, Command: any, cs: any, config: TransferClientResolvedConfig, o: any) { |
| 135 | + return [ |
| 136 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 137 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 138 | + ]; |
| 139 | + }) |
| 140 | + .s("TransferService", "StartDirectoryListing", {}) |
| 141 | + .n("TransferClient", "StartDirectoryListingCommand") |
| 142 | + .f(void 0, void 0) |
| 143 | + .ser(se_StartDirectoryListingCommand) |
| 144 | + .de(de_StartDirectoryListingCommand) |
| 145 | + .build() {} |
0 commit comments