# 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, Mapping, Optional, TYPE_CHECKING, overload

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

if TYPE_CHECKING:
    from .. import models as _models


class ListWidgetsResponse(_Model):
    """ListWidgetsResponse.

    :ivar widgets: Required.
    :vartype widgets: list[~specs.azure.versioning.previewversion.models.Widget]
    """

    widgets: list["_models.Widget"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Required."""

    @overload
    def __init__(
        self,
        *,
        widgets: list["_models.Widget"],
    ) -> 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 UpdateWidgetColorRequest(_Model):
    """Update widget color request.

    :ivar color: New color for the widget. Required.
    :vartype color: str
    """

    color: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """New color for the widget. Required."""

    @overload
    def __init__(
        self,
        *,
        color: 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 Widget(_Model):
    """A simple model for testing.

    :ivar id: Widget identifier. Required.
    :vartype id: str
    :ivar name: Widget name. Required.
    :vartype name: str
    :ivar color: Widget color, only available in preview version.
    :vartype color: str
    """

    id: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Widget identifier. Required."""
    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Widget name. Required."""
    color: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Widget color, only available in preview version."""

    @overload
    def __init__(
        self,
        *,
        id: str,  # pylint: disable=redefined-builtin
        name: str,
        color: Optional[str] = None,
    ) -> 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)
