# generated by datamodel-codegen:
#   timestamp: 2024-04-28T19:06:26+00:00
#   k8s version: v1.30.0

from __future__ import annotations

from typing import List, Optional

from pydantic import BaseModel, Field

from ...apimachinery.pkg.apis.meta import v1


class ParentReference(BaseModel):
    group: Optional[str] = Field(
        default=None, description="Group is the group of the object being referenced."
    )
    name: str = Field(
        ..., description="Name is the name of the object being referenced."
    )
    namespace: Optional[str] = Field(
        default=None,
        description="Namespace is the namespace of the object being referenced.",
    )
    resource: str = Field(
        ..., description="Resource is the resource of the object being referenced."
    )


class ServiceCIDRSpec(BaseModel):
    cidrs: Optional[List[str]] = Field(
        default=None,
        description=(
            'CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or'
            ' "2001:db8::/64") from which to assign service cluster IPs. Max of two'
            " CIDRs is allowed, one of each IP family. This field is immutable."
        ),
    )


class IPAddressSpec(BaseModel):
    parentRef: ParentReference = Field(
        ...,
        description=(
            "ParentRef references the resource that an IPAddress is attached to. An"
            " IPAddress must reference a parent object."
        ),
    )


class ServiceCIDRStatus(BaseModel):
    conditions: Optional[List[v1.Condition]] = Field(
        default=None,
        description=(
            "conditions holds an array of metav1.Condition that describe the state of"
            " the ServiceCIDR. Current service state"
        ),
    )


class IPAddress(BaseModel):
    apiVersion: Optional[str] = Field(
        default="networking.k8s.io/v1alpha1",
        description=(
            "APIVersion 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. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
        ),
    )
    kind: Optional[str] = Field(
        default="IPAddress",
        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. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
        ),
    )
    metadata: Optional[v1.ObjectMeta] = Field(
        default=None,
        description=(
            "Standard object's metadata. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata"
        ),
    )
    spec: Optional[IPAddressSpec] = Field(
        default=None,
        description=(
            "spec is the desired state of the IPAddress. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status"
        ),
    )


class IPAddressList(BaseModel):
    apiVersion: Optional[str] = Field(
        default="networking.k8s.io/v1alpha1",
        description=(
            "APIVersion 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. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
        ),
    )
    items: List[IPAddress] = Field(..., description="items is the list of IPAddresses.")
    kind: Optional[str] = Field(
        default="IPAddressList",
        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. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
        ),
    )
    metadata: Optional[v1.ListMeta] = Field(
        default=None,
        description=(
            "Standard object's metadata. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata"
        ),
    )


class ServiceCIDR(BaseModel):
    apiVersion: Optional[str] = Field(
        default="networking.k8s.io/v1alpha1",
        description=(
            "APIVersion 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. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
        ),
    )
    kind: Optional[str] = Field(
        default="ServiceCIDR",
        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. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
        ),
    )
    metadata: Optional[v1.ObjectMeta] = Field(
        default=None,
        description=(
            "Standard object's metadata. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata"
        ),
    )
    spec: Optional[ServiceCIDRSpec] = Field(
        default=None,
        description=(
            "spec is the desired state of the ServiceCIDR. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status"
        ),
    )
    status: Optional[ServiceCIDRStatus] = Field(
        default=None,
        description=(
            "status represents the current state of the ServiceCIDR. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status"
        ),
    )


class ServiceCIDRList(BaseModel):
    apiVersion: Optional[str] = Field(
        default="networking.k8s.io/v1alpha1",
        description=(
            "APIVersion 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. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
        ),
    )
    items: List[ServiceCIDR] = Field(
        ..., description="items is the list of ServiceCIDRs."
    )
    kind: Optional[str] = Field(
        default="ServiceCIDRList",
        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. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
        ),
    )
    metadata: Optional[v1.ListMeta] = Field(
        default=None,
        description=(
            "Standard object's metadata. More info:"
            " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata"
        ),
    )
