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

from __future__ import annotations

from typing import Type, Optional, cast

import httpx

from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
    to_raw_response_wrapper,
    to_streamed_response_wrapper,
    async_to_raw_response_wrapper,
    async_to_streamed_response_wrapper,
)
from ..._wrappers import ResultWrapper
from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
from ..._base_client import AsyncPaginator, make_request_options
from ...types.vulnerability_scanner import (
    target_environment_edit_params,
    target_environment_list_params,
    target_environment_create_params,
    target_environment_update_params,
)
from ...types.vulnerability_scanner.target_environment_get_response import TargetEnvironmentGetResponse
from ...types.vulnerability_scanner.target_environment_edit_response import TargetEnvironmentEditResponse
from ...types.vulnerability_scanner.target_environment_list_response import TargetEnvironmentListResponse
from ...types.vulnerability_scanner.target_environment_create_response import TargetEnvironmentCreateResponse
from ...types.vulnerability_scanner.target_environment_update_response import TargetEnvironmentUpdateResponse

__all__ = ["TargetEnvironmentsResource", "AsyncTargetEnvironmentsResource"]


class TargetEnvironmentsResource(SyncAPIResource):
    @cached_property
    def with_raw_response(self) -> TargetEnvironmentsResourceWithRawResponse:
        """
        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 TargetEnvironmentsResourceWithRawResponse(self)

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

    def create(
        self,
        *,
        account_id: str,
        name: str,
        target: target_environment_create_params.Target,
        description: Optional[str] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> Optional[TargetEnvironmentCreateResponse]:
        """
        Creates a new target environment for the account.

        Args:
          account_id: Identifier.

          name: Human-readable name.

          target: Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
              the service supports only `zone` targets.

          description: Optional description.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        return self._post(
            path_template("/accounts/{account_id}/vuln_scanner/target_environments", account_id=account_id),
            body=maybe_transform(
                {
                    "name": name,
                    "target": target,
                    "description": description,
                },
                target_environment_create_params.TargetEnvironmentCreateParams,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[TargetEnvironmentCreateResponse]]._unwrapper,
            ),
            cast_to=cast(
                Type[Optional[TargetEnvironmentCreateResponse]], ResultWrapper[TargetEnvironmentCreateResponse]
            ),
        )

    def update(
        self,
        target_environment_id: str,
        *,
        account_id: str,
        name: str,
        target: target_environment_update_params.Target,
        description: Optional[str] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> Optional[TargetEnvironmentUpdateResponse]:
        """Replaces a target environment.

        All fields must be provided.

        Args:
          account_id: Identifier.

          name: Human-readable name.

          target: Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
              the service supports only `zone` targets.

          description: Optional description.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        if not target_environment_id:
            raise ValueError(
                f"Expected a non-empty value for `target_environment_id` but received {target_environment_id!r}"
            )
        return self._put(
            path_template(
                "/accounts/{account_id}/vuln_scanner/target_environments/{target_environment_id}",
                account_id=account_id,
                target_environment_id=target_environment_id,
            ),
            body=maybe_transform(
                {
                    "name": name,
                    "target": target,
                    "description": description,
                },
                target_environment_update_params.TargetEnvironmentUpdateParams,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[TargetEnvironmentUpdateResponse]]._unwrapper,
            ),
            cast_to=cast(
                Type[Optional[TargetEnvironmentUpdateResponse]], ResultWrapper[TargetEnvironmentUpdateResponse]
            ),
        )

    def list(
        self,
        *,
        account_id: str,
        page: int | Omit = omit,
        per_page: int | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SyncV4PagePaginationArray[TargetEnvironmentListResponse]:
        """
        Returns all target environments for the account.

        Args:
          account_id: Identifier.

          page: Page number of paginated results.

          per_page: Number of results per page.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        return self._get_api_list(
            path_template("/accounts/{account_id}/vuln_scanner/target_environments", account_id=account_id),
            page=SyncV4PagePaginationArray[TargetEnvironmentListResponse],
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=maybe_transform(
                    {
                        "page": page,
                        "per_page": per_page,
                    },
                    target_environment_list_params.TargetEnvironmentListParams,
                ),
            ),
            model=TargetEnvironmentListResponse,
        )

    def delete(
        self,
        target_environment_id: str,
        *,
        account_id: str,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> object:
        """
        Removes a target environment.

        Args:
          account_id: Identifier.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        if not target_environment_id:
            raise ValueError(
                f"Expected a non-empty value for `target_environment_id` but received {target_environment_id!r}"
            )
        return self._delete(
            path_template(
                "/accounts/{account_id}/vuln_scanner/target_environments/{target_environment_id}",
                account_id=account_id,
                target_environment_id=target_environment_id,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[object]]._unwrapper,
            ),
            cast_to=cast(Type[object], ResultWrapper[object]),
        )

    def edit(
        self,
        target_environment_id: str,
        *,
        account_id: str,
        description: Optional[str] | Omit = omit,
        name: str | Omit = omit,
        target: target_environment_edit_params.Target | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> Optional[TargetEnvironmentEditResponse]:
        """
        Updates a target environment with only the provided fields; omitted fields
        remain unchanged.

        Args:
          account_id: Identifier.

          description: Optional description. Omit to leave unchanged, set to `null` to clear, or
              provide a string to update.

          name: Human-readable name.

          target: Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
              the service supports only `zone` targets.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        if not target_environment_id:
            raise ValueError(
                f"Expected a non-empty value for `target_environment_id` but received {target_environment_id!r}"
            )
        return self._patch(
            path_template(
                "/accounts/{account_id}/vuln_scanner/target_environments/{target_environment_id}",
                account_id=account_id,
                target_environment_id=target_environment_id,
            ),
            body=maybe_transform(
                {
                    "description": description,
                    "name": name,
                    "target": target,
                },
                target_environment_edit_params.TargetEnvironmentEditParams,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[TargetEnvironmentEditResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[TargetEnvironmentEditResponse]], ResultWrapper[TargetEnvironmentEditResponse]),
        )

    def get(
        self,
        target_environment_id: str,
        *,
        account_id: str,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> Optional[TargetEnvironmentGetResponse]:
        """
        Returns a single target environment by ID.

        Args:
          account_id: Identifier.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        if not target_environment_id:
            raise ValueError(
                f"Expected a non-empty value for `target_environment_id` but received {target_environment_id!r}"
            )
        return self._get(
            path_template(
                "/accounts/{account_id}/vuln_scanner/target_environments/{target_environment_id}",
                account_id=account_id,
                target_environment_id=target_environment_id,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[TargetEnvironmentGetResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[TargetEnvironmentGetResponse]], ResultWrapper[TargetEnvironmentGetResponse]),
        )


class AsyncTargetEnvironmentsResource(AsyncAPIResource):
    @cached_property
    def with_raw_response(self) -> AsyncTargetEnvironmentsResourceWithRawResponse:
        """
        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 AsyncTargetEnvironmentsResourceWithRawResponse(self)

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

    async def create(
        self,
        *,
        account_id: str,
        name: str,
        target: target_environment_create_params.Target,
        description: Optional[str] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> Optional[TargetEnvironmentCreateResponse]:
        """
        Creates a new target environment for the account.

        Args:
          account_id: Identifier.

          name: Human-readable name.

          target: Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
              the service supports only `zone` targets.

          description: Optional description.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        return await self._post(
            path_template("/accounts/{account_id}/vuln_scanner/target_environments", account_id=account_id),
            body=await async_maybe_transform(
                {
                    "name": name,
                    "target": target,
                    "description": description,
                },
                target_environment_create_params.TargetEnvironmentCreateParams,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[TargetEnvironmentCreateResponse]]._unwrapper,
            ),
            cast_to=cast(
                Type[Optional[TargetEnvironmentCreateResponse]], ResultWrapper[TargetEnvironmentCreateResponse]
            ),
        )

    async def update(
        self,
        target_environment_id: str,
        *,
        account_id: str,
        name: str,
        target: target_environment_update_params.Target,
        description: Optional[str] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> Optional[TargetEnvironmentUpdateResponse]:
        """Replaces a target environment.

        All fields must be provided.

        Args:
          account_id: Identifier.

          name: Human-readable name.

          target: Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
              the service supports only `zone` targets.

          description: Optional description.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        if not target_environment_id:
            raise ValueError(
                f"Expected a non-empty value for `target_environment_id` but received {target_environment_id!r}"
            )
        return await self._put(
            path_template(
                "/accounts/{account_id}/vuln_scanner/target_environments/{target_environment_id}",
                account_id=account_id,
                target_environment_id=target_environment_id,
            ),
            body=await async_maybe_transform(
                {
                    "name": name,
                    "target": target,
                    "description": description,
                },
                target_environment_update_params.TargetEnvironmentUpdateParams,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[TargetEnvironmentUpdateResponse]]._unwrapper,
            ),
            cast_to=cast(
                Type[Optional[TargetEnvironmentUpdateResponse]], ResultWrapper[TargetEnvironmentUpdateResponse]
            ),
        )

    def list(
        self,
        *,
        account_id: str,
        page: int | Omit = omit,
        per_page: int | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> AsyncPaginator[TargetEnvironmentListResponse, AsyncV4PagePaginationArray[TargetEnvironmentListResponse]]:
        """
        Returns all target environments for the account.

        Args:
          account_id: Identifier.

          page: Page number of paginated results.

          per_page: Number of results per page.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        return self._get_api_list(
            path_template("/accounts/{account_id}/vuln_scanner/target_environments", account_id=account_id),
            page=AsyncV4PagePaginationArray[TargetEnvironmentListResponse],
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=maybe_transform(
                    {
                        "page": page,
                        "per_page": per_page,
                    },
                    target_environment_list_params.TargetEnvironmentListParams,
                ),
            ),
            model=TargetEnvironmentListResponse,
        )

    async def delete(
        self,
        target_environment_id: str,
        *,
        account_id: str,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> object:
        """
        Removes a target environment.

        Args:
          account_id: Identifier.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        if not target_environment_id:
            raise ValueError(
                f"Expected a non-empty value for `target_environment_id` but received {target_environment_id!r}"
            )
        return await self._delete(
            path_template(
                "/accounts/{account_id}/vuln_scanner/target_environments/{target_environment_id}",
                account_id=account_id,
                target_environment_id=target_environment_id,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[object]]._unwrapper,
            ),
            cast_to=cast(Type[object], ResultWrapper[object]),
        )

    async def edit(
        self,
        target_environment_id: str,
        *,
        account_id: str,
        description: Optional[str] | Omit = omit,
        name: str | Omit = omit,
        target: target_environment_edit_params.Target | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> Optional[TargetEnvironmentEditResponse]:
        """
        Updates a target environment with only the provided fields; omitted fields
        remain unchanged.

        Args:
          account_id: Identifier.

          description: Optional description. Omit to leave unchanged, set to `null` to clear, or
              provide a string to update.

          name: Human-readable name.

          target: Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
              the service supports only `zone` targets.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        if not target_environment_id:
            raise ValueError(
                f"Expected a non-empty value for `target_environment_id` but received {target_environment_id!r}"
            )
        return await self._patch(
            path_template(
                "/accounts/{account_id}/vuln_scanner/target_environments/{target_environment_id}",
                account_id=account_id,
                target_environment_id=target_environment_id,
            ),
            body=await async_maybe_transform(
                {
                    "description": description,
                    "name": name,
                    "target": target,
                },
                target_environment_edit_params.TargetEnvironmentEditParams,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[TargetEnvironmentEditResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[TargetEnvironmentEditResponse]], ResultWrapper[TargetEnvironmentEditResponse]),
        )

    async def get(
        self,
        target_environment_id: str,
        *,
        account_id: str,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> Optional[TargetEnvironmentGetResponse]:
        """
        Returns a single target environment by ID.

        Args:
          account_id: Identifier.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not account_id:
            raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
        if not target_environment_id:
            raise ValueError(
                f"Expected a non-empty value for `target_environment_id` but received {target_environment_id!r}"
            )
        return await self._get(
            path_template(
                "/accounts/{account_id}/vuln_scanner/target_environments/{target_environment_id}",
                account_id=account_id,
                target_environment_id=target_environment_id,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[TargetEnvironmentGetResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[TargetEnvironmentGetResponse]], ResultWrapper[TargetEnvironmentGetResponse]),
        )


class TargetEnvironmentsResourceWithRawResponse:
    def __init__(self, target_environments: TargetEnvironmentsResource) -> None:
        self._target_environments = target_environments

        self.create = to_raw_response_wrapper(
            target_environments.create,
        )
        self.update = to_raw_response_wrapper(
            target_environments.update,
        )
        self.list = to_raw_response_wrapper(
            target_environments.list,
        )
        self.delete = to_raw_response_wrapper(
            target_environments.delete,
        )
        self.edit = to_raw_response_wrapper(
            target_environments.edit,
        )
        self.get = to_raw_response_wrapper(
            target_environments.get,
        )


class AsyncTargetEnvironmentsResourceWithRawResponse:
    def __init__(self, target_environments: AsyncTargetEnvironmentsResource) -> None:
        self._target_environments = target_environments

        self.create = async_to_raw_response_wrapper(
            target_environments.create,
        )
        self.update = async_to_raw_response_wrapper(
            target_environments.update,
        )
        self.list = async_to_raw_response_wrapper(
            target_environments.list,
        )
        self.delete = async_to_raw_response_wrapper(
            target_environments.delete,
        )
        self.edit = async_to_raw_response_wrapper(
            target_environments.edit,
        )
        self.get = async_to_raw_response_wrapper(
            target_environments.get,
        )


class TargetEnvironmentsResourceWithStreamingResponse:
    def __init__(self, target_environments: TargetEnvironmentsResource) -> None:
        self._target_environments = target_environments

        self.create = to_streamed_response_wrapper(
            target_environments.create,
        )
        self.update = to_streamed_response_wrapper(
            target_environments.update,
        )
        self.list = to_streamed_response_wrapper(
            target_environments.list,
        )
        self.delete = to_streamed_response_wrapper(
            target_environments.delete,
        )
        self.edit = to_streamed_response_wrapper(
            target_environments.edit,
        )
        self.get = to_streamed_response_wrapper(
            target_environments.get,
        )


class AsyncTargetEnvironmentsResourceWithStreamingResponse:
    def __init__(self, target_environments: AsyncTargetEnvironmentsResource) -> None:
        self._target_environments = target_environments

        self.create = async_to_streamed_response_wrapper(
            target_environments.create,
        )
        self.update = async_to_streamed_response_wrapper(
            target_environments.update,
        )
        self.list = async_to_streamed_response_wrapper(
            target_environments.list,
        )
        self.delete = async_to_streamed_response_wrapper(
            target_environments.delete,
        )
        self.edit = async_to_streamed_response_wrapper(
            target_environments.edit,
        )
        self.get = async_to_streamed_response_wrapper(
            target_environments.get,
        )
