# 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 .credentials import (
    CredentialsResource,
    AsyncCredentialsResource,
    CredentialsResourceWithRawResponse,
    AsyncCredentialsResourceWithRawResponse,
    CredentialsResourceWithStreamingResponse,
    AsyncCredentialsResourceWithStreamingResponse,
)
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 (
    credential_set_edit_params,
    credential_set_list_params,
    credential_set_create_params,
    credential_set_update_params,
)
from ....types.vulnerability_scanner.credential_set_get_response import CredentialSetGetResponse
from ....types.vulnerability_scanner.credential_set_edit_response import CredentialSetEditResponse
from ....types.vulnerability_scanner.credential_set_list_response import CredentialSetListResponse
from ....types.vulnerability_scanner.credential_set_create_response import CredentialSetCreateResponse
from ....types.vulnerability_scanner.credential_set_update_response import CredentialSetUpdateResponse

__all__ = ["CredentialSetsResource", "AsyncCredentialSetsResource"]


class CredentialSetsResource(SyncAPIResource):
    @cached_property
    def credentials(self) -> CredentialsResource:
        return CredentialsResource(self._client)

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

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

    def create(
        self,
        *,
        account_id: str,
        name: 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[CredentialSetCreateResponse]:
        """
        Creates a new credential set.

        Args:
          account_id: Identifier.

          name: Human-readable name.

          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/credential_sets", account_id=account_id),
            body=maybe_transform({"name": name}, credential_set_create_params.CredentialSetCreateParams),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[CredentialSetCreateResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[CredentialSetCreateResponse]], ResultWrapper[CredentialSetCreateResponse]),
        )

    def update(
        self,
        credential_set_id: str,
        *,
        account_id: str,
        name: 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[CredentialSetUpdateResponse]:
        """Replaces a credential set.

        All fields must be provided.

        Args:
          account_id: Identifier.

          name: Human-readable name.

          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 credential_set_id:
            raise ValueError(f"Expected a non-empty value for `credential_set_id` but received {credential_set_id!r}")
        return self._put(
            path_template(
                "/accounts/{account_id}/vuln_scanner/credential_sets/{credential_set_id}",
                account_id=account_id,
                credential_set_id=credential_set_id,
            ),
            body=maybe_transform({"name": name}, credential_set_update_params.CredentialSetUpdateParams),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[CredentialSetUpdateResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[CredentialSetUpdateResponse]], ResultWrapper[CredentialSetUpdateResponse]),
        )

    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[CredentialSetListResponse]:
        """
        Returns all credential sets 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/credential_sets", account_id=account_id),
            page=SyncV4PagePaginationArray[CredentialSetListResponse],
            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,
                    },
                    credential_set_list_params.CredentialSetListParams,
                ),
            ),
            model=CredentialSetListResponse,
        )

    def delete(
        self,
        credential_set_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:
        """
        Deletes a credential set and all of its credentials.

        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 credential_set_id:
            raise ValueError(f"Expected a non-empty value for `credential_set_id` but received {credential_set_id!r}")
        return self._delete(
            path_template(
                "/accounts/{account_id}/vuln_scanner/credential_sets/{credential_set_id}",
                account_id=account_id,
                credential_set_id=credential_set_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,
        credential_set_id: str,
        *,
        account_id: str,
        name: 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[CredentialSetEditResponse]:
        """
        Updates a credential set with only the provided fields; omitted fields remain
        unchanged.

        Args:
          account_id: Identifier.

          name: Human-readable name.

          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 credential_set_id:
            raise ValueError(f"Expected a non-empty value for `credential_set_id` but received {credential_set_id!r}")
        return self._patch(
            path_template(
                "/accounts/{account_id}/vuln_scanner/credential_sets/{credential_set_id}",
                account_id=account_id,
                credential_set_id=credential_set_id,
            ),
            body=maybe_transform({"name": name}, credential_set_edit_params.CredentialSetEditParams),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[CredentialSetEditResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[CredentialSetEditResponse]], ResultWrapper[CredentialSetEditResponse]),
        )

    def get(
        self,
        credential_set_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[CredentialSetGetResponse]:
        """
        Returns a single credential set 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 credential_set_id:
            raise ValueError(f"Expected a non-empty value for `credential_set_id` but received {credential_set_id!r}")
        return self._get(
            path_template(
                "/accounts/{account_id}/vuln_scanner/credential_sets/{credential_set_id}",
                account_id=account_id,
                credential_set_id=credential_set_id,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[CredentialSetGetResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[CredentialSetGetResponse]], ResultWrapper[CredentialSetGetResponse]),
        )


class AsyncCredentialSetsResource(AsyncAPIResource):
    @cached_property
    def credentials(self) -> AsyncCredentialsResource:
        return AsyncCredentialsResource(self._client)

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

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

    async def create(
        self,
        *,
        account_id: str,
        name: 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[CredentialSetCreateResponse]:
        """
        Creates a new credential set.

        Args:
          account_id: Identifier.

          name: Human-readable name.

          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/credential_sets", account_id=account_id),
            body=await async_maybe_transform({"name": name}, credential_set_create_params.CredentialSetCreateParams),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[CredentialSetCreateResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[CredentialSetCreateResponse]], ResultWrapper[CredentialSetCreateResponse]),
        )

    async def update(
        self,
        credential_set_id: str,
        *,
        account_id: str,
        name: 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[CredentialSetUpdateResponse]:
        """Replaces a credential set.

        All fields must be provided.

        Args:
          account_id: Identifier.

          name: Human-readable name.

          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 credential_set_id:
            raise ValueError(f"Expected a non-empty value for `credential_set_id` but received {credential_set_id!r}")
        return await self._put(
            path_template(
                "/accounts/{account_id}/vuln_scanner/credential_sets/{credential_set_id}",
                account_id=account_id,
                credential_set_id=credential_set_id,
            ),
            body=await async_maybe_transform({"name": name}, credential_set_update_params.CredentialSetUpdateParams),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[CredentialSetUpdateResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[CredentialSetUpdateResponse]], ResultWrapper[CredentialSetUpdateResponse]),
        )

    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[CredentialSetListResponse, AsyncV4PagePaginationArray[CredentialSetListResponse]]:
        """
        Returns all credential sets 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/credential_sets", account_id=account_id),
            page=AsyncV4PagePaginationArray[CredentialSetListResponse],
            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,
                    },
                    credential_set_list_params.CredentialSetListParams,
                ),
            ),
            model=CredentialSetListResponse,
        )

    async def delete(
        self,
        credential_set_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:
        """
        Deletes a credential set and all of its credentials.

        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 credential_set_id:
            raise ValueError(f"Expected a non-empty value for `credential_set_id` but received {credential_set_id!r}")
        return await self._delete(
            path_template(
                "/accounts/{account_id}/vuln_scanner/credential_sets/{credential_set_id}",
                account_id=account_id,
                credential_set_id=credential_set_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,
        credential_set_id: str,
        *,
        account_id: str,
        name: 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[CredentialSetEditResponse]:
        """
        Updates a credential set with only the provided fields; omitted fields remain
        unchanged.

        Args:
          account_id: Identifier.

          name: Human-readable name.

          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 credential_set_id:
            raise ValueError(f"Expected a non-empty value for `credential_set_id` but received {credential_set_id!r}")
        return await self._patch(
            path_template(
                "/accounts/{account_id}/vuln_scanner/credential_sets/{credential_set_id}",
                account_id=account_id,
                credential_set_id=credential_set_id,
            ),
            body=await async_maybe_transform({"name": name}, credential_set_edit_params.CredentialSetEditParams),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[CredentialSetEditResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[CredentialSetEditResponse]], ResultWrapper[CredentialSetEditResponse]),
        )

    async def get(
        self,
        credential_set_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[CredentialSetGetResponse]:
        """
        Returns a single credential set 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 credential_set_id:
            raise ValueError(f"Expected a non-empty value for `credential_set_id` but received {credential_set_id!r}")
        return await self._get(
            path_template(
                "/accounts/{account_id}/vuln_scanner/credential_sets/{credential_set_id}",
                account_id=account_id,
                credential_set_id=credential_set_id,
            ),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                post_parser=ResultWrapper[Optional[CredentialSetGetResponse]]._unwrapper,
            ),
            cast_to=cast(Type[Optional[CredentialSetGetResponse]], ResultWrapper[CredentialSetGetResponse]),
        )


class CredentialSetsResourceWithRawResponse:
    def __init__(self, credential_sets: CredentialSetsResource) -> None:
        self._credential_sets = credential_sets

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

    @cached_property
    def credentials(self) -> CredentialsResourceWithRawResponse:
        return CredentialsResourceWithRawResponse(self._credential_sets.credentials)


class AsyncCredentialSetsResourceWithRawResponse:
    def __init__(self, credential_sets: AsyncCredentialSetsResource) -> None:
        self._credential_sets = credential_sets

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

    @cached_property
    def credentials(self) -> AsyncCredentialsResourceWithRawResponse:
        return AsyncCredentialsResourceWithRawResponse(self._credential_sets.credentials)


class CredentialSetsResourceWithStreamingResponse:
    def __init__(self, credential_sets: CredentialSetsResource) -> None:
        self._credential_sets = credential_sets

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

    @cached_property
    def credentials(self) -> CredentialsResourceWithStreamingResponse:
        return CredentialsResourceWithStreamingResponse(self._credential_sets.credentials)


class AsyncCredentialSetsResourceWithStreamingResponse:
    def __init__(self, credential_sets: AsyncCredentialSetsResource) -> None:
        self._credential_sets = credential_sets

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

    @cached_property
    def credentials(self) -> AsyncCredentialsResourceWithStreamingResponse:
        return AsyncCredentialsResourceWithStreamingResponse(self._credential_sets.credentials)
