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/cost_optimization_hub.py
| def get_preferences(
self, *, config_overrides: Optional[CostOptimizationHubClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_cost_optimization_hub.types.get_preferences_request.GetPreferencesRequest]",
) -> OperationResponse[
"capo_cost_optimization_hub.types.get_preferences_response.GetPreferencesResponse"
]:
import capo_cost_optimization_hub._operations.cost_optimization_hub_service.get_preferences
output, http_response = (
capo_cost_optimization_hub._operations.cost_optimization_hub_service.get_preferences.get_preferences(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|