Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 21, 2024
1 parent 9872fdf commit fdc599e
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 63 deletions.
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4026,7 +4026,7 @@ from cloudflare.types.pages.projects import DeploymentListResponse, DeploymentDe
Methods:

- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

from typing import Type, cast
from typing_extensions import Literal

import httpx

Expand Down Expand Up @@ -34,7 +33,7 @@
from ....._base_client import (
make_request_options,
)
from .....types.pages.projects import DeploymentListResponse, deployment_list_params, deployment_create_params
from .....types.pages.projects import DeploymentListResponse, deployment_create_params

__all__ = ["Deployments", "AsyncDeployments"]

Expand Down Expand Up @@ -108,7 +107,6 @@ def list(
project_name: str,
*,
account_id: str,
env: Literal["production", "preview"] | NotGiven = NOT_GIVEN,
# 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 All @@ -124,8 +122,6 @@ def list(
project_name: Name of the project.
env: What type of deployments to fetch.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -145,7 +141,6 @@ def list(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"env": env}, deployment_list_params.DeploymentListParams),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[DeploymentListResponse], ResultWrapper[DeploymentListResponse]),
Expand Down Expand Up @@ -415,7 +410,6 @@ async def list(
project_name: str,
*,
account_id: str,
env: Literal["production", "preview"] | NotGiven = NOT_GIVEN,
# 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 All @@ -431,8 +425,6 @@ async def list(
project_name: Name of the project.
env: What type of deployments to fetch.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -452,7 +444,6 @@ async def list(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"env": env}, deployment_list_params.DeploymentListParams),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[DeploymentListResponse], ResultWrapper[DeploymentListResponse]),
Expand Down
6 changes: 0 additions & 6 deletions src/cloudflare/types/pages/pages_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ class DeploymentConfigsPreviewR2Buckets(BaseModel):


class DeploymentConfigsPreviewServicesServiceBinding(BaseModel):
entrypoint: Optional[str] = None
"""The entrypoint to bind to."""

environment: Optional[str] = None
"""The Service environment."""

Expand Down Expand Up @@ -408,9 +405,6 @@ class DeploymentConfigsProductionR2Buckets(BaseModel):


class DeploymentConfigsProductionServicesServiceBinding(BaseModel):
entrypoint: Optional[str] = None
"""The entrypoint to bind to."""

environment: Optional[str] = None
"""The Service environment."""

Expand Down
6 changes: 0 additions & 6 deletions src/cloudflare/types/pages/project_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,6 @@ class DeploymentConfigsPreviewR2Buckets(TypedDict, total=False):


class DeploymentConfigsPreviewServicesServiceBinding(TypedDict, total=False):
entrypoint: Optional[str]
"""The entrypoint to bind to."""

environment: str
"""The Service environment."""

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


class DeploymentConfigsProductionServicesServiceBinding(TypedDict, total=False):
entrypoint: Optional[str]
"""The entrypoint to bind to."""

environment: str
"""The Service environment."""

Expand Down
1 change: 0 additions & 1 deletion src/cloudflare/types/pages/projects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from .domain_create_params import DomainCreateParams as DomainCreateParams
from .domain_edit_response import DomainEditResponse as DomainEditResponse
from .domain_list_response import DomainListResponse as DomainListResponse
from .deployment_list_params import DeploymentListParams as DeploymentListParams
from .domain_create_response import DomainCreateResponse as DomainCreateResponse
from .deployment_create_params import DeploymentCreateParams as DeploymentCreateParams
from .deployment_list_response import DeploymentListResponse as DeploymentListResponse
15 changes: 0 additions & 15 deletions src/cloudflare/types/pages/projects/deployment_list_params.py

This file was deleted.

20 changes: 0 additions & 20 deletions tests/api_resources/pages/projects/test_deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,6 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(DeploymentListResponse, deployment, path=["response"])

@pytest.mark.skip()
@parametrize
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
deployment = client.pages.projects.deployments.list(
"this-is-my-project-01",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
env="preview",
)
assert_matches_type(DeploymentListResponse, deployment, path=["response"])

@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
Expand Down Expand Up @@ -473,16 +463,6 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(DeploymentListResponse, deployment, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
deployment = await async_client.pages.projects.deployments.list(
"this-is-my-project-01",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
env="preview",
)
assert_matches_type(DeploymentListResponse, deployment, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
Expand Down
4 changes: 0 additions & 4 deletions tests/api_resources/pages/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
"services": {
"service_binding": {
"entrypoint": "MyHandler",
"environment": "production",
"service": "example-worker",
}
Expand Down Expand Up @@ -96,7 +95,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
"services": {
"service_binding": {
"entrypoint": "MyHandler",
"environment": "production",
"service": "example-worker",
}
Expand Down Expand Up @@ -523,7 +521,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
"services": {
"service_binding": {
"entrypoint": "MyHandler",
"environment": "production",
"service": "example-worker",
}
Expand Down Expand Up @@ -552,7 +549,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
"services": {
"service_binding": {
"entrypoint": "MyHandler",
"environment": "production",
"service": "example-worker",
}
Expand Down

0 comments on commit fdc599e

Please sign in to comment.