# Copyright 2026 UCP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# generated by datamodel-codegen
# pylint: disable=all
# pyformat: disable

from __future__ import annotations

from typing import Any

from pydantic import ConfigDict, Field, RootModel

from ..checkout import Checkout as Checkout_1
from ..types import fulfillment as fulfillment_1
from ..types import (
    fulfillment_available_method,
    fulfillment_group,
    fulfillment_method,
    fulfillment_option,
)


class FulfillmentExtension(RootModel[Any]):
    model_config = ConfigDict(
        frozen=True,
    )
    root: Any = Field(..., title="Fulfillment Extension")
    """
    Extends Checkout with fulfillment support using methods, destinations, and groups.
    """


class FulfillmentAvailableMethod(
    RootModel[fulfillment_available_method.FulfillmentAvailableMethod]
):
    model_config = ConfigDict(
        frozen=True,
    )
    root: fulfillment_available_method.FulfillmentAvailableMethod


class FulfillmentOption(RootModel[fulfillment_option.FulfillmentOption]):
    model_config = ConfigDict(
        frozen=True,
    )
    root: fulfillment_option.FulfillmentOption


class FulfillmentGroup(RootModel[fulfillment_group.FulfillmentGroup]):
    model_config = ConfigDict(
        frozen=True,
    )
    root: fulfillment_group.FulfillmentGroup


class FulfillmentMethod(RootModel[fulfillment_method.FulfillmentMethod]):
    model_config = ConfigDict(
        frozen=True,
    )
    root: fulfillment_method.FulfillmentMethod


class Fulfillment(RootModel[fulfillment_1.Fulfillment]):
    model_config = ConfigDict(
        frozen=True,
    )
    root: fulfillment_1.Fulfillment


class Checkout(Checkout_1):
    """
    Checkout extended with hierarchical fulfillment.
    """

    model_config = ConfigDict(
        extra="allow",
    )
    fulfillment: Fulfillment | None = None
    """
    Fulfillment details.
    """
