Skip to content

update_agent

update_agent(
    agent_id: AgentId,
    aws_account_id: AwsAccountId,
    name: AgentName,
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    description: Optional[AgentDescription] = None,
    icon_id: Optional[IconId] = None,
    starter_prompts: Optional[StarterPromptList] = None,
    welcome_message: Optional[WelcomeMessage] = None,
    custom_prompt_input: Optional[CustomPromptInput] = None,
    spaces_to_add: Optional[UpdateAgentRequestSpacesToAddList] = None,
    spaces_to_remove: Optional[UpdateAgentRequestSpacesToRemoveList] = None,
    action_connectors_to_add: Optional[
        UpdateAgentRequestActionConnectorsToAddList
    ] = None,
    action_connectors_to_remove: Optional[
        UpdateAgentRequestActionConnectorsToRemoveList
    ] = None,
) -> UpdateAgentResponse

Updates an existing agent.

Parameters:

Raises:

Source code in docs_src/capo_quicksight/_services/quick_sight.py
def update_agent(
    self,
    agent_id: "capo_quicksight.types.agent_id.AgentId",
    aws_account_id: "capo_quicksight.types.aws_account_id.AwsAccountId",
    name: "capo_quicksight.types.agent_name.AgentName",
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    description: Optional[
        "capo_quicksight.types.agent_description.AgentDescription"
    ] = None,
    icon_id: Optional["capo_quicksight.types.icon_id.IconId"] = None,
    starter_prompts: Optional[
        "capo_quicksight.types.starter_prompt_list.StarterPromptList"
    ] = None,
    welcome_message: Optional[
        "capo_quicksight.types.welcome_message.WelcomeMessage"
    ] = None,
    custom_prompt_input: Optional[
        "capo_quicksight.types.custom_prompt_input.CustomPromptInput"
    ] = None,
    spaces_to_add: Optional[
        "capo_quicksight.types.update_agent_request_spaces_to_add_list.UpdateAgentRequestSpacesToAddList"
    ] = None,
    spaces_to_remove: Optional[
        "capo_quicksight.types.update_agent_request_spaces_to_remove_list.UpdateAgentRequestSpacesToRemoveList"
    ] = None,
    action_connectors_to_add: Optional[
        "capo_quicksight.types.update_agent_request_action_connectors_to_add_list.UpdateAgentRequestActionConnectorsToAddList"
    ] = None,
    action_connectors_to_remove: Optional[
        "capo_quicksight.types.update_agent_request_action_connectors_to_remove_list.UpdateAgentRequestActionConnectorsToRemoveList"
    ] = None,
) -> "capo_quicksight.types.update_agent_response.UpdateAgentResponse":
    """<p>Updates an existing agent.</p>

    Args:
        agent_id: <p>The unique identifier for the agent to update.</p>
        aws_account_id: <p>The ID of the Amazon Web Services account that contains the agent.</p>
        name: <p>The name of the agent.</p>
        description: <p>A description of the agent.</p>
        icon_id: <p>The icon identifier for the agent.</p>
        starter_prompts: <p>A list of starter prompts that are displayed to users when they begin interacting with the agent.</p>
        welcome_message: <p>The welcome message that is displayed when a user starts a conversation with the agent.</p>
        custom_prompt_input: <p>The custom prompt configuration for the agent.</p>
        spaces_to_add: <p>The Amazon Resource Names (ARNs) of the spaces to attach to the agent.</p>
        spaces_to_remove: <p>The Amazon Resource Names (ARNs) of the spaces to detach from the agent.</p>
        action_connectors_to_add: <p>The Amazon Resource Names (ARNs) of the action connectors to attach to the agent.</p>
        action_connectors_to_remove: <p>The Amazon Resource Names (ARNs) of the action connectors to detach from the agent.</p>

    Raises:
        capo_quicksight.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.</p>
        capo_quicksight.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameters has a value that isn't valid.</p>
        capo_quicksight.errors.limit_exceeded_exception.LimitExceededException: <p>A limit is exceeded.</p>
        capo_quicksight.errors.precondition_not_met_exception.PreconditionNotMetException: <p>One or more preconditions aren't met.</p>
        capo_quicksight.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_quicksight.errors.throttling_exception.ThrottlingException: <p>Access is throttled.</p>
        capo_quicksight.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_quicksight.types.update_agent_request.UpdateAgentRequest]",
    ) -> OperationResponse[
        "capo_quicksight.types.update_agent_response.UpdateAgentResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.update_agent

        output, http_response = (
            capo_quicksight._operations.quick_sight_20180401.update_agent.update_agent(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_quicksight.types.update_agent_request.UpdateAgentRequest",
    ) -> dict[str, Any]:
        import capo_quicksight.types.update_agent_request

        return capo_quicksight.types.update_agent_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateAgent", redact_input=_redact_input),
    )
    input_: capo_quicksight.types.update_agent_request.UpdateAgentRequest = {
        "agent_id": agent_id,
        "aws_account_id": aws_account_id,
        "name": name,
    }
    if description is not None:
        input_["description"] = description
    if icon_id is not None:
        input_["icon_id"] = icon_id
    if starter_prompts is not None:
        input_["starter_prompts"] = starter_prompts
    if welcome_message is not None:
        input_["welcome_message"] = welcome_message
    if custom_prompt_input is not None:
        input_["custom_prompt_input"] = custom_prompt_input
    if spaces_to_add is not None:
        input_["spaces_to_add"] = spaces_to_add
    if spaces_to_remove is not None:
        input_["spaces_to_remove"] = spaces_to_remove
    if action_connectors_to_add is not None:
        input_["action_connectors_to_add"] = action_connectors_to_add
    if action_connectors_to_remove is not None:
        input_["action_connectors_to_remove"] = action_connectors_to_remove

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output