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

from __future__ import annotations
from .prometheus_response_activetarget_discoveredlabels import (
    PrometheusResponseActiveTargetDiscoveredLabels,
    PrometheusResponseActiveTargetDiscoveredLabelsTypedDict,
)
from .prometheus_response_activetarget_labels import (
    PrometheusResponseActiveTargetLabels,
    PrometheusResponseActiveTargetLabelsTypedDict,
)
from censys_platform.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict


class PrometheusResponseActiveTargetTypedDict(TypedDict):
    discovered_labels: NotRequired[
        PrometheusResponseActiveTargetDiscoveredLabelsTypedDict
    ]
    health: NotRequired[str]
    r"""Whether target is up or down."""
    labels: NotRequired[PrometheusResponseActiveTargetLabelsTypedDict]
    last_error: NotRequired[str]
    r"""Last error that occurred within target."""
    last_scrape: NotRequired[str]
    r"""Last time Prometheus scraped target."""
    scrape_url: NotRequired[str]
    r"""URL that Prometheus scraped."""


class PrometheusResponseActiveTarget(BaseModel):
    discovered_labels: Optional[PrometheusResponseActiveTargetDiscoveredLabels] = None

    health: Optional[str] = None
    r"""Whether target is up or down."""

    labels: Optional[PrometheusResponseActiveTargetLabels] = None

    last_error: Optional[str] = None
    r"""Last error that occurred within target."""

    last_scrape: Optional[str] = None
    r"""Last time Prometheus scraped target."""

    scrape_url: Optional[str] = None
    r"""URL that Prometheus scraped."""
