Skip to content

update_notify_configuration async

update_notify_configuration(
    notify_configuration_id: NotifyConfigurationIdOrArn,
    *,
    config_overrides: Optional[AsyncPinpointSMSVoiceV2ClientConfig] = None,
    default_template_id: Optional[NotifyTemplateId] = None,
    pool_id: Optional[NotifyPoolIdOrUnset] = None,
    enabled_countries: Optional[IsoCountryCodeList] = None,
    enabled_channels: Optional[NotifyEnabledChannelsList] = None,
    deletion_protection_enabled: Optional[bool] = None,
) -> UpdateNotifyConfigurationResult

Updates an existing notify configuration. You can update the default template, pool association, enabled channels, enabled countries, and deletion protection settings.

Parameters:

  • notify_configuration_id (NotifyConfigurationIdOrArn) –

    The identifier of the notify configuration to update. The NotifyConfigurationId can be found using the DescribeNotifyConfigurations operation.

  • default_template_id (Optional[NotifyTemplateId], default: None ) –

    The default template identifier to associate with the notify configuration. If specified, this template is used when sending messages without an explicit template identifier. Pass the special value UNSET_DEFAULT_TEMPLATE to clear the current default template from the notify configuration.

  • pool_id (Optional[NotifyPoolIdOrUnset], default: None ) –

    The pool identifier or Amazon Resource Name (ARN) to associate with the notify configuration. Pass the special value UNSET_DEFAULT_POOL_FOR_NOTIFY to clear the current default pool from the notify configuration.

  • enabled_countries (Optional[IsoCountryCodeList], default: None ) –

    An array of two-character ISO country codes, in ISO 3166-1 alpha-2 format, that are enabled for the notify configuration.

  • enabled_channels (Optional[NotifyEnabledChannelsList], default: None ) –

    An array of channels to enable for the notify configuration. Supported values include SMS and VOICE.

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

    When set to true the notify configuration can't be deleted.

Raises:

  • AccessDeniedException –

    The request was denied because you don't have sufficient permissions to access the resource.

  • ConflictException –

    Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time or it could be that the requested action isn't valid for the current state or configuration of the resource.

  • InternalServerException –

    The API encountered an unexpected error and couldn't complete the request. You might be able to successfully issue the request again in the future.

  • ResourceNotFoundException –

    A requested resource couldn't be found.

  • ThrottlingException –

    An error that occurred because too many requests were sent during a certain amount of time.

  • ValidationException –

    A validation exception for a field.

  • UnknownServiceError –

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

Examples:

UpdateNotifyConfiguration Update a notify configuration to add voice channel and additional countries.

>>> await client.update_notify_configuration(notify_configuration_id='nc-1234567890abcdef0', enabled_channels=['SMS', 'VOICE'], enabled_countries=['US', 'CA', 'GB'], deletion_protection_enabled=True)
Source code in docs_src/capo_pinpoint_sms_voice_v2/_services/async_pinpoint_sms_voice_v2.py
async def update_notify_configuration(
    self,
    notify_configuration_id: "capo_pinpoint_sms_voice_v2.types.notify_configuration_id_or_arn.NotifyConfigurationIdOrArn",
    *,
    config_overrides: Optional[AsyncPinpointSMSVoiceV2ClientConfig] = None,
    default_template_id: Optional[
        "capo_pinpoint_sms_voice_v2.types.notify_template_id.NotifyTemplateId"
    ] = None,
    pool_id: Optional[
        "capo_pinpoint_sms_voice_v2.types.notify_pool_id_or_unset.NotifyPoolIdOrUnset"
    ] = None,
    enabled_countries: Optional[
        "capo_pinpoint_sms_voice_v2.types.iso_country_code_list.IsoCountryCodeList"
    ] = None,
    enabled_channels: Optional[
        "capo_pinpoint_sms_voice_v2.types.notify_enabled_channels_list.NotifyEnabledChannelsList"
    ] = None,
    deletion_protection_enabled: Optional[bool] = None,
) -> "capo_pinpoint_sms_voice_v2.types.update_notify_configuration_result.UpdateNotifyConfigurationResult":
    """<p>Updates an existing notify configuration. You can update the default template, pool association, enabled channels, enabled countries, and deletion protection settings.</p>

    Args:
        notify_configuration_id: <p>The identifier of the notify configuration to update. The NotifyConfigurationId can be found using the <a>DescribeNotifyConfigurations</a> operation.</p>
        default_template_id: <p>The default template identifier to associate with the notify configuration. If specified, this template is used when sending messages without an explicit template identifier. Pass the special value <code>UNSET_DEFAULT_TEMPLATE</code> to clear the current default template from the notify configuration.</p>
        pool_id: <p>The pool identifier or Amazon Resource Name (ARN) to associate with the notify configuration. Pass the special value <code>UNSET_DEFAULT_POOL_FOR_NOTIFY</code> to clear the current default pool from the notify configuration.</p>
        enabled_countries: <p>An array of two-character ISO country codes, in ISO 3166-1 alpha-2 format, that are enabled for the notify configuration.</p>
        enabled_channels: <p>An array of channels to enable for the notify configuration. Supported values include <code>SMS</code> and <code>VOICE</code>.</p>
        deletion_protection_enabled: <p>When set to true the notify configuration can't be deleted.</p>

    Raises:
        capo_pinpoint_sms_voice_v2.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient permissions to access the resource.</p>
        capo_pinpoint_sms_voice_v2.errors.conflict_exception.ConflictException: <p>Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time or it could be that the requested action isn't valid for the current state or configuration of the resource.</p>
        capo_pinpoint_sms_voice_v2.errors.internal_server_exception.InternalServerException: <p>The API encountered an unexpected error and couldn't complete the request. You might be able to successfully issue the request again in the future.</p>
        capo_pinpoint_sms_voice_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p>A requested resource couldn't be found.</p>
        capo_pinpoint_sms_voice_v2.errors.throttling_exception.ThrottlingException: <p>An error that occurred because too many requests were sent during a certain amount of time.</p>
        capo_pinpoint_sms_voice_v2.errors.validation_exception.ValidationException: <p>A validation exception for a field.</p>
        capo_pinpoint_sms_voice_v2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        UpdateNotifyConfiguration
        Update a notify configuration to add voice channel and additional countries.

        >>> await client.update_notify_configuration(notify_configuration_id='nc-1234567890abcdef0', enabled_channels=['SMS', 'VOICE'], enabled_countries=['US', 'CA', 'GB'], deletion_protection_enabled=True)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_pinpoint_sms_voice_v2.types.update_notify_configuration_request.UpdateNotifyConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_pinpoint_sms_voice_v2.types.update_notify_configuration_result.UpdateNotifyConfigurationResult"
    ]:
        import capo_pinpoint_sms_voice_v2._operations.pinpoint_sms_voice_v2.update_notify_configuration

        (
            output,
            http_response,
        ) = await capo_pinpoint_sms_voice_v2._operations.pinpoint_sms_voice_v2.update_notify_configuration.async_update_notify_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateNotifyConfiguration")
    )
    input_: capo_pinpoint_sms_voice_v2.types.update_notify_configuration_request.UpdateNotifyConfigurationRequest = {
        "notify_configuration_id": notify_configuration_id
    }
    if default_template_id is not None:
        input_["default_template_id"] = default_template_id
    if pool_id is not None:
        input_["pool_id"] = pool_id
    if enabled_countries is not None:
        input_["enabled_countries"] = enabled_countries
    if enabled_channels is not None:
        input_["enabled_channels"] = enabled_channels
    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