Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-route53-recovery-control-config): Adds permissions for Ge…
…tResourcePolicy to support returning details about AWS Resource Access Manager resource policies for shared resources.
- Loading branch information
awstools
committed
Oct 17, 2023
1 parent
c5617b0
commit 81747e4
Showing
24 changed files
with
491 additions
and
43 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
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
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
157 changes: 157 additions & 0 deletions
157
clients/client-route53-recovery-control-config/src/commands/GetResourcePolicyCommand.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,157 @@ | ||
// smithy-typescript generated code | ||
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; | ||
import { getSerdePlugin } from "@smithy/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; | ||
import { Command as $Command } from "@smithy/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
SMITHY_CONTEXT_KEY, | ||
} from "@smithy/types"; | ||
|
||
import { GetResourcePolicyRequest, GetResourcePolicyResponse } from "../models/models_0"; | ||
import { de_GetResourcePolicyCommand, se_GetResourcePolicyCommand } from "../protocols/Aws_restJson1"; | ||
import { | ||
Route53RecoveryControlConfigClientResolvedConfig, | ||
ServiceInputTypes, | ||
ServiceOutputTypes, | ||
} from "../Route53RecoveryControlConfigClient"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link GetResourcePolicyCommand}. | ||
*/ | ||
export interface GetResourcePolicyCommandInput extends GetResourcePolicyRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link GetResourcePolicyCommand}. | ||
*/ | ||
export interface GetResourcePolicyCommandOutput extends GetResourcePolicyResponse, __MetadataBearer {} | ||
|
||
/** | ||
* @public | ||
* <p>Get information about the resource policy for a cluster.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { Route53RecoveryControlConfigClient, GetResourcePolicyCommand } from "@aws-sdk/client-route53-recovery-control-config"; // ES Modules import | ||
* // const { Route53RecoveryControlConfigClient, GetResourcePolicyCommand } = require("@aws-sdk/client-route53-recovery-control-config"); // CommonJS import | ||
* const client = new Route53RecoveryControlConfigClient(config); | ||
* const input = { // GetResourcePolicyRequest | ||
* ResourceArn: "STRING_VALUE", // required | ||
* }; | ||
* const command = new GetResourcePolicyCommand(input); | ||
* const response = await client.send(command); | ||
* // { // GetResourcePolicyResponse | ||
* // Policy: "STRING_VALUE", | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param GetResourcePolicyCommandInput - {@link GetResourcePolicyCommandInput} | ||
* @returns {@link GetResourcePolicyCommandOutput} | ||
* @see {@link GetResourcePolicyCommandInput} for command's `input` shape. | ||
* @see {@link GetResourcePolicyCommandOutput} for command's `response` shape. | ||
* @see {@link Route53RecoveryControlConfigClientResolvedConfig | config} for Route53RecoveryControlConfigClient's `config` shape. | ||
* | ||
* @throws {@link InternalServerException} (server fault) | ||
* <p>500 response - InternalServiceError. Temporary service error. Retry the request.</p> | ||
* | ||
* @throws {@link ResourceNotFoundException} (client fault) | ||
* <p>404 response - MalformedQueryString. The query string contains a syntax error or resource not found.</p> | ||
* | ||
* @throws {@link Route53RecoveryControlConfigServiceException} | ||
* <p>Base exception class for all service exceptions from Route53RecoveryControlConfig service.</p> | ||
* | ||
*/ | ||
export class GetResourcePolicyCommand extends $Command< | ||
GetResourcePolicyCommandInput, | ||
GetResourcePolicyCommandOutput, | ||
Route53RecoveryControlConfigClientResolvedConfig | ||
> { | ||
// 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" }, | ||
}; | ||
} | ||
|
||
/** | ||
* @public | ||
*/ | ||
constructor(readonly input: GetResourcePolicyCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: Route53RecoveryControlConfigClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<GetResourcePolicyCommandInput, GetResourcePolicyCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
this.middlewareStack.use( | ||
getEndpointPlugin(configuration, GetResourcePolicyCommand.getEndpointParameterInstructions()) | ||
); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "Route53RecoveryControlConfigClient"; | ||
const commandName = "GetResourcePolicyCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: (_: any) => _, | ||
outputFilterSensitiveLog: (_: any) => _, | ||
[SMITHY_CONTEXT_KEY]: { | ||
service: "Route53RecoveryControlConfig", | ||
operation: "GetResourcePolicy", | ||
}, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private serialize(input: GetResourcePolicyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return se_GetResourcePolicyCommand(input, context); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetResourcePolicyCommandOutput> { | ||
return de_GetResourcePolicyCommand(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
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.