"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from censys_platform.types import BaseModel
from enum import Enum
from typing import Union
from typing_extensions import TypeAliasType, TypedDict


class TargetWebOriginTypedDict(TypedDict):
    hostname: str
    r"""Hostname of the web origin"""
    port: int
    r"""Port number of the web origin"""


class TargetWebOrigin(BaseModel):
    hostname: str
    r"""Hostname of the web origin"""

    port: int
    r"""Port number of the web origin"""


class TwoTypedDict(TypedDict):
    r"""Rescan of known web property"""

    web_origin: TargetWebOriginTypedDict


class Two(BaseModel):
    r"""Rescan of known web property"""

    web_origin: TargetWebOrigin


class TargetTransportProtocol(str, Enum):
    UNKNOWN = "unknown"
    TCP = "tcp"
    UDP = "udp"
    ICMP = "icmp"
    QUIC = "quic"


class TargetServiceIDTypedDict(TypedDict):
    ip: str
    r"""IP address of service"""
    port: int
    r"""Port number of service"""
    protocol: str
    r"""Name of service protocol"""
    transport_protocol: TargetTransportProtocol


class TargetServiceID(BaseModel):
    ip: str
    r"""IP address of service"""

    port: int
    r"""Port number of service"""

    protocol: str
    r"""Name of service protocol"""

    transport_protocol: TargetTransportProtocol


class OneTypedDict(TypedDict):
    r"""Rescan of known service"""

    service_id: TargetServiceIDTypedDict


class One(BaseModel):
    r"""Rescan of known service"""

    service_id: TargetServiceID


ScansRescanInputBodyTargetTypedDict = TypeAliasType(
    "ScansRescanInputBodyTargetTypedDict", Union[OneTypedDict, TwoTypedDict]
)


ScansRescanInputBodyTarget = TypeAliasType(
    "ScansRescanInputBodyTarget", Union[One, Two]
)


class ScansRescanInputBodyTypedDict(TypedDict):
    target: ScansRescanInputBodyTargetTypedDict


class ScansRescanInputBody(BaseModel):
    target: ScansRescanInputBodyTarget
