Returns a set of preferences for an account in order to add account-specific preferences into the service. These preferences impact how the savings associated with recommendations are presented—estimated savings after discounts or estimated savings before discounts, for example.
Raises:
Source code in docs_src/capo_cost_optimization_hub/_services/async_cost_optimization_hub.py
| async def get_preferences(
self, *, config_overrides: Optional[AsyncCostOptimizationHubClientConfig] = None
) -> "capo_cost_optimization_hub.types.get_preferences_response.GetPreferencesResponse":
"""<p>Returns a set of preferences for an account in order to add account-specific preferences into the service. These preferences impact how the savings associated with recommendations are presented—estimated savings after discounts or estimated savings before discounts, for example.</p>
Raises:
capo_cost_optimization_hub.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to use this operation with the given parameters.</p>
capo_cost_optimization_hub.errors.internal_server_exception.InternalServerException: <p>An error on the server occurred during the processing of your request. Try again later.</p>
capo_cost_optimization_hub.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_cost_optimization_hub.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_cost_optimization_hub.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cost_optimization_hub.types.get_preferences_request.GetPreferencesRequest]",
) -> AsyncOperationResponse[
"capo_cost_optimization_hub.types.get_preferences_response.GetPreferencesResponse"
]:
import capo_cost_optimization_hub._operations.cost_optimization_hub_service.get_preferences
(
output,
http_response,
) = await capo_cost_optimization_hub._operations.cost_optimization_hub_service.get_preferences.async_get_preferences(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetPreferences")
)
input_: capo_cost_optimization_hub.types.get_preferences_request.GetPreferencesRequest = {}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|