Skip to content

update_notify_code_configuration async

update_notify_code_configuration(
    notify_code_configuration_id: NotifyCodeConfigurationIdOrArn,
    *,
    config_overrides: Optional[AsyncEndUserMessagingClientConfig] = None,
    notify_code_configuration_name: Optional[NotifyCodeConfigurationName] = None,
    code_configuration_parameters: Optional[UpdateCodeConfigurationParameters] = None,
    channel_parameters: Optional[UpdateChannelParameters] = None,
    deletion_protection_enabled: Optional[bool] = None,
) -> UpdateNotifyCodeConfigurationOutput

Updates the mutable fields of a notify code configuration. Only the fields that you supply are changed. For the template and language fields, supplying an empty value clears the currently stored value.

Parameters:

  • notify_code_configuration_id (NotifyCodeConfigurationIdOrArn) –

    The unique identifier of the notify code configuration. You can specify either the bare ID or the full Amazon Resource Name (ARN).

  • notify_code_configuration_name (Optional[NotifyCodeConfigurationName], default: None ) –

    The name of the notify code configuration.

  • code_configuration_parameters (Optional[UpdateCodeConfigurationParameters], default: None ) –

    The updated passcode policy parameters, including the code type, length, validity period, and maximum number of attempts. When you omit a member, its current value is preserved.

  • channel_parameters (Optional[UpdateChannelParameters], default: None ) –

    The updated channel-specific parameters used to render and deliver the one-time passcode. This is a loose, nested update: when you omit a channel, that channel's parameters remain unchanged. Within a supplied channel, an empty string on a string member, or an empty map on the destination-country parameters, clears the currently stored value, and absent members preserve the current value.

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

    Specifies whether deletion protection is enabled. When enabled, the resource cannot be deleted until deletion protection is turned off.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request conflicts with the current state of the resource.

  • InternalServerException –

    An unexpected error occurred during the processing of the request.

  • ResourceNotFoundException –

    The request references a resource that does not exist. Verify that the resource identifier is correct and try your request again.

  • ThrottlingException –

    The request was denied because it exceeded the allowed request rate.

  • ValidationException –

    A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.

  • UnknownServiceError –

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

Examples:

Update a notify code configuration

>>> await client.update_notify_code_configuration(notify_code_configuration_id='ncc-abc12345678901234', code_configuration_parameters={'codeLength': 8, 'validityPeriodMinutes': 15})
Source code in docs_src/capo_endusermessaging/_services/async_end_user_messaging.py
async def update_notify_code_configuration(
    self,
    notify_code_configuration_id: "capo_endusermessaging.types.notify_code_configuration_id_or_arn.NotifyCodeConfigurationIdOrArn",
    *,
    config_overrides: Optional[AsyncEndUserMessagingClientConfig] = None,
    notify_code_configuration_name: Optional[
        "capo_endusermessaging.types.notify_code_configuration_name.NotifyCodeConfigurationName"
    ] = None,
    code_configuration_parameters: Optional[
        "capo_endusermessaging.types.update_code_configuration_parameters.UpdateCodeConfigurationParameters"
    ] = None,
    channel_parameters: Optional[
        "capo_endusermessaging.types.update_channel_parameters.UpdateChannelParameters"
    ] = None,
    deletion_protection_enabled: Optional[bool] = None,
) -> "capo_endusermessaging.types.update_notify_code_configuration_output.UpdateNotifyCodeConfigurationOutput":
    """<p>Updates the mutable fields of a notify code configuration. Only the fields that you supply are changed. For the template and language fields, supplying an empty value clears the currently stored value.</p>

    Args:
        notify_code_configuration_id: <p>The unique identifier of the notify code configuration. You can specify either the bare ID or the full Amazon Resource Name (ARN).</p>
        notify_code_configuration_name: <p>The name of the notify code configuration.</p>
        code_configuration_parameters: <p>The updated passcode policy parameters, including the code type, length, validity period, and maximum number of attempts. When you omit a member, its current value is preserved.</p>
        channel_parameters: <p>The updated channel-specific parameters used to render and deliver the one-time passcode. This is a loose, nested update: when you omit a channel, that channel's parameters remain unchanged. Within a supplied channel, an empty string on a string member, or an empty map on the destination-country parameters, clears the currently stored value, and absent members preserve the current value.</p>
        deletion_protection_enabled: <p>Specifies whether deletion protection is enabled. When enabled, the resource cannot be deleted until deletion protection is turned off.</p>

    Raises:
        capo_endusermessaging.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_endusermessaging.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_endusermessaging.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_endusermessaging.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist. Verify that the resource identifier is correct and try your request again.</p>
        capo_endusermessaging.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded the allowed request rate.</p>
        capo_endusermessaging.errors.validation_exception.ValidationException: A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
        capo_endusermessaging.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Update a notify code configuration

        >>> await client.update_notify_code_configuration(notify_code_configuration_id='ncc-abc12345678901234', code_configuration_parameters={'codeLength': 8, 'validityPeriodMinutes': 15})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_endusermessaging.types.update_notify_code_configuration_input.UpdateNotifyCodeConfigurationInput]",
    ) -> AsyncOperationResponse[
        "capo_endusermessaging.types.update_notify_code_configuration_output.UpdateNotifyCodeConfigurationOutput"
    ]:
        import capo_endusermessaging._operations.end_user_messaging.update_notify_code_configuration

        (
            output,
            http_response,
        ) = await capo_endusermessaging._operations.end_user_messaging.update_notify_code_configuration.async_update_notify_code_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_endusermessaging.types.update_notify_code_configuration_input.UpdateNotifyCodeConfigurationInput",
    ) -> dict[str, Any]:
        import capo_endusermessaging.types.update_notify_code_configuration_input

        return capo_endusermessaging.types.update_notify_code_configuration_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_endusermessaging.types.update_notify_code_configuration_output.UpdateNotifyCodeConfigurationOutput",
    ) -> dict[str, Any]:
        import capo_endusermessaging.types.update_notify_code_configuration_output

        return capo_endusermessaging.types.update_notify_code_configuration_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateNotifyCodeConfiguration",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_endusermessaging.types.update_notify_code_configuration_input.UpdateNotifyCodeConfigurationInput = {
        "notify_code_configuration_id": notify_code_configuration_id
    }
    if notify_code_configuration_name is not None:
        input_["notify_code_configuration_name"] = notify_code_configuration_name
    if code_configuration_parameters is not None:
        input_["code_configuration_parameters"] = code_configuration_parameters
    if channel_parameters is not None:
        input_["channel_parameters"] = channel_parameters
    if deletion_protection_enabled is not None:
        input_["deletion_protection_enabled"] = deletion_protection_enabled

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