|
| 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 { GetStatementResultV2Request, GetStatementResultV2Response } from "../models/models_0"; |
| 9 | +import { de_GetStatementResultV2Command, se_GetStatementResultV2Command } from "../protocols/Aws_json1_1"; |
| 10 | +import { RedshiftDataClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RedshiftDataClient"; |
| 11 | + |
| 12 | +/** |
| 13 | + * @public |
| 14 | + */ |
| 15 | +export type { __MetadataBearer }; |
| 16 | +export { $Command }; |
| 17 | +/** |
| 18 | + * @public |
| 19 | + * |
| 20 | + * The input for {@link GetStatementResultV2Command}. |
| 21 | + */ |
| 22 | +export interface GetStatementResultV2CommandInput extends GetStatementResultV2Request {} |
| 23 | +/** |
| 24 | + * @public |
| 25 | + * |
| 26 | + * The output of {@link GetStatementResultV2Command}. |
| 27 | + */ |
| 28 | +export interface GetStatementResultV2CommandOutput extends GetStatementResultV2Response, __MetadataBearer {} |
| 29 | + |
| 30 | +/** |
| 31 | + * <p>Fetches the temporarily cached result of an SQL statement in CSV format. |
| 32 | + * The <code>ExecuteStatement</code> or <code>BatchExecuteStatement</code> operation that ran the SQL statement must have specified <code>ResultFormat</code> as <code>CSV</code>. |
| 33 | + * A token is returned to page through the statement results.</p> |
| 34 | + * <p>For more information about the Amazon Redshift Data API and CLI usage examples, see |
| 35 | + * <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html">Using the Amazon Redshift Data API</a> in the |
| 36 | + * <i>Amazon Redshift Management Guide</i>. </p> |
| 37 | + * @example |
| 38 | + * Use a bare-bones client and the command you need to make an API call. |
| 39 | + * ```javascript |
| 40 | + * import { RedshiftDataClient, GetStatementResultV2Command } from "@aws-sdk/client-redshift-data"; // ES Modules import |
| 41 | + * // const { RedshiftDataClient, GetStatementResultV2Command } = require("@aws-sdk/client-redshift-data"); // CommonJS import |
| 42 | + * const client = new RedshiftDataClient(config); |
| 43 | + * const input = { // GetStatementResultV2Request |
| 44 | + * Id: "STRING_VALUE", // required |
| 45 | + * NextToken: "STRING_VALUE", |
| 46 | + * }; |
| 47 | + * const command = new GetStatementResultV2Command(input); |
| 48 | + * const response = await client.send(command); |
| 49 | + * // { // GetStatementResultV2Response |
| 50 | + * // Records: [ // FormattedSqlRecords // required |
| 51 | + * // { // QueryRecords Union: only one key present |
| 52 | + * // CSVRecords: "STRING_VALUE", |
| 53 | + * // }, |
| 54 | + * // ], |
| 55 | + * // ColumnMetadata: [ // ColumnMetadataList |
| 56 | + * // { // ColumnMetadata |
| 57 | + * // isCaseSensitive: true || false, |
| 58 | + * // isCurrency: true || false, |
| 59 | + * // isSigned: true || false, |
| 60 | + * // label: "STRING_VALUE", |
| 61 | + * // name: "STRING_VALUE", |
| 62 | + * // nullable: Number("int"), |
| 63 | + * // precision: Number("int"), |
| 64 | + * // scale: Number("int"), |
| 65 | + * // schemaName: "STRING_VALUE", |
| 66 | + * // tableName: "STRING_VALUE", |
| 67 | + * // typeName: "STRING_VALUE", |
| 68 | + * // length: Number("int"), |
| 69 | + * // columnDefault: "STRING_VALUE", |
| 70 | + * // }, |
| 71 | + * // ], |
| 72 | + * // TotalNumRows: Number("long"), |
| 73 | + * // ResultFormat: "STRING_VALUE", |
| 74 | + * // NextToken: "STRING_VALUE", |
| 75 | + * // }; |
| 76 | + * |
| 77 | + * ``` |
| 78 | + * |
| 79 | + * @param GetStatementResultV2CommandInput - {@link GetStatementResultV2CommandInput} |
| 80 | + * @returns {@link GetStatementResultV2CommandOutput} |
| 81 | + * @see {@link GetStatementResultV2CommandInput} for command's `input` shape. |
| 82 | + * @see {@link GetStatementResultV2CommandOutput} for command's `response` shape. |
| 83 | + * @see {@link RedshiftDataClientResolvedConfig | config} for RedshiftDataClient's `config` shape. |
| 84 | + * |
| 85 | + * @throws {@link InternalServerException} (server fault) |
| 86 | + * <p>The Amazon Redshift Data API operation failed due to invalid input. </p> |
| 87 | + * |
| 88 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 89 | + * <p>The Amazon Redshift Data API operation failed due to a missing resource. </p> |
| 90 | + * |
| 91 | + * @throws {@link ValidationException} (client fault) |
| 92 | + * <p>The Amazon Redshift Data API operation failed due to invalid input. </p> |
| 93 | + * |
| 94 | + * @throws {@link RedshiftDataServiceException} |
| 95 | + * <p>Base exception class for all service exceptions from RedshiftData service.</p> |
| 96 | + * |
| 97 | + * @public |
| 98 | + */ |
| 99 | +export class GetStatementResultV2Command extends $Command |
| 100 | + .classBuilder< |
| 101 | + GetStatementResultV2CommandInput, |
| 102 | + GetStatementResultV2CommandOutput, |
| 103 | + RedshiftDataClientResolvedConfig, |
| 104 | + ServiceInputTypes, |
| 105 | + ServiceOutputTypes |
| 106 | + >() |
| 107 | + .ep(commonParams) |
| 108 | + .m(function (this: any, Command: any, cs: any, config: RedshiftDataClientResolvedConfig, o: any) { |
| 109 | + return [ |
| 110 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 111 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 112 | + ]; |
| 113 | + }) |
| 114 | + .s("RedshiftData", "GetStatementResultV2", {}) |
| 115 | + .n("RedshiftDataClient", "GetStatementResultV2Command") |
| 116 | + .f(void 0, void 0) |
| 117 | + .ser(se_GetStatementResultV2Command) |
| 118 | + .de(de_GetStatementResultV2Command) |
| 119 | + .build() { |
| 120 | + /** @internal type navigation helper, not in runtime. */ |
| 121 | + protected declare static __types: { |
| 122 | + api: { |
| 123 | + input: GetStatementResultV2Request; |
| 124 | + output: GetStatementResultV2Response; |
| 125 | + }; |
| 126 | + sdk: { |
| 127 | + input: GetStatementResultV2CommandInput; |
| 128 | + output: GetStatementResultV2CommandOutput; |
| 129 | + }; |
| 130 | + }; |
| 131 | +} |
0 commit comments