Skip to content

Commit 5a4d204

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#349)
1 parent 5b9a07e commit 5a4d204

File tree

11 files changed

+37
-31
lines changed

11 files changed

+37
-31
lines changed

api.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
```python
44
from cloudflare.types import (
5+
ASN,
56
AuditLog,
67
CloudflareTunnel,
78
ErrorData,
@@ -3525,15 +3526,9 @@ Methods:
35253526

35263527
## ASN
35273528

3528-
Types:
3529-
3530-
```python
3531-
from cloudflare.types.intel import IntelASN
3532-
```
3533-
35343529
Methods:
35353530

3536-
- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.intel.asn.<a href="./src/cloudflare/resources/intel/asn/asn.py">get</a>(asn, \*, account_id) -> <a href="./src/cloudflare/types/intel/intel_asn.py">IntelASN</a></code>
3531+
- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.intel.asn.<a href="./src/cloudflare/resources/intel/asn/asn.py">get</a>(asn, \*, account_id) -> <a href="./src/cloudflare/types/shared/asn.py">ASN</a></code>
35373532

35383533
### Subnets
35393534

src/cloudflare/resources/intel/asn/asn.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
async_to_streamed_response_wrapper,
2525
)
2626
from ...._wrappers import ResultWrapper
27-
from ....types.intel import IntelASN
2827
from ...._base_client import (
2928
make_request_options,
3029
)
30+
from ....types.shared import asn
3131

3232
__all__ = ["ASN", "AsyncASN"]
3333

@@ -47,7 +47,7 @@ def with_streaming_response(self) -> ASNWithStreamingResponse:
4747

4848
def get(
4949
self,
50-
asn: IntelASN,
50+
asn: asn.ASN,
5151
*,
5252
account_id: str,
5353
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -56,7 +56,7 @@ def get(
5656
extra_query: Query | None = None,
5757
extra_body: Body | None = None,
5858
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
59-
) -> IntelASN:
59+
) -> asn.ASN:
6060
"""
6161
Get ASN Overview
6262
@@ -80,9 +80,9 @@ def get(
8080
extra_query=extra_query,
8181
extra_body=extra_body,
8282
timeout=timeout,
83-
post_parser=ResultWrapper[IntelASN]._unwrapper,
83+
post_parser=ResultWrapper[asn.ASN]._unwrapper,
8484
),
85-
cast_to=cast(Type[IntelASN], ResultWrapper[int]),
85+
cast_to=cast(Type[asn.ASN], ResultWrapper[int]),
8686
)
8787

8888

@@ -101,7 +101,7 @@ def with_streaming_response(self) -> AsyncASNWithStreamingResponse:
101101

102102
async def get(
103103
self,
104-
asn: IntelASN,
104+
asn: asn.ASN,
105105
*,
106106
account_id: str,
107107
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -110,7 +110,7 @@ async def get(
110110
extra_query: Query | None = None,
111111
extra_body: Body | None = None,
112112
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
113-
) -> IntelASN:
113+
) -> asn.ASN:
114114
"""
115115
Get ASN Overview
116116
@@ -134,9 +134,9 @@ async def get(
134134
extra_query=extra_query,
135135
extra_body=extra_body,
136136
timeout=timeout,
137-
post_parser=ResultWrapper[IntelASN]._unwrapper,
137+
post_parser=ResultWrapper[asn.ASN]._unwrapper,
138138
),
139-
cast_to=cast(Type[IntelASN], ResultWrapper[int]),
139+
cast_to=cast(Type[asn.ASN], ResultWrapper[int]),
140140
)
141141

142142

src/cloudflare/resources/intel/asn/subnets.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
async_to_raw_response_wrapper,
1414
async_to_streamed_response_wrapper,
1515
)
16-
from ....types.intel import IntelASN
1716
from ...._base_client import (
1817
make_request_options,
1918
)
19+
from ....types.shared import ASN
2020
from ....types.intel.asn import SubnetGetResponse
2121

2222
__all__ = ["Subnets", "AsyncSubnets"]
@@ -33,7 +33,7 @@ def with_streaming_response(self) -> SubnetsWithStreamingResponse:
3333

3434
def get(
3535
self,
36-
asn: IntelASN,
36+
asn: ASN,
3737
*,
3838
account_id: str,
3939
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -79,7 +79,7 @@ def with_streaming_response(self) -> AsyncSubnetsWithStreamingResponse:
7979

8080
async def get(
8181
self,
82-
asn: IntelASN,
82+
asn: ASN,
8383
*,
8484
account_id: str,
8585
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.

src/cloudflare/types/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from .shared import (
6+
ASN as ASN,
67
Role as Role,
78
Member as Member,
89
Result as Result,

src/cloudflare/types/intel/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from .ip_list import IPList as IPList
1010
from .sinkhole import Sinkhole as Sinkhole
1111
from .dns_param import DNSParam as DNSParam
12-
from .intel_asn import IntelASN as IntelASN
1312
from .ip_get_params import IPGetParams as IPGetParams
1413
from .domain_history import DomainHistory as DomainHistory
1514
from .dns_list_params import DNSListParams as DNSListParams

src/cloudflare/types/intel/asn/subnet_get_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
from typing import List, Optional
44

5+
from ...shared import ASN
56
from ...._models import BaseModel
6-
from ..intel_asn import IntelASN
77

88
__all__ = ["SubnetGetResponse"]
99

1010

1111
class SubnetGetResponse(BaseModel):
12-
asn: Optional[IntelASN] = None
12+
asn: Optional[ASN] = None
1313

1414
count: Optional[float] = None
1515
"""Total results returned based on your search parameters."""

src/cloudflare/types/shared/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from .asn import ASN as ASN
34
from .role import Role as Role
45
from .member import Member as Member
56
from .result import Result as Result
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33

4-
__all__ = ["IntelASN"]
54

6-
IntelASN = int
5+
6+
__all__ = ["ASN"]
7+
8+
ASN = int
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from .asn import ASN as ASN
34
from .permission_grant import PermissionGrant as PermissionGrant
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
__all__ = ["ASN"]
6+
7+
ASN = int

tests/api_resources/intel/test_asn.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from cloudflare import Cloudflare, AsyncCloudflare
1111
from tests.utils import assert_matches_type
12-
from cloudflare.types.intel import IntelASN
12+
from cloudflare.types.shared import ASN
1313

1414
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1515

@@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None:
2424
0,
2525
account_id="023e105f4ecef8ad9ca31a8372d0c353",
2626
)
27-
assert_matches_type(IntelASN, asn, path=["response"])
27+
assert_matches_type(ASN, asn, path=["response"])
2828

2929
@pytest.mark.skip()
3030
@parametrize
@@ -37,7 +37,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
3737
assert response.is_closed is True
3838
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
3939
asn = response.parse()
40-
assert_matches_type(IntelASN, asn, path=["response"])
40+
assert_matches_type(ASN, asn, path=["response"])
4141

4242
@pytest.mark.skip()
4343
@parametrize
@@ -50,7 +50,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
5050
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5151

5252
asn = response.parse()
53-
assert_matches_type(IntelASN, asn, path=["response"])
53+
assert_matches_type(ASN, asn, path=["response"])
5454

5555
assert cast(Any, response.is_closed) is True
5656

@@ -74,7 +74,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
7474
0,
7575
account_id="023e105f4ecef8ad9ca31a8372d0c353",
7676
)
77-
assert_matches_type(IntelASN, asn, path=["response"])
77+
assert_matches_type(ASN, asn, path=["response"])
7878

7979
@pytest.mark.skip()
8080
@parametrize
@@ -87,7 +87,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
8787
assert response.is_closed is True
8888
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
8989
asn = await response.parse()
90-
assert_matches_type(IntelASN, asn, path=["response"])
90+
assert_matches_type(ASN, asn, path=["response"])
9191

9292
@pytest.mark.skip()
9393
@parametrize
@@ -100,7 +100,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
100100
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
101101

102102
asn = await response.parse()
103-
assert_matches_type(IntelASN, asn, path=["response"])
103+
assert_matches_type(ASN, asn, path=["response"])
104104

105105
assert cast(Any, response.is_closed) is True
106106

0 commit comments

Comments
 (0)