"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .grouppreferencefilterdto import (
    GroupPreferenceFilterDto,
    GroupPreferenceFilterDtoTypedDict,
)
from .topicsubscriberidentifierdto import (
    TopicSubscriberIdentifierDto,
    TopicSubscriberIdentifierDtoTypedDict,
)
from .workflowpreferencerequestdto import (
    WorkflowPreferenceRequestDto,
    WorkflowPreferenceRequestDtoTypedDict,
)
from novu_py.types import BaseModel
import pydantic
from typing import List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


SubscriptionsModelTypedDict = TypeAliasType(
    "SubscriptionsModelTypedDict", Union[TopicSubscriberIdentifierDtoTypedDict, str]
)


SubscriptionsModel = TypeAliasType(
    "SubscriptionsModel", Union[TopicSubscriberIdentifierDto, str]
)


PreferencesModelTypedDict = TypeAliasType(
    "PreferencesModelTypedDict",
    Union[
        WorkflowPreferenceRequestDtoTypedDict, GroupPreferenceFilterDtoTypedDict, str
    ],
)


PreferencesModel = TypeAliasType(
    "PreferencesModel",
    Union[WorkflowPreferenceRequestDto, GroupPreferenceFilterDto, str],
)


class CreateTopicSubscriptionsRequestDtoTypedDict(TypedDict):
    subscriber_ids: NotRequired[List[str]]
    r"""List of subscriber IDs to subscribe to the topic (max: 100). @deprecated Use the \"subscriptions\" property instead."""
    subscriptions: NotRequired[List[SubscriptionsModelTypedDict]]
    r"""List of subscriptions to subscribe to the topic (max: 100). Can be either a string array of subscriber IDs or an array of objects with identifier and subscriberId"""
    name: NotRequired[str]
    r"""The name of the topic"""
    preferences: NotRequired[List[PreferencesModelTypedDict]]
    r"""The preferences of the topic. Can be a simple workflow ID string, workflow preference object, or group filter object"""


class CreateTopicSubscriptionsRequestDto(BaseModel):
    subscriber_ids: Annotated[
        Optional[List[str]],
        pydantic.Field(
            deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
            alias="subscriberIds",
        ),
    ] = None
    r"""List of subscriber IDs to subscribe to the topic (max: 100). @deprecated Use the \"subscriptions\" property instead."""

    subscriptions: Optional[List[SubscriptionsModel]] = None
    r"""List of subscriptions to subscribe to the topic (max: 100). Can be either a string array of subscriber IDs or an array of objects with identifier and subscriberId"""

    name: Optional[str] = None
    r"""The name of the topic"""

    preferences: Optional[List[PreferencesModel]] = None
    r"""The preferences of the topic. Can be a simple workflow ID string, workflow preference object, or group filter object"""
