# Copyright (C) 2023-2024 Cochise Ruhulessin
#
# All rights reserved. No warranty, explicit or implicit, provided. In
# no event shall the author(s) be liable for any claim or damages.
#
# 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.
from typing import Annotated

import pydantic

from .types import APIVersion as APIVersionType


__all__: list[str] = [
    'APIVersion',
    'Kind'
]

APIVersion = Annotated[
    APIVersionType,
    pydantic.Field(
        alias='apiVersion',
        title="API Version",
        description=(
            "The `apiVersion` field defines the versioned schema of this "
            "representation of an object. Servers should convert recognized "
            "schemas to the latest internal value, and may reject "
            "unrecognized values."
        ),
        frozen=True
    )
]

Kind = Annotated[
    str,
    pydantic.Field(
        description=(
            "Kind is a string value representing the REST resource this "
            "object represents. Servers may infer this from the endpoint "
            "the client submits requests to. Cannot be updated. In `CamelCase`."
        ),
        frozen=True
    )
]

Name = Annotated[
    str,
    pydantic.Field(
        description=(
            "Name must be unique within a namespace. Is required when creating "
            "resources, although some resources may allow a client to request "
            "the generation of an appropriate name automatically. Name is "
            "primarily intended for creation idempotence and configuration"
            "definition."
        )
    )
]

Namespace = Annotated[
    str,
    pydantic.Field(
        frozen=True
    )
]

ReferencedName = Annotated[
    str,
    pydantic.Field(
        description=(
            "The `name` field is the name of resource being "
            "referenced"
        )
    )
]

UID = Annotated[
    int,
    pydantic.Field(
        title="UID",
        description=(
            "UID is the unique in time and space value for this object. "
            "It is typically generated by the server on successful creation "
            "of a resource and is not allowed to change on PUT operations. "
            "Populated by the system. Read-only."
        )
    ),
]