Skip to content

create_notification_subscription

create_notification_subscription(
    organization_id: IdType,
    endpoint: SubscriptionEndPointType,
    protocol: SubscriptionProtocolType,
    subscription_type: SubscriptionType,
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
) -> CreateNotificationSubscriptionResponse

Configure Amazon WorkDocs to use Amazon SNS notifications. The endpoint receives a confirmation message, and must confirm the subscription.

For more information, see Setting up notifications for an IAM user or role in the Amazon WorkDocs Developer Guide.

Parameters:

  • organization_id (IdType) –

    The ID of the organization.

  • endpoint (SubscriptionEndPointType) –

    The endpoint to receive the notifications. If the protocol is HTTPS, the endpoint is a URL that begins with https.

  • protocol (SubscriptionProtocolType) –

    The protocol to use. The supported value is https, which delivers JSON-encoded messages using HTTPS POST.

  • subscription_type (SubscriptionType) –

    The notification type.

Raises:

Source code in docs_src/capo_workdocs/_services/work_docs.py
def create_notification_subscription(
    self,
    organization_id: "capo_workdocs.types.id_type.IdType",
    endpoint: "capo_workdocs.types.subscription_end_point_type.SubscriptionEndPointType",
    protocol: "capo_workdocs.types.subscription_protocol_type.SubscriptionProtocolType",
    subscription_type: "capo_workdocs.types.subscription_type.SubscriptionType",
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
) -> "capo_workdocs.types.create_notification_subscription_response.CreateNotificationSubscriptionResponse":
    """<p>Configure Amazon WorkDocs to use Amazon SNS notifications. The endpoint receives a confirmation message, and must confirm the subscription.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/workdocs/latest/developerguide/manage-notifications.html">Setting up notifications for an IAM user or role</a> in the <i>Amazon WorkDocs Developer Guide</i>.</p>

    Args:
        organization_id: <p>The ID of the organization.</p>
        endpoint: <p>The endpoint to receive the notifications. If the protocol is HTTPS, the endpoint is a URL that begins with <code>https</code>.</p>
        protocol: <p>The protocol to use. The supported value is https, which delivers JSON-encoded messages using HTTPS POST.</p>
        subscription_type: <p>The notification type.</p>

    Raises:
        capo_workdocs.errors.invalid_argument_exception.InvalidArgumentException: <p>The pagination marker or limit fields are not valid.</p>
        capo_workdocs.errors.service_unavailable_exception.ServiceUnavailableException: <p>One or more of the dependencies is unavailable.</p>
        capo_workdocs.errors.too_many_subscriptions_exception.TooManySubscriptionsException: <p>You've reached the limit on the number of subscriptions for the WorkDocs instance.</p>
        capo_workdocs.errors.unauthorized_resource_access_exception.UnauthorizedResourceAccessException: <p>The caller does not have access to perform the action on the resource.</p>
        capo_workdocs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_workdocs.types.create_notification_subscription_request.CreateNotificationSubscriptionRequest]",
    ) -> OperationResponse[
        "capo_workdocs.types.create_notification_subscription_response.CreateNotificationSubscriptionResponse"
    ]:
        import capo_workdocs._operations.aws_gorilla_boy_service.create_notification_subscription

        output, http_response = (
            capo_workdocs._operations.aws_gorilla_boy_service.create_notification_subscription.create_notification_subscription(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateNotificationSubscription")
    )
    input_: capo_workdocs.types.create_notification_subscription_request.CreateNotificationSubscriptionRequest = {
        "organization_id": organization_id,
        "endpoint": endpoint,
        "protocol": protocol,
        "subscription_type": subscription_type,
    }

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