Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Jun 4, 2024
1 parent 88b2b95 commit a241362
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 0 deletions.
48 changes: 48 additions & 0 deletions tests/api_resources/alerting/destinations/test_pagerduty.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@
class TestPagerduty:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
pagerduty = client.alerting.destinations.pagerduty.create(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[PagerdutyCreateResponse], pagerduty, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.alerting.destinations.pagerduty.with_raw_response.create(
Expand All @@ -40,6 +46,9 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
pagerduty = response.parse()
assert_matches_type(Optional[PagerdutyCreateResponse], pagerduty, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.alerting.destinations.pagerduty.with_streaming_response.create(
Expand All @@ -53,6 +62,9 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
Expand Down Expand Up @@ -136,6 +148,9 @@ def test_path_params_get(self, client: Cloudflare) -> None:
account_id="",
)

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
def test_method_link(self, client: Cloudflare) -> None:
pagerduty = client.alerting.destinations.pagerduty.link(
Expand All @@ -144,6 +159,9 @@ def test_method_link(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[PagerdutyLinkResponse], pagerduty, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
def test_raw_response_link(self, client: Cloudflare) -> None:
response = client.alerting.destinations.pagerduty.with_raw_response.link(
Expand All @@ -156,6 +174,9 @@ def test_raw_response_link(self, client: Cloudflare) -> None:
pagerduty = response.parse()
assert_matches_type(Optional[PagerdutyLinkResponse], pagerduty, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
def test_streaming_response_link(self, client: Cloudflare) -> None:
with client.alerting.destinations.pagerduty.with_streaming_response.link(
Expand All @@ -170,6 +191,9 @@ def test_streaming_response_link(self, client: Cloudflare) -> None:

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
def test_path_params_link(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
Expand All @@ -188,13 +212,19 @@ def test_path_params_link(self, client: Cloudflare) -> None:
class TestAsyncPagerduty:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
pagerduty = await async_client.alerting.destinations.pagerduty.create(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[PagerdutyCreateResponse], pagerduty, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.alerting.destinations.pagerduty.with_raw_response.create(
Expand All @@ -206,6 +236,9 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
pagerduty = await response.parse()
assert_matches_type(Optional[PagerdutyCreateResponse], pagerduty, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.alerting.destinations.pagerduty.with_streaming_response.create(
Expand All @@ -219,6 +252,9 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
Expand Down Expand Up @@ -302,6 +338,9 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
account_id="",
)

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
async def test_method_link(self, async_client: AsyncCloudflare) -> None:
pagerduty = await async_client.alerting.destinations.pagerduty.link(
Expand All @@ -310,6 +349,9 @@ async def test_method_link(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[PagerdutyLinkResponse], pagerduty, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
async def test_raw_response_link(self, async_client: AsyncCloudflare) -> None:
response = await async_client.alerting.destinations.pagerduty.with_raw_response.link(
Expand All @@ -322,6 +364,9 @@ async def test_raw_response_link(self, async_client: AsyncCloudflare) -> None:
pagerduty = await response.parse()
assert_matches_type(Optional[PagerdutyLinkResponse], pagerduty, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
async def test_streaming_response_link(self, async_client: AsyncCloudflare) -> None:
async with async_client.alerting.destinations.pagerduty.with_streaming_response.link(
Expand All @@ -336,6 +381,9 @@ async def test_streaming_response_link(self, async_client: AsyncCloudflare) -> N

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4285"
)
@parametrize
async def test_path_params_link(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
Expand Down
60 changes: 60 additions & 0 deletions tests/api_resources/alerting/destinations/test_webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
class TestWebhooks:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
def test_method_create(self, client: Cloudflare) -> None:
webhook = client.alerting.destinations.webhooks.create(
Expand All @@ -32,6 +35,9 @@ def test_method_create(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
webhook = client.alerting.destinations.webhooks.create(
Expand All @@ -42,6 +48,9 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
def test_raw_response_create(self, client: Cloudflare) -> None:
response = client.alerting.destinations.webhooks.with_raw_response.create(
Expand All @@ -55,6 +64,9 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
webhook = response.parse()
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
def test_streaming_response_create(self, client: Cloudflare) -> None:
with client.alerting.destinations.webhooks.with_streaming_response.create(
Expand All @@ -70,6 +82,9 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
Expand All @@ -79,6 +94,9 @@ def test_path_params_create(self, client: Cloudflare) -> None:
url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
)

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
def test_method_update(self, client: Cloudflare) -> None:
webhook = client.alerting.destinations.webhooks.update(
Expand All @@ -89,6 +107,9 @@ def test_method_update(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
webhook = client.alerting.destinations.webhooks.update(
Expand All @@ -100,6 +121,9 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
)
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
def test_raw_response_update(self, client: Cloudflare) -> None:
response = client.alerting.destinations.webhooks.with_raw_response.update(
Expand All @@ -114,6 +138,9 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
webhook = response.parse()
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
def test_streaming_response_update(self, client: Cloudflare) -> None:
with client.alerting.destinations.webhooks.with_streaming_response.update(
Expand All @@ -130,6 +157,9 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
def test_path_params_update(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
Expand Down Expand Up @@ -286,6 +316,9 @@ def test_path_params_get(self, client: Cloudflare) -> None:
class TestAsyncWebhooks:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
webhook = await async_client.alerting.destinations.webhooks.create(
Expand All @@ -295,6 +328,9 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
webhook = await async_client.alerting.destinations.webhooks.create(
Expand All @@ -305,6 +341,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
)
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
response = await async_client.alerting.destinations.webhooks.with_raw_response.create(
Expand All @@ -318,6 +357,9 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
webhook = await response.parse()
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
async with async_client.alerting.destinations.webhooks.with_streaming_response.create(
Expand All @@ -333,6 +375,9 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
Expand All @@ -342,6 +387,9 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
)

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
webhook = await async_client.alerting.destinations.webhooks.update(
Expand All @@ -352,6 +400,9 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
webhook = await async_client.alerting.destinations.webhooks.update(
Expand All @@ -363,6 +414,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
)
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.alerting.destinations.webhooks.with_raw_response.update(
Expand All @@ -377,6 +431,9 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
webhook = await response.parse()
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
async with async_client.alerting.destinations.webhooks.with_streaming_response.update(
Expand All @@ -393,6 +450,9 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(
reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291"
)
@parametrize
async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
Expand Down
Loading

0 comments on commit a241362

Please sign in to comment.