feat(api): OpenAPI spec update via Stainless API (#1156)

This commit is contained in:
stainless-app[bot] 2024-07-01 11:14:32 +00:00 committed by stainless-bot
parent 7706d48f3f
commit e71be01b47
2 changed files with 39 additions and 39 deletions

View file

@ -1,2 +1,2 @@
configured_endpoints: 1254
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-623885448544cf05b4f37663c71fa42a56151359a9b770b24d86195f10da96d8.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-10e0f5bf9e74bc8593c8024dd72b3c91d0402b96678320361ec2166da30136ff.yml

View file

@ -27,7 +27,7 @@ class TestAIGateway:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.create(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
@ -41,7 +41,7 @@ class TestAIGateway:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.ai_gateway.with_raw_response.create(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
@ -59,7 +59,7 @@ class TestAIGateway:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.ai_gateway.with_streaming_response.create(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
@ -94,7 +94,7 @@ class TestAIGateway:
def test_method_update(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.update(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
@ -108,7 +108,7 @@ class TestAIGateway:
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.ai_gateway.with_raw_response.update(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
@ -126,7 +126,7 @@ class TestAIGateway:
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.ai_gateway.with_streaming_response.update(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
@ -159,7 +159,7 @@ class TestAIGateway:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.ai_gateway.with_raw_response.update(
"",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
@ -171,14 +171,14 @@ class TestAIGateway:
@parametrize
def test_method_list(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.list(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert_matches_type(SyncV4PagePaginationArray[AIGatewayListResponse], ai_gateway, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.list(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
id="my-gateway",
order_by="string",
page=1,
@ -189,7 +189,7 @@ class TestAIGateway:
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.ai_gateway.with_raw_response.list(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert response.is_closed is True
@ -200,7 +200,7 @@ class TestAIGateway:
@parametrize
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.ai_gateway.with_streaming_response.list(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -221,7 +221,7 @@ class TestAIGateway:
def test_method_delete(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.delete(
"string",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert_matches_type(AIGatewayDeleteResponse, ai_gateway, path=["response"])
@ -229,7 +229,7 @@ class TestAIGateway:
def test_raw_response_delete(self, client: Cloudflare) -> None:
response = client.ai_gateway.with_raw_response.delete(
"string",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert response.is_closed is True
@ -241,7 +241,7 @@ class TestAIGateway:
def test_streaming_response_delete(self, client: Cloudflare) -> None:
with client.ai_gateway.with_streaming_response.delete(
"string",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -262,14 +262,14 @@ class TestAIGateway:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.ai_gateway.with_raw_response.delete(
"",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
@parametrize
def test_method_get(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.get(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert_matches_type(AIGatewayGetResponse, ai_gateway, path=["response"])
@ -277,7 +277,7 @@ class TestAIGateway:
def test_raw_response_get(self, client: Cloudflare) -> None:
response = client.ai_gateway.with_raw_response.get(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert response.is_closed is True
@ -289,7 +289,7 @@ class TestAIGateway:
def test_streaming_response_get(self, client: Cloudflare) -> None:
with client.ai_gateway.with_streaming_response.get(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -310,7 +310,7 @@ class TestAIGateway:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.ai_gateway.with_raw_response.get(
"",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
@ -320,7 +320,7 @@ class TestAsyncAIGateway:
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
ai_gateway = await async_client.ai_gateway.create(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
@ -334,7 +334,7 @@ class TestAsyncAIGateway:
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.ai_gateway.with_raw_response.create(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
@ -352,7 +352,7 @@ class TestAsyncAIGateway:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.ai_gateway.with_streaming_response.create(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
@ -387,7 +387,7 @@ class TestAsyncAIGateway:
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
ai_gateway = await async_client.ai_gateway.update(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
@ -401,7 +401,7 @@ class TestAsyncAIGateway:
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.ai_gateway.with_raw_response.update(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
@ -419,7 +419,7 @@ class TestAsyncAIGateway:
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.ai_gateway.with_streaming_response.update(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
@ -452,7 +452,7 @@ class TestAsyncAIGateway:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
await async_client.ai_gateway.with_raw_response.update(
"",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
@ -464,14 +464,14 @@ class TestAsyncAIGateway:
@parametrize
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
ai_gateway = await async_client.ai_gateway.list(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert_matches_type(AsyncV4PagePaginationArray[AIGatewayListResponse], ai_gateway, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
ai_gateway = await async_client.ai_gateway.list(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
id="my-gateway",
order_by="string",
page=1,
@ -482,7 +482,7 @@ class TestAsyncAIGateway:
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.ai_gateway.with_raw_response.list(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert response.is_closed is True
@ -493,7 +493,7 @@ class TestAsyncAIGateway:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.ai_gateway.with_streaming_response.list(
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -514,7 +514,7 @@ class TestAsyncAIGateway:
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
ai_gateway = await async_client.ai_gateway.delete(
"string",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert_matches_type(AIGatewayDeleteResponse, ai_gateway, path=["response"])
@ -522,7 +522,7 @@ class TestAsyncAIGateway:
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
response = await async_client.ai_gateway.with_raw_response.delete(
"string",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert response.is_closed is True
@ -534,7 +534,7 @@ class TestAsyncAIGateway:
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
async with async_client.ai_gateway.with_streaming_response.delete(
"string",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -555,14 +555,14 @@ class TestAsyncAIGateway:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
await async_client.ai_gateway.with_raw_response.delete(
"",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
@parametrize
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
ai_gateway = await async_client.ai_gateway.get(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert_matches_type(AIGatewayGetResponse, ai_gateway, path=["response"])
@ -570,7 +570,7 @@ class TestAsyncAIGateway:
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
response = await async_client.ai_gateway.with_raw_response.get(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)
assert response.is_closed is True
@ -582,7 +582,7 @@ class TestAsyncAIGateway:
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
async with async_client.ai_gateway.with_streaming_response.get(
"my-gateway",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@ -603,5 +603,5 @@ class TestAsyncAIGateway:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
await async_client.ai_gateway.with_raw_response.get(
"",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
)