# pylint: disable=line-too-long,useless-suppression
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=useless-super-delegation

from typing import Any, Literal, Mapping, overload

from .._utils.model_base import Model as _Model, rest_discriminator, rest_field


class Animal(_Model):
    """Animal.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    Dog, Pet

    :ivar kind: The kind of animal. Required. Default value is None.
    :vartype kind: str
    :ivar name: Name of the animal. Required.
    :vartype name: str
    """

    __mapping__: dict[str, _Model] = {}
    kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])
    """The kind of animal. Required. Default value is None."""
    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the animal. Required."""

    @overload
    def __init__(
        self,
        *,
        kind: str,
        name: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Pet(Animal, discriminator="pet"):
    """Pet.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    Dog

    :ivar name: Name of the animal. Required.
    :vartype name: str
    :ivar kind: Required. Default value is "pet".
    :vartype kind: str
    :ivar trained: Whether the pet is trained. Required.
    :vartype trained: bool
    """

    __mapping__: dict[str, _Model] = {}
    kind: Literal["pet"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. Default value is \"pet\"."""
    trained: bool = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Whether the pet is trained. Required."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        trained: bool,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.kind = "pet"  # type: ignore


class Dog(Pet, discriminator="dog"):
    """Dog.

    :ivar name: Name of the animal. Required.
    :vartype name: str
    :ivar trained: Whether the pet is trained. Required.
    :vartype trained: bool
    :ivar kind: Required. Default value is "dog".
    :vartype kind: str
    :ivar breed: The breed of the dog. Required.
    :vartype breed: str
    """

    kind: Literal["dog"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. Default value is \"dog\"."""
    breed: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The breed of the dog. Required."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        trained: bool,
        breed: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.kind = "dog"  # type: ignore
