"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
from dub.types import BaseModel
from dub.utils import FieldMetadata, QueryParamMetadata
from enum import Enum
import pydantic
from typing import List, Optional, TypedDict, Union
from typing_extensions import Annotated, NotRequired


class GetLinksCountGlobalsTypedDict(TypedDict):
    workspace_id: NotRequired[str]
    

class GetLinksCountGlobals(BaseModel):
    workspace_id: Annotated[Optional[str], pydantic.Field(deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", alias="workspaceId"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None
    

class Two(str, Enum):
    TAG_ID = "tagId"


class One(str, Enum):
    DOMAIN = "domain"


class GetLinksCountRequestTypedDict(TypedDict):
    domain: NotRequired[str]
    r"""The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned."""
    tag_id: NotRequired[str]
    r"""The tag ID to filter the links by. This field is deprecated – use `tagIds` instead."""
    tag_ids: NotRequired[GetLinksCountQueryParamTagIdsTypedDict]
    r"""The tag IDs to filter the links by."""
    tag_names: NotRequired[GetLinksCountQueryParamTagNamesTypedDict]
    r"""The unique name of the tags assigned to the short link (case insensitive)."""
    search: NotRequired[str]
    r"""The search term to filter the links by. The search term will be matched against the short link slug and the destination url."""
    user_id: NotRequired[str]
    r"""The user ID to filter the links by."""
    show_archived: NotRequired[bool]
    r"""Whether to include archived links in the response. Defaults to `false` if not provided."""
    with_tags: NotRequired[bool]
    r"""Whether to include tags in the response. Defaults to `false` if not provided."""
    group_by: NotRequired[GroupByTypedDict]
    r"""The field to group the links by."""
    

class GetLinksCountRequest(BaseModel):
    domain: Annotated[Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None
    r"""The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned."""
    tag_id: Annotated[Optional[str], pydantic.Field(alias="tagId"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None
    r"""The tag ID to filter the links by. This field is deprecated – use `tagIds` instead."""
    tag_ids: Annotated[Optional[GetLinksCountQueryParamTagIds], pydantic.Field(alias="tagIds"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None
    r"""The tag IDs to filter the links by."""
    tag_names: Annotated[Optional[GetLinksCountQueryParamTagNames], pydantic.Field(alias="tagNames"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None
    r"""The unique name of the tags assigned to the short link (case insensitive)."""
    search: Annotated[Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None
    r"""The search term to filter the links by. The search term will be matched against the short link slug and the destination url."""
    user_id: Annotated[Optional[str], pydantic.Field(alias="userId"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None
    r"""The user ID to filter the links by."""
    show_archived: Annotated[Optional[bool], pydantic.Field(alias="showArchived"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = True
    r"""Whether to include archived links in the response. Defaults to `false` if not provided."""
    with_tags: Annotated[Optional[bool], pydantic.Field(alias="withTags"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = True
    r"""Whether to include tags in the response. Defaults to `false` if not provided."""
    group_by: Annotated[Optional[GroupBy], pydantic.Field(alias="groupBy"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True))] = None
    r"""The field to group the links by."""
    

GetLinksCountQueryParamTagIdsTypedDict = Union[str, List[str]]
r"""The tag IDs to filter the links by."""


GetLinksCountQueryParamTagIds = Union[str, List[str]]
r"""The tag IDs to filter the links by."""


GetLinksCountQueryParamTagNamesTypedDict = Union[str, List[str]]
r"""The unique name of the tags assigned to the short link (case insensitive)."""


GetLinksCountQueryParamTagNames = Union[str, List[str]]
r"""The unique name of the tags assigned to the short link (case insensitive)."""


GroupByTypedDict = Union[One, Two]
r"""The field to group the links by."""


GroupBy = Union[One, Two]
r"""The field to group the links by."""

