Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#910)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 10, 2024
1 parent f9ea911 commit cef0cea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1343
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6545c93a16062d2763cd304367d8babf5aaef09046036361dbb077b75536e858.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f1ab7e5d073ef27b0e08bd9fd83e406c15c1c69017c29b17dadceec459febd7b.yml
4 changes: 2 additions & 2 deletions src/cloudflare/resources/zero_trust/dlp/datasets/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def edit(
*,
account_id: str,
dataset_id: str,
body: object,
body: str,
# 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,
Expand Down Expand Up @@ -178,7 +178,7 @@ async def edit(
*,
account_id: str,
dataset_id: str,
body: object,
body: str,
# 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class UploadEditParams(TypedDict, total=False):

dataset_id: Required[str]

body: Required[object]
body: Required[str]
20 changes: 10 additions & 10 deletions tests/api_resources/zero_trust/dlp/datasets/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_method_edit(self, client: Cloudflare) -> None:
0,
account_id="string",
dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
body={},
body="string",
)
assert_matches_type(Optional[Dataset], upload, path=["response"])

Expand All @@ -84,7 +84,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None:
0,
account_id="string",
dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
body={},
body="string",
)

assert response.is_closed is True
Expand All @@ -99,7 +99,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None:
0,
account_id="string",
dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
body={},
body="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -117,15 +117,15 @@ def test_path_params_edit(self, client: Cloudflare) -> None:
0,
account_id="",
dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
body={},
body="string",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
client.zero_trust.dlp.datasets.upload.with_raw_response.edit(
0,
account_id="string",
dataset_id="",
body={},
body="string",
)


Expand Down Expand Up @@ -187,7 +187,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
0,
account_id="string",
dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
body={},
body="string",
)
assert_matches_type(Optional[Dataset], upload, path=["response"])

Expand All @@ -198,7 +198,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
0,
account_id="string",
dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
body={},
body="string",
)

assert response.is_closed is True
Expand All @@ -213,7 +213,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N
0,
account_id="string",
dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
body={},
body="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -231,13 +231,13 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None:
0,
account_id="",
dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
body={},
body="string",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
await async_client.zero_trust.dlp.datasets.upload.with_raw_response.edit(
0,
account_id="string",
dataset_id="",
body={},
body="string",
)

0 comments on commit cef0cea

Please sign in to comment.