"""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, alias="subscriptionId")
    networks: list[BindAdministeredLicensingSubscriptionSubscriptionResponseNetworksItem] | None = (
        None
    )
    errors: list[str] | None = None
    insufficient_entitlements: list[LicensingEntitlementsItem2] | None = Field(
        default=None, 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, alias="subscriptionId")
    name: str | None = None
    description: str | None = None
    status: str | None = None
    start_date: datetime | None = Field(default=None, alias="startDate")
    end_date: datetime | None = Field(default=None, alias="endDate")
    last_updated_at: datetime | None = Field(default=None, alias="lastUpdatedAt")
    web_order_id: str | None = Field(default=None, alias="webOrderId")
    type_: str | None = Field(default=None, alias="type")
    smart_account: LicensingSmartAccount | None = Field(default=None, alias="smartAccount")
    renewal_requested: bool | None = Field(default=None, alias="renewalRequested")
    product_types: list[str] | None = Field(default=None, alias="productTypes")
    entitlements: list[LicensingEntitlementsItem] | None = None
    counts: LicensingCounts | None = None
    enterprise_agreement: LicensingEnterpriseAgreement | None = Field(
        default=None, 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, alias="productType")
    product_class: str | None = Field(default=None, alias="productClass")
    feature_tier: str | None = Field(default=None, alias="featureTier")
    is_add_on: bool | None = Field(default=None, alias="isAddOn")
    is_free: bool | None = Field(default=None, 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, alias="subscriptionId")
    name: str | None = None
    description: str | None = None
    status: str | None = None
    start_date: datetime | None = Field(default=None, alias="startDate")
    end_date: datetime | None = Field(default=None, alias="endDate")
    last_updated_at: datetime | None = Field(default=None, alias="lastUpdatedAt")
    web_order_id: str | None = Field(default=None, alias="webOrderId")
    type_: str | None = Field(default=None, alias="type")
    smart_account: LicensingSmartAccount | None = Field(default=None, alias="smartAccount")
    renewal_requested: bool | None = Field(default=None, alias="renewalRequested")
    product_types: list[str] | None = Field(default=None, alias="productTypes")
    entitlements: list[LicensingEntitlementsItem] | None = None
    counts: LicensingCounts | None = None
    enterprise_agreement: LicensingEnterpriseAgreement | None = Field(
        default=None, 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, alias="organizationId")
    duration: int | None = None
    mode: str | None = None
    started_at: datetime | None = Field(default=None, alias="startedAt")
    claimed_at: datetime | None = Field(default=None, alias="claimedAt")
    invalidated: bool | None = None
    invalidated_at: datetime | None = Field(default=None, alias="invalidatedAt")
    expired: bool | None = None
    editions: list[LicensingEditionsItem] | None = None
    counts: list[LicensingCountsItem] | None = None


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, alias="productClass")
    grace_period_ends_at: str | None = Field(default=None, 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, alias="productType")


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

    suites: list[str] | None = None


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] | None = None


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] | None = Field(
        default=None, alias="byProductClass"
    )


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

    organization_id: str | None = Field(default=None, 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] | None
    ) = Field(default=None, alias="remainderLicenses")
    moved_licenses: (
        list[MoveOrganizationLicensingCotermLicensesResponseRemainderLicensesItem] | None
    ) = Field(default=None, alias="movedLicenses")


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

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


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

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