"""AdCP Type System.

All AdCP types exported from a single location.
Users should import from here or directly from adcp.

Examples:
    from adcp.types import Product, CreativeFilters
    from adcp import Product, CreativeFilters

Type Coercion:
    For developer ergonomics, request types accept flexible input:

    - Enum fields accept string values:
        ListCreativeFormatsRequest(type="video")  # Works!
        ListCreativeFormatsRequest(type=FormatCategory.video)  # Also works

    - Context fields accept dicts:
        GetProductsRequest(context={"key": "value"})  # Works!

    - FieldModel lists accept strings:
        ListCreativesRequest(fields=["creative_id", "name"])  # Works!

    See adcp.types.coercion for implementation details.
"""

from __future__ import annotations

# Apply type coercion to generated types (must be imported before other types)
from adcp.types import (
    _ergonomic,  # noqa: F401
    aliases,  # noqa: F401
)

# Also make submodules available for advanced use
from adcp.types import _generated as generated  # noqa: F401

# Import all types from generated code
# V3 Protocol Discovery types
# V3 Content Standards types
# V3 Sponsored Intelligence types
# V3 Governance (Property Lists) types
from adcp.types._generated import (
    A2UiComponent,
    A2UiSurface,
    Account,
    ActivateSignalRequest,
    ActivateSignalResponse,
    AggregatedTotals,
    Artifact,
    Asset,
    AssetContentType,
    AssetSelectors,
    AssignedPackage,
    Assignments,
    AudioAsset,
    Authentication,
    AuthenticationScheme,
    AuthorizedAgents,
    AvailableMetric,
    BrandManifest,
    BuildCreativeRequest,
    BuildCreativeResponse,
    ByPackageItem,
    CalibrateContentRequest,
    CalibrateContentResponse,
    CoBrandingRequirement,
    Colors,
    Contact,
    ContentStandards,
    Country,
    CpcPricingOption,
    CpcvPricingOption,
    CpmPricingOption,
    CppPricingOption,
    CpvPricingOption,
    CreateContentStandardsRequest,
    CreateContentStandardsResponse,
    CreateMediaBuyRequest,
    CreateMediaBuyResponse,
    CreatePropertyListRequest,
    CreatePropertyListResponse,
    Creative,
    CreativeAction,
    CreativeAgent,
    CreativeAgentCapability,
    CreativeAsset,
    CreativeAssignment,
    CreativeFilters,
    CreativeManifest,
    CreativePolicy,
    CreativeStatus,
    CssAsset,
    DaastTrackingEvent,
    DaastVersion,
    DailyBreakdownItem,
    DayOfWeek,
    DaypartTarget,
    DeletePropertyListRequest,
    DeletePropertyListResponse,
    DeliverTo,
    DeliveryForecast,
    DeliveryMeasurement,
    DeliveryMetrics,
    DeliveryType,
    DemographicSystem,
    DimensionUnit,
    Disclaimer,
    DoohMetrics,
    Error,
    FeedbackSource,
    FeedFormat,
    FieldModel,
    FlatRatePricingOption,
    Fonts,
    ForecastableMetric,
    ForecastMethod,
    ForecastPoint,
    ForecastRange,
    ForecastRangeUnit,
    Format,
    FormatCard,
    FormatCardDetailed,
    FormatCategory,
    FormatId,
    FormatIdParameter,
    FrequencyCap,
    FrequencyCapScope,
    GeoCountry,
    GeoMetro,
    GeoPostalArea,
    GeoRegion,
    GetAdcpCapabilitiesRequest,
    GetAdcpCapabilitiesResponse,
    GetContentStandardsRequest,
    GetContentStandardsResponse,
    GetCreativeDeliveryRequest,
    GetCreativeDeliveryResponse,
    GetMediaBuyArtifactsRequest,
    GetMediaBuyArtifactsResponse,
    GetMediaBuyDeliveryRequest,
    GetMediaBuyDeliveryResponse,
    GetProductsRequest,
    GetProductsResponse,
    GetPropertyListRequest,
    GetPropertyListResponse,
    GetSignalsRequest,
    GetSignalsResponse,
    HtmlAsset,
    HttpMethod,
    Identifier,
    ImageAsset,
    Input,
    JavascriptAsset,
    JavascriptModuleType,
    LandingPageRequirement,
    ListAccountsRequest,
    ListAccountsResponse,
    ListContentStandardsRequest,
    ListContentStandardsResponse,
    ListCreativeFormatsRequest,
    ListCreativeFormatsResponse,
    ListCreativesRequest,
    ListCreativesResponse,
    ListPropertyListsRequest,
    ListPropertyListsResponse,
    LogEventRequest,
    LogEventResponse,
    Logo,
    MarkdownFlavor,
    Measurement,
    MeasurementPeriod,
    MediaBuy,
    MediaBuyDelivery,
    MediaBuyStatus,
    Metadata,
    MetricType,
    NotificationType,
    Offering,
    Pacing,
    PackageRequest,
    PackageUpdate,
    Pagination,
    Parameters,
    Performance,
    PerformanceFeedback,
    Placement,
    Preview,
    PreviewCreativeRequest,
    PreviewCreativeResponse,
    PreviewOutputFormat,
    PreviewRender,
    PriceGuidance,
    Pricing,
    PricingModel,
    PrimaryCountry,
    Product,
    ProductCard,
    ProductCardDetailed,
    ProductCatalog,
    ProductFilters,
    PromotedOfferings,
    PromotedProducts,
    Property,
    PropertyIdentifierTypes,
    PropertyList,
    PropertyListChangedWebhook,
    PropertyListFilters,
    PropertyListReference,
    PropertyType,
    ProtocolEnvelope,
    ProtocolResponse,
    ProvidePerformanceFeedbackRequest,
    ProvidePerformanceFeedbackResponse,
    PublisherDomain,
    PublisherIdentifierTypes,
    PushNotificationConfig,
    QuartileData,
    QuerySummary,
    ReachUnit,
    ReportingCapabilities,
    ReportingFrequency,
    ReportingPeriod,
    ReportingWebhook,
    Request,
    Response,
    Responsive,
    Results,
    Security,
    SiCapabilities,
    SiGetOfferingRequest,
    SiGetOfferingResponse,
    Signal,
    SignalCatalogType,
    SignalFilters,
    SiIdentity,
    SiInitiateSessionRequest,
    SiInitiateSessionResponse,
    SiSendMessageRequest,
    SiSendMessageResponse,
    SiTerminateSessionRequest,
    SiTerminateSessionResponse,
    SiUiElement,
    Sort,
    SortApplied,
    SortDirection,
    Status,
    StatusSummary,
    SyncAccountsRequest,
    SyncAccountsResponse,
    SyncCreativesRequest,
    SyncCreativesResponse,
    SyncEventSourcesRequest,
    SyncEventSourcesResponse,
    Tags,
    TargetingOverlay,
    TaskType,
    TextAsset,
    Totals,
    UpdateContentStandardsRequest,
    UpdateContentStandardsResponse,
    UpdateFrequency,
    UpdateMediaBuyRequest,
    UpdateMediaBuyResponse,
    UpdatePropertyListRequest,
    UpdatePropertyListResponse,
    UrlAsset,
    UrlAssetType,
    ValidateContentDeliveryRequest,
    ValidateContentDeliveryResponse,
    ValidationMode,
    VastTrackingEvent,
    VastVersion,
    VcpmPricingOption,
    VenueBreakdownItem,
    VideoAsset,
    ViewThreshold,
    WebhookAsset,
    WebhookResponseType,
)
from adcp.types._generated import TaskStatus as GeneratedTaskStatus
from adcp.types._generated import _PackageFromPackage as Package

# Import semantic aliases for discriminated unions
from adcp.types.aliases import (
    ActivateSignalErrorResponse,
    ActivateSignalSuccessResponse,
    AgentDeployment,
    AgentDestination,
    AuthorizedAgent,
    AuthorizedAgentsByInlineProperties,
    AuthorizedAgentsByPropertyId,
    AuthorizedAgentsByPropertyTag,
    AuthorizedAgentsByPublisherProperties,
    BothPreviewRender,
    BuildCreativeErrorResponse,
    BuildCreativeSuccessResponse,
    CalibrateContentErrorResponse,
    CalibrateContentSuccessResponse,
    CreateContentStandardsErrorResponse,
    CreateContentStandardsSuccessResponse,
    CreateMediaBuyErrorResponse,
    CreateMediaBuySuccessResponse,
    Deployment,
    Destination,
    GetContentStandardsErrorResponse,
    GetContentStandardsSuccessResponse,
    GetCreativeDeliveryByBuyerRefRequest,
    GetCreativeDeliveryByCreativeRequest,
    GetCreativeDeliveryByMediaBuyRequest,
    GetMediaBuyArtifactsErrorResponse,
    GetMediaBuyArtifactsSuccessResponse,
    HtmlPreviewRender,
    InlineDaastAsset,
    InlineVastAsset,
    ListContentStandardsErrorResponse,
    ListContentStandardsSuccessResponse,
    LogEventErrorResponse,
    LogEventSuccessResponse,
    MediaSubAsset,
    PlatformDeployment,
    PlatformDestination,
    PreviewCreativeFormatRequest,
    PreviewCreativeInteractiveResponse,
    PreviewCreativeManifestRequest,
    PreviewCreativeStaticResponse,
    PricingOption,
    PropertyId,
    PropertyTag,
    ProvidePerformanceFeedbackErrorResponse,
    ProvidePerformanceFeedbackSuccessResponse,
    PublisherProperties,
    PublisherPropertiesAll,
    PublisherPropertiesById,
    PublisherPropertiesByTag,
    SyncAccountsErrorResponse,
    SyncAccountsSuccessResponse,
    SyncCreativeResult,
    SyncCreativesErrorResponse,
    SyncCreativesSuccessResponse,
    SyncEventSourcesErrorResponse,
    SyncEventSourcesSuccessResponse,
    TextSubAsset,
    UpdateMediaBuyErrorResponse,
    UpdateMediaBuyPackagesRequest,
    UpdateMediaBuyPropertiesRequest,
    UpdateMediaBuySuccessResponse,
    UrlDaastAsset,
    UrlPreviewRender,
    UrlVastAsset,
    ValidateContentDeliveryErrorResponse,
    ValidateContentDeliverySuccessResponse,
)

# Re-export core types (not in generated, but part of public API)
# Note: We don't import TaskStatus here to avoid shadowing GeneratedTaskStatus
# Users should import TaskStatus from adcp.types.core directly if they need the core enum
from adcp.types.core import AgentConfig, Protocol, TaskResult, WebhookMetadata

# Re-export webhook payload type for webhook handling
from adcp.types.generated_poc.core.mcp_webhook_payload import McpWebhookPayload

# Backward compatibility aliases
AssetType = AssetContentType  # Use AssetContentType instead

# Schema renames from filter ref split (v1.0.0)
Action = CreativeAction
Capability = CreativeAgentCapability
CatalogType = SignalCatalogType
CoBranding = CoBrandingRequirement
FormatType = FormatCategory
LandingPage = LandingPageRequirement
Method = HttpMethod
ModuleType = JavascriptModuleType
TrackingEvent = VastTrackingEvent  # Split into DaastTrackingEvent and VastTrackingEvent
Unit = DimensionUnit
OutputFormat = PreviewOutputFormat
ResponseType = WebhookResponseType
Scheme = AuthenticationScheme
SignalType = SignalCatalogType
UrlType = UrlAssetType
AvailableReportingFrequency = ReportingFrequency

__all__ = [
    # A2UI types
    "A2UiComponent",
    "A2UiSurface",
    # Account types
    "Account",
    "ListAccountsRequest",
    "ListAccountsResponse",
    "SyncAccountsRequest",
    "SyncAccountsResponse",
    # Request/Response types
    "ActivateSignalRequest",
    "ActivateSignalResponse",
    "CreativeAction",
    "AggregatedTotals",
    "BuildCreativeRequest",
    "BuildCreativeResponse",
    "ByPackageItem",
    "CreateMediaBuyRequest",
    "CreateMediaBuyResponse",
    "DailyBreakdownItem",
    "GetMediaBuyDeliveryRequest",
    "GetMediaBuyDeliveryResponse",
    "GetProductsRequest",
    "GetProductsResponse",
    "GetSignalsRequest",
    "GetSignalsResponse",
    "ListCreativeFormatsRequest",
    "ListCreativeFormatsResponse",
    "ListCreativesRequest",
    "ListCreativesResponse",
    "MediaBuyDelivery",
    "PreviewCreativeRequest",
    "PreviewCreativeResponse",
    "ProtocolEnvelope",
    "ProtocolResponse",
    "ProvidePerformanceFeedbackRequest",
    "ProvidePerformanceFeedbackResponse",
    "QuerySummary",
    "SortApplied",
    "StatusSummary",
    "SyncCreativesRequest",
    "SyncCreativesResponse",
    # Event & Source Operations
    "LogEventRequest",
    "LogEventResponse",
    "SyncEventSourcesRequest",
    "SyncEventSourcesResponse",
    "Totals",
    "UpdateMediaBuyRequest",
    "UpdateMediaBuyResponse",
    # V3 Protocol Discovery
    "GetAdcpCapabilitiesRequest",
    "GetAdcpCapabilitiesResponse",
    # Creative Delivery
    "GetCreativeDeliveryRequest",
    "GetCreativeDeliveryResponse",
    # Forecasting types
    "DayOfWeek",
    "DaypartTarget",
    "DeliveryForecast",
    "DemographicSystem",
    "ForecastMethod",
    "ForecastPoint",
    "ForecastRange",
    "ForecastRangeUnit",
    "ForecastableMetric",
    "ReachUnit",
    # V3 Content Standards
    "Artifact",
    "CalibrateContentRequest",
    "CalibrateContentResponse",
    "ContentStandards",
    "CreateContentStandardsRequest",
    "CreateContentStandardsResponse",
    "GetContentStandardsRequest",
    "GetContentStandardsResponse",
    "GetMediaBuyArtifactsRequest",
    "GetMediaBuyArtifactsResponse",
    "ListContentStandardsRequest",
    "ListContentStandardsResponse",
    "UpdateContentStandardsRequest",
    "UpdateContentStandardsResponse",
    "ValidateContentDeliveryRequest",
    "ValidateContentDeliveryResponse",
    # V3 Sponsored Intelligence
    "SiCapabilities",
    "SiGetOfferingRequest",
    "SiGetOfferingResponse",
    "SiIdentity",
    "SiInitiateSessionRequest",
    "SiInitiateSessionResponse",
    "SiSendMessageRequest",
    "SiSendMessageResponse",
    "SiTerminateSessionRequest",
    "SiTerminateSessionResponse",
    "SiUiElement",
    # V3 Governance (Property Lists)
    "CreatePropertyListRequest",
    "CreatePropertyListResponse",
    "DeletePropertyListRequest",
    "DeletePropertyListResponse",
    "GetPropertyListRequest",
    "GetPropertyListResponse",
    "ListPropertyListsRequest",
    "ListPropertyListsResponse",
    "PropertyList",
    "PropertyListChangedWebhook",
    "PropertyListFilters",
    "PropertyListReference",
    "UpdatePropertyListRequest",
    "UpdatePropertyListResponse",
    # Domain types
    "Asset",
    "AssetSelectors",
    "AssetContentType",
    "AssetType",  # Deprecated
    "FormatCategory",
    "AssignedPackage",
    "Assignments",
    "BrandManifest",
    "CreativeAgentCapability",
    "CoBrandingRequirement",
    "Colors",
    "Contact",
    "Creative",
    "CreativeAgent",
    "CreativeAsset",
    "CreativeAssignment",
    "CreativeFilters",
    "CreativeManifest",
    "CreativePolicy",
    "DeliveryMeasurement",
    "DeliveryMetrics",
    "Disclaimer",
    "DoohMetrics",
    "Error",
    "FeedFormat",
    "Fonts",
    "Format",
    "FormatCard",
    "FormatCardDetailed",
    "FormatId",
    "FormatIdParameter",
    "Identifier",
    "Input",
    "LandingPageRequirement",
    "Logo",
    "MediaBuy",
    "Metadata",
    "Offering",
    "Package",
    "PackageRequest",
    "PackageUpdate",
    "Parameters",
    "Performance",
    "PerformanceFeedback",
    "Placement",
    "Preview",
    "PreviewRender",
    "Pricing",
    "Product",
    "ProductCard",
    "ProductCardDetailed",
    "ProductCatalog",
    "ProductFilters",
    "PromotedOfferings",
    "PromotedProducts",
    "Property",
    "QuartileData",
    "Request",
    "Response",
    "Results",
    "Signal",
    "SignalFilters",
    "Tags",
    "TargetingOverlay",
    "VenueBreakdownItem",
    # Pricing types
    "CpcPricingOption",
    "CpcvPricingOption",
    "CpmPricingOption",
    "CppPricingOption",
    "CpvPricingOption",
    "FlatRatePricingOption",
    "PriceGuidance",
    "VcpmPricingOption",
    # Status enums & simple types
    "SignalCatalogType",
    "Country",
    "CreativeStatus",
    "DaastVersion",
    "DeliverTo",
    "DeliveryType",
    "SortDirection",
    "FeedbackSource",
    "FieldModel",
    "FrequencyCap",
    "FrequencyCapScope",
    "GeoCountry",
    "GeoMetro",
    "GeoPostalArea",
    "GeoRegion",
    "MarkdownFlavor",
    "Measurement",
    "MeasurementPeriod",
    "MediaBuyStatus",
    "HttpMethod",
    "MetricType",
    "JavascriptModuleType",
    "NotificationType",
    "PreviewOutputFormat",
    "Pacing",
    "Pagination",
    "PricingModel",
    "PrimaryCountry",
    "PropertyIdentifierTypes",
    "PropertyType",
    "PublisherDomain",
    "PublisherIdentifierTypes",
    "WebhookResponseType",
    "Responsive",
    "Sort",
    "Status",
    "TaskType",
    "DaastTrackingEvent",
    "VastTrackingEvent",
    "DimensionUnit",
    "UpdateFrequency",
    "UrlAssetType",
    "ValidationMode",
    "VastVersion",
    "ViewThreshold",
    # Configuration & infrastructure types
    "Authentication",
    "AuthorizedAgents",
    "AvailableMetric",
    "PushNotificationConfig",
    "ReportingCapabilities",
    "ReportingFrequency",
    "ReportingPeriod",
    "ReportingWebhook",
    "AuthenticationScheme",
    "Security",
    # Assets
    "AudioAsset",
    "CssAsset",
    "HtmlAsset",
    "ImageAsset",
    "JavascriptAsset",
    "TextAsset",
    "UrlAsset",
    "VideoAsset",
    "WebhookAsset",
    # Core types
    "AgentConfig",
    "Protocol",
    "TaskResult",
    "WebhookMetadata",
    # Webhook types
    "McpWebhookPayload",
    # Semantic aliases for discriminated unions
    "ActivateSignalErrorResponse",
    "ActivateSignalSuccessResponse",
    "AgentDeployment",
    "AgentDestination",
    "AuthorizedAgent",
    "AuthorizedAgentsByInlineProperties",
    "AuthorizedAgentsByPropertyId",
    "AuthorizedAgentsByPropertyTag",
    "AuthorizedAgentsByPublisherProperties",
    "BothPreviewRender",
    "BuildCreativeErrorResponse",
    "BuildCreativeSuccessResponse",
    "CalibrateContentErrorResponse",
    "CalibrateContentSuccessResponse",
    "CreateContentStandardsErrorResponse",
    "CreateContentStandardsSuccessResponse",
    "CreateMediaBuyErrorResponse",
    "CreateMediaBuySuccessResponse",
    "Deployment",
    "Destination",
    "GetContentStandardsErrorResponse",
    "GetContentStandardsSuccessResponse",
    "GetCreativeDeliveryByBuyerRefRequest",
    "GetCreativeDeliveryByCreativeRequest",
    "GetCreativeDeliveryByMediaBuyRequest",
    "GetMediaBuyArtifactsErrorResponse",
    "GetMediaBuyArtifactsSuccessResponse",
    "HtmlPreviewRender",
    "InlineDaastAsset",
    "InlineVastAsset",
    "ListContentStandardsErrorResponse",
    "ListContentStandardsSuccessResponse",
    "LogEventErrorResponse",
    "LogEventSuccessResponse",
    "MediaSubAsset",
    "PlatformDeployment",
    "PlatformDestination",
    "PreviewCreativeFormatRequest",
    "PreviewCreativeInteractiveResponse",
    "PreviewCreativeManifestRequest",
    "PreviewCreativeStaticResponse",
    "PricingOption",
    "PropertyId",
    "PropertyTag",
    "ProvidePerformanceFeedbackErrorResponse",
    "ProvidePerformanceFeedbackSuccessResponse",
    "PublisherProperties",
    "PublisherPropertiesAll",
    "PublisherPropertiesById",
    "PublisherPropertiesByTag",
    "SyncAccountsErrorResponse",
    "SyncAccountsSuccessResponse",
    "SyncCreativesErrorResponse",
    "SyncCreativesSuccessResponse",
    "SyncCreativeResult",
    "SyncEventSourcesErrorResponse",
    "SyncEventSourcesSuccessResponse",
    "TextSubAsset",
    "UpdateMediaBuyErrorResponse",
    "UpdateMediaBuyPackagesRequest",
    "UpdateMediaBuyPropertiesRequest",
    "UpdateMediaBuySuccessResponse",
    "UrlDaastAsset",
    "UrlPreviewRender",
    "UrlVastAsset",
    "ValidateContentDeliveryErrorResponse",
    "ValidateContentDeliverySuccessResponse",
    # Internal/special exports
    "GeneratedTaskStatus",
    # Backward compatibility aliases (deprecated)
    "Action",
    "Capability",
    "CatalogType",
    "CoBranding",
    "FormatType",
    "LandingPage",
    "Method",
    "ModuleType",
    "TrackingEvent",
    "Unit",
    "OutputFormat",
    "ResponseType",
    "Scheme",
    "SignalType",
    "UrlType",
    "AvailableReportingFrequency",
    # Submodules for advanced use:
    "generated",
    "aliases",
]
