Skip to content

Commit 9872fdf

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#165)
1 parent 5b83748 commit 9872fdf

File tree

8 files changed

+63
-2
lines changed

8 files changed

+63
-2
lines changed

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4026,7 +4026,7 @@ from cloudflare.types.pages.projects import DeploymentListResponse, DeploymentDe
40264026
Methods:
40274027

40284028
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/deployments">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">create</a>(project_name, \*, account_id, \*\*<a href="src/cloudflare/types/pages/projects/deployment_create_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/pages_deployments.py">PagesDeployments</a></code>
4029-
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/deployments">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">list</a>(project_name, \*, account_id) -> <a href="./src/cloudflare/types/pages/projects/deployment_list_response.py">DeploymentListResponse</a></code>
4029+
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/deployments">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">list</a>(project_name, \*, account_id, \*\*<a href="src/cloudflare/types/pages/projects/deployment_list_params.py">params</a>) -> <a href="./src/cloudflare/types/pages/projects/deployment_list_response.py">DeploymentListResponse</a></code>
40304030
- <code title="delete /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">delete</a>(deployment_id, \*, account_id, project_name) -> <a href="./src/cloudflare/types/pages/projects/deployment_delete_response.py">object</a></code>
40314031
- <code title="get /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">get</a>(deployment_id, \*, account_id, project_name) -> <a href="./src/cloudflare/types/pages/pages_deployments.py">PagesDeployments</a></code>
40324032
- <code title="post /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/retry">client.pages.projects.deployments.<a href="./src/cloudflare/resources/pages/projects/deployments/deployments.py">retry</a>(deployment_id, \*, account_id, project_name) -> <a href="./src/cloudflare/types/pages/pages_deployments.py">PagesDeployments</a></code>

src/cloudflare/resources/pages/projects/deployments/deployments.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Type, cast
6+
from typing_extensions import Literal
67

78
import httpx
89

@@ -33,7 +34,7 @@
3334
from ....._base_client import (
3435
make_request_options,
3536
)
36-
from .....types.pages.projects import DeploymentListResponse, deployment_create_params
37+
from .....types.pages.projects import DeploymentListResponse, deployment_list_params, deployment_create_params
3738

3839
__all__ = ["Deployments", "AsyncDeployments"]
3940

@@ -107,6 +108,7 @@ def list(
107108
project_name: str,
108109
*,
109110
account_id: str,
111+
env: Literal["production", "preview"] | NotGiven = NOT_GIVEN,
110112
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
111113
# The extra values given here take precedence over values defined on the client or passed to this method.
112114
extra_headers: Headers | None = None,
@@ -122,6 +124,8 @@ def list(
122124
123125
project_name: Name of the project.
124126
127+
env: What type of deployments to fetch.
128+
125129
extra_headers: Send extra headers
126130
127131
extra_query: Add additional query parameters to the request
@@ -141,6 +145,7 @@ def list(
141145
extra_query=extra_query,
142146
extra_body=extra_body,
143147
timeout=timeout,
148+
query=maybe_transform({"env": env}, deployment_list_params.DeploymentListParams),
144149
post_parser=ResultWrapper._unwrapper,
145150
),
146151
cast_to=cast(Type[DeploymentListResponse], ResultWrapper[DeploymentListResponse]),
@@ -410,6 +415,7 @@ async def list(
410415
project_name: str,
411416
*,
412417
account_id: str,
418+
env: Literal["production", "preview"] | NotGiven = NOT_GIVEN,
413419
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
414420
# The extra values given here take precedence over values defined on the client or passed to this method.
415421
extra_headers: Headers | None = None,
@@ -425,6 +431,8 @@ async def list(
425431
426432
project_name: Name of the project.
427433
434+
env: What type of deployments to fetch.
435+
428436
extra_headers: Send extra headers
429437
430438
extra_query: Add additional query parameters to the request
@@ -444,6 +452,7 @@ async def list(
444452
extra_query=extra_query,
445453
extra_body=extra_body,
446454
timeout=timeout,
455+
query=await async_maybe_transform({"env": env}, deployment_list_params.DeploymentListParams),
447456
post_parser=ResultWrapper._unwrapper,
448457
),
449458
cast_to=cast(Type[DeploymentListResponse], ResultWrapper[DeploymentListResponse]),

src/cloudflare/types/pages/pages_projects.py

+6
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ class DeploymentConfigsPreviewR2Buckets(BaseModel):
211211

212212

213213
class DeploymentConfigsPreviewServicesServiceBinding(BaseModel):
214+
entrypoint: Optional[str] = None
215+
"""The entrypoint to bind to."""
216+
214217
environment: Optional[str] = None
215218
"""The Service environment."""
216219

@@ -405,6 +408,9 @@ class DeploymentConfigsProductionR2Buckets(BaseModel):
405408

406409

407410
class DeploymentConfigsProductionServicesServiceBinding(BaseModel):
411+
entrypoint: Optional[str] = None
412+
"""The entrypoint to bind to."""
413+
408414
environment: Optional[str] = None
409415
"""The Service environment."""
410416

src/cloudflare/types/pages/project_create_params.py

+6
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ class DeploymentConfigsPreviewR2Buckets(TypedDict, total=False):
228228

229229

230230
class DeploymentConfigsPreviewServicesServiceBinding(TypedDict, total=False):
231+
entrypoint: Optional[str]
232+
"""The entrypoint to bind to."""
233+
231234
environment: str
232235
"""The Service environment."""
233236

@@ -417,6 +420,9 @@ class DeploymentConfigsProductionR2Buckets(TypedDict, total=False):
417420

418421

419422
class DeploymentConfigsProductionServicesServiceBinding(TypedDict, total=False):
423+
entrypoint: Optional[str]
424+
"""The entrypoint to bind to."""
425+
420426
environment: str
421427
"""The Service environment."""
422428

src/cloudflare/types/pages/projects/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .domain_create_params import DomainCreateParams as DomainCreateParams
77
from .domain_edit_response import DomainEditResponse as DomainEditResponse
88
from .domain_list_response import DomainListResponse as DomainListResponse
9+
from .deployment_list_params import DeploymentListParams as DeploymentListParams
910
from .domain_create_response import DomainCreateResponse as DomainCreateResponse
1011
from .deployment_create_params import DeploymentCreateParams as DeploymentCreateParams
1112
from .deployment_list_response import DeploymentListResponse as DeploymentListResponse
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, Required, TypedDict
6+
7+
__all__ = ["DeploymentListParams"]
8+
9+
10+
class DeploymentListParams(TypedDict, total=False):
11+
account_id: Required[str]
12+
"""Identifier"""
13+
14+
env: Literal["production", "preview"]
15+
"""What type of deployments to fetch."""

tests/api_resources/pages/projects/test_deployments.py

+20
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ def test_method_list(self, client: Cloudflare) -> None:
8989
)
9090
assert_matches_type(DeploymentListResponse, deployment, path=["response"])
9191

92+
@pytest.mark.skip()
93+
@parametrize
94+
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
95+
deployment = client.pages.projects.deployments.list(
96+
"this-is-my-project-01",
97+
account_id="023e105f4ecef8ad9ca31a8372d0c353",
98+
env="preview",
99+
)
100+
assert_matches_type(DeploymentListResponse, deployment, path=["response"])
101+
92102
@pytest.mark.skip()
93103
@parametrize
94104
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -463,6 +473,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
463473
)
464474
assert_matches_type(DeploymentListResponse, deployment, path=["response"])
465475

476+
@pytest.mark.skip()
477+
@parametrize
478+
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
479+
deployment = await async_client.pages.projects.deployments.list(
480+
"this-is-my-project-01",
481+
account_id="023e105f4ecef8ad9ca31a8372d0c353",
482+
env="preview",
483+
)
484+
assert_matches_type(DeploymentListResponse, deployment, path=["response"])
485+
466486
@pytest.mark.skip()
467487
@parametrize
468488
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:

tests/api_resources/pages/test_projects.py

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
6767
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
6868
"services": {
6969
"service_binding": {
70+
"entrypoint": "MyHandler",
7071
"environment": "production",
7172
"service": "example-worker",
7273
}
@@ -95,6 +96,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
9596
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
9697
"services": {
9798
"service_binding": {
99+
"entrypoint": "MyHandler",
98100
"environment": "production",
99101
"service": "example-worker",
100102
}
@@ -521,6 +523,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
521523
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
522524
"services": {
523525
"service_binding": {
526+
"entrypoint": "MyHandler",
524527
"environment": "production",
525528
"service": "example-worker",
526529
}
@@ -549,6 +552,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
549552
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
550553
"services": {
551554
"service_binding": {
555+
"entrypoint": "MyHandler",
552556
"environment": "production",
553557
"service": "example-worker",
554558
}

0 commit comments

Comments
 (0)