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

from __future__ import annotations

from typing import Any, Iterable, cast

import httpx

from .alerts import (
    AlertsResource,
    AsyncAlertsResource,
    AlertsResourceWithRawResponse,
    AsyncAlertsResourceWithRawResponse,
    AlertsResourceWithStreamingResponse,
    AsyncAlertsResourceWithStreamingResponse,
)
from .offers import (
    OffersResource,
    AsyncOffersResource,
    OffersResourceWithRawResponse,
    AsyncOffersResourceWithRawResponse,
    OffersResourceWithStreamingResponse,
    AsyncOffersResourceWithStreamingResponse,
)
from .bookmarks import (
    BookmarksResource,
    AsyncBookmarksResource,
    BookmarksResourceWithRawResponse,
    AsyncBookmarksResourceWithRawResponse,
    BookmarksResourceWithStreamingResponse,
    AsyncBookmarksResourceWithStreamingResponse,
)
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ....._utils import maybe_transform, async_maybe_transform
from ....._compat import cached_property
from .rush_grants import (
    RushGrantsResource,
    AsyncRushGrantsResource,
    RushGrantsResourceWithRawResponse,
    AsyncRushGrantsResourceWithRawResponse,
    RushGrantsResourceWithStreamingResponse,
    AsyncRushGrantsResourceWithStreamingResponse,
)
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 .shows_reviews import (
    ShowsReviewsResource,
    AsyncShowsReviewsResource,
    ShowsReviewsResourceWithRawResponse,
    AsyncShowsReviewsResourceWithRawResponse,
    ShowsReviewsResourceWithStreamingResponse,
    AsyncShowsReviewsResourceWithStreamingResponse,
)
from .lottery_entries import (
    LotteryEntriesResource,
    AsyncLotteryEntriesResource,
    LotteryEntriesResourceWithRawResponse,
    AsyncLotteryEntriesResourceWithRawResponse,
    LotteryEntriesResourceWithStreamingResponse,
    AsyncLotteryEntriesResourceWithStreamingResponse,
)
from .payment_methods import (
    PaymentMethodsResource,
    AsyncPaymentMethodsResource,
    PaymentMethodsResourceWithRawResponse,
    AsyncPaymentMethodsResourceWithRawResponse,
    PaymentMethodsResourceWithStreamingResponse,
    AsyncPaymentMethodsResourceWithStreamingResponse,
)
from ....._base_client import make_request_options
from .....types.api.v2 import (
    PrivacyLaw,
    MarketingConsentStatus,
    MarketingSubscriptionSource,
    customer_create_params,
    customer_update_params,
    customer_bookmark_orderings_params,
)
from .....types.api.v2.customer import Customer
from .....types.api.v2.privacy_law import PrivacyLaw
from .....types.api.v2.marketing_consent_status import MarketingConsentStatus
from .....types.api.v2.marketing_subscription_source import MarketingSubscriptionSource
from .....types.api.v2.customer_deletion_requests_response import CustomerDeletionRequestsResponse
from .....types.api.v2.customer_bookmark_orderings_response import CustomerBookmarkOrderingsResponse
from .....types.api.v2.customer_retrieve_rewards_summary_response import CustomerRetrieveRewardsSummaryResponse
from .....types.api.v2.customer_retrieve_available_profile_images_response import (
    CustomerRetrieveAvailableProfileImagesResponse,
)

__all__ = ["CustomersResource", "AsyncCustomersResource"]


class CustomersResource(SyncAPIResource):
    @cached_property
    def alerts(self) -> AlertsResource:
        return AlertsResource(self._client)

    @cached_property
    def bookmarks(self) -> BookmarksResource:
        return BookmarksResource(self._client)

    @cached_property
    def lottery_entries(self) -> LotteryEntriesResource:
        return LotteryEntriesResource(self._client)

    @cached_property
    def offers(self) -> OffersResource:
        return OffersResource(self._client)

    @cached_property
    def payment_methods(self) -> PaymentMethodsResource:
        return PaymentMethodsResource(self._client)

    @cached_property
    def shows_reviews(self) -> ShowsReviewsResource:
        return ShowsReviewsResource(self._client)

    @cached_property
    def rush_grants(self) -> RushGrantsResource:
        return RushGrantsResource(self._client)

    @cached_property
    def with_raw_response(self) -> CustomersResourceWithRawResponse:
        """
        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/alisytsma/ali-test-mcp#accessing-raw-response-data-eg-headers
        """
        return CustomersResourceWithRawResponse(self)

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

        For more information, see https://www.github.com/alisytsma/ali-test-mcp#with_streaming_response
        """
        return CustomersResourceWithStreamingResponse(self)

    def create(
        self,
        *,
        email: str,
        first_name: str,
        home_location_id: int,
        identity: str,
        last_name: str,
        marketing_email_consent: MarketingConsentStatus | NotGiven = NOT_GIVEN,
        password: str | NotGiven = NOT_GIVEN,
        privacy_law: PrivacyLaw | NotGiven = NOT_GIVEN,
        subscription_source: MarketingSubscriptionSource | NotGiven = NOT_GIVEN,
        # 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,
    ) -> Customer:
        """Register a new customer on TodayTix.

        Only available on TodayTix retailer. The
        server will verify that the authenticated principal has permission to create a
        new customer with the provided identity.

        Args:
          email: Email address.

          first_name: First name of the TodayTix customer.

          home_location_id: Numeric identifier for a resource

          identity: The identity id to associate with this customer.

          last_name: Last name of the TodayTix customer.

          marketing_email_consent: Used to indicate the status of a user's consent to receive marketing
              communications from TodayTix. N.B. Clients may only set this to GRANTED or
              DENIED in POST/PATCH endpoints; only the backend can set this to UNDETERMINED.

          password: Password to create user

          privacy_law: The privacy law by which a customer's personal data is protected. Different
              customers fall under different legal protection based on their home location,
              citizenship, etc. Laws include:

              - GDPR (General Data Protection & Regulation) for EU citizens & residents.
              - CA (California Consumer Privacy Act) for California residents.
              - CASL (Canada's Anti-Spam Law) for Canadians.
              - AUS (Australia's Privacy Act) for Australians.
              - NZ (New Zealand's Privacy Act) for New Zealanders.
              - CT (Connecticut's Privacy Act) for Connecticut residents.
              - VA (Virginia's Privacy Act) for Virginia residents.
              - UT (Utah's Privacy Act) for Utah residents.
              - CO (Colorado's Privacy Act) for Colorado residents.
              - NONE for customers not protected by any of the above.

          subscription_source: Used to indicate the source process of a user's marketing subscription.

          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
        """
        return self._post(
            "/api/v2/customers",
            body=maybe_transform(
                {
                    "email": email,
                    "first_name": first_name,
                    "home_location_id": home_location_id,
                    "identity": identity,
                    "last_name": last_name,
                    "marketing_email_consent": marketing_email_consent,
                    "password": password,
                    "privacy_law": privacy_law,
                    "subscription_source": subscription_source,
                },
                customer_create_params.CustomerCreateParams,
            ),
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=Customer,
        )

    def retrieve(
        self,
        customer_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,
    ) -> Customer:
        """Gets `Customer` details.

        Supports embedded `homeLocation` object.

        Use `embed=homeLocation` to get full
        Location object instead of homeLocationId.

        Args:
          customer_id: A customer public facing Id (String). "me" or a hashed string. ?customer=me and
              /customers/me/ are both magical customer identifiers, but they are customer
              identifiers nonetheless. They make the API easier to use than
              ?customer=c.dkd3kl238es or /customers/c.23i8fjdksdfs3.

          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return self._get(
            f"/api/v2/customers/{customer_id}",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=Customer,
        )

    def update(
        self,
        account_id: int,
        *,
        customer_id: str,
        status: MarketingConsentStatus,
        # 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,
    ) -> MarketingConsentStatus:
        """
        Sets the customer's consent for a partner's account

        Args:
          status: Used to indicate the status of a user's consent to receive marketing
              communications from TodayTix. N.B. Clients may only set this to GRANTED or
              DENIED in POST/PATCH endpoints; only the backend can set this to UNDETERMINED.

          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return self._put(
            f"/api/v2/customers/{customer_id}/accountConsents/{account_id}",
            body=maybe_transform({"status": status}, customer_update_params.CustomerUpdateParams),
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=cast(Any, MarketingConsentStatus),  # Enum types cannot be passed in as arguments in the type system
        )

    def bookmark_orderings(
        self,
        customer_id: str,
        *,
        bookmark_ids: Iterable[int] | NotGiven = NOT_GIVEN,
        location_id: int | NotGiven = NOT_GIVEN,
        # 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,
    ) -> CustomerBookmarkOrderingsResponse:
        """
        Order customer bookmarks for a specific location

        Args:
          location_id: Numeric identifier for a resource

          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return self._post(
            f"/api/v2/customers/{customer_id}/bookmarkOrderings",
            body=maybe_transform(
                {
                    "bookmark_ids": bookmark_ids,
                    "location_id": location_id,
                },
                customer_bookmark_orderings_params.CustomerBookmarkOrderingsParams,
            ),
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=CustomerBookmarkOrderingsResponse,
        )

    def deletion_requests(
        self,
        customer_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,
    ) -> CustomerDeletionRequestsResponse:
        """
        Create a request for deleting all customer's personal data in our and our
        third-party systems.

        Args:
          customer_id: A customer public facing Id (String). "me" or a hashed string. ?customer=me and
              /customers/me/ are both magical customer identifiers, but they are customer
              identifiers nonetheless. They make the API easier to use than
              ?customer=c.dkd3kl238es or /customers/c.23i8fjdksdfs3.

          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return self._post(
            f"/api/v2/customers/{customer_id}/deletionRequests",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=CustomerDeletionRequestsResponse,
        )

    def retrieve_available_profile_images(
        self,
        customer_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,
    ) -> CustomerRetrieveAvailableProfileImagesResponse:
        """Returns all profile images available for the customer to select from.

        This is
        customer-specific since certain images may be gated to certain customers based
        on their rewards tier.

        Args:
          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return self._get(
            f"/api/v2/customers/{customer_id}/availableProfileImages",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=CustomerRetrieveAvailableProfileImagesResponse,
        )

    def retrieve_rewards_summary(
        self,
        customer_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,
    ) -> CustomerRetrieveRewardsSummaryResponse:
        """
        Returns customer's reward information.

        Args:
          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return self._get(
            f"/api/v2/customers/{customer_id}/rewardsSummary",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=CustomerRetrieveRewardsSummaryResponse,
        )


class AsyncCustomersResource(AsyncAPIResource):
    @cached_property
    def alerts(self) -> AsyncAlertsResource:
        return AsyncAlertsResource(self._client)

    @cached_property
    def bookmarks(self) -> AsyncBookmarksResource:
        return AsyncBookmarksResource(self._client)

    @cached_property
    def lottery_entries(self) -> AsyncLotteryEntriesResource:
        return AsyncLotteryEntriesResource(self._client)

    @cached_property
    def offers(self) -> AsyncOffersResource:
        return AsyncOffersResource(self._client)

    @cached_property
    def payment_methods(self) -> AsyncPaymentMethodsResource:
        return AsyncPaymentMethodsResource(self._client)

    @cached_property
    def shows_reviews(self) -> AsyncShowsReviewsResource:
        return AsyncShowsReviewsResource(self._client)

    @cached_property
    def rush_grants(self) -> AsyncRushGrantsResource:
        return AsyncRushGrantsResource(self._client)

    @cached_property
    def with_raw_response(self) -> AsyncCustomersResourceWithRawResponse:
        """
        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/alisytsma/ali-test-mcp#accessing-raw-response-data-eg-headers
        """
        return AsyncCustomersResourceWithRawResponse(self)

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

        For more information, see https://www.github.com/alisytsma/ali-test-mcp#with_streaming_response
        """
        return AsyncCustomersResourceWithStreamingResponse(self)

    async def create(
        self,
        *,
        email: str,
        first_name: str,
        home_location_id: int,
        identity: str,
        last_name: str,
        marketing_email_consent: MarketingConsentStatus | NotGiven = NOT_GIVEN,
        password: str | NotGiven = NOT_GIVEN,
        privacy_law: PrivacyLaw | NotGiven = NOT_GIVEN,
        subscription_source: MarketingSubscriptionSource | NotGiven = NOT_GIVEN,
        # 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,
    ) -> Customer:
        """Register a new customer on TodayTix.

        Only available on TodayTix retailer. The
        server will verify that the authenticated principal has permission to create a
        new customer with the provided identity.

        Args:
          email: Email address.

          first_name: First name of the TodayTix customer.

          home_location_id: Numeric identifier for a resource

          identity: The identity id to associate with this customer.

          last_name: Last name of the TodayTix customer.

          marketing_email_consent: Used to indicate the status of a user's consent to receive marketing
              communications from TodayTix. N.B. Clients may only set this to GRANTED or
              DENIED in POST/PATCH endpoints; only the backend can set this to UNDETERMINED.

          password: Password to create user

          privacy_law: The privacy law by which a customer's personal data is protected. Different
              customers fall under different legal protection based on their home location,
              citizenship, etc. Laws include:

              - GDPR (General Data Protection & Regulation) for EU citizens & residents.
              - CA (California Consumer Privacy Act) for California residents.
              - CASL (Canada's Anti-Spam Law) for Canadians.
              - AUS (Australia's Privacy Act) for Australians.
              - NZ (New Zealand's Privacy Act) for New Zealanders.
              - CT (Connecticut's Privacy Act) for Connecticut residents.
              - VA (Virginia's Privacy Act) for Virginia residents.
              - UT (Utah's Privacy Act) for Utah residents.
              - CO (Colorado's Privacy Act) for Colorado residents.
              - NONE for customers not protected by any of the above.

          subscription_source: Used to indicate the source process of a user's marketing subscription.

          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
        """
        return await self._post(
            "/api/v2/customers",
            body=await async_maybe_transform(
                {
                    "email": email,
                    "first_name": first_name,
                    "home_location_id": home_location_id,
                    "identity": identity,
                    "last_name": last_name,
                    "marketing_email_consent": marketing_email_consent,
                    "password": password,
                    "privacy_law": privacy_law,
                    "subscription_source": subscription_source,
                },
                customer_create_params.CustomerCreateParams,
            ),
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=Customer,
        )

    async def retrieve(
        self,
        customer_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,
    ) -> Customer:
        """Gets `Customer` details.

        Supports embedded `homeLocation` object.

        Use `embed=homeLocation` to get full
        Location object instead of homeLocationId.

        Args:
          customer_id: A customer public facing Id (String). "me" or a hashed string. ?customer=me and
              /customers/me/ are both magical customer identifiers, but they are customer
              identifiers nonetheless. They make the API easier to use than
              ?customer=c.dkd3kl238es or /customers/c.23i8fjdksdfs3.

          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return await self._get(
            f"/api/v2/customers/{customer_id}",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=Customer,
        )

    async def update(
        self,
        account_id: int,
        *,
        customer_id: str,
        status: MarketingConsentStatus,
        # 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,
    ) -> MarketingConsentStatus:
        """
        Sets the customer's consent for a partner's account

        Args:
          status: Used to indicate the status of a user's consent to receive marketing
              communications from TodayTix. N.B. Clients may only set this to GRANTED or
              DENIED in POST/PATCH endpoints; only the backend can set this to UNDETERMINED.

          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return await self._put(
            f"/api/v2/customers/{customer_id}/accountConsents/{account_id}",
            body=await async_maybe_transform({"status": status}, customer_update_params.CustomerUpdateParams),
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=cast(Any, MarketingConsentStatus),  # Enum types cannot be passed in as arguments in the type system
        )

    async def bookmark_orderings(
        self,
        customer_id: str,
        *,
        bookmark_ids: Iterable[int] | NotGiven = NOT_GIVEN,
        location_id: int | NotGiven = NOT_GIVEN,
        # 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,
    ) -> CustomerBookmarkOrderingsResponse:
        """
        Order customer bookmarks for a specific location

        Args:
          location_id: Numeric identifier for a resource

          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return await self._post(
            f"/api/v2/customers/{customer_id}/bookmarkOrderings",
            body=await async_maybe_transform(
                {
                    "bookmark_ids": bookmark_ids,
                    "location_id": location_id,
                },
                customer_bookmark_orderings_params.CustomerBookmarkOrderingsParams,
            ),
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=CustomerBookmarkOrderingsResponse,
        )

    async def deletion_requests(
        self,
        customer_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,
    ) -> CustomerDeletionRequestsResponse:
        """
        Create a request for deleting all customer's personal data in our and our
        third-party systems.

        Args:
          customer_id: A customer public facing Id (String). "me" or a hashed string. ?customer=me and
              /customers/me/ are both magical customer identifiers, but they are customer
              identifiers nonetheless. They make the API easier to use than
              ?customer=c.dkd3kl238es or /customers/c.23i8fjdksdfs3.

          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return await self._post(
            f"/api/v2/customers/{customer_id}/deletionRequests",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=CustomerDeletionRequestsResponse,
        )

    async def retrieve_available_profile_images(
        self,
        customer_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,
    ) -> CustomerRetrieveAvailableProfileImagesResponse:
        """Returns all profile images available for the customer to select from.

        This is
        customer-specific since certain images may be gated to certain customers based
        on their rewards tier.

        Args:
          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return await self._get(
            f"/api/v2/customers/{customer_id}/availableProfileImages",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=CustomerRetrieveAvailableProfileImagesResponse,
        )

    async def retrieve_rewards_summary(
        self,
        customer_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,
    ) -> CustomerRetrieveRewardsSummaryResponse:
        """
        Returns customer's reward information.

        Args:
          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 customer_id:
            raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
        return await self._get(
            f"/api/v2/customers/{customer_id}/rewardsSummary",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=CustomerRetrieveRewardsSummaryResponse,
        )


class CustomersResourceWithRawResponse:
    def __init__(self, customers: CustomersResource) -> None:
        self._customers = customers

        self.create = to_raw_response_wrapper(
            customers.create,
        )
        self.retrieve = to_raw_response_wrapper(
            customers.retrieve,
        )
        self.update = to_raw_response_wrapper(
            customers.update,
        )
        self.bookmark_orderings = to_raw_response_wrapper(
            customers.bookmark_orderings,
        )
        self.deletion_requests = to_raw_response_wrapper(
            customers.deletion_requests,
        )
        self.retrieve_available_profile_images = to_raw_response_wrapper(
            customers.retrieve_available_profile_images,
        )
        self.retrieve_rewards_summary = to_raw_response_wrapper(
            customers.retrieve_rewards_summary,
        )

    @cached_property
    def alerts(self) -> AlertsResourceWithRawResponse:
        return AlertsResourceWithRawResponse(self._customers.alerts)

    @cached_property
    def bookmarks(self) -> BookmarksResourceWithRawResponse:
        return BookmarksResourceWithRawResponse(self._customers.bookmarks)

    @cached_property
    def lottery_entries(self) -> LotteryEntriesResourceWithRawResponse:
        return LotteryEntriesResourceWithRawResponse(self._customers.lottery_entries)

    @cached_property
    def offers(self) -> OffersResourceWithRawResponse:
        return OffersResourceWithRawResponse(self._customers.offers)

    @cached_property
    def payment_methods(self) -> PaymentMethodsResourceWithRawResponse:
        return PaymentMethodsResourceWithRawResponse(self._customers.payment_methods)

    @cached_property
    def shows_reviews(self) -> ShowsReviewsResourceWithRawResponse:
        return ShowsReviewsResourceWithRawResponse(self._customers.shows_reviews)

    @cached_property
    def rush_grants(self) -> RushGrantsResourceWithRawResponse:
        return RushGrantsResourceWithRawResponse(self._customers.rush_grants)


class AsyncCustomersResourceWithRawResponse:
    def __init__(self, customers: AsyncCustomersResource) -> None:
        self._customers = customers

        self.create = async_to_raw_response_wrapper(
            customers.create,
        )
        self.retrieve = async_to_raw_response_wrapper(
            customers.retrieve,
        )
        self.update = async_to_raw_response_wrapper(
            customers.update,
        )
        self.bookmark_orderings = async_to_raw_response_wrapper(
            customers.bookmark_orderings,
        )
        self.deletion_requests = async_to_raw_response_wrapper(
            customers.deletion_requests,
        )
        self.retrieve_available_profile_images = async_to_raw_response_wrapper(
            customers.retrieve_available_profile_images,
        )
        self.retrieve_rewards_summary = async_to_raw_response_wrapper(
            customers.retrieve_rewards_summary,
        )

    @cached_property
    def alerts(self) -> AsyncAlertsResourceWithRawResponse:
        return AsyncAlertsResourceWithRawResponse(self._customers.alerts)

    @cached_property
    def bookmarks(self) -> AsyncBookmarksResourceWithRawResponse:
        return AsyncBookmarksResourceWithRawResponse(self._customers.bookmarks)

    @cached_property
    def lottery_entries(self) -> AsyncLotteryEntriesResourceWithRawResponse:
        return AsyncLotteryEntriesResourceWithRawResponse(self._customers.lottery_entries)

    @cached_property
    def offers(self) -> AsyncOffersResourceWithRawResponse:
        return AsyncOffersResourceWithRawResponse(self._customers.offers)

    @cached_property
    def payment_methods(self) -> AsyncPaymentMethodsResourceWithRawResponse:
        return AsyncPaymentMethodsResourceWithRawResponse(self._customers.payment_methods)

    @cached_property
    def shows_reviews(self) -> AsyncShowsReviewsResourceWithRawResponse:
        return AsyncShowsReviewsResourceWithRawResponse(self._customers.shows_reviews)

    @cached_property
    def rush_grants(self) -> AsyncRushGrantsResourceWithRawResponse:
        return AsyncRushGrantsResourceWithRawResponse(self._customers.rush_grants)


class CustomersResourceWithStreamingResponse:
    def __init__(self, customers: CustomersResource) -> None:
        self._customers = customers

        self.create = to_streamed_response_wrapper(
            customers.create,
        )
        self.retrieve = to_streamed_response_wrapper(
            customers.retrieve,
        )
        self.update = to_streamed_response_wrapper(
            customers.update,
        )
        self.bookmark_orderings = to_streamed_response_wrapper(
            customers.bookmark_orderings,
        )
        self.deletion_requests = to_streamed_response_wrapper(
            customers.deletion_requests,
        )
        self.retrieve_available_profile_images = to_streamed_response_wrapper(
            customers.retrieve_available_profile_images,
        )
        self.retrieve_rewards_summary = to_streamed_response_wrapper(
            customers.retrieve_rewards_summary,
        )

    @cached_property
    def alerts(self) -> AlertsResourceWithStreamingResponse:
        return AlertsResourceWithStreamingResponse(self._customers.alerts)

    @cached_property
    def bookmarks(self) -> BookmarksResourceWithStreamingResponse:
        return BookmarksResourceWithStreamingResponse(self._customers.bookmarks)

    @cached_property
    def lottery_entries(self) -> LotteryEntriesResourceWithStreamingResponse:
        return LotteryEntriesResourceWithStreamingResponse(self._customers.lottery_entries)

    @cached_property
    def offers(self) -> OffersResourceWithStreamingResponse:
        return OffersResourceWithStreamingResponse(self._customers.offers)

    @cached_property
    def payment_methods(self) -> PaymentMethodsResourceWithStreamingResponse:
        return PaymentMethodsResourceWithStreamingResponse(self._customers.payment_methods)

    @cached_property
    def shows_reviews(self) -> ShowsReviewsResourceWithStreamingResponse:
        return ShowsReviewsResourceWithStreamingResponse(self._customers.shows_reviews)

    @cached_property
    def rush_grants(self) -> RushGrantsResourceWithStreamingResponse:
        return RushGrantsResourceWithStreamingResponse(self._customers.rush_grants)


class AsyncCustomersResourceWithStreamingResponse:
    def __init__(self, customers: AsyncCustomersResource) -> None:
        self._customers = customers

        self.create = async_to_streamed_response_wrapper(
            customers.create,
        )
        self.retrieve = async_to_streamed_response_wrapper(
            customers.retrieve,
        )
        self.update = async_to_streamed_response_wrapper(
            customers.update,
        )
        self.bookmark_orderings = async_to_streamed_response_wrapper(
            customers.bookmark_orderings,
        )
        self.deletion_requests = async_to_streamed_response_wrapper(
            customers.deletion_requests,
        )
        self.retrieve_available_profile_images = async_to_streamed_response_wrapper(
            customers.retrieve_available_profile_images,
        )
        self.retrieve_rewards_summary = async_to_streamed_response_wrapper(
            customers.retrieve_rewards_summary,
        )

    @cached_property
    def alerts(self) -> AsyncAlertsResourceWithStreamingResponse:
        return AsyncAlertsResourceWithStreamingResponse(self._customers.alerts)

    @cached_property
    def bookmarks(self) -> AsyncBookmarksResourceWithStreamingResponse:
        return AsyncBookmarksResourceWithStreamingResponse(self._customers.bookmarks)

    @cached_property
    def lottery_entries(self) -> AsyncLotteryEntriesResourceWithStreamingResponse:
        return AsyncLotteryEntriesResourceWithStreamingResponse(self._customers.lottery_entries)

    @cached_property
    def offers(self) -> AsyncOffersResourceWithStreamingResponse:
        return AsyncOffersResourceWithStreamingResponse(self._customers.offers)

    @cached_property
    def payment_methods(self) -> AsyncPaymentMethodsResourceWithStreamingResponse:
        return AsyncPaymentMethodsResourceWithStreamingResponse(self._customers.payment_methods)

    @cached_property
    def shows_reviews(self) -> AsyncShowsReviewsResourceWithStreamingResponse:
        return AsyncShowsReviewsResourceWithStreamingResponse(self._customers.shows_reviews)

    @cached_property
    def rush_grants(self) -> AsyncRushGrantsResourceWithStreamingResponse:
        return AsyncRushGrantsResourceWithStreamingResponse(self._customers.rush_grants)
