# coding: utf-8

"""
    NetHSM
    All endpoints expect exactly the specified JSON. Additional properties will cause a Bad Request Error (400). All HTTP errors contain a JSON structure with an explanation of type string. All [base64](https://tools.ietf.org/html/rfc4648#section-4) encoded values are Big Endian.   # noqa: E501
    The version of the OpenAPI document: v1
    Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

from __future__ import annotations
from nethsm.client.shared_imports.schema_imports import *  # pyright: ignore [reportWildcardImportFromLibrary]


from nethsm.client.components.schema import namespace_item


class NamespaceListTuple(
    typing.Tuple[
        namespace_item.NamespaceItemDict,
        ...
    ]
):

    def __new__(cls, arg: typing.Union[NamespaceListTupleInput, NamespaceListTuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
        return NamespaceList.validate(arg, configuration=configuration)
NamespaceListTupleInput = typing.Union[
    typing.List[
        typing.Union[
            namespace_item.NamespaceItemDictInput,
            namespace_item.NamespaceItemDict,
        ],
    ],
    typing.Tuple[
        typing.Union[
            namespace_item.NamespaceItemDictInput,
            namespace_item.NamespaceItemDict,
        ],
        ...
    ]
]


@dataclasses.dataclass(frozen=True)
class NamespaceList(
    schemas.Schema[schemas.immutabledict, NamespaceListTuple]
):
    """NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
    Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator

    Do not edit the class manually.
    """
    types: typing.FrozenSet[typing.Type] = frozenset({tuple})
    items: typing.Type[namespace_item.NamespaceItem] = dataclasses.field(default_factory=lambda: namespace_item.NamespaceItem) # type: ignore
    type_to_output_cls: typing.Mapping[
        typing.Type,
        typing.Type
    ] = dataclasses.field(
        default_factory=lambda: {
            tuple: NamespaceListTuple
        }
    )

    @classmethod
    def validate(
        cls,
        arg: typing.Union[
            NamespaceListTupleInput,
            NamespaceListTuple,
        ],
        configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
    ) -> NamespaceListTuple:
        return super().validate_base(
            arg,
            configuration=configuration,
        )
