Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored May 8, 2024
1 parent f8ec76e commit c8d766d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
1 change: 0 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2282,7 +2282,6 @@ from cloudflare.types.pagerules import (
PageRule,
Route,
Target,
URLTarget,
PageruleCreateResponse,
PageruleUpdateResponse,
PageruleListResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing_extensions import Literal

from ...._models import BaseModel
from .issue_type import IssueType
from ...shared.response_info import ResponseInfo

__all__ = ["IssueListResponse", "Result", "ResultIssue"]
Expand All @@ -17,15 +18,7 @@ class ResultIssue(BaseModel):

issue_class: Optional[str] = None

issue_type: Optional[
Literal[
"compliance_violation",
"email_security",
"exposed_infrastructure",
"insecure_configuration",
"weak_authentication",
]
] = None
issue_type: Optional[IssueType] = None

payload: Optional[object] = None

Expand Down
5 changes: 3 additions & 2 deletions src/cloudflare/types/pagerules/target.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

from ..._models import BaseModel
Expand All @@ -21,8 +22,8 @@ class Constraint(BaseModel):


class Target(BaseModel):
constraint: Constraint
constraint: Optional[Constraint] = None
"""String constraint."""

target: Literal["url"]
target: Optional[Literal["url"]] = None
"""A target based on the URL of the request."""
4 changes: 2 additions & 2 deletions src/cloudflare/types/pagerules/target_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Constraint(TypedDict, total=False):


class TargetParam(TypedDict, total=False):
constraint: Required[Constraint]
constraint: Constraint
"""String constraint."""

target: Required[Literal["url"]]
target: Literal["url"]
"""A target based on the URL of the request."""
8 changes: 8 additions & 0 deletions tests/api_resources/snippets/test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
class TestContent:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip(reason="throwing HTTP 415")
@parametrize
@pytest.mark.respx(base_url=base_url)
def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None:
Expand All @@ -38,6 +39,7 @@ def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None:
assert cast(Any, content.is_closed) is True
assert isinstance(content, BinaryAPIResponse)

@pytest.mark.skip(reason="throwing HTTP 415")
@parametrize
@pytest.mark.respx(base_url=base_url)
def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None:
Expand All @@ -55,6 +57,7 @@ def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> N
assert content.json() == {"foo": "bar"}
assert isinstance(content, BinaryAPIResponse)

@pytest.mark.skip(reason="throwing HTTP 415")
@parametrize
@pytest.mark.respx(base_url=base_url)
def test_streaming_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None:
Expand All @@ -74,6 +77,7 @@ def test_streaming_response_get(self, client: Cloudflare, respx_mock: MockRouter

assert cast(Any, content.is_closed) is True

@pytest.mark.skip(reason="throwing HTTP 415")
@parametrize
@pytest.mark.respx(base_url=base_url)
def test_path_params_get(self, client: Cloudflare) -> None:
Expand All @@ -93,6 +97,7 @@ def test_path_params_get(self, client: Cloudflare) -> None:
class TestAsyncContent:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip(reason="throwing HTTP 415")
@parametrize
@pytest.mark.respx(base_url=base_url)
async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None:
Expand All @@ -108,6 +113,7 @@ async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockR
assert cast(Any, content.is_closed) is True
assert isinstance(content, AsyncBinaryAPIResponse)

@pytest.mark.skip(reason="throwing HTTP 415")
@parametrize
@pytest.mark.respx(base_url=base_url)
async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None:
Expand All @@ -125,6 +131,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock:
assert await content.json() == {"foo": "bar"}
assert isinstance(content, AsyncBinaryAPIResponse)

@pytest.mark.skip(reason="throwing HTTP 415")
@parametrize
@pytest.mark.respx(base_url=base_url)
async def test_streaming_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None:
Expand All @@ -144,6 +151,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare, respx

assert cast(Any, content.is_closed) is True

@pytest.mark.skip(reason="throwing HTTP 415")
@parametrize
@pytest.mark.respx(base_url=base_url)
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
Expand Down

0 comments on commit c8d766d

Please sign in to comment.