-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-rbin): This release adds support for Rule Lock for Recycl…
…e Bin, which allows you to lock retention rules so that they can no longer be modified or deleted.
- Loading branch information
awstools
committed
Nov 23, 2022
1 parent
b6cf732
commit cf212da
Showing
11 changed files
with
1,690 additions
and
312 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
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,108 @@ | ||
// smithy-typescript generated code | ||
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; | ||
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 { | ||
LockRuleRequest, | ||
LockRuleRequestFilterSensitiveLog, | ||
LockRuleResponse, | ||
LockRuleResponseFilterSensitiveLog, | ||
} from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1LockRuleCommand, | ||
serializeAws_restJson1LockRuleCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
import { RbinClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RbinClient"; | ||
|
||
export interface LockRuleCommandInput extends LockRuleRequest {} | ||
export interface LockRuleCommandOutput extends LockRuleResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Locks a retention rule. A locked retention rule can't be modified or deleted.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { RbinClient, LockRuleCommand } from "@aws-sdk/client-rbin"; // ES Modules import | ||
* // const { RbinClient, LockRuleCommand } = require("@aws-sdk/client-rbin"); // CommonJS import | ||
* const client = new RbinClient(config); | ||
* const command = new LockRuleCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link LockRuleCommandInput} for command's `input` shape. | ||
* @see {@link LockRuleCommandOutput} for command's `response` shape. | ||
* @see {@link RbinClientResolvedConfig | config} for RbinClient's `config` shape. | ||
* | ||
*/ | ||
export class LockRuleCommand extends $Command<LockRuleCommandInput, LockRuleCommandOutput, RbinClientResolvedConfig> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
public static getEndpointParameterInstructions(): EndpointParameterInstructions { | ||
return { | ||
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, | ||
Endpoint: { type: "builtInParams", name: "endpoint" }, | ||
Region: { type: "builtInParams", name: "region" }, | ||
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, | ||
}; | ||
} | ||
|
||
constructor(readonly input: LockRuleCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: RbinClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<LockRuleCommandInput, LockRuleCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
this.middlewareStack.use(getEndpointPlugin(configuration, LockRuleCommand.getEndpointParameterInstructions())); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "RbinClient"; | ||
const commandName = "LockRuleCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: LockRuleRequestFilterSensitiveLog, | ||
outputFilterSensitiveLog: LockRuleResponseFilterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: LockRuleCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1LockRuleCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<LockRuleCommandOutput> { | ||
return deserializeAws_restJson1LockRuleCommand(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
// smithy-typescript generated code | ||
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; | ||
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 { | ||
UnlockRuleRequest, | ||
UnlockRuleRequestFilterSensitiveLog, | ||
UnlockRuleResponse, | ||
UnlockRuleResponseFilterSensitiveLog, | ||
} from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1UnlockRuleCommand, | ||
serializeAws_restJson1UnlockRuleCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
import { RbinClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RbinClient"; | ||
|
||
export interface UnlockRuleCommandInput extends UnlockRuleRequest {} | ||
export interface UnlockRuleCommandOutput extends UnlockRuleResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Unlocks a retention rule. After a retention rule is unlocked, it can be modified or deleted | ||
* only after the unlock delay period expires.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { RbinClient, UnlockRuleCommand } from "@aws-sdk/client-rbin"; // ES Modules import | ||
* // const { RbinClient, UnlockRuleCommand } = require("@aws-sdk/client-rbin"); // CommonJS import | ||
* const client = new RbinClient(config); | ||
* const command = new UnlockRuleCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link UnlockRuleCommandInput} for command's `input` shape. | ||
* @see {@link UnlockRuleCommandOutput} for command's `response` shape. | ||
* @see {@link RbinClientResolvedConfig | config} for RbinClient's `config` shape. | ||
* | ||
*/ | ||
export class UnlockRuleCommand extends $Command< | ||
UnlockRuleCommandInput, | ||
UnlockRuleCommandOutput, | ||
RbinClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
public static getEndpointParameterInstructions(): EndpointParameterInstructions { | ||
return { | ||
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, | ||
Endpoint: { type: "builtInParams", name: "endpoint" }, | ||
Region: { type: "builtInParams", name: "region" }, | ||
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, | ||
}; | ||
} | ||
|
||
constructor(readonly input: UnlockRuleCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: RbinClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<UnlockRuleCommandInput, UnlockRuleCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
this.middlewareStack.use(getEndpointPlugin(configuration, UnlockRuleCommand.getEndpointParameterInstructions())); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "RbinClient"; | ||
const commandName = "UnlockRuleCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: UnlockRuleRequestFilterSensitiveLog, | ||
outputFilterSensitiveLog: UnlockRuleResponseFilterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: UnlockRuleCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1UnlockRuleCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UnlockRuleCommandOutput> { | ||
return deserializeAws_restJson1UnlockRuleCommand(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
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.