"""Stable public API for AdCP types.

This module provides a stable, versioned API that shields users from internal
implementation details and schema evolution. All types exported here are
guaranteed to be stable within a major version.

Internal Implementation:
- Types are generated from JSON schemas into adcp.types.generated_poc
- The generator may create numbered variants (e.g., BrandManifest1, BrandManifest2)
  when schema evolution creates multiple valid structures
- This module provides clean, unnumbered aliases pointing to the canonical version

**IMPORTANT**: Never import directly from adcp.types.generated_poc or adcp.types.generated.
Always import from adcp.types or adcp.types.stable.

Schema Evolution:
- When schemas change, we update the alias targets here
- Users see stable names (BrandManifest, Product, etc.)
- Breaking changes require major version bumps
"""

from __future__ import annotations

from adcp.types._generated import (
    Action,
    # Core request/response types
    ActivateSignalRequest,
    ActivateSignalResponse,
    AggregatedTotals,
    # Assets
    Asset,
    AssetContentType,  # New from PR #222: consolidated asset content types
    AssetSelectors,
    AssetsRequired,
    AssignedPackage,
    Assignments,
    AudioAsset,
    Authentication,
    AuthorizedAgents,
    AuthorizedSalesAgents,
    AvailableMetric,
    AvailableReportingFrequency,
    # Core domain types
    BrandManifest,  # Clean single type after upstream schema fix
    BuildCreativeRequest,
    BuildCreativeResponse,
    ByPackageItem,
    Capability,
    CatalogType,
    CoBranding,
    Colors,
    Contact,
    Country,
    # Pricing options
    CpcPricingOption,
    CpcvPricingOption,
    CpmAuctionPricingOption,
    CpmFixedRatePricingOption,
    CppPricingOption,
    CpvPricingOption,
    CreateMediaBuyRequest,
    CreateMediaBuyResponse,
    Creative,
    CreativeAgent,
    CreativeAsset,
    CreativeAssignment,
    CreativeManifest,
    CreativePolicy,
    # Enums and constants
    CreativeStatus,
    CssAsset,
    DaastVersion,
    DailyBreakdownItem,
    DeliverTo,
    DeliveryMeasurement,
    DeliveryMetrics,
    DeliveryType,
    Details,
    Direction,
    Disclaimer,
    Domain,
    DomainBreakdown,
    DoohMetrics,
    Embedding,
    Error,
    FeedbackSource,
    FeedFormat,
    FieldModel,
    Filters,
    FlatRatePricingOption,
    Fonts,
    Format,
    FormatCard,
    FormatCardDetailed,
    FormatCategory,  # New from PR #222: format categories (display, video, native, etc.)
    FormatId,
    FormatType,
    FrequencyCap,
    FrequencyCapScope,
    GeoCountryAnyOfItem,
    GetMediaBuyDeliveryRequest,
    GetMediaBuyDeliveryResponse,
    GetProductsRequest,
    GetProductsResponse,
    GetSignalsRequest,
    GetSignalsResponse,
    HistoryItem,
    HtmlAsset,
    Identifier,
    ImageAsset,
    Input,
    JavascriptAsset,
    LandingPage,
    ListAuthorizedPropertiesRequest,
    ListAuthorizedPropertiesResponse,
    ListCreativeFormatsRequest,
    ListCreativeFormatsResponse,
    ListCreativesRequest,
    ListCreativesResponse,
    Logo,
    MarkdownAsset,
    MarkdownFlavor,
    Measurement,
    MeasurementPeriod,
    MediaBuy,
    MediaBuyDelivery,
    MediaBuyStatus,
    Metadata,
    Method,
    MetricType,
    ModuleType,
    NotificationType,
    Offering,
    OutputFormat,
    Pacing,
    PackageRequest,
    Packages,
    PackageStatus,
    Pagination,
    Parameters,
    Performance,
    PerformanceFeedback,
    Placement,
    Preview,
    PreviewCreativeRequest,
    PreviewCreativeResponse,
    PreviewRender,
    PriceGuidance,
    Pricing,
    PricingModel,
    PrimaryCountry,
    Product,
    ProductCard,
    ProductCardDetailed,
    ProductCatalog,
    Progress,
    PromotedOfferings,
    PromotedProducts,
    Property,
    PropertyIdentifierTypes,
    PropertyType,
    ProtocolEnvelope,
    ProtocolResponse,
    ProvidePerformanceFeedbackRequest,
    ProvidePerformanceFeedbackResponse,
    PublisherDomain,
    PublisherIdentifierTypes,
    PushNotificationConfig,
    QuartileData,
    QuerySummary,
    Render,
    ReportingCapabilities,
    ReportingFrequency,
    ReportingPeriod,
    ReportingWebhook,
    Request,
    RequestedMetric,
    Response,
    ResponseType,
    Responsive,
    Results,
    Scheme,
    Security,
    Signal,
    SignalType,
    Sort,
    SortApplied,
    StandardFormatIds,
    Status,
    StatusFilter,
    StatusFilterEnum,
    StatusSummary,
    SyncCreativesRequest,
    SyncCreativesResponse,
    Tag,
    Tags,
    TargetingOverlay,
    Task,
    TasksGetRequest,
    TasksGetResponse,
    TasksListRequest,
    TasksListResponse,
    TaskStatus,
    TaskType,
    TextAsset,
    Totals,
    TrackingEvent,
    Type,
    Unit,
    UpdateFrequency,
    UpdateMediaBuyRequest,
    UpdateMediaBuyResponse,
    UrlAsset,
    UrlType,
    ValidationMode,
    VastVersion,
    VcpmAuctionPricingOption,
    VcpmFixedRatePricingOption,
    VenueBreakdownItem,
    VideoAsset,
    ViewThreshold,
    WebhookAsset,
    WebhookPayload,
)
from adcp.types._generated import (
    # PR #223 unified responses, no more collision
    _PackageFromPackage as Package,
)

# Note: BrandManifest is currently split into BrandManifest1/2 due to upstream schema
# using anyOf incorrectly. This will be fixed upstream to create a single BrandManifest type.
# For now, users should use BrandManifest1 (url required) which is most common.

# Note: BrandManifest is now a single clean type
# Re-export BrandManifest directly (no alias needed)

# Backward compatibility notes:
# - AssetType is maintained as an alias to AssetContentType for backward compatibility
# - Will be removed in 3.0.0
# - Package collision resolved by PR #223 (unified responses)

# Re-export all stable types
__all__ = [
    # Request/Response types
    "ActivateSignalRequest",
    "ActivateSignalResponse",
    "Action",
    "AggregatedTotals",
    "BuildCreativeRequest",
    "BuildCreativeResponse",
    "ByPackageItem",
    "CreateMediaBuyRequest",
    "CreateMediaBuyResponse",
    "DailyBreakdownItem",
    "Details",
    "Domain",
    "DomainBreakdown",
    "GetMediaBuyDeliveryRequest",
    "GetMediaBuyDeliveryResponse",
    "GetProductsRequest",
    "GetProductsResponse",
    "GetSignalsRequest",
    "GetSignalsResponse",
    "HistoryItem",
    "ListAuthorizedPropertiesRequest",
    "ListAuthorizedPropertiesResponse",
    "ListCreativeFormatsRequest",
    "ListCreativeFormatsResponse",
    "ListCreativesRequest",
    "ListCreativesResponse",
    "MediaBuyDelivery",
    "PreviewCreativeRequest",
    "PreviewCreativeResponse",
    "Progress",
    "ProtocolEnvelope",
    "ProtocolResponse",
    "ProvidePerformanceFeedbackRequest",
    "ProvidePerformanceFeedbackResponse",
    "QuerySummary",
    "SortApplied",
    "StatusSummary",
    "SyncCreativesRequest",
    "SyncCreativesResponse",
    "Task",
    "TasksGetRequest",
    "TasksGetResponse",
    "TasksListRequest",
    "TasksListResponse",
    "Totals",
    "UpdateMediaBuyRequest",
    "UpdateMediaBuyResponse",
    # Domain types
    "Asset",
    "AssetSelectors",
    "AssetContentType",  # New canonical name from PR #222
    "AssetType",  # Deprecated alias for AssetContentType
    "FormatCategory",  # New from PR #222
    "AssetsRequired",
    "AssignedPackage",
    "Assignments",
    "BrandManifest",
    "Capability",
    "CoBranding",
    "Colors",
    "Contact",
    "Creative",
    "CreativeAgent",
    "CreativeAsset",
    "CreativeAssignment",
    "CreativeManifest",
    "CreativePolicy",
    "DeliveryMeasurement",
    "DeliveryMetrics",
    "Disclaimer",
    "DoohMetrics",
    "Embedding",
    "Error",
    "FeedFormat",
    "Filters",
    "Fonts",
    "Format",
    "FormatCard",
    "FormatCardDetailed",
    "FormatId",
    "Identifier",
    "Input",
    "LandingPage",
    "Logo",
    "MediaBuy",
    "Metadata",
    "Offering",
    "Package",
    "PackageRequest",
    "Packages",
    "Parameters",
    "Performance",
    "PerformanceFeedback",
    "Placement",
    "Preview",
    "PreviewRender",
    "Pricing",
    "Product",
    "ProductCard",
    "ProductCardDetailed",
    "ProductCatalog",
    "PromotedOfferings",
    "PromotedProducts",
    "Property",
    "QuartileData",
    "Render",
    "Request",
    "Response",
    "Results",
    "Signal",
    "Tag",
    "Tags",
    "TargetingOverlay",
    "VenueBreakdownItem",
    # Pricing-related types
    "CpcPricingOption",
    "CpcvPricingOption",
    "CpmAuctionPricingOption",
    "CpmFixedRatePricingOption",
    "CppPricingOption",
    "CpvPricingOption",
    "FlatRatePricingOption",
    "PriceGuidance",
    "VcpmAuctionPricingOption",
    "VcpmFixedRatePricingOption",
    # Status enums & simple types
    "CatalogType",
    "Country",
    "CreativeStatus",
    "DaastVersion",
    "DeliverTo",
    "DeliveryType",
    "Direction",
    "FeedbackSource",
    "FieldModel",
    "FormatType",
    "FrequencyCap",
    "FrequencyCapScope",
    "GeoCountryAnyOfItem",
    "MarkdownFlavor",
    "Measurement",
    "MeasurementPeriod",
    "MediaBuyStatus",
    "Method",
    "MetricType",
    "ModuleType",
    "NotificationType",
    "OutputFormat",
    "Pacing",
    "PackageStatus",
    "Pagination",
    "PricingModel",
    "PrimaryCountry",
    "PropertyIdentifierTypes",
    "PropertyType",
    "PublisherDomain",
    "PublisherIdentifierTypes",
    "ResponseType",
    "Responsive",
    "SignalType",
    "Sort",
    "StandardFormatIds",
    "Status",
    "StatusFilter",
    "StatusFilterEnum",
    "TaskStatus",
    "TaskType",
    "TrackingEvent",
    "Type",
    "Unit",
    "UpdateFrequency",
    "UrlType",
    "ValidationMode",
    "VastVersion",
    "ViewThreshold",
    # Configuration & infrastructure types
    "Authentication",
    "AuthorizedAgents",
    "AuthorizedSalesAgents",
    "AvailableMetric",
    "AvailableReportingFrequency",
    "PushNotificationConfig",
    "ReportingCapabilities",
    "ReportingFrequency",
    "ReportingPeriod",
    "ReportingWebhook",
    "RequestedMetric",
    "Scheme",
    "Security",
    # Assets
    "AudioAsset",
    "CssAsset",
    "HtmlAsset",
    "ImageAsset",
    "JavascriptAsset",
    "MarkdownAsset",
    "TextAsset",
    "UrlAsset",
    "VideoAsset",
    "WebhookAsset",
    "WebhookPayload",
]

# Deprecated aliases for backward compatibility - will be removed in 3.0.0
AssetType = AssetContentType  # Use AssetContentType instead
