# 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 ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
from .azure_blob_export_storage_status import AzureBlobExportStorageStatus


class AzureBlobExportStorage(pydantic_v1.BaseModel):
    id: typing.Optional[int] = None
    type: typing.Optional[str] = None
    synchronizable: typing.Optional[bool] = None
    container: typing.Optional[str] = pydantic_v1.Field(default=None)
    """
    Azure blob container
    """

    prefix: typing.Optional[str] = pydantic_v1.Field(default=None)
    """
    Azure blob prefix name
    """

    regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
    """
    Cloud storage regex for filtering objects
    """

    use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
    """
    Interpret objects as BLOBs and generate URLs
    """

    account_name: typing.Optional[str] = pydantic_v1.Field(default=None)
    """
    Azure Blob account name
    """

    account_key: typing.Optional[str] = pydantic_v1.Field(default=None)
    """
    Azure Blob account key
    """

    last_sync: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
    """
    Last sync finished time
    """

    last_sync_count: typing.Optional[int] = pydantic_v1.Field(default=None)
    """
    Count of tasks synced last time
    """

    last_sync_job: typing.Optional[str] = pydantic_v1.Field(default=None)
    """
    Last sync job ID
    """

    status: typing.Optional[AzureBlobExportStorageStatus] = None
    traceback: typing.Optional[str] = pydantic_v1.Field(default=None)
    """
    Traceback report for the last failed sync
    """

    meta: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field(default=None)
    """
    Meta and debug information about storage processes
    """

    title: typing.Optional[str] = pydantic_v1.Field(default=None)
    """
    Cloud storage title
    """

    description: typing.Optional[str] = pydantic_v1.Field(default=None)
    """
    Cloud storage description
    """

    created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
    """
    Creation time
    """

    can_delete_objects: typing.Optional[bool] = pydantic_v1.Field(default=None)
    """
    Deletion from storage enabled
    """

    project: int = pydantic_v1.Field()
    """
    A unique integer value identifying this project.
    """

    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_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}

        return deep_union_pydantic_dicts(
            super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
        )

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