Skip to content

update_bot

update_bot(
    network_id: NetworkId,
    bot_id: BotId,
    *,
    config_overrides: Optional[WickrClientConfig] = None,
    display_name: Optional[GenericString] = None,
    group_id: Optional[GenericString] = None,
    challenge: Optional[SensitiveString] = None,
    suspend: Optional[bool] = None,
) -> UpdateBotResponse

Updates the properties of an existing bot in a Wickr network. This operation allows you to modify the bot's display name, security group, password, or suspension status.

Parameters:

  • network_id (NetworkId) –

    The ID of the Wickr network containing the bot to update.

  • bot_id (BotId) –

    The unique identifier of the bot to update.

  • display_name (Optional[GenericString], default: None ) –

    The new display name for the bot.

  • group_id (Optional[GenericString], default: None ) –

    The ID of the new security group to assign the bot to.

  • challenge (Optional[SensitiveString], default: None ) –

    The new password for the bot account.

  • suspend (Optional[bool], default: None ) –

    Set to true to suspend the bot or false to unsuspend it. Omit this field for standard updates that don't affect suspension status.

Raises:

  • BadRequestError –

    The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.

  • ForbiddenError –

    Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.

  • InternalServerError –

    An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.

  • RateLimitError –

    The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.

  • ResourceNotFoundError –

    The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.

  • UnauthorizedError –

    The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.

  • ValidationError –

    One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.

  • UnknownServiceError –

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

Examples:

Update bot successfully

>>> client.update_bot(network_id='12345678', bot_id='98765', display_name='Updated Support Bot', group_id='support_group')
Update bot - bot not found
>>> client.update_bot(network_id='12345678', bot_id='99999', display_name='Updated Bot')
Source code in docs_src/capo_wickr/_services/wickr.py
def update_bot(
    self,
    network_id: "capo_wickr.types.network_id.NetworkId",
    bot_id: "capo_wickr.types.bot_id.BotId",
    *,
    config_overrides: Optional[WickrClientConfig] = None,
    display_name: Optional["capo_wickr.types.generic_string.GenericString"] = None,
    group_id: Optional["capo_wickr.types.generic_string.GenericString"] = None,
    challenge: Optional["capo_wickr.types.sensitive_string.SensitiveString"] = None,
    suspend: Optional[bool] = None,
) -> "capo_wickr.types.update_bot_response.UpdateBotResponse":
    """<p>Updates the properties of an existing bot in a Wickr network. This operation allows you to modify the bot's display name, security group, password, or suspension status.</p>

    Args:
        network_id: <p>The ID of the Wickr network containing the bot to update.</p>
        bot_id: <p>The unique identifier of the bot to update.</p>
        display_name: <p>The new display name for the bot.</p>
        group_id: <p>The ID of the new security group to assign the bot to.</p>
        challenge: <p>The new password for the bot account.</p>
        suspend: <p>Set to true to suspend the bot or false to unsuspend it. Omit this field for standard updates that don't affect suspension status.</p>

    Raises:
        capo_wickr.errors.bad_request_error.BadRequestError: <p>The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.</p>
        capo_wickr.errors.forbidden_error.ForbiddenError: <p>Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.</p>
        capo_wickr.errors.internal_server_error.InternalServerError: <p>An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.</p>
        capo_wickr.errors.rate_limit_error.RateLimitError: <p>The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.</p>
        capo_wickr.errors.resource_not_found_error.ResourceNotFoundError: <p>The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.</p>
        capo_wickr.errors.unauthorized_error.UnauthorizedError: <p>The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.</p>
        capo_wickr.errors.validation_error.ValidationError: <p>One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.</p>
        capo_wickr.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Update bot successfully

        >>> client.update_bot(network_id='12345678', bot_id='98765', display_name='Updated Support Bot', group_id='support_group')
        Update bot - bot not found

        >>> client.update_bot(network_id='12345678', bot_id='99999', display_name='Updated Bot')
    """

    def _handler(
        req: "OperationRequest[capo_wickr.types.update_bot_request.UpdateBotRequest]",
    ) -> OperationResponse[
        "capo_wickr.types.update_bot_response.UpdateBotResponse"
    ]:
        import capo_wickr._operations.wickr_admin_api.update_bot

        output, http_response = (
            capo_wickr._operations.wickr_admin_api.update_bot.update_bot(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_wickr.types.update_bot_request.UpdateBotRequest",
    ) -> dict[str, Any]:
        import capo_wickr.types.update_bot_request

        return capo_wickr.types.update_bot_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateBot", redact_input=_redact_input)
    )
    input_: capo_wickr.types.update_bot_request.UpdateBotRequest = {
        "network_id": network_id,
        "bot_id": bot_id,
    }
    if display_name is not None:
        input_["display_name"] = display_name
    if group_id is not None:
        input_["group_id"] = group_id
    if challenge is not None:
        input_["challenge"] = challenge
    if suspend is not None:
        input_["suspend"] = suspend

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