Skip to content

update_control async

update_control(
    control_id: UUID,
    name: ControlName,
    control_mapping_sources: ControlMappingSources,
    *,
    config_overrides: Optional[AsyncAuditManagerClientConfig] = None,
    description: Optional[ControlDescription] = None,
    testing_information: Optional[TestingInformation] = None,
    action_plan_title: Optional[ActionPlanTitle] = None,
    action_plan_instructions: Optional[ActionPlanInstructions] = None,
) -> UpdateControlResponse

Updates a custom control in Audit Manager.

Parameters:

  • control_id (UUID) –

    The identifier for the control.

  • name (ControlName) –

    The name of the updated control.

  • description (Optional[ControlDescription], default: None ) –

    The optional description of the control.

  • testing_information (Optional[TestingInformation], default: None ) –

    The steps that you should follow to determine if the control is met.

  • action_plan_title (Optional[ActionPlanTitle], default: None ) –

    The title of the action plan for remediating the control.

  • action_plan_instructions (Optional[ActionPlanInstructions], default: None ) –

    The recommended actions to carry out if the control isn't fulfilled.

  • control_mapping_sources (ControlMappingSources) –

    The data mapping sources for the control.

Raises:

  • AccessDeniedException –

    Your account isn't registered with Audit Manager. Check the delegated administrator setup on the Audit Manager settings page, and try again.

  • InternalServerException –

    An internal service error occurred during the processing of your request. Try again later.

  • ResourceNotFoundException –

    The resource that's specified in the request can't be found.

  • ValidationException –

    The request has invalid or missing parameters.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_auditmanager/_services/async_audit_manager.py
async def update_control(
    self,
    control_id: "capo_auditmanager.types.uuid.UUID",
    name: "capo_auditmanager.types.control_name.ControlName",
    control_mapping_sources: "capo_auditmanager.types.control_mapping_sources.ControlMappingSources",
    *,
    config_overrides: Optional[AsyncAuditManagerClientConfig] = None,
    description: Optional[
        "capo_auditmanager.types.control_description.ControlDescription"
    ] = None,
    testing_information: Optional[
        "capo_auditmanager.types.testing_information.TestingInformation"
    ] = None,
    action_plan_title: Optional[
        "capo_auditmanager.types.action_plan_title.ActionPlanTitle"
    ] = None,
    action_plan_instructions: Optional[
        "capo_auditmanager.types.action_plan_instructions.ActionPlanInstructions"
    ] = None,
) -> "capo_auditmanager.types.update_control_response.UpdateControlResponse":
    """<p> Updates a custom control in Audit Manager. </p>

    Args:
        control_id: <p> The identifier for the control. </p>
        name: <p> The name of the updated control. </p>
        description: <p> The optional description of the control. </p>
        testing_information: <p> The steps that you should follow to determine if the control is met. </p>
        action_plan_title: <p> The title of the action plan for remediating the control. </p>
        action_plan_instructions: <p> The recommended actions to carry out if the control isn't fulfilled. </p>
        control_mapping_sources: <p> The data mapping sources for the control. </p>

    Raises:
        capo_auditmanager.errors.access_denied_exception.AccessDeniedException: <p> Your account isn't registered with Audit Manager. Check the delegated administrator setup on the Audit Manager settings page, and try again. </p>
        capo_auditmanager.errors.internal_server_exception.InternalServerException: <p> An internal service error occurred during the processing of your request. Try again later. </p>
        capo_auditmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource that's specified in the request can't be found. </p>
        capo_auditmanager.errors.validation_exception.ValidationException: <p> The request has invalid or missing parameters. </p>
        capo_auditmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_auditmanager.types.update_control_request.UpdateControlRequest]",
    ) -> AsyncOperationResponse[
        "capo_auditmanager.types.update_control_response.UpdateControlResponse"
    ]:
        import capo_auditmanager._operations.bedrock_assessment_manager_lambda.update_control

        (
            output,
            http_response,
        ) = await capo_auditmanager._operations.bedrock_assessment_manager_lambda.update_control.async_update_control(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_auditmanager.types.update_control_request.UpdateControlRequest",
    ) -> dict[str, Any]:
        import capo_auditmanager.types.update_control_request

        return capo_auditmanager.types.update_control_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_auditmanager.types.update_control_response.UpdateControlResponse",
    ) -> dict[str, Any]:
        import capo_auditmanager.types.update_control_response

        return capo_auditmanager.types.update_control_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateControl",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_auditmanager.types.update_control_request.UpdateControlRequest = {
        "control_id": control_id,
        "name": name,
        "control_mapping_sources": control_mapping_sources,
    }
    if description is not None:
        input_["description"] = description
    if testing_information is not None:
        input_["testing_information"] = testing_information
    if action_plan_title is not None:
        input_["action_plan_title"] = action_plan_title
    if action_plan_instructions is not None:
        input_["action_plan_instructions"] = action_plan_instructions

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output