Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-inspector2): This release adds support for Inspector V2 s…
…can configurations through the get and update configuration APIs. Currently this allows configuring ECR automated re-scan duration to lifetime or 180 days or 30 days.
- Loading branch information
awstools
committed
Jul 14, 2022
1 parent
f47fa13
commit 36bccb8
Showing
8 changed files
with
954 additions
and
101 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
96 changes: 96 additions & 0 deletions
96
clients/client-inspector2/src/commands/GetConfigurationCommand.ts
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,96 @@ | ||
// smithy-typescript generated code | ||
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 { Inspector2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../Inspector2Client"; | ||
import { GetConfigurationRequest, GetConfigurationResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1GetConfigurationCommand, | ||
serializeAws_restJson1GetConfigurationCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface GetConfigurationCommandInput extends GetConfigurationRequest {} | ||
export interface GetConfigurationCommandOutput extends GetConfigurationResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Retrieves setting configurations for Inspector scans.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { Inspector2Client, GetConfigurationCommand } from "@aws-sdk/client-inspector2"; // ES Modules import | ||
* // const { Inspector2Client, GetConfigurationCommand } = require("@aws-sdk/client-inspector2"); // CommonJS import | ||
* const client = new Inspector2Client(config); | ||
* const command = new GetConfigurationCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link GetConfigurationCommandInput} for command's `input` shape. | ||
* @see {@link GetConfigurationCommandOutput} for command's `response` shape. | ||
* @see {@link Inspector2ClientResolvedConfig | config} for Inspector2Client's `config` shape. | ||
* | ||
*/ | ||
export class GetConfigurationCommand extends $Command< | ||
GetConfigurationCommandInput, | ||
GetConfigurationCommandOutput, | ||
Inspector2ClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: GetConfigurationCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: Inspector2ClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<GetConfigurationCommandInput, GetConfigurationCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "Inspector2Client"; | ||
const commandName = "GetConfigurationCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: GetConfigurationRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: GetConfigurationResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: GetConfigurationCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1GetConfigurationCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetConfigurationCommandOutput> { | ||
return deserializeAws_restJson1GetConfigurationCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
96 changes: 96 additions & 0 deletions
96
clients/client-inspector2/src/commands/UpdateConfigurationCommand.ts
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,96 @@ | ||
// smithy-typescript generated code | ||
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 { Inspector2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../Inspector2Client"; | ||
import { UpdateConfigurationRequest, UpdateConfigurationResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1UpdateConfigurationCommand, | ||
serializeAws_restJson1UpdateConfigurationCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface UpdateConfigurationCommandInput extends UpdateConfigurationRequest {} | ||
export interface UpdateConfigurationCommandOutput extends UpdateConfigurationResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Updates setting configurations for your Amazon Inspector account. When you use this API as an Amazon Inspector delegated administrator this updates the setting for all accounts you manage. Member accounts in an organization cannot update this setting.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { Inspector2Client, UpdateConfigurationCommand } from "@aws-sdk/client-inspector2"; // ES Modules import | ||
* // const { Inspector2Client, UpdateConfigurationCommand } = require("@aws-sdk/client-inspector2"); // CommonJS import | ||
* const client = new Inspector2Client(config); | ||
* const command = new UpdateConfigurationCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link UpdateConfigurationCommandInput} for command's `input` shape. | ||
* @see {@link UpdateConfigurationCommandOutput} for command's `response` shape. | ||
* @see {@link Inspector2ClientResolvedConfig | config} for Inspector2Client's `config` shape. | ||
* | ||
*/ | ||
export class UpdateConfigurationCommand extends $Command< | ||
UpdateConfigurationCommandInput, | ||
UpdateConfigurationCommandOutput, | ||
Inspector2ClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: UpdateConfigurationCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: Inspector2ClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<UpdateConfigurationCommandInput, UpdateConfigurationCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "Inspector2Client"; | ||
const commandName = "UpdateConfigurationCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: UpdateConfigurationRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: UpdateConfigurationResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: UpdateConfigurationCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1UpdateConfigurationCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateConfigurationCommandOutput> { | ||
return deserializeAws_restJson1UpdateConfigurationCommand(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
Oops, something went wrong.