-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-transfer): This release adds support for SFTP Connectors.
- Loading branch information
awstools
committed
Jul 25, 2023
1 parent
0d803e7
commit e28d57d
Showing
13 changed files
with
641 additions
and
42 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
159 changes: 159 additions & 0 deletions
159
clients/client-transfer/src/commands/TestConnectionCommand.ts
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,159 @@ | ||
// smithy-typescript generated code | ||
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; | ||
import { getSerdePlugin } from "@smithy/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; | ||
import { Command as $Command } from "@smithy/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@smithy/types"; | ||
|
||
import { TestConnectionRequest, TestConnectionResponse } from "../models/models_0"; | ||
import { de_TestConnectionCommand, se_TestConnectionCommand } from "../protocols/Aws_json1_1"; | ||
import { ServiceInputTypes, ServiceOutputTypes, TransferClientResolvedConfig } from "../TransferClient"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link TestConnectionCommand}. | ||
*/ | ||
export interface TestConnectionCommandInput extends TestConnectionRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link TestConnectionCommand}. | ||
*/ | ||
export interface TestConnectionCommandOutput extends TestConnectionResponse, __MetadataBearer {} | ||
|
||
/** | ||
* @public | ||
* <p>Tests whether your SFTP connector is set up successfully. We highly recommend that you call this | ||
* operation to test your ability to transfer files between a Transfer Family server and a trading partner's | ||
* SFTP server.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { TransferClient, TestConnectionCommand } from "@aws-sdk/client-transfer"; // ES Modules import | ||
* // const { TransferClient, TestConnectionCommand } = require("@aws-sdk/client-transfer"); // CommonJS import | ||
* const client = new TransferClient(config); | ||
* const input = { // TestConnectionRequest | ||
* ConnectorId: "STRING_VALUE", // required | ||
* }; | ||
* const command = new TestConnectionCommand(input); | ||
* const response = await client.send(command); | ||
* // { // TestConnectionResponse | ||
* // ConnectorId: "STRING_VALUE", | ||
* // Status: "STRING_VALUE", | ||
* // StatusMessage: "STRING_VALUE", | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param TestConnectionCommandInput - {@link TestConnectionCommandInput} | ||
* @returns {@link TestConnectionCommandOutput} | ||
* @see {@link TestConnectionCommandInput} for command's `input` shape. | ||
* @see {@link TestConnectionCommandOutput} for command's `response` shape. | ||
* @see {@link TransferClientResolvedConfig | config} for TransferClient's `config` shape. | ||
* | ||
* @throws {@link InternalServiceError} (server fault) | ||
* <p>This exception is thrown when an error occurs in the Amazon Web ServicesTransfer Family service.</p> | ||
* | ||
* @throws {@link InvalidRequestException} (client fault) | ||
* <p>This exception is thrown when the client submits a malformed request.</p> | ||
* | ||
* @throws {@link ResourceNotFoundException} (client fault) | ||
* <p>This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family | ||
* service.</p> | ||
* | ||
* @throws {@link ServiceUnavailableException} (server fault) | ||
* <p>The request has failed because the Amazon Web ServicesTransfer Family service is not available.</p> | ||
* | ||
* @throws {@link TransferServiceException} | ||
* <p>Base exception class for all service exceptions from Transfer service.</p> | ||
* | ||
*/ | ||
export class TestConnectionCommand extends $Command< | ||
TestConnectionCommandInput, | ||
TestConnectionCommandOutput, | ||
TransferClientResolvedConfig | ||
> { | ||
// 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: TestConnectionCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: TransferClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<TestConnectionCommandInput, TestConnectionCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
this.middlewareStack.use( | ||
getEndpointPlugin(configuration, TestConnectionCommand.getEndpointParameterInstructions()) | ||
); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "TransferClient"; | ||
const commandName = "TestConnectionCommand"; | ||
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: TestConnectionCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return se_TestConnectionCommand(input, context); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<TestConnectionCommandOutput> { | ||
return de_TestConnectionCommand(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
Oops, something went wrong.