# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

from ....core.datetime_utils import serialize_datetime
from .sentinel_credential import SentinelCredential

try:
    import pydantic.v1 as pydantic  # type: ignore
except ImportError:
    import pydantic  # type: ignore


class SiemSentinel(pydantic.BaseModel):
    """
    Configuration for Microsoft Sentinel SIEM Product.
    """

    credential: SentinelCredential
    default_tables: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    The default tables to use for queries. Supply this value if you would like to a subset of the default tables or non-ASIM data tables with Sentinel/Log Analytics queries. If more than one table is specified, a union operator will join them to query all of the tables at once. Supply a single value with "_" if you would like to query all tables without the normalizing ASIM transformations. **Note** that a single "_" entry will map to a 'union \*' query. Relying heavily on these queries is generally discouraged by Sentinel because they are slower and more resource intensive.
    """

    logs_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    The root URL for the Microsoft Azure Monitor Logs API. This is optional and should only be supplied if using an alternate Microsoft cloud, such as GovCloud.
    """

    management_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    The root URL for the Microsoft Azure Management API. This is optional and should only be supplied if using an alternate Microsoft cloud, such as GovCloud.
    """

    resource_group: str = pydantic.Field()
    """
    The Azure resource group name that contains the Microsoft Sentinel workspace.
    """

    subscription_id: str = pydantic.Field()
    """
    The Azure subscription ID that contains the Microsoft Sentinel workspace.
    """

    tenant_id: str = pydantic.Field()
    """
    The Azure Active Directory tenant ID that contains the Microsoft Sentinel workspace.
    """

    workspace_id: str = pydantic.Field()
    """
    The ID of the Microsoft Sentinel Log Analytics workspace.
    """

    workspace_name: str = pydantic.Field()
    """
    The name of the Microsoft Sentinel Log Analytics workspace.
    """

    def json(self, **kwargs: typing.Any) -> str:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().json(**kwargs_with_defaults)

    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().dict(**kwargs_with_defaults)

    class Config:
        frozen = True
        smart_union = True
        extra = pydantic.Extra.allow
        json_encoders = {dt.datetime: serialize_datetime}
