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

from __future__ import annotations

import os
from typing import Any, cast

import pytest

from ali_test_2 import AliTest2, AsyncAliTest2
from tests.utils import assert_matches_type
from ali_test_2.types.api.v2 import (
    Hold,
    HoldListResponse,
    HoldUpdateClearResponse,
    HoldRetrieveApplePaySessionResponse,
)

base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")


class TestHolds:
    parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])

    @pytest.mark.skip()
    @parametrize
    def test_method_create(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.create(
            hold_type="RUSH",
        )
        assert_matches_type(Hold, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_method_create_with_all_params(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.create(
            hold_type="RUSH",
            agent_payment_reference="agentPaymentReference",
            apply_rewards_credit=True,
            customer="c.a1b2c3d4e5f6",
            hold_body_id="holdBodyId",
            lottery_entry=0,
            num_tickets=0,
            offer=0,
            provider=0,
            provider_params="providerParams",
            seats=[
                {
                    "_type": "_type",
                    "provider": 0,
                    "seatsio_label": "GRAND CIRCLE-A-101",
                }
            ],
            section=0,
            should_override_ticket_protection_plan=True,
            showtime=0,
            tickets_by_price_type=[
                {
                    "num_tickets": 2,
                    "price_type_id": 0,
                }
            ],
            use_unified_checkout=True,
            voucher_code="voucherCode",
        )
        assert_matches_type(Hold, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_raw_response_create(self, client: AliTest2) -> None:
        response = client.api.v2.holds.with_raw_response.create(
            hold_type="RUSH",
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = response.parse()
        assert_matches_type(Hold, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_streaming_response_create(self, client: AliTest2) -> None:
        with client.api.v2.holds.with_streaming_response.create(
            hold_type="RUSH",
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = response.parse()
            assert_matches_type(Hold, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    def test_method_retrieve(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.retrieve(
            0,
        )
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_raw_response_retrieve(self, client: AliTest2) -> None:
        response = client.api.v2.holds.with_raw_response.retrieve(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = response.parse()
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_streaming_response_retrieve(self, client: AliTest2) -> None:
        with client.api.v2.holds.with_streaming_response.retrieve(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = response.parse()
            assert_matches_type(object, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    def test_method_update(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.update(
            hold_id=0,
        )
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_method_update_with_all_params(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.update(
            hold_id=0,
            add_ons=[
                {
                    "id": 0,
                    "quantity": 2,
                    "provider_id": 1,
                }
            ],
            agent_payment_reference="agentPaymentReference",
            apply_rewards_credit=True,
            apply_ticket_protection=True,
            email="email",
            hold_type="RUSH",
            is_rewards_benefit=True,
            num_tickets=0,
            phone_country_code="phoneCountryCode",
            provider=0,
            provider_params="providerParams",
            seats=[
                {
                    "_type": "_type",
                    "provider": 0,
                    "seatsio_label": "GRAND CIRCLE-A-101",
                }
            ],
            secret="secret",
            section=0,
            should_override_ticket_protection_plan=True,
            showtime=0,
            tickets_by_price_type=[
                {
                    "num_tickets": 2,
                    "price_type_id": 0,
                }
            ],
            use_unified_checkout=True,
            voucher="voucher",
        )
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_raw_response_update(self, client: AliTest2) -> None:
        response = client.api.v2.holds.with_raw_response.update(
            hold_id=0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = response.parse()
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_streaming_response_update(self, client: AliTest2) -> None:
        with client.api.v2.holds.with_streaming_response.update(
            hold_id=0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = response.parse()
            assert_matches_type(object, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    def test_method_list(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.list()
        assert_matches_type(HoldListResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_method_list_with_all_params(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.list(
            customer_id="customerId",
        )
        assert_matches_type(HoldListResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_raw_response_list(self, client: AliTest2) -> None:
        response = client.api.v2.holds.with_raw_response.list()

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = response.parse()
        assert_matches_type(HoldListResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_streaming_response_list(self, client: AliTest2) -> None:
        with client.api.v2.holds.with_streaming_response.list() as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = response.parse()
            assert_matches_type(HoldListResponse, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    def test_method_delete(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.delete(
            0,
        )
        assert hold is None

    @pytest.mark.skip()
    @parametrize
    def test_raw_response_delete(self, client: AliTest2) -> None:
        response = client.api.v2.holds.with_raw_response.delete(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = response.parse()
        assert hold is None

    @pytest.mark.skip()
    @parametrize
    def test_streaming_response_delete(self, client: AliTest2) -> None:
        with client.api.v2.holds.with_streaming_response.delete(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = response.parse()
            assert hold is None

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    def test_method_delete_ticket_protection(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.delete_ticket_protection(
            0,
        )
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_raw_response_delete_ticket_protection(self, client: AliTest2) -> None:
        response = client.api.v2.holds.with_raw_response.delete_ticket_protection(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = response.parse()
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_streaming_response_delete_ticket_protection(self, client: AliTest2) -> None:
        with client.api.v2.holds.with_streaming_response.delete_ticket_protection(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = response.parse()
            assert_matches_type(object, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    def test_method_delete_voucher(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.delete_voucher(
            0,
        )
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_raw_response_delete_voucher(self, client: AliTest2) -> None:
        response = client.api.v2.holds.with_raw_response.delete_voucher(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = response.parse()
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_streaming_response_delete_voucher(self, client: AliTest2) -> None:
        with client.api.v2.holds.with_streaming_response.delete_voucher(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = response.parse()
            assert_matches_type(object, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    def test_method_retrieve_apple_pay_session(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.retrieve_apple_pay_session(
            0,
        )
        assert_matches_type(HoldRetrieveApplePaySessionResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_raw_response_retrieve_apple_pay_session(self, client: AliTest2) -> None:
        response = client.api.v2.holds.with_raw_response.retrieve_apple_pay_session(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = response.parse()
        assert_matches_type(HoldRetrieveApplePaySessionResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_streaming_response_retrieve_apple_pay_session(self, client: AliTest2) -> None:
        with client.api.v2.holds.with_streaming_response.retrieve_apple_pay_session(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = response.parse()
            assert_matches_type(HoldRetrieveApplePaySessionResponse, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    def test_method_update_clear(self, client: AliTest2) -> None:
        hold = client.api.v2.holds.update_clear(
            0,
        )
        assert_matches_type(HoldUpdateClearResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_raw_response_update_clear(self, client: AliTest2) -> None:
        response = client.api.v2.holds.with_raw_response.update_clear(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = response.parse()
        assert_matches_type(HoldUpdateClearResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    def test_streaming_response_update_clear(self, client: AliTest2) -> None:
        with client.api.v2.holds.with_streaming_response.update_clear(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = response.parse()
            assert_matches_type(HoldUpdateClearResponse, hold, path=["response"])

        assert cast(Any, response.is_closed) is True


class TestAsyncHolds:
    parametrize = pytest.mark.parametrize(
        "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
    )

    @pytest.mark.skip()
    @parametrize
    async def test_method_create(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.create(
            hold_type="RUSH",
        )
        assert_matches_type(Hold, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_method_create_with_all_params(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.create(
            hold_type="RUSH",
            agent_payment_reference="agentPaymentReference",
            apply_rewards_credit=True,
            customer="c.a1b2c3d4e5f6",
            hold_body_id="holdBodyId",
            lottery_entry=0,
            num_tickets=0,
            offer=0,
            provider=0,
            provider_params="providerParams",
            seats=[
                {
                    "_type": "_type",
                    "provider": 0,
                    "seatsio_label": "GRAND CIRCLE-A-101",
                }
            ],
            section=0,
            should_override_ticket_protection_plan=True,
            showtime=0,
            tickets_by_price_type=[
                {
                    "num_tickets": 2,
                    "price_type_id": 0,
                }
            ],
            use_unified_checkout=True,
            voucher_code="voucherCode",
        )
        assert_matches_type(Hold, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_raw_response_create(self, async_client: AsyncAliTest2) -> None:
        response = await async_client.api.v2.holds.with_raw_response.create(
            hold_type="RUSH",
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = await response.parse()
        assert_matches_type(Hold, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_streaming_response_create(self, async_client: AsyncAliTest2) -> None:
        async with async_client.api.v2.holds.with_streaming_response.create(
            hold_type="RUSH",
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = await response.parse()
            assert_matches_type(Hold, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    async def test_method_retrieve(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.retrieve(
            0,
        )
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_raw_response_retrieve(self, async_client: AsyncAliTest2) -> None:
        response = await async_client.api.v2.holds.with_raw_response.retrieve(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = await response.parse()
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_streaming_response_retrieve(self, async_client: AsyncAliTest2) -> None:
        async with async_client.api.v2.holds.with_streaming_response.retrieve(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = await response.parse()
            assert_matches_type(object, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    async def test_method_update(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.update(
            hold_id=0,
        )
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_method_update_with_all_params(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.update(
            hold_id=0,
            add_ons=[
                {
                    "id": 0,
                    "quantity": 2,
                    "provider_id": 1,
                }
            ],
            agent_payment_reference="agentPaymentReference",
            apply_rewards_credit=True,
            apply_ticket_protection=True,
            email="email",
            hold_type="RUSH",
            is_rewards_benefit=True,
            num_tickets=0,
            phone_country_code="phoneCountryCode",
            provider=0,
            provider_params="providerParams",
            seats=[
                {
                    "_type": "_type",
                    "provider": 0,
                    "seatsio_label": "GRAND CIRCLE-A-101",
                }
            ],
            secret="secret",
            section=0,
            should_override_ticket_protection_plan=True,
            showtime=0,
            tickets_by_price_type=[
                {
                    "num_tickets": 2,
                    "price_type_id": 0,
                }
            ],
            use_unified_checkout=True,
            voucher="voucher",
        )
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_raw_response_update(self, async_client: AsyncAliTest2) -> None:
        response = await async_client.api.v2.holds.with_raw_response.update(
            hold_id=0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = await response.parse()
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_streaming_response_update(self, async_client: AsyncAliTest2) -> None:
        async with async_client.api.v2.holds.with_streaming_response.update(
            hold_id=0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = await response.parse()
            assert_matches_type(object, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    async def test_method_list(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.list()
        assert_matches_type(HoldListResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_method_list_with_all_params(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.list(
            customer_id="customerId",
        )
        assert_matches_type(HoldListResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_raw_response_list(self, async_client: AsyncAliTest2) -> None:
        response = await async_client.api.v2.holds.with_raw_response.list()

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = await response.parse()
        assert_matches_type(HoldListResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_streaming_response_list(self, async_client: AsyncAliTest2) -> None:
        async with async_client.api.v2.holds.with_streaming_response.list() as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = await response.parse()
            assert_matches_type(HoldListResponse, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    async def test_method_delete(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.delete(
            0,
        )
        assert hold is None

    @pytest.mark.skip()
    @parametrize
    async def test_raw_response_delete(self, async_client: AsyncAliTest2) -> None:
        response = await async_client.api.v2.holds.with_raw_response.delete(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = await response.parse()
        assert hold is None

    @pytest.mark.skip()
    @parametrize
    async def test_streaming_response_delete(self, async_client: AsyncAliTest2) -> None:
        async with async_client.api.v2.holds.with_streaming_response.delete(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = await response.parse()
            assert hold is None

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    async def test_method_delete_ticket_protection(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.delete_ticket_protection(
            0,
        )
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_raw_response_delete_ticket_protection(self, async_client: AsyncAliTest2) -> None:
        response = await async_client.api.v2.holds.with_raw_response.delete_ticket_protection(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = await response.parse()
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_streaming_response_delete_ticket_protection(self, async_client: AsyncAliTest2) -> None:
        async with async_client.api.v2.holds.with_streaming_response.delete_ticket_protection(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = await response.parse()
            assert_matches_type(object, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    async def test_method_delete_voucher(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.delete_voucher(
            0,
        )
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_raw_response_delete_voucher(self, async_client: AsyncAliTest2) -> None:
        response = await async_client.api.v2.holds.with_raw_response.delete_voucher(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = await response.parse()
        assert_matches_type(object, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_streaming_response_delete_voucher(self, async_client: AsyncAliTest2) -> None:
        async with async_client.api.v2.holds.with_streaming_response.delete_voucher(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = await response.parse()
            assert_matches_type(object, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    async def test_method_retrieve_apple_pay_session(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.retrieve_apple_pay_session(
            0,
        )
        assert_matches_type(HoldRetrieveApplePaySessionResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_raw_response_retrieve_apple_pay_session(self, async_client: AsyncAliTest2) -> None:
        response = await async_client.api.v2.holds.with_raw_response.retrieve_apple_pay_session(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = await response.parse()
        assert_matches_type(HoldRetrieveApplePaySessionResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_streaming_response_retrieve_apple_pay_session(self, async_client: AsyncAliTest2) -> None:
        async with async_client.api.v2.holds.with_streaming_response.retrieve_apple_pay_session(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = await response.parse()
            assert_matches_type(HoldRetrieveApplePaySessionResponse, hold, path=["response"])

        assert cast(Any, response.is_closed) is True

    @pytest.mark.skip()
    @parametrize
    async def test_method_update_clear(self, async_client: AsyncAliTest2) -> None:
        hold = await async_client.api.v2.holds.update_clear(
            0,
        )
        assert_matches_type(HoldUpdateClearResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_raw_response_update_clear(self, async_client: AsyncAliTest2) -> None:
        response = await async_client.api.v2.holds.with_raw_response.update_clear(
            0,
        )

        assert response.is_closed is True
        assert response.http_request.headers.get("X-Stainless-Lang") == "python"
        hold = await response.parse()
        assert_matches_type(HoldUpdateClearResponse, hold, path=["response"])

    @pytest.mark.skip()
    @parametrize
    async def test_streaming_response_update_clear(self, async_client: AsyncAliTest2) -> None:
        async with async_client.api.v2.holds.with_streaming_response.update_clear(
            0,
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            hold = await response.parse()
            assert_matches_type(HoldUpdateClearResponse, hold, path=["response"])

        assert cast(Any, response.is_closed) is True
