Skip to content

Commit 694e7bd

Browse files
feat(api): api update
1 parent fc4f23e commit 694e7bd

File tree

4 files changed

+11
-25
lines changed

4 files changed

+11
-25
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1751
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f908ce94a7017a1e6b34f013795afea224441a6acff49e1c597c133c2f3acec6.yml
3-
openapi_spec_hash: 25b8271a76dc250d983966d996cd4fdf
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5a43fe09becab8ea24790c571c5fc48d9c38cf96bcaa3d1330ff3d03e20dcd2c.yml
3+
openapi_spec_hash: 68b51401e1419eb348353f46c83149e1
44
config_hash: 259b5eeae0358ea7d7756b294847f140

src/cloudflare/resources/schema_validation/schemas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def create(
5757
kind: Literal["openapi_v3"],
5858
name: str,
5959
source: str,
60-
validation_enabled: bool | NotGiven = NOT_GIVEN,
60+
validation_enabled: bool,
6161
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6262
# The extra values given here take precedence over values defined on the client or passed to this method.
6363
extra_headers: Headers | None = None,
@@ -338,7 +338,7 @@ async def create(
338338
kind: Literal["openapi_v3"],
339339
name: str,
340340
source: str,
341-
validation_enabled: bool | NotGiven = NOT_GIVEN,
341+
validation_enabled: bool,
342342
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
343343
# The extra values given here take precedence over values defined on the client or passed to this method.
344344
extra_headers: Headers | None = None,

src/cloudflare/types/schema_validation/schema_create_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ class SchemaCreateParams(TypedDict, total=False):
2020
source: Required[str]
2121
"""The raw schema, e.g., the OpenAPI schema, either as JSON or YAML"""
2222

23-
validation_enabled: bool
23+
validation_enabled: Required[bool]
2424
"""An indicator if this schema is enabled"""

tests/api_resources/schema_validation/test_schemas.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ class TestSchemas:
2626

2727
@parametrize
2828
def test_method_create(self, client: Cloudflare) -> None:
29-
schema = client.schema_validation.schemas.create(
30-
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
31-
kind="openapi_v3",
32-
name="petstore schema",
33-
source="<schema file contents>",
34-
)
35-
assert_matches_type(SchemaCreateResponse, schema, path=["response"])
36-
37-
@parametrize
38-
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
3929
schema = client.schema_validation.schemas.create(
4030
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
4131
kind="openapi_v3",
@@ -52,6 +42,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
5242
kind="openapi_v3",
5343
name="petstore schema",
5444
source="<schema file contents>",
45+
validation_enabled=True,
5546
)
5647

5748
assert response.is_closed is True
@@ -66,6 +57,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
6657
kind="openapi_v3",
6758
name="petstore schema",
6859
source="<schema file contents>",
60+
validation_enabled=True,
6961
) as response:
7062
assert not response.is_closed
7163
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -83,6 +75,7 @@ def test_path_params_create(self, client: Cloudflare) -> None:
8375
kind="openapi_v3",
8476
name="petstore schema",
8577
source="<schema file contents>",
78+
validation_enabled=True,
8679
)
8780

8881
@parametrize
@@ -302,16 +295,6 @@ class TestAsyncSchemas:
302295

303296
@parametrize
304297
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
305-
schema = await async_client.schema_validation.schemas.create(
306-
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
307-
kind="openapi_v3",
308-
name="petstore schema",
309-
source="<schema file contents>",
310-
)
311-
assert_matches_type(SchemaCreateResponse, schema, path=["response"])
312-
313-
@parametrize
314-
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
315298
schema = await async_client.schema_validation.schemas.create(
316299
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
317300
kind="openapi_v3",
@@ -328,6 +311,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
328311
kind="openapi_v3",
329312
name="petstore schema",
330313
source="<schema file contents>",
314+
validation_enabled=True,
331315
)
332316

333317
assert response.is_closed is True
@@ -342,6 +326,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
342326
kind="openapi_v3",
343327
name="petstore schema",
344328
source="<schema file contents>",
329+
validation_enabled=True,
345330
) as response:
346331
assert not response.is_closed
347332
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -359,6 +344,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
359344
kind="openapi_v3",
360345
name="petstore schema",
361346
source="<schema file contents>",
347+
validation_enabled=True,
362348
)
363349

364350
@parametrize

0 commit comments

Comments
 (0)