Skip to content

modify_event_subscription async

modify_event_subscription(
    *,
    config_overrides: Optional[AsyncNeptuneClientConfig] = None,
    subscription_name: Optional[String] = None,
    sns_topic_arn: Optional[String] = None,
    source_type: Optional[String] = None,
    event_categories: Optional[EventCategoriesList] = None,
    enabled: Optional[BooleanOptional] = None,
) -> ModifyEventSubscriptionResult

Modifies an existing event notification subscription. Note that you can't modify the source identifiers using this call; to change source identifiers for a subscription, use the AddSourceIdentifierToSubscription and RemoveSourceIdentifierFromSubscription calls.

You can see a list of the event categories for a given SourceType by using the DescribeEventCategories action.

Parameters:

  • subscription_name (Optional[String], default: None ) –

    The name of the event notification subscription.

  • sns_topic_arn (Optional[String], default: None ) –

    The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.

  • source_type (Optional[String], default: None ) –

    The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, you would set this parameter to db-instance. if this value is not specified, all events are returned.

    Valid values: db-instance | db-parameter-group | db-security-group | db-snapshot

  • event_categories (Optional[EventCategoriesList], default: None ) –

    A list of event categories for a SourceType that you want to subscribe to. You can see a list of the categories for a given SourceType by using the DescribeEventCategories action.

  • enabled (Optional[BooleanOptional], default: None ) –

    A Boolean value; set to true to activate the subscription.

Raises:

Source code in docs_src/capo_neptune/_services/async_neptune.py
async def modify_event_subscription(
    self,
    *,
    config_overrides: Optional[AsyncNeptuneClientConfig] = None,
    subscription_name: Optional["capo_neptune.types.string.String"] = None,
    sns_topic_arn: Optional["capo_neptune.types.string.String"] = None,
    source_type: Optional["capo_neptune.types.string.String"] = None,
    event_categories: Optional[
        "capo_neptune.types.event_categories_list.EventCategoriesList"
    ] = None,
    enabled: Optional["capo_neptune.types.boolean_optional.BooleanOptional"] = None,
) -> "capo_neptune.types.modify_event_subscription_result.ModifyEventSubscriptionResult":
    """<p>Modifies an existing event notification subscription. Note that you can't modify the source identifiers using this call; to change source identifiers for a subscription, use the <a>AddSourceIdentifierToSubscription</a> and <a>RemoveSourceIdentifierFromSubscription</a> calls.</p> <p>You can see a list of the event categories for a given SourceType by using the <b>DescribeEventCategories</b> action.</p>

    Args:
        subscription_name: <p>The name of the event notification subscription.</p>
        sns_topic_arn: <p>The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.</p>
        source_type: <p>The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, you would set this parameter to db-instance. if this value is not specified, all events are returned.</p> <p>Valid values: db-instance | db-parameter-group | db-security-group | db-snapshot</p>
        event_categories: <p> A list of event categories for a SourceType that you want to subscribe to. You can see a list of the categories for a given SourceType by using the <b>DescribeEventCategories</b> action.</p>
        enabled: <p> A Boolean value; set to <b>true</b> to activate the subscription.</p>

    Raises:
        capo_neptune.errors.event_subscription_quota_exceeded_fault.EventSubscriptionQuotaExceededFault: <p>You have exceeded the number of events you can subscribe to.</p>
        capo_neptune.errors.sns_invalid_topic_fault.SNSInvalidTopicFault: <p>The SNS topic is invalid.</p>
        capo_neptune.errors.sns_no_authorization_fault.SNSNoAuthorizationFault: <p>There is no SNS authorization.</p>
        capo_neptune.errors.sns_topic_arn_not_found_fault.SNSTopicArnNotFoundFault: <p>The ARN of the SNS topic could not be found.</p>
        capo_neptune.errors.subscription_category_not_found_fault.SubscriptionCategoryNotFoundFault: <p>The designated subscription category could not be found.</p>
        capo_neptune.errors.subscription_not_found_fault.SubscriptionNotFoundFault: <p>The designated subscription could not be found.</p>
        capo_neptune.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_neptune.types.modify_event_subscription_message.ModifyEventSubscriptionMessage]",
    ) -> AsyncOperationResponse[
        "capo_neptune.types.modify_event_subscription_result.ModifyEventSubscriptionResult"
    ]:
        import capo_neptune._operations.amazon_rd_sv19.modify_event_subscription

        (
            output,
            http_response,
        ) = await capo_neptune._operations.amazon_rd_sv19.modify_event_subscription.async_modify_event_subscription(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyEventSubscription")
    )
    input_: capo_neptune.types.modify_event_subscription_message.ModifyEventSubscriptionMessage = {}
    if subscription_name is not None:
        input_["subscription_name"] = subscription_name
    if sns_topic_arn is not None:
        input_["sns_topic_arn"] = sns_topic_arn
    if source_type is not None:
        input_["source_type"] = source_type
    if event_categories is not None:
        input_["event_categories"] = event_categories
    if enabled is not None:
        input_["enabled"] = enabled

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