|
| 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 { |
| 9 | + InvokeRestApiRequest, |
| 10 | + InvokeRestApiRequestFilterSensitiveLog, |
| 11 | + InvokeRestApiResponse, |
| 12 | + InvokeRestApiResponseFilterSensitiveLog, |
| 13 | +} from "../models/models_0"; |
| 14 | +import { MWAAClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MWAAClient"; |
| 15 | +import { de_InvokeRestApiCommand, se_InvokeRestApiCommand } from "../protocols/Aws_restJson1"; |
| 16 | + |
| 17 | +/** |
| 18 | + * @public |
| 19 | + */ |
| 20 | +export type { __MetadataBearer }; |
| 21 | +export { $Command }; |
| 22 | +/** |
| 23 | + * @public |
| 24 | + * |
| 25 | + * The input for {@link InvokeRestApiCommand}. |
| 26 | + */ |
| 27 | +export interface InvokeRestApiCommandInput extends InvokeRestApiRequest {} |
| 28 | +/** |
| 29 | + * @public |
| 30 | + * |
| 31 | + * The output of {@link InvokeRestApiCommand}. |
| 32 | + */ |
| 33 | +export interface InvokeRestApiCommandOutput extends InvokeRestApiResponse, __MetadataBearer {} |
| 34 | + |
| 35 | +/** |
| 36 | + * <p>Invokes the Apache Airflow REST API on the webserver with the specified inputs. To |
| 37 | + * learn more, see <a href="https://docs.aws.amazon.com/mwaa/latest/userguide/access-mwaa-apache-airflow-rest-api.html">Using the Apache Airflow REST API</a> |
| 38 | + * </p> |
| 39 | + * @example |
| 40 | + * Use a bare-bones client and the command you need to make an API call. |
| 41 | + * ```javascript |
| 42 | + * import { MWAAClient, InvokeRestApiCommand } from "@aws-sdk/client-mwaa"; // ES Modules import |
| 43 | + * // const { MWAAClient, InvokeRestApiCommand } = require("@aws-sdk/client-mwaa"); // CommonJS import |
| 44 | + * const client = new MWAAClient(config); |
| 45 | + * const input = { // InvokeRestApiRequest |
| 46 | + * Name: "STRING_VALUE", // required |
| 47 | + * Path: "STRING_VALUE", // required |
| 48 | + * Method: "STRING_VALUE", // required |
| 49 | + * QueryParameters: "DOCUMENT_VALUE", |
| 50 | + * Body: "DOCUMENT_VALUE", |
| 51 | + * }; |
| 52 | + * const command = new InvokeRestApiCommand(input); |
| 53 | + * const response = await client.send(command); |
| 54 | + * // { // InvokeRestApiResponse |
| 55 | + * // RestApiStatusCode: Number("int"), |
| 56 | + * // RestApiResponse: "DOCUMENT_VALUE", |
| 57 | + * // }; |
| 58 | + * |
| 59 | + * ``` |
| 60 | + * |
| 61 | + * @param InvokeRestApiCommandInput - {@link InvokeRestApiCommandInput} |
| 62 | + * @returns {@link InvokeRestApiCommandOutput} |
| 63 | + * @see {@link InvokeRestApiCommandInput} for command's `input` shape. |
| 64 | + * @see {@link InvokeRestApiCommandOutput} for command's `response` shape. |
| 65 | + * @see {@link MWAAClientResolvedConfig | config} for MWAAClient's `config` shape. |
| 66 | + * |
| 67 | + * @throws {@link AccessDeniedException} (client fault) |
| 68 | + * <p>Access to the Apache Airflow Web UI or CLI has been denied due to insufficient permissions. To learn more, see <a href="https://docs.aws.amazon.com/mwaa/latest/userguide/access-policies.html">Accessing an Amazon MWAA environment</a>.</p> |
| 69 | + * |
| 70 | + * @throws {@link InternalServerException} (server fault) |
| 71 | + * <p>InternalServerException: An internal error has occurred.</p> |
| 72 | + * |
| 73 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 74 | + * <p>ResourceNotFoundException: The resource is not available.</p> |
| 75 | + * |
| 76 | + * @throws {@link RestApiClientException} (client fault) |
| 77 | + * <p>An exception indicating that a client-side error occurred during the Apache Airflow |
| 78 | + * REST API call.</p> |
| 79 | + * |
| 80 | + * @throws {@link RestApiServerException} (client fault) |
| 81 | + * <p>An exception indicating that a server-side error occurred during the Apache Airflow |
| 82 | + * REST API call.</p> |
| 83 | + * |
| 84 | + * @throws {@link ValidationException} (client fault) |
| 85 | + * <p>ValidationException: The provided input is not valid.</p> |
| 86 | + * |
| 87 | + * @throws {@link MWAAServiceException} |
| 88 | + * <p>Base exception class for all service exceptions from MWAA service.</p> |
| 89 | + * |
| 90 | + * @public |
| 91 | + * @example Listing Airflow variables. |
| 92 | + * ```javascript |
| 93 | + * // |
| 94 | + * const input = { |
| 95 | + * "Method": "GET", |
| 96 | + * "Name": "MyEnvironment", |
| 97 | + * "Path": "/variables" |
| 98 | + * }; |
| 99 | + * const command = new InvokeRestApiCommand(input); |
| 100 | + * const response = await client.send(command); |
| 101 | + * /* response == |
| 102 | + * { |
| 103 | + * "RestApiResponse": { |
| 104 | + * "total_entries": 1, |
| 105 | + * "variables": [ |
| 106 | + * { |
| 107 | + * "key": "test-variable", |
| 108 | + * "value": "123", |
| 109 | + * "description": "Example variable" |
| 110 | + * } |
| 111 | + * ] |
| 112 | + * }, |
| 113 | + * "RestApiStatusCode": 200 |
| 114 | + * } |
| 115 | + * *\/ |
| 116 | + * // example id: example-1 |
| 117 | + * ``` |
| 118 | + * |
| 119 | + */ |
| 120 | +export class InvokeRestApiCommand extends $Command |
| 121 | + .classBuilder< |
| 122 | + InvokeRestApiCommandInput, |
| 123 | + InvokeRestApiCommandOutput, |
| 124 | + MWAAClientResolvedConfig, |
| 125 | + ServiceInputTypes, |
| 126 | + ServiceOutputTypes |
| 127 | + >() |
| 128 | + .ep(commonParams) |
| 129 | + .m(function (this: any, Command: any, cs: any, config: MWAAClientResolvedConfig, o: any) { |
| 130 | + return [ |
| 131 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 132 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 133 | + ]; |
| 134 | + }) |
| 135 | + .s("AmazonMWAA", "InvokeRestApi", {}) |
| 136 | + .n("MWAAClient", "InvokeRestApiCommand") |
| 137 | + .f(InvokeRestApiRequestFilterSensitiveLog, InvokeRestApiResponseFilterSensitiveLog) |
| 138 | + .ser(se_InvokeRestApiCommand) |
| 139 | + .de(de_InvokeRestApiCommand) |
| 140 | + .build() { |
| 141 | + /** @internal type navigation helper, not in runtime. */ |
| 142 | + protected declare static __types: { |
| 143 | + api: { |
| 144 | + input: InvokeRestApiRequest; |
| 145 | + output: InvokeRestApiResponse; |
| 146 | + }; |
| 147 | + sdk: { |
| 148 | + input: InvokeRestApiCommandInput; |
| 149 | + output: InvokeRestApiCommandOutput; |
| 150 | + }; |
| 151 | + }; |
| 152 | +} |
0 commit comments