Skip to content

modify_event_subscription async

modify_event_subscription(
    *,
    config_overrides: Optional[AsyncDocDBClientConfig] = 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 Amazon DocumentDB event notification subscription.

Parameters:

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

    The name of the Amazon DocumentDB 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 an instance, 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

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

    A list of event categories for a SourceType that you want to subscribe to.

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

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

Raises:

Source code in docs_src/capo_docdb/_services/async_doc_db.py
async def modify_event_subscription(
    self,
    *,
    config_overrides: Optional[AsyncDocDBClientConfig] = None,
    subscription_name: Optional["capo_docdb.types.string.String"] = None,
    sns_topic_arn: Optional["capo_docdb.types.string.String"] = None,
    source_type: Optional["capo_docdb.types.string.String"] = None,
    event_categories: Optional[
        "capo_docdb.types.event_categories_list.EventCategoriesList"
    ] = None,
    enabled: Optional["capo_docdb.types.boolean_optional.BooleanOptional"] = None,
) -> "capo_docdb.types.modify_event_subscription_result.ModifyEventSubscriptionResult":
    """<p>Modifies an existing Amazon DocumentDB event notification subscription.</p>

    Args:
        subscription_name: <p>The name of the Amazon DocumentDB 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 an instance, set this parameter to <code>db-instance</code>. If this value is not specified, all events are returned.</p> <p>Valid values: <code>db-instance</code>, <code>db-parameter-group</code>, <code>db-security-group</code> </p>
        event_categories: <p> A list of event categories for a <code>SourceType</code> that you want to subscribe to.</p>
        enabled: <p> A Boolean value; set to <code>true</code> to activate the subscription. </p>

    Raises:
        capo_docdb.errors.event_subscription_quota_exceeded_fault.EventSubscriptionQuotaExceededFault: <p>You have reached the maximum number of event subscriptions. </p>
        capo_docdb.errors.sns_invalid_topic_fault.SNSInvalidTopicFault: <p>Amazon SNS has responded that there is a problem with the specified topic. </p>
        capo_docdb.errors.sns_no_authorization_fault.SNSNoAuthorizationFault: <p>You do not have permission to publish to the SNS topic Amazon Resource Name (ARN). </p>
        capo_docdb.errors.sns_topic_arn_not_found_fault.SNSTopicArnNotFoundFault: <p>The SNS topic Amazon Resource Name (ARN) does not exist. </p>
        capo_docdb.errors.subscription_category_not_found_fault.SubscriptionCategoryNotFoundFault: <p>The provided category does not exist. </p>
        capo_docdb.errors.subscription_not_found_fault.SubscriptionNotFoundFault: <p>The subscription name does not exist. </p>
        capo_docdb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_docdb._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_docdb.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