|
| 1 | +// smithy-typescript generated code |
| 2 | +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; |
| 5 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 6 | +import { |
| 7 | + FinalizeHandlerArguments, |
| 8 | + Handler, |
| 9 | + HandlerExecutionContext, |
| 10 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 11 | + MetadataBearer as __MetadataBearer, |
| 12 | + MiddlewareStack, |
| 13 | + SerdeContext as __SerdeContext, |
| 14 | + SMITHY_CONTEXT_KEY, |
| 15 | +} from "@smithy/types"; |
| 16 | + |
| 17 | +import { DeleteOpsItemRequest, DeleteOpsItemResponse } from "../models/models_0"; |
| 18 | +import { de_DeleteOpsItemCommand, se_DeleteOpsItemCommand } from "../protocols/Aws_json1_1"; |
| 19 | +import { ServiceInputTypes, ServiceOutputTypes, SSMClientResolvedConfig } from "../SSMClient"; |
| 20 | + |
| 21 | +/** |
| 22 | + * @public |
| 23 | + */ |
| 24 | +export { __MetadataBearer, $Command }; |
| 25 | +/** |
| 26 | + * @public |
| 27 | + * |
| 28 | + * The input for {@link DeleteOpsItemCommand}. |
| 29 | + */ |
| 30 | +export interface DeleteOpsItemCommandInput extends DeleteOpsItemRequest {} |
| 31 | +/** |
| 32 | + * @public |
| 33 | + * |
| 34 | + * The output of {@link DeleteOpsItemCommand}. |
| 35 | + */ |
| 36 | +export interface DeleteOpsItemCommandOutput extends DeleteOpsItemResponse, __MetadataBearer {} |
| 37 | + |
| 38 | +/** |
| 39 | + * @public |
| 40 | + * <p>Delete an OpsItem. You must have permission in Identity and Access Management (IAM) to |
| 41 | + * delete an OpsItem. </p> |
| 42 | + * <important> |
| 43 | + * <p>Note the following important information about this operation.</p> |
| 44 | + * <ul> |
| 45 | + * <li> |
| 46 | + * <p>Deleting an OpsItem is irreversible. You can't restore a deleted OpsItem.</p> |
| 47 | + * </li> |
| 48 | + * <li> |
| 49 | + * <p>This operation uses an <i>eventual consistency model</i>, which means the |
| 50 | + * system can take a few minutes to complete this operation. If you delete an OpsItem and |
| 51 | + * immediately call, for example, <a>GetOpsItem</a>, the deleted OpsItem might still |
| 52 | + * appear in the response. </p> |
| 53 | + * </li> |
| 54 | + * <li> |
| 55 | + * <p>This operation is idempotent. The system doesn't throw an exception if you repeatedly |
| 56 | + * call this operation for the same OpsItem. If the first call is successful, all additional calls |
| 57 | + * return the same successful response as the first call.</p> |
| 58 | + * </li> |
| 59 | + * <li> |
| 60 | + * <p>This operation doesn't support cross-account calls. A delegated administrator or |
| 61 | + * management account can't delete OpsItems in other accounts, even if OpsCenter has been set up for |
| 62 | + * cross-account administration. For more information about cross-account administration, see |
| 63 | + * <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setting-up-cross-account.html">Setting up |
| 64 | + * OpsCenter to centrally manage OpsItems across accounts</a> in the <i>Systems Manager User Guide</i>.</p> |
| 65 | + * </li> |
| 66 | + * </ul> |
| 67 | + * </important> |
| 68 | + * @example |
| 69 | + * Use a bare-bones client and the command you need to make an API call. |
| 70 | + * ```javascript |
| 71 | + * import { SSMClient, DeleteOpsItemCommand } from "@aws-sdk/client-ssm"; // ES Modules import |
| 72 | + * // const { SSMClient, DeleteOpsItemCommand } = require("@aws-sdk/client-ssm"); // CommonJS import |
| 73 | + * const client = new SSMClient(config); |
| 74 | + * const input = { // DeleteOpsItemRequest |
| 75 | + * OpsItemId: "STRING_VALUE", // required |
| 76 | + * }; |
| 77 | + * const command = new DeleteOpsItemCommand(input); |
| 78 | + * const response = await client.send(command); |
| 79 | + * // {}; |
| 80 | + * |
| 81 | + * ``` |
| 82 | + * |
| 83 | + * @param DeleteOpsItemCommandInput - {@link DeleteOpsItemCommandInput} |
| 84 | + * @returns {@link DeleteOpsItemCommandOutput} |
| 85 | + * @see {@link DeleteOpsItemCommandInput} for command's `input` shape. |
| 86 | + * @see {@link DeleteOpsItemCommandOutput} for command's `response` shape. |
| 87 | + * @see {@link SSMClientResolvedConfig | config} for SSMClient's `config` shape. |
| 88 | + * |
| 89 | + * @throws {@link InternalServerError} (server fault) |
| 90 | + * <p>An error occurred on the server side.</p> |
| 91 | + * |
| 92 | + * @throws {@link OpsItemInvalidParameterException} (client fault) |
| 93 | + * <p>A specified parameter argument isn't valid. Verify the available arguments and try |
| 94 | + * again.</p> |
| 95 | + * |
| 96 | + * @throws {@link SSMServiceException} |
| 97 | + * <p>Base exception class for all service exceptions from SSM service.</p> |
| 98 | + * |
| 99 | + */ |
| 100 | +export class DeleteOpsItemCommand extends $Command< |
| 101 | + DeleteOpsItemCommandInput, |
| 102 | + DeleteOpsItemCommandOutput, |
| 103 | + SSMClientResolvedConfig |
| 104 | +> { |
| 105 | + // Start section: command_properties |
| 106 | + // End section: command_properties |
| 107 | + |
| 108 | + public static getEndpointParameterInstructions(): EndpointParameterInstructions { |
| 109 | + return { |
| 110 | + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, |
| 111 | + Endpoint: { type: "builtInParams", name: "endpoint" }, |
| 112 | + Region: { type: "builtInParams", name: "region" }, |
| 113 | + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, |
| 114 | + }; |
| 115 | + } |
| 116 | + |
| 117 | + /** |
| 118 | + * @public |
| 119 | + */ |
| 120 | + constructor(readonly input: DeleteOpsItemCommandInput) { |
| 121 | + // Start section: command_constructor |
| 122 | + super(); |
| 123 | + // End section: command_constructor |
| 124 | + } |
| 125 | + |
| 126 | + /** |
| 127 | + * @internal |
| 128 | + */ |
| 129 | + resolveMiddleware( |
| 130 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 131 | + configuration: SSMClientResolvedConfig, |
| 132 | + options?: __HttpHandlerOptions |
| 133 | + ): Handler<DeleteOpsItemCommandInput, DeleteOpsItemCommandOutput> { |
| 134 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 135 | + this.middlewareStack.use(getEndpointPlugin(configuration, DeleteOpsItemCommand.getEndpointParameterInstructions())); |
| 136 | + |
| 137 | + const stack = clientStack.concat(this.middlewareStack); |
| 138 | + |
| 139 | + const { logger } = configuration; |
| 140 | + const clientName = "SSMClient"; |
| 141 | + const commandName = "DeleteOpsItemCommand"; |
| 142 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 143 | + logger, |
| 144 | + clientName, |
| 145 | + commandName, |
| 146 | + inputFilterSensitiveLog: (_: any) => _, |
| 147 | + outputFilterSensitiveLog: (_: any) => _, |
| 148 | + [SMITHY_CONTEXT_KEY]: { |
| 149 | + service: "AmazonSSM", |
| 150 | + operation: "DeleteOpsItem", |
| 151 | + }, |
| 152 | + }; |
| 153 | + const { requestHandler } = configuration; |
| 154 | + return stack.resolve( |
| 155 | + (request: FinalizeHandlerArguments<any>) => |
| 156 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 157 | + handlerExecutionContext |
| 158 | + ); |
| 159 | + } |
| 160 | + |
| 161 | + /** |
| 162 | + * @internal |
| 163 | + */ |
| 164 | + private serialize(input: DeleteOpsItemCommandInput, context: __SerdeContext): Promise<__HttpRequest> { |
| 165 | + return se_DeleteOpsItemCommand(input, context); |
| 166 | + } |
| 167 | + |
| 168 | + /** |
| 169 | + * @internal |
| 170 | + */ |
| 171 | + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DeleteOpsItemCommandOutput> { |
| 172 | + return de_DeleteOpsItemCommand(output, context); |
| 173 | + } |
| 174 | + |
| 175 | + // Start section: command_body_extra |
| 176 | + // End section: command_body_extra |
| 177 | +} |
0 commit comments