# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from .queries import (
    QueriesResource,
    AsyncQueriesResource,
    QueriesResourceWithRawResponse,
    AsyncQueriesResourceWithRawResponse,
    QueriesResourceWithStreamingResponse,
    AsyncQueriesResourceWithStreamingResponse,
)
from .telemetry import (
    TelemetryResource,
    AsyncTelemetryResource,
    TelemetryResourceWithRawResponse,
    AsyncTelemetryResourceWithRawResponse,
    TelemetryResourceWithStreamingResponse,
    AsyncTelemetryResourceWithStreamingResponse,
)
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from .destinations import (
    DestinationsResource,
    AsyncDestinationsResource,
    DestinationsResourceWithRawResponse,
    AsyncDestinationsResourceWithRawResponse,
    DestinationsResourceWithStreamingResponse,
    AsyncDestinationsResourceWithStreamingResponse,
)
from .shared_queries import (
    SharedQueriesResource,
    AsyncSharedQueriesResource,
    SharedQueriesResourceWithRawResponse,
    AsyncSharedQueriesResourceWithRawResponse,
    SharedQueriesResourceWithStreamingResponse,
    AsyncSharedQueriesResourceWithStreamingResponse,
)

__all__ = ["ObservabilityResource", "AsyncObservabilityResource"]


class ObservabilityResource(SyncAPIResource):
    @cached_property
    def telemetry(self) -> TelemetryResource:
        return TelemetryResource(self._client)

    @cached_property
    def destinations(self) -> DestinationsResource:
        return DestinationsResource(self._client)

    @cached_property
    def queries(self) -> QueriesResource:
        return QueriesResource(self._client)

    @cached_property
    def shared_queries(self) -> SharedQueriesResource:
        return SharedQueriesResource(self._client)

    @cached_property
    def with_raw_response(self) -> ObservabilityResourceWithRawResponse:
        """
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
        """
        return ObservabilityResourceWithRawResponse(self)

    @cached_property
    def with_streaming_response(self) -> ObservabilityResourceWithStreamingResponse:
        """
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
        """
        return ObservabilityResourceWithStreamingResponse(self)


class AsyncObservabilityResource(AsyncAPIResource):
    @cached_property
    def telemetry(self) -> AsyncTelemetryResource:
        return AsyncTelemetryResource(self._client)

    @cached_property
    def destinations(self) -> AsyncDestinationsResource:
        return AsyncDestinationsResource(self._client)

    @cached_property
    def queries(self) -> AsyncQueriesResource:
        return AsyncQueriesResource(self._client)

    @cached_property
    def shared_queries(self) -> AsyncSharedQueriesResource:
        return AsyncSharedQueriesResource(self._client)

    @cached_property
    def with_raw_response(self) -> AsyncObservabilityResourceWithRawResponse:
        """
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
        """
        return AsyncObservabilityResourceWithRawResponse(self)

    @cached_property
    def with_streaming_response(self) -> AsyncObservabilityResourceWithStreamingResponse:
        """
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
        """
        return AsyncObservabilityResourceWithStreamingResponse(self)


class ObservabilityResourceWithRawResponse:
    def __init__(self, observability: ObservabilityResource) -> None:
        self._observability = observability

    @cached_property
    def telemetry(self) -> TelemetryResourceWithRawResponse:
        return TelemetryResourceWithRawResponse(self._observability.telemetry)

    @cached_property
    def destinations(self) -> DestinationsResourceWithRawResponse:
        return DestinationsResourceWithRawResponse(self._observability.destinations)

    @cached_property
    def queries(self) -> QueriesResourceWithRawResponse:
        return QueriesResourceWithRawResponse(self._observability.queries)

    @cached_property
    def shared_queries(self) -> SharedQueriesResourceWithRawResponse:
        return SharedQueriesResourceWithRawResponse(self._observability.shared_queries)


class AsyncObservabilityResourceWithRawResponse:
    def __init__(self, observability: AsyncObservabilityResource) -> None:
        self._observability = observability

    @cached_property
    def telemetry(self) -> AsyncTelemetryResourceWithRawResponse:
        return AsyncTelemetryResourceWithRawResponse(self._observability.telemetry)

    @cached_property
    def destinations(self) -> AsyncDestinationsResourceWithRawResponse:
        return AsyncDestinationsResourceWithRawResponse(self._observability.destinations)

    @cached_property
    def queries(self) -> AsyncQueriesResourceWithRawResponse:
        return AsyncQueriesResourceWithRawResponse(self._observability.queries)

    @cached_property
    def shared_queries(self) -> AsyncSharedQueriesResourceWithRawResponse:
        return AsyncSharedQueriesResourceWithRawResponse(self._observability.shared_queries)


class ObservabilityResourceWithStreamingResponse:
    def __init__(self, observability: ObservabilityResource) -> None:
        self._observability = observability

    @cached_property
    def telemetry(self) -> TelemetryResourceWithStreamingResponse:
        return TelemetryResourceWithStreamingResponse(self._observability.telemetry)

    @cached_property
    def destinations(self) -> DestinationsResourceWithStreamingResponse:
        return DestinationsResourceWithStreamingResponse(self._observability.destinations)

    @cached_property
    def queries(self) -> QueriesResourceWithStreamingResponse:
        return QueriesResourceWithStreamingResponse(self._observability.queries)

    @cached_property
    def shared_queries(self) -> SharedQueriesResourceWithStreamingResponse:
        return SharedQueriesResourceWithStreamingResponse(self._observability.shared_queries)


class AsyncObservabilityResourceWithStreamingResponse:
    def __init__(self, observability: AsyncObservabilityResource) -> None:
        self._observability = observability

    @cached_property
    def telemetry(self) -> AsyncTelemetryResourceWithStreamingResponse:
        return AsyncTelemetryResourceWithStreamingResponse(self._observability.telemetry)

    @cached_property
    def destinations(self) -> AsyncDestinationsResourceWithStreamingResponse:
        return AsyncDestinationsResourceWithStreamingResponse(self._observability.destinations)

    @cached_property
    def queries(self) -> AsyncQueriesResourceWithStreamingResponse:
        return AsyncQueriesResourceWithStreamingResponse(self._observability.queries)

    @cached_property
    def shared_queries(self) -> AsyncSharedQueriesResourceWithStreamingResponse:
        return AsyncSharedQueriesResourceWithStreamingResponse(self._observability.shared_queries)
