Skip to content

feat(api): api update #2135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1397
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a593104deaa88fb5478971c715a6f8874283042b438b1d9b1c66e640e6804e19.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a4b20862f6df3429ea34d599d65f7731f729b50178dea827dd74159d1ea0e037.yml
18 changes: 8 additions & 10 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3754,13 +3754,7 @@ Methods:
Types:

```python
from cloudflare.types.magic_transit import (
PCAP,
PCAPFilter,
PCAPCreateResponse,
PCAPListResponse,
PCAPGetResponse,
)
from cloudflare.types.magic_transit import PCAPCreateResponse, PCAPListResponse, PCAPGetResponse
```

Methods:
Expand All @@ -3774,15 +3768,19 @@ Methods:
Types:

```python
from cloudflare.types.magic_transit.pcaps import Ownership, OwnershipGetResponse
from cloudflare.types.magic_transit.pcaps import (
OwnershipCreateResponse,
OwnershipGetResponse,
OwnershipValidateResponse,
)
```

Methods:

- <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>
- <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>
- <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>
- <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>
- <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>
- <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>

### Download

Expand Down
27 changes: 14 additions & 13 deletions src/cloudflare/resources/magic_transit/pcaps/ownership.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
from ...._wrappers import ResultWrapper
from ...._base_client import make_request_options
from ....types.magic_transit.pcaps import ownership_create_params, ownership_validate_params
from ....types.magic_transit.pcaps.ownership import Ownership
from ....types.magic_transit.pcaps.ownership_get_response import OwnershipGetResponse
from ....types.magic_transit.pcaps.ownership_create_response import OwnershipCreateResponse
from ....types.magic_transit.pcaps.ownership_validate_response import OwnershipValidateResponse

__all__ = ["OwnershipResource", "AsyncOwnershipResource"]

Expand Down Expand Up @@ -59,7 +60,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Ownership:
) -> OwnershipCreateResponse:
"""
Adds an AWS or GCP bucket to use with full packet captures.

Expand All @@ -86,9 +87,9 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Ownership]._unwrapper,
post_parser=ResultWrapper[OwnershipCreateResponse]._unwrapper,
),
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
cast_to=cast(Type[OwnershipCreateResponse], ResultWrapper[OwnershipCreateResponse]),
)

def delete(
Expand Down Expand Up @@ -183,7 +184,7 @@ def validate(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Ownership:
) -> OwnershipValidateResponse:
"""
Validates buckets added to the packet captures API.

Expand Down Expand Up @@ -218,9 +219,9 @@ def validate(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Ownership]._unwrapper,
post_parser=ResultWrapper[OwnershipValidateResponse]._unwrapper,
),
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
cast_to=cast(Type[OwnershipValidateResponse], ResultWrapper[OwnershipValidateResponse]),
)


Expand Down Expand Up @@ -255,7 +256,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Ownership:
) -> OwnershipCreateResponse:
"""
Adds an AWS or GCP bucket to use with full packet captures.

Expand Down Expand Up @@ -284,9 +285,9 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Ownership]._unwrapper,
post_parser=ResultWrapper[OwnershipCreateResponse]._unwrapper,
),
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
cast_to=cast(Type[OwnershipCreateResponse], ResultWrapper[OwnershipCreateResponse]),
)

async def delete(
Expand Down Expand Up @@ -381,7 +382,7 @@ async def validate(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Ownership:
) -> OwnershipValidateResponse:
"""
Validates buckets added to the packet captures API.

Expand Down Expand Up @@ -416,9 +417,9 @@ async def validate(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Ownership]._unwrapper,
post_parser=ResultWrapper[OwnershipValidateResponse]._unwrapper,
),
cast_to=cast(Type[Ownership], ResultWrapper[Ownership]),
cast_to=cast(Type[OwnershipValidateResponse], ResultWrapper[OwnershipValidateResponse]),
)


Expand Down
13 changes: 6 additions & 7 deletions src/cloudflare/resources/magic_transit/pcaps/pcaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
from ....pagination import SyncSinglePage, AsyncSinglePage
from ...._base_client import AsyncPaginator, make_request_options
from ....types.magic_transit import pcap_create_params
from ....types.magic_transit.pcap_filter_param import PCAPFilterParam
from ....types.magic_transit.pcap_get_response import PCAPGetResponse
from ....types.magic_transit.pcap_list_response import PCAPListResponse
from ....types.magic_transit.pcap_create_response import PCAPCreateResponse
Expand Down Expand Up @@ -86,7 +85,7 @@ def create(
system: Literal["magic-transit"],
time_limit: float,
type: Literal["simple", "full"],
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -132,7 +131,7 @@ def create(
time_limit: float,
type: Literal["simple", "full"],
byte_limit: float | NotGiven = NOT_GIVEN,
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestFullFilterV1 | NotGiven = NOT_GIVEN,
packet_limit: float | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -189,7 +188,7 @@ def create(
system: Literal["magic-transit"],
time_limit: float,
type: Literal["simple", "full"],
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
colo_name: str | NotGiven = NOT_GIVEN,
destination_conf: str | NotGiven = NOT_GIVEN,
byte_limit: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -355,7 +354,7 @@ async def create(
system: Literal["magic-transit"],
time_limit: float,
type: Literal["simple", "full"],
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -401,7 +400,7 @@ async def create(
time_limit: float,
type: Literal["simple", "full"],
byte_limit: float | NotGiven = NOT_GIVEN,
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestFullFilterV1 | NotGiven = NOT_GIVEN,
packet_limit: float | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -458,7 +457,7 @@ async def create(
system: Literal["magic-transit"],
time_limit: float,
type: Literal["simple", "full"],
filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN,
filter_v1: pcap_create_params.MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN,
colo_name: str | NotGiven = NOT_GIVEN,
destination_conf: str | NotGiven = NOT_GIVEN,
byte_limit: float | NotGiven = NOT_GIVEN,
Expand Down
3 changes: 0 additions & 3 deletions src/cloudflare/types/magic_transit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

from __future__ import annotations

from .pcap import PCAP as PCAP
from .site import Site as Site
from .scope import Scope as Scope
from .pcap_filter import PCAPFilter as PCAPFilter
from .scope_param import ScopeParam as ScopeParam
from .health_check import HealthCheck as HealthCheck
from .psk_metadata import PSKMetadata as PSKMetadata
Expand All @@ -17,7 +15,6 @@
from .app_update_params import AppUpdateParams as AppUpdateParams
from .health_check_rate import HealthCheckRate as HealthCheckRate
from .health_check_type import HealthCheckType as HealthCheckType
from .pcap_filter_param import PCAPFilterParam as PCAPFilterParam
from .pcap_get_response import PCAPGetResponse as PCAPGetResponse
from .health_check_param import HealthCheckParam as HealthCheckParam
from .pcap_create_params import PCAPCreateParams as PCAPCreateParams
Expand Down
40 changes: 0 additions & 40 deletions src/cloudflare/types/magic_transit/pcap.py

This file was deleted.

54 changes: 46 additions & 8 deletions src/cloudflare/types/magic_transit/pcap_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
from typing import Union
from typing_extensions import Literal, Required, TypeAlias, TypedDict

from .pcap_filter_param import PCAPFilterParam
__all__ = [
"PCAPCreateParams",
"MagicVisibilityPCAPsPCAPsRequestSimple",
"MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1",
"MagicVisibilityPCAPsPCAPsRequestFull",
"MagicVisibilityPCAPsPCAPsRequestFullFilterV1",
]

__all__ = ["PCAPCreateParams", "MagicVisibilityPCAPsRequestSimple", "MagicVisibilityPCAPsRequestFull"]


class MagicVisibilityPCAPsRequestSimple(TypedDict, total=False):
class MagicVisibilityPCAPsPCAPsRequestSimple(TypedDict, total=False):
account_id: Required[str]
"""Identifier"""

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

filter_v1: PCAPFilterParam
filter_v1: MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1
"""The packet capture filter. When this field is empty, all packets are captured."""


class MagicVisibilityPCAPsRequestFull(TypedDict, total=False):
class MagicVisibilityPCAPsPCAPsRequestSimpleFilterV1(TypedDict, total=False):
destination_address: str
"""The destination IP address of the packet."""

destination_port: float
"""The destination port of the packet."""

protocol: float
"""The protocol number of the packet."""

source_address: str
"""The source IP address of the packet."""

source_port: float
"""The source port of the packet."""


class MagicVisibilityPCAPsPCAPsRequestFull(TypedDict, total=False):
account_id: Required[str]
"""Identifier"""

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

filter_v1: PCAPFilterParam
filter_v1: MagicVisibilityPCAPsPCAPsRequestFullFilterV1
"""The packet capture filter. When this field is empty, all packets are captured."""

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


PCAPCreateParams: TypeAlias = Union[MagicVisibilityPCAPsRequestSimple, MagicVisibilityPCAPsRequestFull]
class MagicVisibilityPCAPsPCAPsRequestFullFilterV1(TypedDict, total=False):
destination_address: str
"""The destination IP address of the packet."""

destination_port: float
"""The destination port of the packet."""

protocol: float
"""The protocol number of the packet."""

source_address: str
"""The source IP address of the packet."""

source_port: float
"""The source port of the packet."""


PCAPCreateParams: TypeAlias = Union[MagicVisibilityPCAPsPCAPsRequestSimple, MagicVisibilityPCAPsPCAPsRequestFull]
Loading