Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1773)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Sep 20, 2024
1 parent 768a7c6 commit b4dd610
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 7 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: 1342
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9f6561357b4e1771455d4e7524bed0826ab9a169a679fe7c095dce93a743354e.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f8773718ab097ba127ddff8348a6c33fb796bffc55b0e7e3ac0eee0124d64cda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ class WARPDevice(TypedDict, total=False):

name: Required[str]
"""Name of the warp device."""

router_ip: Required[str]
"""IPv4 CIDR of the router sourcing flow data associated with this warp device.
Only /32 addresses are currently supported.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ class WARPDevice(TypedDict, total=False):

name: Required[str]
"""Name of the warp device."""

router_ip: Required[str]
"""IPv4 CIDR of the router sourcing flow data associated with this warp device.
Only /32 addresses are currently supported.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ class WARPDevice(TypedDict, total=False):

name: Required[str]
"""Name of the warp device."""

router_ip: Required[str]
"""IPv4 CIDR of the router sourcing flow data associated with this warp device.
Only /32 addresses are currently supported.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ class WARPDevice(BaseModel):
name: str
"""Name of the warp device."""

router_ip: str
"""IPv4 CIDR of the router sourcing flow data associated with this warp device.
Only /32 addresses are currently supported.
"""


class Configuration(BaseModel):
default_sampling: float
Expand Down
30 changes: 24 additions & 6 deletions tests/api_resources/magic_network_monitoring/test_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,22 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
account_id="6f91088a406011ed95aed352566e8d4c",
default_sampling=1,
name="cloudflare user's account",
router_ips=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"],
router_ips=["203.0.113.1", "203.0.113.1", "203.0.113.1"],
warp_devices=[
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
],
)
Expand Down Expand Up @@ -104,19 +107,22 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
account_id="6f91088a406011ed95aed352566e8d4c",
default_sampling=1,
name="cloudflare user's account",
router_ips=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"],
router_ips=["203.0.113.1", "203.0.113.1", "203.0.113.1"],
warp_devices=[
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
],
)
Expand Down Expand Up @@ -210,19 +216,22 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
account_id="6f91088a406011ed95aed352566e8d4c",
default_sampling=1,
name="cloudflare user's account",
router_ips=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"],
router_ips=["203.0.113.1", "203.0.113.1", "203.0.113.1"],
warp_devices=[
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
],
)
Expand Down Expand Up @@ -316,19 +325,22 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
account_id="6f91088a406011ed95aed352566e8d4c",
default_sampling=1,
name="cloudflare user's account",
router_ips=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"],
router_ips=["203.0.113.1", "203.0.113.1", "203.0.113.1"],
warp_devices=[
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
],
)
Expand Down Expand Up @@ -386,19 +398,22 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
account_id="6f91088a406011ed95aed352566e8d4c",
default_sampling=1,
name="cloudflare user's account",
router_ips=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"],
router_ips=["203.0.113.1", "203.0.113.1", "203.0.113.1"],
warp_devices=[
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
],
)
Expand Down Expand Up @@ -492,19 +507,22 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
account_id="6f91088a406011ed95aed352566e8d4c",
default_sampling=1,
name="cloudflare user's account",
router_ips=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"],
router_ips=["203.0.113.1", "203.0.113.1", "203.0.113.1"],
warp_devices=[
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1",
},
],
)
Expand Down

0 comments on commit b4dd610

Please sign in to comment.