Creates or replaces the caller's Well-Architected Agent preferences. Each supplied update sets the desired state of one preference. Preferences not named in the request are left unchanged. Enabling or disabling is performed synchronously, so a failure to reach the requested state is returned as a modeled exception rather than a FAILED status. On success the operation returns an empty response. Call GetAgentPreferences to read the resulting state. The account the preferences belong to is inferred from the caller's authorization context.
Parameters:
-
preferences
(PreferenceUpdates)
–
Preference updates to apply. A given preference key may appear at most once.
Raises:
Source code in docs_src/capo_wellarchitected/_services/async_well_architected.py
| async def put_agent_preferences(
self,
preferences: "capo_wellarchitected.types.preference_updates.PreferenceUpdates",
*,
config_overrides: Optional[AsyncWellArchitectedClientConfig] = None,
) -> "capo_wellarchitected.types.put_agent_preferences_response.PutAgentPreferencesResponse":
"""<p>Creates or replaces the caller's Well-Architected Agent preferences. Each supplied update sets the desired state of one preference. Preferences not named in the request are left unchanged. Enabling or disabling is performed synchronously, so a failure to reach the requested state is returned as a modeled exception rather than a FAILED status. On success the operation returns an empty response. Call GetAgentPreferences to read the resulting state. The account the preferences belong to is inferred from the caller's authorization context.</p>
Args:
preferences: <p>Preference updates to apply. A given preference key may appear at most once.</p>
Raises:
capo_wellarchitected.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
capo_wellarchitected.errors.conflict_exception.ConflictException: <p>The resource has already been processed, was deleted, or is too large.</p>
capo_wellarchitected.errors.internal_server_exception.InternalServerException: <p>There is a problem with the Well-Architected Tool API service.</p>
capo_wellarchitected.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
capo_wellarchitected.errors.validation_exception.ValidationException: <p>The user input is not valid.</p>
capo_wellarchitected.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_wellarchitected.types.put_agent_preferences_request.PutAgentPreferencesRequest]",
) -> AsyncOperationResponse[
"capo_wellarchitected.types.put_agent_preferences_response.PutAgentPreferencesResponse"
]:
import capo_wellarchitected._operations.well_architected_api_service_lambda.put_agent_preferences
(
output,
http_response,
) = await capo_wellarchitected._operations.well_architected_api_service_lambda.put_agent_preferences.async_put_agent_preferences(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutAgentPreferences")
)
input_: capo_wellarchitected.types.put_agent_preferences_request.PutAgentPreferencesRequest = {
"preferences": preferences
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|