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

from __future__ import annotations

from .scans import (
    ScansResource,
    AsyncScansResource,
    ScansResourceWithRawResponse,
    AsyncScansResourceWithRawResponse,
    ScansResourceWithStreamingResponse,
    AsyncScansResourceWithStreamingResponse,
)
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from .target_environments import (
    TargetEnvironmentsResource,
    AsyncTargetEnvironmentsResource,
    TargetEnvironmentsResourceWithRawResponse,
    AsyncTargetEnvironmentsResourceWithRawResponse,
    TargetEnvironmentsResourceWithStreamingResponse,
    AsyncTargetEnvironmentsResourceWithStreamingResponse,
)
from .credential_sets.credential_sets import (
    CredentialSetsResource,
    AsyncCredentialSetsResource,
    CredentialSetsResourceWithRawResponse,
    AsyncCredentialSetsResourceWithRawResponse,
    CredentialSetsResourceWithStreamingResponse,
    AsyncCredentialSetsResourceWithStreamingResponse,
)

__all__ = ["VulnerabilityScannerResource", "AsyncVulnerabilityScannerResource"]


class VulnerabilityScannerResource(SyncAPIResource):
    @cached_property
    def credential_sets(self) -> CredentialSetsResource:
        return CredentialSetsResource(self._client)

    @cached_property
    def scans(self) -> ScansResource:
        return ScansResource(self._client)

    @cached_property
    def target_environments(self) -> TargetEnvironmentsResource:
        return TargetEnvironmentsResource(self._client)

    @cached_property
    def with_raw_response(self) -> VulnerabilityScannerResourceWithRawResponse:
        """
        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 VulnerabilityScannerResourceWithRawResponse(self)

    @cached_property
    def with_streaming_response(self) -> VulnerabilityScannerResourceWithStreamingResponse:
        """
        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 VulnerabilityScannerResourceWithStreamingResponse(self)


class AsyncVulnerabilityScannerResource(AsyncAPIResource):
    @cached_property
    def credential_sets(self) -> AsyncCredentialSetsResource:
        return AsyncCredentialSetsResource(self._client)

    @cached_property
    def scans(self) -> AsyncScansResource:
        return AsyncScansResource(self._client)

    @cached_property
    def target_environments(self) -> AsyncTargetEnvironmentsResource:
        return AsyncTargetEnvironmentsResource(self._client)

    @cached_property
    def with_raw_response(self) -> AsyncVulnerabilityScannerResourceWithRawResponse:
        """
        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 AsyncVulnerabilityScannerResourceWithRawResponse(self)

    @cached_property
    def with_streaming_response(self) -> AsyncVulnerabilityScannerResourceWithStreamingResponse:
        """
        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 AsyncVulnerabilityScannerResourceWithStreamingResponse(self)


class VulnerabilityScannerResourceWithRawResponse:
    def __init__(self, vulnerability_scanner: VulnerabilityScannerResource) -> None:
        self._vulnerability_scanner = vulnerability_scanner

    @cached_property
    def credential_sets(self) -> CredentialSetsResourceWithRawResponse:
        return CredentialSetsResourceWithRawResponse(self._vulnerability_scanner.credential_sets)

    @cached_property
    def scans(self) -> ScansResourceWithRawResponse:
        return ScansResourceWithRawResponse(self._vulnerability_scanner.scans)

    @cached_property
    def target_environments(self) -> TargetEnvironmentsResourceWithRawResponse:
        return TargetEnvironmentsResourceWithRawResponse(self._vulnerability_scanner.target_environments)


class AsyncVulnerabilityScannerResourceWithRawResponse:
    def __init__(self, vulnerability_scanner: AsyncVulnerabilityScannerResource) -> None:
        self._vulnerability_scanner = vulnerability_scanner

    @cached_property
    def credential_sets(self) -> AsyncCredentialSetsResourceWithRawResponse:
        return AsyncCredentialSetsResourceWithRawResponse(self._vulnerability_scanner.credential_sets)

    @cached_property
    def scans(self) -> AsyncScansResourceWithRawResponse:
        return AsyncScansResourceWithRawResponse(self._vulnerability_scanner.scans)

    @cached_property
    def target_environments(self) -> AsyncTargetEnvironmentsResourceWithRawResponse:
        return AsyncTargetEnvironmentsResourceWithRawResponse(self._vulnerability_scanner.target_environments)


class VulnerabilityScannerResourceWithStreamingResponse:
    def __init__(self, vulnerability_scanner: VulnerabilityScannerResource) -> None:
        self._vulnerability_scanner = vulnerability_scanner

    @cached_property
    def credential_sets(self) -> CredentialSetsResourceWithStreamingResponse:
        return CredentialSetsResourceWithStreamingResponse(self._vulnerability_scanner.credential_sets)

    @cached_property
    def scans(self) -> ScansResourceWithStreamingResponse:
        return ScansResourceWithStreamingResponse(self._vulnerability_scanner.scans)

    @cached_property
    def target_environments(self) -> TargetEnvironmentsResourceWithStreamingResponse:
        return TargetEnvironmentsResourceWithStreamingResponse(self._vulnerability_scanner.target_environments)


class AsyncVulnerabilityScannerResourceWithStreamingResponse:
    def __init__(self, vulnerability_scanner: AsyncVulnerabilityScannerResource) -> None:
        self._vulnerability_scanner = vulnerability_scanner

    @cached_property
    def credential_sets(self) -> AsyncCredentialSetsResourceWithStreamingResponse:
        return AsyncCredentialSetsResourceWithStreamingResponse(self._vulnerability_scanner.credential_sets)

    @cached_property
    def scans(self) -> AsyncScansResourceWithStreamingResponse:
        return AsyncScansResourceWithStreamingResponse(self._vulnerability_scanner.scans)

    @cached_property
    def target_environments(self) -> AsyncTargetEnvironmentsResourceWithStreamingResponse:
        return AsyncTargetEnvironmentsResourceWithStreamingResponse(self._vulnerability_scanner.target_environments)
