|
| 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 { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; |
| 8 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 9 | +import { StopIngestionJobRequest, StopIngestionJobResponse } from "../models/models_0"; |
| 10 | +import { de_StopIngestionJobCommand, se_StopIngestionJobCommand } from "../protocols/Aws_restJson1"; |
| 11 | + |
| 12 | +/** |
| 13 | + * @public |
| 14 | + */ |
| 15 | +export type { __MetadataBearer }; |
| 16 | +export { $Command }; |
| 17 | +/** |
| 18 | + * @public |
| 19 | + * |
| 20 | + * The input for {@link StopIngestionJobCommand}. |
| 21 | + */ |
| 22 | +export interface StopIngestionJobCommandInput extends StopIngestionJobRequest {} |
| 23 | +/** |
| 24 | + * @public |
| 25 | + * |
| 26 | + * The output of {@link StopIngestionJobCommand}. |
| 27 | + */ |
| 28 | +export interface StopIngestionJobCommandOutput extends StopIngestionJobResponse, __MetadataBearer {} |
| 29 | + |
| 30 | +/** |
| 31 | + * <p>Stops a currently running data ingestion job. You can send a <code>StartIngestionJob</code> request again to ingest the rest of your data when you are ready.</p> |
| 32 | + * @example |
| 33 | + * Use a bare-bones client and the command you need to make an API call. |
| 34 | + * ```javascript |
| 35 | + * import { BedrockAgentClient, StopIngestionJobCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import |
| 36 | + * // const { BedrockAgentClient, StopIngestionJobCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import |
| 37 | + * const client = new BedrockAgentClient(config); |
| 38 | + * const input = { // StopIngestionJobRequest |
| 39 | + * knowledgeBaseId: "STRING_VALUE", // required |
| 40 | + * dataSourceId: "STRING_VALUE", // required |
| 41 | + * ingestionJobId: "STRING_VALUE", // required |
| 42 | + * }; |
| 43 | + * const command = new StopIngestionJobCommand(input); |
| 44 | + * const response = await client.send(command); |
| 45 | + * // { // StopIngestionJobResponse |
| 46 | + * // ingestionJob: { // IngestionJob |
| 47 | + * // knowledgeBaseId: "STRING_VALUE", // required |
| 48 | + * // dataSourceId: "STRING_VALUE", // required |
| 49 | + * // ingestionJobId: "STRING_VALUE", // required |
| 50 | + * // description: "STRING_VALUE", |
| 51 | + * // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED" || "STOPPING" || "STOPPED", // required |
| 52 | + * // statistics: { // IngestionJobStatistics |
| 53 | + * // numberOfDocumentsScanned: Number("long"), |
| 54 | + * // numberOfMetadataDocumentsScanned: Number("long"), |
| 55 | + * // numberOfNewDocumentsIndexed: Number("long"), |
| 56 | + * // numberOfModifiedDocumentsIndexed: Number("long"), |
| 57 | + * // numberOfMetadataDocumentsModified: Number("long"), |
| 58 | + * // numberOfDocumentsDeleted: Number("long"), |
| 59 | + * // numberOfDocumentsFailed: Number("long"), |
| 60 | + * // }, |
| 61 | + * // failureReasons: [ // FailureReasons |
| 62 | + * // "STRING_VALUE", |
| 63 | + * // ], |
| 64 | + * // startedAt: new Date("TIMESTAMP"), // required |
| 65 | + * // updatedAt: new Date("TIMESTAMP"), // required |
| 66 | + * // }, |
| 67 | + * // }; |
| 68 | + * |
| 69 | + * ``` |
| 70 | + * |
| 71 | + * @param StopIngestionJobCommandInput - {@link StopIngestionJobCommandInput} |
| 72 | + * @returns {@link StopIngestionJobCommandOutput} |
| 73 | + * @see {@link StopIngestionJobCommandInput} for command's `input` shape. |
| 74 | + * @see {@link StopIngestionJobCommandOutput} for command's `response` shape. |
| 75 | + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. |
| 76 | + * |
| 77 | + * @throws {@link AccessDeniedException} (client fault) |
| 78 | + * <p>The request is denied because of missing access permissions.</p> |
| 79 | + * |
| 80 | + * @throws {@link ConflictException} (client fault) |
| 81 | + * <p>There was a conflict performing an operation.</p> |
| 82 | + * |
| 83 | + * @throws {@link InternalServerException} (server fault) |
| 84 | + * <p>An internal server error occurred. Retry your request.</p> |
| 85 | + * |
| 86 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 87 | + * <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p> |
| 88 | + * |
| 89 | + * @throws {@link ThrottlingException} (client fault) |
| 90 | + * <p>The number of requests exceeds the limit. Resubmit your request later.</p> |
| 91 | + * |
| 92 | + * @throws {@link ValidationException} (client fault) |
| 93 | + * <p>Input validation failed. Check your request parameters and retry the request.</p> |
| 94 | + * |
| 95 | + * @throws {@link BedrockAgentServiceException} |
| 96 | + * <p>Base exception class for all service exceptions from BedrockAgent service.</p> |
| 97 | + * |
| 98 | + * @public |
| 99 | + */ |
| 100 | +export class StopIngestionJobCommand extends $Command |
| 101 | + .classBuilder< |
| 102 | + StopIngestionJobCommandInput, |
| 103 | + StopIngestionJobCommandOutput, |
| 104 | + BedrockAgentClientResolvedConfig, |
| 105 | + ServiceInputTypes, |
| 106 | + ServiceOutputTypes |
| 107 | + >() |
| 108 | + .ep(commonParams) |
| 109 | + .m(function (this: any, Command: any, cs: any, config: BedrockAgentClientResolvedConfig, o: any) { |
| 110 | + return [ |
| 111 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 112 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 113 | + ]; |
| 114 | + }) |
| 115 | + .s("AmazonBedrockAgentBuildTimeLambda", "StopIngestionJob", {}) |
| 116 | + .n("BedrockAgentClient", "StopIngestionJobCommand") |
| 117 | + .f(void 0, void 0) |
| 118 | + .ser(se_StopIngestionJobCommand) |
| 119 | + .de(de_StopIngestionJobCommand) |
| 120 | + .build() { |
| 121 | + /** @internal type navigation helper, not in runtime. */ |
| 122 | + protected declare static __types: { |
| 123 | + api: { |
| 124 | + input: StopIngestionJobRequest; |
| 125 | + output: StopIngestionJobResponse; |
| 126 | + }; |
| 127 | + sdk: { |
| 128 | + input: StopIngestionJobCommandInput; |
| 129 | + output: StopIngestionJobCommandOutput; |
| 130 | + }; |
| 131 | + }; |
| 132 | +} |
0 commit comments