-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-athena): This feature introduces the API support for Athe…
…na's parameterized query and BatchGetPreparedStatement API.
- Loading branch information
awstools
committed
Jun 30, 2022
1 parent
debff58
commit 52a77f5
Showing
8 changed files
with
605 additions
and
43 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
99 changes: 99 additions & 0 deletions
99
clients/client-athena/src/commands/BatchGetPreparedStatementCommand.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,99 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { AthenaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AthenaClient"; | ||
import { BatchGetPreparedStatementInput, BatchGetPreparedStatementOutput } from "../models/models_0"; | ||
import { | ||
deserializeAws_json1_1BatchGetPreparedStatementCommand, | ||
serializeAws_json1_1BatchGetPreparedStatementCommand, | ||
} from "../protocols/Aws_json1_1"; | ||
|
||
export interface BatchGetPreparedStatementCommandInput extends BatchGetPreparedStatementInput {} | ||
export interface BatchGetPreparedStatementCommandOutput extends BatchGetPreparedStatementOutput, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Returns the details of a single prepared statement or a list of up to 256 prepared statements for the array of prepared statement names that you provide. Requires you to have access to the workgroup to which the prepared statements belong. If a prepared statement cannot be retrieved for the name specified, the statement is listed in <code>UnprocessedPreparedStatementNames</code>.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { AthenaClient, BatchGetPreparedStatementCommand } from "@aws-sdk/client-athena"; // ES Modules import | ||
* // const { AthenaClient, BatchGetPreparedStatementCommand } = require("@aws-sdk/client-athena"); // CommonJS import | ||
* const client = new AthenaClient(config); | ||
* const command = new BatchGetPreparedStatementCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link BatchGetPreparedStatementCommandInput} for command's `input` shape. | ||
* @see {@link BatchGetPreparedStatementCommandOutput} for command's `response` shape. | ||
* @see {@link AthenaClientResolvedConfig | config} for AthenaClient's `config` shape. | ||
* | ||
*/ | ||
export class BatchGetPreparedStatementCommand extends $Command< | ||
BatchGetPreparedStatementCommandInput, | ||
BatchGetPreparedStatementCommandOutput, | ||
AthenaClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: BatchGetPreparedStatementCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: AthenaClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<BatchGetPreparedStatementCommandInput, BatchGetPreparedStatementCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "AthenaClient"; | ||
const commandName = "BatchGetPreparedStatementCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: BatchGetPreparedStatementInput.filterSensitiveLog, | ||
outputFilterSensitiveLog: BatchGetPreparedStatementOutput.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: BatchGetPreparedStatementCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_json1_1BatchGetPreparedStatementCommand(input, context); | ||
} | ||
|
||
private deserialize( | ||
output: __HttpResponse, | ||
context: __SerdeContext | ||
): Promise<BatchGetPreparedStatementCommandOutput> { | ||
return deserializeAws_json1_1BatchGetPreparedStatementCommand(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.