Skip to content

create_notification_configuration async

create_notification_configuration(
    event_type: EventType,
    destination_name: DestinationName,
    *,
    config_overrides: Optional[AsyncIoTManagedIntegrationsClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagsMap] = None,
) -> CreateNotificationConfigurationResponse

Creates a notification configuration. A configuration is a connection between an event type and a destination that you have already created.

Parameters:

  • event_type (EventType) –

    The type of event triggering a device notification to the customer-managed destination.

  • destination_name (DestinationName) –

    The name of the destination for the notification configuration.

  • client_token (Optional[ClientToken], default: None ) –

    An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.

  • tags (Optional[TagsMap], default: None ) –

    A set of key/value pairs that are used to manage the notification configuration.

Raises:

Source code in docs_src/capo_iot_managed_integrations/_services/async_io_t_managed_integrations.py
async def create_notification_configuration(
    self,
    event_type: "capo_iot_managed_integrations.types.event_type.EventType",
    destination_name: "capo_iot_managed_integrations.types.destination_name.DestinationName",
    *,
    config_overrides: Optional[AsyncIoTManagedIntegrationsClientConfig] = None,
    client_token: Optional[
        "capo_iot_managed_integrations.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_iot_managed_integrations.types.tags_map.TagsMap"] = None,
) -> "capo_iot_managed_integrations.types.create_notification_configuration_response.CreateNotificationConfigurationResponse":
    """<p>Creates a notification configuration. A configuration is a connection between an event type and a destination that you have already created. </p>

    Args:
        event_type: <p>The type of event triggering a device notification to the customer-managed destination.</p>
        destination_name: <p>The name of the destination for the notification configuration.</p>
        client_token: <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>
        tags: <p>A set of key/value pairs that are used to manage the notification configuration.</p>

    Raises:
        capo_iot_managed_integrations.errors.access_denied_exception.AccessDeniedException: <p>User is not authorized.</p>
        capo_iot_managed_integrations.errors.conflict_exception.ConflictException: <p>There is a conflict with the request.</p>
        capo_iot_managed_integrations.errors.internal_server_exception.InternalServerException: <p>Internal error from the service that indicates an unexpected error or that the service is unavailable.</p>
        capo_iot_managed_integrations.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot_managed_integrations.errors.validation_exception.ValidationException: <p>A validation error occurred when performing the API request.</p>
        capo_iot_managed_integrations.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot_managed_integrations.types.create_notification_configuration_request.CreateNotificationConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot_managed_integrations.types.create_notification_configuration_response.CreateNotificationConfigurationResponse"
    ]:
        import capo_iot_managed_integrations._operations.iot_managed_integrations.create_notification_configuration

        (
            output,
            http_response,
        ) = await capo_iot_managed_integrations._operations.iot_managed_integrations.create_notification_configuration.async_create_notification_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_iot_managed_integrations.types.create_notification_configuration_request.CreateNotificationConfigurationRequest",
    ) -> dict[str, Any]:
        import capo_iot_managed_integrations.types.create_notification_configuration_request

        return capo_iot_managed_integrations.types.create_notification_configuration_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateNotificationConfiguration", redact_input=_redact_input
        ),
    )
    input_: capo_iot_managed_integrations.types.create_notification_configuration_request.CreateNotificationConfigurationRequest = {
        "event_type": event_type,
        "destination_name": destination_name,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

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