Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1254
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-10e0f5bf9e74bc8593c8024dd72b3c91d0402b96678320361ec2166da30136ff.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-623885448544cf05b4f37663c71fa42a56151359a9b770b24d86195f10da96d8.yml
76 changes: 38 additions & 38 deletions tests/api_resources/test_ai_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TestAIGateway:
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.create(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
Expand All @@ -41,7 +41,7 @@ def test_method_create(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.ai_gateway.with_raw_response.create(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
Expand All @@ -59,7 +59,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.ai_gateway.with_streaming_response.create(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_path_params_create(self, client: Cloudflare) -> None:
def test_method_update(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.update(
"my-gateway",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
Expand All @@ -108,7 +108,7 @@ def test_method_update(self, client: Cloudflare) -> None:
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.ai_gateway.with_raw_response.update(
"my-gateway",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
Expand All @@ -126,7 +126,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.ai_gateway.with_streaming_response.update(
"my-gateway",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
Expand Down Expand Up @@ -159,7 +159,7 @@ def test_path_params_update(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.ai_gateway.with_raw_response.update(
"",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
Expand All @@ -171,14 +171,14 @@ def test_path_params_update(self, client: Cloudflare) -> None:
@parametrize
def test_method_list(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.list(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)
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="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
id="my-gateway",
order_by="string",
page=1,
Expand All @@ -189,7 +189,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
response = client.ai_gateway.with_raw_response.list(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)

assert response.is_closed is True
Expand All @@ -200,7 +200,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_list(self, client: Cloudflare) -> None:
with client.ai_gateway.with_streaming_response.list(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -221,15 +221,15 @@ def test_path_params_list(self, client: Cloudflare) -> None:
def test_method_delete(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.delete(
"string",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)
assert_matches_type(AIGatewayDeleteResponse, ai_gateway, path=["response"])

@parametrize
def test_raw_response_delete(self, client: Cloudflare) -> None:
response = client.ai_gateway.with_raw_response.delete(
"string",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)

assert response.is_closed is True
Expand All @@ -241,7 +241,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None:
def test_streaming_response_delete(self, client: Cloudflare) -> None:
with client.ai_gateway.with_streaming_response.delete(
"string",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -262,22 +262,22 @@ def test_path_params_delete(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.ai_gateway.with_raw_response.delete(
"",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)

@parametrize
def test_method_get(self, client: Cloudflare) -> None:
ai_gateway = client.ai_gateway.get(
"my-gateway",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)
assert_matches_type(AIGatewayGetResponse, ai_gateway, path=["response"])

@parametrize
def test_raw_response_get(self, client: Cloudflare) -> None:
response = client.ai_gateway.with_raw_response.get(
"my-gateway",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)

assert response.is_closed is True
Expand All @@ -289,7 +289,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
def test_streaming_response_get(self, client: Cloudflare) -> None:
with client.ai_gateway.with_streaming_response.get(
"my-gateway",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -310,7 +310,7 @@ def test_path_params_get(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.ai_gateway.with_raw_response.get(
"",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)


Expand All @@ -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="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
Expand All @@ -334,7 +334,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.ai_gateway.with_raw_response.create(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
Expand All @@ -352,7 +352,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.ai_gateway.with_streaming_response.create(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
id="my-gateway",
cache_invalidate_on_update=True,
cache_ttl=0,
Expand Down Expand Up @@ -387,7 +387,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
ai_gateway = await async_client.ai_gateway.update(
"my-gateway",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
Expand All @@ -401,7 +401,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
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="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
Expand All @@ -419,7 +419,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
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="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
Expand Down Expand Up @@ -452,7 +452,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
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="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
cache_invalidate_on_update=True,
cache_ttl=0,
collect_logs=True,
Expand All @@ -464,14 +464,14 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
ai_gateway = await async_client.ai_gateway.list(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)
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="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
id="my-gateway",
order_by="string",
page=1,
Expand All @@ -482,7 +482,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
response = await async_client.ai_gateway.with_raw_response.list(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)

assert response.is_closed is True
Expand All @@ -493,7 +493,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
async with async_client.ai_gateway.with_streaming_response.list(
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -514,15 +514,15 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
ai_gateway = await async_client.ai_gateway.delete(
"string",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)
assert_matches_type(AIGatewayDeleteResponse, ai_gateway, path=["response"])

@parametrize
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
response = await async_client.ai_gateway.with_raw_response.delete(
"string",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)

assert response.is_closed is True
Expand All @@ -534,7 +534,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
async with async_client.ai_gateway.with_streaming_response.delete(
"string",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -555,22 +555,22 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
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="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)

@parametrize
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
ai_gateway = await async_client.ai_gateway.get(
"my-gateway",
account_id="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)
assert_matches_type(AIGatewayGetResponse, ai_gateway, path=["response"])

@parametrize
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="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)

assert response.is_closed is True
Expand All @@ -582,7 +582,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
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="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -603,5 +603,5 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
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="0d37909e38d3e99c29fa2cd343ac421a",
account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0",
)