Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent b6f0062 commit 5b9a07e
Show file tree
Hide file tree
Showing 18 changed files with 131 additions and 130 deletions.
16 changes: 8 additions & 8 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1682,11 +1682,11 @@ from cloudflare.types.dns import (

Methods:

- <code title="post /accounts/{account_id}/dns_firewall">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_create_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall.py">Firewall</a></code>
- <code title="get /accounts/{account_id}/dns_firewall">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_list_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall.py">SyncV4PagePaginationArray[Firewall]</a></code>
- <code title="post /accounts/{account_id}/dns_firewall">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_create_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">Firewall</a></code>
- <code title="get /accounts/{account_id}/dns_firewall">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_list_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">SyncV4PagePaginationArray[Firewall]</a></code>
- <code title="delete /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">delete</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall_delete_response.py">FirewallDeleteResponse</a></code>
- <code title="patch /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">edit</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall.py">Firewall</a></code>
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">get</a>(dns_firewall_id, \*, account_id) -> <a href="./src/cloudflare/types/dns/firewall.py">Firewall</a></code>
- <code title="patch /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">edit</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">Firewall</a></code>
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">get</a>(dns_firewall_id, \*, account_id) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">Firewall</a></code>

### Analytics

Expand Down Expand Up @@ -3523,17 +3523,17 @@ Methods:

# Intel

## ASNResource
## ASN

Types:

```python
from cloudflare.types.intel import ASN
from cloudflare.types.intel import IntelASN
```

Methods:

- <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/asn.py">ASN</a></code>
- <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>

### Subnets

Expand Down Expand Up @@ -4420,7 +4420,7 @@ from cloudflare.types.stream.captions.language import VttGetResponse

Methods:

- <code title="get /accounts/{account_id}/stream/{identifier}/captions/{language}/vtt">client.stream.captions.language.vtt.<a href="./src/cloudflare/resources/stream/captions/language/vtt.py">get</a>(language, \*, account_id, identifier, \*\*<a href="src/cloudflare/types/stream/captions/language/vtt_get_params.py">params</a>) -> str</code>
- <code title="get /accounts/{account_id}/stream/{identifier}/captions/{language}/vtt">client.stream.captions.language.vtt.<a href="./src/cloudflare/resources/stream/captions/language/vtt.py">get</a>(language, \*, account_id, identifier) -> str</code>

## Downloads

Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/resources/dns/firewall/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
)
from ...._wrappers import ResultWrapper
from ....types.dns import (
Firewall,
FirewallIPsParam,
UpstreamIPsParam,
AttackMitigationParam,
Expand All @@ -45,6 +44,7 @@
make_request_options,
)
from .analytics.analytics import Analytics, AsyncAnalytics
from ....types.dns.firewall import Firewall

__all__ = ["FirewallResource", "AsyncFirewallResource"]

Expand Down
24 changes: 12 additions & 12 deletions src/cloudflare/resources/intel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .asn import (
ASNResource,
AsyncASNResource,
ASNResourceWithRawResponse,
AsyncASNResourceWithRawResponse,
ASNResourceWithStreamingResponse,
AsyncASNResourceWithStreamingResponse,
ASN,
AsyncASN,
ASNWithRawResponse,
AsyncASNWithRawResponse,
ASNWithStreamingResponse,
AsyncASNWithStreamingResponse,
)
from .dns import (
DNS,
Expand Down Expand Up @@ -98,12 +98,12 @@
)

__all__ = [
"ASNResource",
"AsyncASNResource",
"ASNResourceWithRawResponse",
"AsyncASNResourceWithRawResponse",
"ASNResourceWithStreamingResponse",
"AsyncASNResourceWithStreamingResponse",
"ASN",
"AsyncASN",
"ASNWithRawResponse",
"AsyncASNWithRawResponse",
"ASNWithStreamingResponse",
"AsyncASNWithStreamingResponse",
"DNS",
"AsyncDNS",
"DNSWithRawResponse",
Expand Down
24 changes: 12 additions & 12 deletions src/cloudflare/resources/intel/asn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .asn import (
ASNResource,
AsyncASNResource,
ASNResourceWithRawResponse,
AsyncASNResourceWithRawResponse,
ASNResourceWithStreamingResponse,
AsyncASNResourceWithStreamingResponse,
ASN,
AsyncASN,
ASNWithRawResponse,
AsyncASNWithRawResponse,
ASNWithStreamingResponse,
AsyncASNWithStreamingResponse,
)
from .subnets import (
Subnets,
Expand All @@ -24,10 +24,10 @@
"AsyncSubnetsWithRawResponse",
"SubnetsWithStreamingResponse",
"AsyncSubnetsWithStreamingResponse",
"ASNResource",
"AsyncASNResource",
"ASNResourceWithRawResponse",
"AsyncASNResourceWithRawResponse",
"ASNResourceWithStreamingResponse",
"AsyncASNResourceWithStreamingResponse",
"ASN",
"AsyncASN",
"ASNWithRawResponse",
"AsyncASNWithRawResponse",
"ASNWithStreamingResponse",
"AsyncASNWithStreamingResponse",
]
56 changes: 28 additions & 28 deletions src/cloudflare/resources/intel/asn/asn.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@
async_to_streamed_response_wrapper,
)
from ...._wrappers import ResultWrapper
from ....types.intel import ASN
from ....types.intel import IntelASN
from ...._base_client import (
make_request_options,
)

__all__ = ["ASNResource", "AsyncASNResource"]
__all__ = ["ASN", "AsyncASN"]


class ASNResource(SyncAPIResource):
class ASN(SyncAPIResource):
@cached_property
def subnets(self) -> Subnets:
return Subnets(self._client)

@cached_property
def with_raw_response(self) -> ASNResourceWithRawResponse:
return ASNResourceWithRawResponse(self)
def with_raw_response(self) -> ASNWithRawResponse:
return ASNWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> ASNResourceWithStreamingResponse:
return ASNResourceWithStreamingResponse(self)
def with_streaming_response(self) -> ASNWithStreamingResponse:
return ASNWithStreamingResponse(self)

def get(
self,
asn: ASN,
asn: IntelASN,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -56,7 +56,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ASN:
) -> IntelASN:
"""
Get ASN Overview
Expand All @@ -80,28 +80,28 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ASN]._unwrapper,
post_parser=ResultWrapper[IntelASN]._unwrapper,
),
cast_to=cast(Type[ASN], ResultWrapper[int]),
cast_to=cast(Type[IntelASN], ResultWrapper[int]),
)


class AsyncASNResource(AsyncAPIResource):
class AsyncASN(AsyncAPIResource):
@cached_property
def subnets(self) -> AsyncSubnets:
return AsyncSubnets(self._client)

@cached_property
def with_raw_response(self) -> AsyncASNResourceWithRawResponse:
return AsyncASNResourceWithRawResponse(self)
def with_raw_response(self) -> AsyncASNWithRawResponse:
return AsyncASNWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncASNResourceWithStreamingResponse:
return AsyncASNResourceWithStreamingResponse(self)
def with_streaming_response(self) -> AsyncASNWithStreamingResponse:
return AsyncASNWithStreamingResponse(self)

async def get(
self,
asn: ASN,
asn: IntelASN,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -110,7 +110,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ASN:
) -> IntelASN:
"""
Get ASN Overview
Expand All @@ -134,14 +134,14 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ASN]._unwrapper,
post_parser=ResultWrapper[IntelASN]._unwrapper,
),
cast_to=cast(Type[ASN], ResultWrapper[int]),
cast_to=cast(Type[IntelASN], ResultWrapper[int]),
)


class ASNResourceWithRawResponse:
def __init__(self, asn: ASNResource) -> None:
class ASNWithRawResponse:
def __init__(self, asn: ASN) -> None:
self._asn = asn

self.get = to_raw_response_wrapper(
Expand All @@ -153,8 +153,8 @@ def subnets(self) -> SubnetsWithRawResponse:
return SubnetsWithRawResponse(self._asn.subnets)


class AsyncASNResourceWithRawResponse:
def __init__(self, asn: AsyncASNResource) -> None:
class AsyncASNWithRawResponse:
def __init__(self, asn: AsyncASN) -> None:
self._asn = asn

self.get = async_to_raw_response_wrapper(
Expand All @@ -166,8 +166,8 @@ def subnets(self) -> AsyncSubnetsWithRawResponse:
return AsyncSubnetsWithRawResponse(self._asn.subnets)


class ASNResourceWithStreamingResponse:
def __init__(self, asn: ASNResource) -> None:
class ASNWithStreamingResponse:
def __init__(self, asn: ASN) -> None:
self._asn = asn

self.get = to_streamed_response_wrapper(
Expand All @@ -179,8 +179,8 @@ def subnets(self) -> SubnetsWithStreamingResponse:
return SubnetsWithStreamingResponse(self._asn.subnets)


class AsyncASNResourceWithStreamingResponse:
def __init__(self, asn: AsyncASNResource) -> None:
class AsyncASNWithStreamingResponse:
def __init__(self, asn: AsyncASN) -> None:
self._asn = asn

self.get = async_to_streamed_response_wrapper(
Expand Down
6 changes: 3 additions & 3 deletions src/cloudflare/resources/intel/asn/subnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ....types.intel import ASN
from ....types.intel import IntelASN
from ...._base_client import (
make_request_options,
)
Expand All @@ -33,7 +33,7 @@ def with_streaming_response(self) -> SubnetsWithStreamingResponse:

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

async def get(
self,
asn: ASN,
asn: IntelASN,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down
Loading

0 comments on commit 5b9a07e

Please sign in to comment.