"""Response schemas for licensing endpoints.

This module is automatically @generated from the Meraki API specification.
Do not edit this file manually.
"""

from __future__ import annotations

from datetime import datetime

from pydantic import Field, RootModel

from meraki_client.schemas._base import _BaseSchema


class BindAdministeredLicensingSubscriptionSubscriptionResponse(_BaseSchema):
    """Response for bindAdministeredLicensingSubscriptionSubscription operation."""

    subscription_id: str | None = Field(
        default=None, validation_alias="subscriptionId", serialization_alias="subscriptionId"
    )
    networks: list[BindAdministeredLicensingSubscriptionSubscriptionResponseNetworksItem] = Field(
        default_factory=list
    )
    errors: list[str] = Field(default_factory=list)
    insufficient_entitlements: list[LicensingEntitlementsItem2] = Field(
        default_factory=list,
        validation_alias="insufficientEntitlements",
        serialization_alias="insufficientEntitlements",
    )


class BindAdministeredLicensingSubscriptionSubscriptionResponseNetworksItem(_BaseSchema):
    """Schema for BindAdministeredLicensingSubscriptionSubscriptionResponseNetworksItem."""

    id: str | None = None
    name: str | None = None


class ClaimAdministeredLicensingSubscriptionSubscriptionsResponse(_BaseSchema):
    """Response for claimAdministeredLicensingSubscriptionSubscriptions operation."""

    subscription_id: str | None = Field(
        default=None, validation_alias="subscriptionId", serialization_alias="subscriptionId"
    )
    name: str | None = None
    description: str | None = None
    status: str | None = None
    start_date: datetime | None = Field(
        default=None, validation_alias="startDate", serialization_alias="startDate"
    )
    end_date: datetime | None = Field(
        default=None, validation_alias="endDate", serialization_alias="endDate"
    )
    last_updated_at: datetime | None = Field(
        default=None, validation_alias="lastUpdatedAt", serialization_alias="lastUpdatedAt"
    )
    web_order_id: str | None = Field(
        default=None, validation_alias="webOrderId", serialization_alias="webOrderId"
    )
    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    smart_account: LicensingSmartAccount | None = Field(
        default=None, validation_alias="smartAccount", serialization_alias="smartAccount"
    )
    renewal_requested: bool | None = Field(
        default=None, validation_alias="renewalRequested", serialization_alias="renewalRequested"
    )
    product_types: list[str] = Field(
        default_factory=list, validation_alias="productTypes", serialization_alias="productTypes"
    )
    entitlements: list[LicensingEntitlementsItem] = Field(default_factory=list)
    counts: LicensingCounts | None = None
    enterprise_agreement: LicensingEnterpriseAgreement | None = Field(
        default=None,
        validation_alias="enterpriseAgreement",
        serialization_alias="enterpriseAgreement",
    )


class GetAdministeredLicensingSubscriptionEntitlementsResponse(
    RootModel[list["GetAdministeredLicensingSubscriptionEntitlementsResponseItem"]]
):
    """Response for getAdministeredLicensingSubscriptionEntitlements operation."""


class GetAdministeredLicensingSubscriptionEntitlementsResponseItem(_BaseSchema):
    """Schema for GetAdministeredLicensingSubscriptionEntitlementsResponseItem."""

    sku: str | None = None
    name: str | None = None
    product_type: str | None = Field(
        default=None, validation_alias="productType", serialization_alias="productType"
    )
    product_class: str | None = Field(
        default=None, validation_alias="productClass", serialization_alias="productClass"
    )
    feature_tier: str | None = Field(
        default=None, validation_alias="featureTier", serialization_alias="featureTier"
    )
    is_add_on: bool | None = Field(
        default=None, validation_alias="isAddOn", serialization_alias="isAddOn"
    )
    is_free: bool | None = Field(
        default=None, validation_alias="isFree", serialization_alias="isFree"
    )


class GetAdministeredLicensingSubscriptionSubscriptionsComplianceStatusesResponse(
    RootModel[
        list["GetAdministeredLicensingSubscriptionSubscriptionsComplianceStatusesResponseItem"]
    ]
):
    """Response for getAdministeredLicensingSubscriptionSubscriptionsComplianceStatuses operation."""


class GetAdministeredLicensingSubscriptionSubscriptionsComplianceStatusesResponseItem(_BaseSchema):
    """Schema for GetAdministeredLicensingSubscriptionSubscriptionsComplianceStatusesResponseItem."""

    subscription: LicensingSubscription | None = None
    violations: LicensingViolations | None = None


class GetAdministeredLicensingSubscriptionSubscriptionsResponse(
    RootModel[list["GetAdministeredLicensingSubscriptionSubscriptionsResponseItem"]]
):
    """Response for getAdministeredLicensingSubscriptionSubscriptions operation."""


class GetAdministeredLicensingSubscriptionSubscriptionsResponseItem(_BaseSchema):
    """Schema for GetAdministeredLicensingSubscriptionSubscriptionsResponseItem."""

    subscription_id: str | None = Field(
        default=None, validation_alias="subscriptionId", serialization_alias="subscriptionId"
    )
    name: str | None = None
    description: str | None = None
    status: str | None = None
    start_date: datetime | None = Field(
        default=None, validation_alias="startDate", serialization_alias="startDate"
    )
    end_date: datetime | None = Field(
        default=None, validation_alias="endDate", serialization_alias="endDate"
    )
    last_updated_at: datetime | None = Field(
        default=None, validation_alias="lastUpdatedAt", serialization_alias="lastUpdatedAt"
    )
    web_order_id: str | None = Field(
        default=None, validation_alias="webOrderId", serialization_alias="webOrderId"
    )
    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    smart_account: LicensingSmartAccount | None = Field(
        default=None, validation_alias="smartAccount", serialization_alias="smartAccount"
    )
    renewal_requested: bool | None = Field(
        default=None, validation_alias="renewalRequested", serialization_alias="renewalRequested"
    )
    product_types: list[str] = Field(
        default_factory=list, validation_alias="productTypes", serialization_alias="productTypes"
    )
    entitlements: list[LicensingEntitlementsItem] = Field(default_factory=list)
    counts: LicensingCounts | None = None
    enterprise_agreement: LicensingEnterpriseAgreement | None = Field(
        default=None,
        validation_alias="enterpriseAgreement",
        serialization_alias="enterpriseAgreement",
    )


class GetOrganizationLicensingCotermLicensesResponse(
    RootModel[list["GetOrganizationLicensingCotermLicensesResponseItem"]]
):
    """Response for getOrganizationLicensingCotermLicenses operation."""


class GetOrganizationLicensingCotermLicensesResponseItem(_BaseSchema):
    """Schema for GetOrganizationLicensingCotermLicensesResponseItem."""

    key: str | None = None
    organization_id: str | None = Field(
        default=None, validation_alias="organizationId", serialization_alias="organizationId"
    )
    duration: int | None = None
    mode: str | None = None
    started_at: datetime | None = Field(
        default=None, validation_alias="startedAt", serialization_alias="startedAt"
    )
    claimed_at: datetime | None = Field(
        default=None, validation_alias="claimedAt", serialization_alias="claimedAt"
    )
    invalidated: bool | None = None
    invalidated_at: datetime | None = Field(
        default=None, validation_alias="invalidatedAt", serialization_alias="invalidatedAt"
    )
    expired: bool | None = None
    editions: list[LicensingEditionsItem] = Field(default_factory=list)
    counts: list[LicensingCountsItem] = Field(default_factory=list)


class LicensingAccount(_BaseSchema):
    """Smart Account data."""

    id: str | None = None
    name: str | None = None
    domain: str | None = None


class LicensingByProductClassItem(_BaseSchema):
    """Schema for LicensingByProductClassItem."""

    product_class: str | None = Field(
        default=None, validation_alias="productClass", serialization_alias="productClass"
    )
    grace_period_ends_at: str | None = Field(
        default=None, validation_alias="gracePeriodEndsAt", serialization_alias="gracePeriodEndsAt"
    )
    missing: LicensingMissing | None = None


class LicensingCounts(_BaseSchema):
    """Numeric breakdown of network, organizations, entitlement counts."""

    seats: LicensingSeats | None = None
    networks: int | None = None
    organizations: int | None = None


class LicensingCountsItem(_BaseSchema):
    """Schema for LicensingCountsItem."""

    model: str | None = None
    count: int | None = None


class LicensingEditionsItem(_BaseSchema):
    """Schema for LicensingEditionsItem."""

    edition: str | None = None
    product_type: str | None = Field(
        default=None, validation_alias="productType", serialization_alias="productType"
    )


class LicensingEnterpriseAgreement(_BaseSchema):
    """enterprise agreement details."""

    suites: list[str] = Field(default_factory=list)


class LicensingEntitlementsItem(_BaseSchema):
    """Schema for LicensingEntitlementsItem."""

    sku: str | None = None
    seats: LicensingSeats | None = None


class LicensingEntitlementsItem2(_BaseSchema):
    """Schema for LicensingEntitlementsItem2."""

    sku: str | None = None
    quantity: int | None = None


class LicensingMissing(_BaseSchema):
    """Missing entitlements details."""

    entitlements: list[LicensingEntitlementsItem2] = Field(default_factory=list)


class LicensingSeats(_BaseSchema):
    """Seat distribution."""

    assigned: int | None = None
    available: int | None = None
    limit: int | None = None


class LicensingSmartAccount(_BaseSchema):
    """Smart Account linkage information."""

    status: str | None = None
    account: LicensingAccount | None = None


class LicensingSubscription(_BaseSchema):
    """Subscription details."""

    id: str | None = None
    name: str | None = None
    status: str | None = None


class LicensingViolations(_BaseSchema):
    """Violations."""

    by_product_class: list[LicensingByProductClassItem] = Field(
        default_factory=list,
        validation_alias="byProductClass",
        serialization_alias="byProductClass",
    )


class MoveOrganizationLicensingCotermLicensesDestination(_BaseSchema):
    """Destination data for the license move."""

    organization_id: str | None = Field(
        default=None, validation_alias="organizationId", serialization_alias="organizationId"
    )
    mode: str | None = None


class MoveOrganizationLicensingCotermLicensesLicensesItem(_BaseSchema):
    """Item schema for licenses."""

    key: str
    counts: list[MoveOrganizationLicensingCotermLicensesLicensesItemCountsItem]


class MoveOrganizationLicensingCotermLicensesLicensesItemCountsItem(_BaseSchema):
    """Schema for MoveOrganizationLicensingCotermLicensesLicensesItemCountsItem."""

    model: str
    count: int


class MoveOrganizationLicensingCotermLicensesResponse(_BaseSchema):
    """Response for moveOrganizationLicensingCotermLicenses operation."""

    remainder_licenses: list[
        MoveOrganizationLicensingCotermLicensesResponseRemainderLicensesItem
    ] = Field(
        default_factory=list,
        validation_alias="remainderLicenses",
        serialization_alias="remainderLicenses",
    )
    moved_licenses: list[MoveOrganizationLicensingCotermLicensesResponseRemainderLicensesItem] = (
        Field(
            default_factory=list,
            validation_alias="movedLicenses",
            serialization_alias="movedLicenses",
        )
    )


class MoveOrganizationLicensingCotermLicensesResponseRemainderLicensesItem(_BaseSchema):
    """Schema for MoveOrganizationLicensingCotermLicensesResponseRemainderLicensesItem."""

    key: str | None = None
    organization_id: str | None = Field(
        default=None, validation_alias="organizationId", serialization_alias="organizationId"
    )
    duration: int | None = None
    mode: str | None = None
    started_at: datetime | None = Field(
        default=None, validation_alias="startedAt", serialization_alias="startedAt"
    )
    claimed_at: datetime | None = Field(
        default=None, validation_alias="claimedAt", serialization_alias="claimedAt"
    )
    invalidated: bool | None = None
    invalidated_at: datetime | None = Field(
        default=None, validation_alias="invalidatedAt", serialization_alias="invalidatedAt"
    )
    expired: bool | None = None
    editions: list[LicensingEditionsItem] = Field(default_factory=list)
    counts: list[LicensingCountsItem] = Field(default_factory=list)


class ValidateAdministeredLicensingSubscriptionSubscriptionsClaimKeyResponse(_BaseSchema):
    """Response for validateAdministeredLicensingSubscriptionSubscriptionsClaimKey operation."""

    subscription_id: str | None = Field(
        default=None, validation_alias="subscriptionId", serialization_alias="subscriptionId"
    )
    name: str | None = None
    description: str | None = None
    status: str | None = None
    start_date: datetime | None = Field(
        default=None, validation_alias="startDate", serialization_alias="startDate"
    )
    end_date: datetime | None = Field(
        default=None, validation_alias="endDate", serialization_alias="endDate"
    )
    last_updated_at: datetime | None = Field(
        default=None, validation_alias="lastUpdatedAt", serialization_alias="lastUpdatedAt"
    )
    web_order_id: str | None = Field(
        default=None, validation_alias="webOrderId", serialization_alias="webOrderId"
    )
    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    smart_account: LicensingSmartAccount | None = Field(
        default=None, validation_alias="smartAccount", serialization_alias="smartAccount"
    )
    renewal_requested: bool | None = Field(
        default=None, validation_alias="renewalRequested", serialization_alias="renewalRequested"
    )
    product_types: list[str] = Field(
        default_factory=list, validation_alias="productTypes", serialization_alias="productTypes"
    )
    entitlements: list[LicensingEntitlementsItem] = Field(default_factory=list)
    counts: LicensingCounts | None = None
    enterprise_agreement: LicensingEnterpriseAgreement | None = Field(
        default=None,
        validation_alias="enterpriseAgreement",
        serialization_alias="enterpriseAgreement",
    )
