Skip to content

Commit 29e0389

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#2135)
1 parent fdc0bb6 commit 29e0389

18 files changed

+373
-174
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1397
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a593104deaa88fb5478971c715a6f8874283042b438b1d9b1c66e640e6804e19.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a4b20862f6df3429ea34d599d65f7731f729b50178dea827dd74159d1ea0e037.yml

api.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3754,13 +3754,7 @@ Methods:
37543754
Types:
37553755

37563756
```python
3757-
from cloudflare.types.magic_transit import (
3758-
PCAP,
3759-
PCAPFilter,
3760-
PCAPCreateResponse,
3761-
PCAPListResponse,
3762-
PCAPGetResponse,
3763-
)
3757+
from cloudflare.types.magic_transit import PCAPCreateResponse, PCAPListResponse, PCAPGetResponse
37643758
```
37653759

37663760
Methods:
@@ -3774,15 +3768,19 @@ Methods:
37743768
Types:
37753769

37763770
```python
3777-
from cloudflare.types.magic_transit.pcaps import Ownership, OwnershipGetResponse
3771+
from cloudflare.types.magic_transit.pcaps import (
3772+
OwnershipCreateResponse,
3773+
OwnershipGetResponse,
3774+
OwnershipValidateResponse,
3775+
)
37783776
```
37793777

37803778
Methods:
37813779

3782-
- <code title="post /accounts/{account_id}/pcaps/ownership">client.magic_transit.pcaps.ownership.<a href="./src/cloudflare/resources/magic_transit/pcaps/ownership.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/magic_transit/pcaps/ownership_create_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/pcaps/ownership.py">Ownership</a></code>
3780+
- <code title="post /accounts/{account_id}/pcaps/ownership">client.magic_transit.pcaps.ownership.<a href="./src/cloudflare/resources/magic_transit/pcaps/ownership.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/magic_transit/pcaps/ownership_create_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/pcaps/ownership_create_response.py">OwnershipCreateResponse</a></code>
37833781
- <code title="delete /accounts/{account_id}/pcaps/ownership/{ownership_id}">client.magic_transit.pcaps.ownership.<a href="./src/cloudflare/resources/magic_transit/pcaps/ownership.py">delete</a>(ownership_id, \*, account_id) -> None</code>
37843782
- <code title="get /accounts/{account_id}/pcaps/ownership">client.magic_transit.pcaps.ownership.<a href="./src/cloudflare/resources/magic_transit/pcaps/ownership.py">get</a>(\*, account_id) -> <a href="./src/cloudflare/types/magic_transit/pcaps/ownership_get_response.py">Optional</a></code>
3785-
- <code title="post /accounts/{account_id}/pcaps/ownership/validate">client.magic_transit.pcaps.ownership.<a href="./src/cloudflare/resources/magic_transit/pcaps/ownership.py">validate</a>(\*, account_id, \*\*<a href="src/cloudflare/types/magic_transit/pcaps/ownership_validate_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/pcaps/ownership.py">Ownership</a></code>
3783+
- <code title="post /accounts/{account_id}/pcaps/ownership/validate">client.magic_transit.pcaps.ownership.<a href="./src/cloudflare/resources/magic_transit/pcaps/ownership.py">validate</a>(\*, account_id, \*\*<a href="src/cloudflare/types/magic_transit/pcaps/ownership_validate_params.py">params</a>) -> <a href="./src/cloudflare/types/magic_transit/pcaps/ownership_validate_response.py">OwnershipValidateResponse</a></code>
37863784

37873785
### Download
37883786

src/cloudflare/resources/magic_transit/pcaps/ownership.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
from ...._wrappers import ResultWrapper
2323
from ...._base_client import make_request_options
2424
from ....types.magic_transit.pcaps import ownership_create_params, ownership_validate_params
25-
from ....types.magic_transit.pcaps.ownership import Ownership
2625
from ....types.magic_transit.pcaps.ownership_get_response import OwnershipGetResponse
26+
from ....types.magic_transit.pcaps.ownership_create_response import OwnershipCreateResponse
27+
from ....types.magic_transit.pcaps.ownership_validate_response import OwnershipValidateResponse
2728

2829
__all__ = ["OwnershipResource", "AsyncOwnershipResource"]
2930

@@ -59,7 +60,7 @@ def create(
5960
extra_query: Query | None = None,
6061
extra_body: Body | None = None,
6162
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
62-
) -> Ownership:
63+
) -> OwnershipCreateResponse:
6364
"""
6465
Adds an AWS or GCP bucket to use with full packet captures.
6566
@@ -86,9 +87,9 @@ def create(
8687
extra_query=extra_query,
8788
extra_body=extra_body,
8889
timeout=timeout,
89-
post_parser=ResultWrapper[Ownership]._unwrapper,
90+
post_parser=ResultWrapper[OwnershipCreateResponse]._unwrapper,
9091
),
91-
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
92+
cast_to=cast(Type[OwnershipCreateResponse], ResultWrapper[OwnershipCreateResponse]),
9293
)
9394

9495
def delete(
@@ -183,7 +184,7 @@ def validate(
183184
extra_query: Query | None = None,
184185
extra_body: Body | None = None,
185186
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
186-
) -> Ownership:
187+
) -> OwnershipValidateResponse:
187188
"""
188189
Validates buckets added to the packet captures API.
189190
@@ -218,9 +219,9 @@ def validate(
218219
extra_query=extra_query,
219220
extra_body=extra_body,
220221
timeout=timeout,
221-
post_parser=ResultWrapper[Ownership]._unwrapper,
222+
post_parser=ResultWrapper[OwnershipValidateResponse]._unwrapper,
222223
),
223-
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
224+
cast_to=cast(Type[OwnershipValidateResponse], ResultWrapper[OwnershipValidateResponse]),
224225
)
225226

226227

@@ -255,7 +256,7 @@ async def create(
255256
extra_query: Query | None = None,
256257
extra_body: Body | None = None,
257258
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
258-
) -> Ownership:
259+
) -> OwnershipCreateResponse:
259260
"""
260261
Adds an AWS or GCP bucket to use with full packet captures.
261262
@@ -284,9 +285,9 @@ async def create(
284285
extra_query=extra_query,
285286
extra_body=extra_body,
286287
timeout=timeout,
287-
post_parser=ResultWrapper[Ownership]._unwrapper,
288+
post_parser=ResultWrapper[OwnershipCreateResponse]._unwrapper,
288289
),
289-
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
290+
cast_to=cast(Type[OwnershipCreateResponse], ResultWrapper[OwnershipCreateResponse]),
290291
)
291292

292293
async def delete(
@@ -381,7 +382,7 @@ async def validate(
381382
extra_query: Query | None = None,
382383
extra_body: Body | None = None,
383384
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
384-
) -> Ownership:
385+
) -> OwnershipValidateResponse:
385386
"""
386387
Validates buckets added to the packet captures API.
387388
@@ -416,9 +417,9 @@ async def validate(
416417
extra_query=extra_query,
417418
extra_body=extra_body,
418419
timeout=timeout,
419-
post_parser=ResultWrapper[Ownership]._unwrapper,
420+
post_parser=ResultWrapper[OwnershipValidateResponse]._unwrapper,
420421
),
421-
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
422+
cast_to=cast(Type[OwnershipValidateResponse], ResultWrapper[OwnershipValidateResponse]),
422423
)
423424

424425

src/cloudflare/resources/magic_transit/pcaps/pcaps.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
from ....pagination import SyncSinglePage, AsyncSinglePage
4242
from ...._base_client import AsyncPaginator, make_request_options
4343
from ....types.magic_transit import pcap_create_params
44-
from ....types.magic_transit.pcap_filter_param import PCAPFilterParam
4544
from ....types.magic_transit.pcap_get_response import PCAPGetResponse
4645
from ....types.magic_transit.pcap_list_response import PCAPListResponse
4746
from ....types.magic_transit.pcap_create_response import PCAPCreateResponse
@@ -86,7 +85,7 @@ def create(
8685
system: Literal["magic-transit"],
8786
time_limit: float,
8887
type: Literal["simple", "full"],
89-
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
88+
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
9089
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9190
# The extra values given here take precedence over values defined on the client or passed to this method.
9291
extra_headers: Headers | None = None,
@@ -132,7 +131,7 @@ def create(
132131
time_limit: float,
133132
type: Literal["simple", "full"],
134133
byte_limit: float | NotGiven = NOT_GIVEN,
135-
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
134+
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestFullFilterV1 | NotGiven = NOT_GIVEN,
136135
packet_limit: float | NotGiven = NOT_GIVEN,
137136
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
138137
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -189,7 +188,7 @@ def create(
189188
system: Literal["magic-transit"],
190189
time_limit: float,
191190
type: Literal["simple", "full"],
192-
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
191+
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
193192
colo_name: str | NotGiven = NOT_GIVEN,
194193
destination_conf: str | NotGiven = NOT_GIVEN,
195194
byte_limit: float | NotGiven = NOT_GIVEN,
@@ -355,7 +354,7 @@ async def create(
355354
system: Literal["magic-transit"],
356355
time_limit: float,
357356
type: Literal["simple", "full"],
358-
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
357+
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
359358
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
360359
# The extra values given here take precedence over values defined on the client or passed to this method.
361360
extra_headers: Headers | None = None,
@@ -401,7 +400,7 @@ async def create(
401400
time_limit: float,
402401
type: Literal["simple", "full"],
403402
byte_limit: float | NotGiven = NOT_GIVEN,
404-
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
403+
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestFullFilterV1 | NotGiven = NOT_GIVEN,
405404
packet_limit: float | NotGiven = NOT_GIVEN,
406405
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
407406
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -458,7 +457,7 @@ async def create(
458457
system: Literal["magic-transit"],
459458
time_limit: float,
460459
type: Literal["simple", "full"],
461-
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
460+
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
462461
colo_name: str | NotGiven = NOT_GIVEN,
463462
destination_conf: str | NotGiven = NOT_GIVEN,
464463
byte_limit: float | NotGiven = NOT_GIVEN,

src/cloudflare/types/magic_transit/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
from __future__ import annotations
44

5-
from .pcap import PCAP as PCAP
65
from .site import Site as Site
76
from .scope import Scope as Scope
8-
from .pcap_filter import PCAPFilter as PCAPFilter
97
from .scope_param import ScopeParam as ScopeParam
108
from .health_check import HealthCheck as HealthCheck
119
from .psk_metadata import PSKMetadata as PSKMetadata
@@ -17,7 +15,6 @@
1715
from .app_update_params import AppUpdateParams as AppUpdateParams
1816
from .health_check_rate import HealthCheckRate as HealthCheckRate
1917
from .health_check_type import HealthCheckType as HealthCheckType
20-
from .pcap_filter_param import PCAPFilterParam as PCAPFilterParam
2118
from .pcap_get_response import PCAPGetResponse as PCAPGetResponse
2219
from .health_check_param import HealthCheckParam as HealthCheckParam
2320
from .pcap_create_params import PCAPCreateParams as PCAPCreateParams

src/cloudflare/types/magic_transit/pcap.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/cloudflare/types/magic_transit/pcap_create_params.py

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
from typing import Union
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

8-
from .pcap_filter_param import PCAPFilterParam
8+
__all__ = [
9+
"PCAPCreateParams",
10+
"MagicVisibilityPCAPsPCAPsRequestSimple",
11+
"MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1",
12+
"MagicVisibilityPCAPsPCAPsRequestFull",
13+
"MagicVisibilityPCAPsPCAPsRequestFullFilterV1",
14+
]
915

10-
__all__ = ["PCAPCreateParams", "MagicVisibilityPCAPsRequestSimple", "MagicVisibilityPCAPsRequestFull"]
1116

12-
13-
class MagicVisibilityPCAPsRequestSimple(TypedDict, total=False):
17+
class MagicVisibilityPCAPsPCAPsRequestSimple(TypedDict, total=False):
1418
account_id: Required[str]
1519
"""Identifier"""
1620

@@ -30,11 +34,28 @@ class MagicVisibilityPCAPsRequestSimple(TypedDict, total=False):
3034
non-sampled packets.
3135
"""
3236

33-
filter_v1: PCAPFilterParam
37+
filter_v1: MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1
3438
"""The packet capture filter. When this field is empty, all packets are captured."""
3539

3640

37-
class MagicVisibilityPCAPsRequestFull(TypedDict, total=False):
41+
class MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1(TypedDict, total=False):
42+
destination_address: str
43+
"""The destination IP address of the packet."""
44+
45+
destination_port: float
46+
"""The destination port of the packet."""
47+
48+
protocol: float
49+
"""The protocol number of the packet."""
50+
51+
source_address: str
52+
"""The source IP address of the packet."""
53+
54+
source_port: float
55+
"""The source port of the packet."""
56+
57+
58+
class MagicVisibilityPCAPsPCAPsRequestFull(TypedDict, total=False):
3859
account_id: Required[str]
3960
"""Identifier"""
4061

@@ -67,11 +88,28 @@ class MagicVisibilityPCAPsRequestFull(TypedDict, total=False):
6788
This field only applies to `full` packet captures.
6889
"""
6990

70-
filter_v1: PCAPFilterParam
91+
filter_v1: MagicVisibilityPCAPsPCAPsRequestFullFilterV1
7192
"""The packet capture filter. When this field is empty, all packets are captured."""
7293

7394
packet_limit: float
7495
"""The limit of packets contained in a packet capture."""
7596

7697

77-
PCAPCreateParams: TypeAlias = Union[MagicVisibilityPCAPsRequestSimple, MagicVisibilityPCAPsRequestFull]
98+
class MagicVisibilityPCAPsPCAPsRequestFullFilterV1(TypedDict, total=False):
99+
destination_address: str
100+
"""The destination IP address of the packet."""
101+
102+
destination_port: float
103+
"""The destination port of the packet."""
104+
105+
protocol: float
106+
"""The protocol number of the packet."""
107+
108+
source_address: str
109+
"""The source IP address of the packet."""
110+
111+
source_port: float
112+
"""The source port of the packet."""
113+
114+
115+
PCAPCreateParams: TypeAlias = Union[MagicVisibilityPCAPsPCAPsRequestSimple, MagicVisibilityPCAPsPCAPsRequestFull]

0 commit comments

Comments
 (0)