Skip to content

Commit 74f433a

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): clean up missing model references (#2138)
1 parent e323e62 commit 74f433a

17 files changed

+167
-366
lines changed

api.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -3754,7 +3754,13 @@ Methods:
37543754
Types:
37553755

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

37603766
Methods:
@@ -3768,19 +3774,15 @@ Methods:
37683774
Types:
37693775

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

37783780
Methods:
37793781

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>
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>
37813783
- <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>
37823784
- <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>
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>
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>
37843786

37853787
### Download
37863788

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

+13-14
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
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
2526
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
2827

2928
__all__ = ["OwnershipResource", "AsyncOwnershipResource"]
3029

@@ -60,7 +59,7 @@ def create(
6059
extra_query: Query | None = None,
6160
extra_body: Body | None = None,
6261
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
63-
) -> OwnershipCreateResponse:
62+
) -> Ownership:
6463
"""
6564
Adds an AWS or GCP bucket to use with full packet captures.
6665
@@ -87,9 +86,9 @@ def create(
8786
extra_query=extra_query,
8887
extra_body=extra_body,
8988
timeout=timeout,
90-
post_parser=ResultWrapper[OwnershipCreateResponse]._unwrapper,
89+
post_parser=ResultWrapper[Ownership]._unwrapper,
9190
),
92-
cast_to=cast(Type[OwnershipCreateResponse], ResultWrapper[OwnershipCreateResponse]),
91+
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
9392
)
9493

9594
def delete(
@@ -184,7 +183,7 @@ def validate(
184183
extra_query: Query | None = None,
185184
extra_body: Body | None = None,
186185
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
187-
) -> OwnershipValidateResponse:
186+
) -> Ownership:
188187
"""
189188
Validates buckets added to the packet captures API.
190189
@@ -219,9 +218,9 @@ def validate(
219218
extra_query=extra_query,
220219
extra_body=extra_body,
221220
timeout=timeout,
222-
post_parser=ResultWrapper[OwnershipValidateResponse]._unwrapper,
221+
post_parser=ResultWrapper[Ownership]._unwrapper,
223222
),
224-
cast_to=cast(Type[OwnershipValidateResponse], ResultWrapper[OwnershipValidateResponse]),
223+
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
225224
)
226225

227226

@@ -256,7 +255,7 @@ async def create(
256255
extra_query: Query | None = None,
257256
extra_body: Body | None = None,
258257
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
259-
) -> OwnershipCreateResponse:
258+
) -> Ownership:
260259
"""
261260
Adds an AWS or GCP bucket to use with full packet captures.
262261
@@ -285,9 +284,9 @@ async def create(
285284
extra_query=extra_query,
286285
extra_body=extra_body,
287286
timeout=timeout,
288-
post_parser=ResultWrapper[OwnershipCreateResponse]._unwrapper,
287+
post_parser=ResultWrapper[Ownership]._unwrapper,
289288
),
290-
cast_to=cast(Type[OwnershipCreateResponse], ResultWrapper[OwnershipCreateResponse]),
289+
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
291290
)
292291

293292
async def delete(
@@ -382,7 +381,7 @@ async def validate(
382381
extra_query: Query | None = None,
383382
extra_body: Body | None = None,
384383
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
385-
) -> OwnershipValidateResponse:
384+
) -> Ownership:
386385
"""
387386
Validates buckets added to the packet captures API.
388387
@@ -417,9 +416,9 @@ async def validate(
417416
extra_query=extra_query,
418417
extra_body=extra_body,
419418
timeout=timeout,
420-
post_parser=ResultWrapper[OwnershipValidateResponse]._unwrapper,
419+
post_parser=ResultWrapper[Ownership]._unwrapper,
421420
),
422-
cast_to=cast(Type[OwnershipValidateResponse], ResultWrapper[OwnershipValidateResponse]),
421+
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
423422
)
424423

425424

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

+7-6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
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
4445
from ....types.magic_transit.pcap_get_response import PCAPGetResponse
4546
from ....types.magic_transit.pcap_list_response import PCAPListResponse
4647
from ....types.magic_transit.pcap_create_response import PCAPCreateResponse
@@ -85,7 +86,7 @@ def create(
8586
system: Literal["magic-transit"],
8687
time_limit: float,
8788
type: Literal["simple", "full"],
88-
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
89+
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
8990
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9091
# The extra values given here take precedence over values defined on the client or passed to this method.
9192
extra_headers: Headers | None = None,
@@ -131,7 +132,7 @@ def create(
131132
time_limit: float,
132133
type: Literal["simple", "full"],
133134
byte_limit: float | NotGiven = NOT_GIVEN,
134-
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestFullFilterV1 | NotGiven = NOT_GIVEN,
135+
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
135136
packet_limit: float | NotGiven = NOT_GIVEN,
136137
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
137138
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -188,7 +189,7 @@ def create(
188189
system: Literal["magic-transit"],
189190
time_limit: float,
190191
type: Literal["simple", "full"],
191-
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
192+
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
192193
colo_name: str | NotGiven = NOT_GIVEN,
193194
destination_conf: str | NotGiven = NOT_GIVEN,
194195
byte_limit: float | NotGiven = NOT_GIVEN,
@@ -354,7 +355,7 @@ async def create(
354355
system: Literal["magic-transit"],
355356
time_limit: float,
356357
type: Literal["simple", "full"],
357-
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
358+
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
358359
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
359360
# The extra values given here take precedence over values defined on the client or passed to this method.
360361
extra_headers: Headers | None = None,
@@ -400,7 +401,7 @@ async def create(
400401
time_limit: float,
401402
type: Literal["simple", "full"],
402403
byte_limit: float | NotGiven = NOT_GIVEN,
403-
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestFullFilterV1 | NotGiven = NOT_GIVEN,
404+
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
404405
packet_limit: float | NotGiven = NOT_GIVEN,
405406
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
406407
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -457,7 +458,7 @@ async def create(
457458
system: Literal["magic-transit"],
458459
time_limit: float,
459460
type: Literal["simple", "full"],
460-
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
461+
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
461462
colo_name: str | NotGiven = NOT_GIVEN,
462463
destination_conf: str | NotGiven = NOT_GIVEN,
463464
byte_limit: float | NotGiven = NOT_GIVEN,

src/cloudflare/types/magic_transit/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
from __future__ import annotations
44

5+
from .pcap import PCAP as PCAP
56
from .site import Site as Site
67
from .scope import Scope as Scope
8+
from .pcap_filter import PCAPFilter as PCAPFilter
79
from .scope_param import ScopeParam as ScopeParam
810
from .health_check import HealthCheck as HealthCheck
911
from .psk_metadata import PSKMetadata as PSKMetadata
@@ -15,6 +17,7 @@
1517
from .app_update_params import AppUpdateParams as AppUpdateParams
1618
from .health_check_rate import HealthCheckRate as HealthCheckRate
1719
from .health_check_type import HealthCheckType as HealthCheckType
20+
from .pcap_filter_param import PCAPFilterParam as PCAPFilterParam
1821
from .pcap_get_response import PCAPGetResponse as PCAPGetResponse
1922
from .health_check_param import HealthCheckParam as HealthCheckParam
2023
from .pcap_create_params import PCAPCreateParams as PCAPCreateParams
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
from typing_extensions import Literal
5+
6+
from ..._models import BaseModel
7+
from .pcap_filter import PCAPFilter
8+
9+
__all__ = ["PCAP"]
10+
11+
12+
class PCAP(BaseModel):
13+
id: Optional[str] = None
14+
"""The ID for the packet capture."""
15+
16+
filter_v1: Optional[PCAPFilter] = None
17+
"""The packet capture filter. When this field is empty, all packets are captured."""
18+
19+
status: Optional[
20+
Literal[
21+
"unknown", "success", "pending", "running", "conversion_pending", "conversion_running", "complete", "failed"
22+
]
23+
] = None
24+
"""The status of the packet capture request."""
25+
26+
submitted: Optional[str] = None
27+
"""The RFC 3339 timestamp when the packet capture was created."""
28+
29+
system: Optional[Literal["magic-transit"]] = None
30+
"""The system used to collect packet captures."""
31+
32+
time_limit: Optional[float] = None
33+
"""The packet capture duration in seconds."""
34+
35+
type: Optional[Literal["simple", "full"]] = None
36+
"""The type of packet capture.
37+
38+
`Simple` captures sampled packets, and `full` captures entire payloads and
39+
non-sampled packets.
40+
"""

src/cloudflare/types/magic_transit/pcap_create_params.py

+5-43
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55
from typing import Union
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

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

1612

1713
class MagicVisibilityPCAPsPCAPsRequestSimple(TypedDict, total=False):
@@ -34,27 +30,10 @@ class MagicVisibilityPCAPsPCAPsRequestSimple(TypedDict, total=False):
3430
non-sampled packets.
3531
"""
3632

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

4036

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-
5837
class MagicVisibilityPCAPsPCAPsRequestFull(TypedDict, total=False):
5938
account_id: Required[str]
6039
"""Identifier"""
@@ -88,28 +67,11 @@ class MagicVisibilityPCAPsPCAPsRequestFull(TypedDict, total=False):
8867
This field only applies to `full` packet captures.
8968
"""
9069

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

9473
packet_limit: float
9574
"""The limit of packets contained in a packet capture."""
9675

9776

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-
11577
PCAPCreateParams: TypeAlias = Union[MagicVisibilityPCAPsPCAPsRequestSimple, MagicVisibilityPCAPsPCAPsRequestFull]

0 commit comments

Comments
 (0)