Get a specific Recommendation. This API provides global recommendations, eliminating the need to call the API in each AWS Region.
Parameters:
Raises:
Examples:
Get a Recommendation by ARN
>>> await client.get_recommendation(recommendation_identifier='arn:aws:trustedadvisor::000000000000:recommendation/55fa4d2e-bbb7-491a-833b-5773e9589578')
Source code in docs_src/capo_trustedadvisor/_services/async_trusted_advisor.py
| async def get_recommendation(
self,
recommendation_identifier: "capo_trustedadvisor.types.account_recommendation_identifier.AccountRecommendationIdentifier",
*,
config_overrides: Optional[AsyncTrustedAdvisorClientConfig] = None,
language: Optional[
"capo_trustedadvisor.types.recommendation_language.RecommendationLanguage"
] = None,
) -> "capo_trustedadvisor.types.get_recommendation_response.GetRecommendationResponse":
"""<p>Get a specific Recommendation. This API provides global recommendations, eliminating the need to call the API in each AWS Region.</p>
Args:
recommendation_identifier: <p>The Recommendation identifier</p>
language: <p>The ISO 639-1 code for the language that you want your recommendations to appear in.</p>
Raises:
capo_trustedadvisor.errors.access_denied_exception.AccessDeniedException: <p>Exception that access has been denied due to insufficient access</p>
capo_trustedadvisor.errors.internal_server_exception.InternalServerException: <p>Exception to notify that an unexpected internal error occurred during processing of the request</p>
capo_trustedadvisor.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception that the requested resource has not been found</p>
capo_trustedadvisor.errors.throttling_exception.ThrottlingException: <p>Exception to notify that requests are being throttled</p>
capo_trustedadvisor.errors.validation_exception.ValidationException: <p>Exception that the request failed to satisfy service constraints</p>
capo_trustedadvisor.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Get a Recommendation by ARN
>>> await client.get_recommendation(recommendation_identifier='arn:aws:trustedadvisor::000000000000:recommendation/55fa4d2e-bbb7-491a-833b-5773e9589578')
"""
async def _handler(
req: "AsyncOperationRequest[capo_trustedadvisor.types.get_recommendation_request.GetRecommendationRequest]",
) -> AsyncOperationResponse[
"capo_trustedadvisor.types.get_recommendation_response.GetRecommendationResponse"
]:
import capo_trustedadvisor._operations.trusted_advisor.get_recommendation
(
output,
http_response,
) = await capo_trustedadvisor._operations.trusted_advisor.get_recommendation.async_get_recommendation(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_trustedadvisor.types.get_recommendation_response.GetRecommendationResponse",
) -> dict[str, Any]:
import capo_trustedadvisor.types.get_recommendation_response
return (
capo_trustedadvisor.types.get_recommendation_response.redact_sensitive(
output
)
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("GetRecommendation", redact_output=_redact_output),
)
input_: capo_trustedadvisor.types.get_recommendation_request.GetRecommendationRequest = {
"recommendation_identifier": recommendation_identifier
}
if language is not None:
input_["language"] = language
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|