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

from __future__ import annotations

import httpx

from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
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 ....._base_client import make_request_options
from .....types.api.v2.shows.lottery_settings import LotterySettings

__all__ = ["LotterySettingsResource", "AsyncLotterySettingsResource"]


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

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

    def generate_new_question(
        self,
        show_id: int,
        *,
        # 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,
    ) -> LotterySettings:
        """
        Generate a new skill-based problem for this lottery

        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
        """
        return self._post(
            f"/api/v2/shows/{show_id}/lotterySettings/generateNewQuestion",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=LotterySettings,
        )

    def retrieve_lottery_settings(
        self,
        show_id: int,
        *,
        # 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,
    ) -> LotterySettings:
        """
        Get lotterySettings for show

        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
        """
        return self._get(
            f"/api/v2/shows/{show_id}/lotterySettings",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=LotterySettings,
        )


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

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

    async def generate_new_question(
        self,
        show_id: int,
        *,
        # 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,
    ) -> LotterySettings:
        """
        Generate a new skill-based problem for this lottery

        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
        """
        return await self._post(
            f"/api/v2/shows/{show_id}/lotterySettings/generateNewQuestion",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=LotterySettings,
        )

    async def retrieve_lottery_settings(
        self,
        show_id: int,
        *,
        # 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,
    ) -> LotterySettings:
        """
        Get lotterySettings for show

        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
        """
        return await self._get(
            f"/api/v2/shows/{show_id}/lotterySettings",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=LotterySettings,
        )


class LotterySettingsResourceWithRawResponse:
    def __init__(self, lottery_settings: LotterySettingsResource) -> None:
        self._lottery_settings = lottery_settings

        self.generate_new_question = to_raw_response_wrapper(
            lottery_settings.generate_new_question,
        )
        self.retrieve_lottery_settings = to_raw_response_wrapper(
            lottery_settings.retrieve_lottery_settings,
        )


class AsyncLotterySettingsResourceWithRawResponse:
    def __init__(self, lottery_settings: AsyncLotterySettingsResource) -> None:
        self._lottery_settings = lottery_settings

        self.generate_new_question = async_to_raw_response_wrapper(
            lottery_settings.generate_new_question,
        )
        self.retrieve_lottery_settings = async_to_raw_response_wrapper(
            lottery_settings.retrieve_lottery_settings,
        )


class LotterySettingsResourceWithStreamingResponse:
    def __init__(self, lottery_settings: LotterySettingsResource) -> None:
        self._lottery_settings = lottery_settings

        self.generate_new_question = to_streamed_response_wrapper(
            lottery_settings.generate_new_question,
        )
        self.retrieve_lottery_settings = to_streamed_response_wrapper(
            lottery_settings.retrieve_lottery_settings,
        )


class AsyncLotterySettingsResourceWithStreamingResponse:
    def __init__(self, lottery_settings: AsyncLotterySettingsResource) -> None:
        self._lottery_settings = lottery_settings

        self.generate_new_question = async_to_streamed_response_wrapper(
            lottery_settings.generate_new_question,
        )
        self.retrieve_lottery_settings = async_to_streamed_response_wrapper(
            lottery_settings.retrieve_lottery_settings,
        )
