Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Apr 9, 2024
1 parent 2fe8f50 commit 731c333
Show file tree
Hide file tree
Showing 59 changed files with 434 additions and 416 deletions.
64 changes: 32 additions & 32 deletions api.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/cloudflare/resources/alerting/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
)
from ...types.alerting import (
Policy,
FilterParam,
MechanismParam,
PolicyFilterParam,
PolicyCreateResponse,
PolicyDeleteResponse,
PolicyUpdateResponse,
Expand Down Expand Up @@ -114,7 +114,7 @@ def create(
mechanisms: MechanismParam,
name: str,
description: str | NotGiven = NOT_GIVEN,
filters: FilterParam | NotGiven = NOT_GIVEN,
filters: PolicyFilterParam | 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 @@ -243,7 +243,7 @@ def update(
| NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
filters: FilterParam | NotGiven = NOT_GIVEN,
filters: PolicyFilterParam | NotGiven = NOT_GIVEN,
mechanisms: MechanismParam | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -517,7 +517,7 @@ async def create(
mechanisms: MechanismParam,
name: str,
description: str | NotGiven = NOT_GIVEN,
filters: FilterParam | NotGiven = NOT_GIVEN,
filters: PolicyFilterParam | 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 @@ -646,7 +646,7 @@ async def update(
| NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
filters: FilterParam | NotGiven = NOT_GIVEN,
filters: PolicyFilterParam | NotGiven = NOT_GIVEN,
mechanisms: MechanismParam | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down
38 changes: 19 additions & 19 deletions src/cloudflare/resources/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import httpx

from ..types import (
Filter,
FirewallFilter,
FilterCreateResponse,
filter_list_params,
filter_create_params,
Expand Down Expand Up @@ -99,7 +99,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Filter:
) -> FirewallFilter:
"""
Updates an existing filter.
Expand Down Expand Up @@ -130,7 +130,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Filter], ResultWrapper[Filter]),
cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]),
)

def list(
Expand All @@ -150,7 +150,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncV4PagePaginationArray[Filter]:
) -> SyncV4PagePaginationArray[FirewallFilter]:
"""Fetches filters in a zone.
You can filter the results using several optional
Expand Down Expand Up @@ -185,7 +185,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}")
return self._get_api_list(
f"/zones/{zone_identifier}/filters",
page=SyncV4PagePaginationArray[Filter],
page=SyncV4PagePaginationArray[FirewallFilter],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -204,7 +204,7 @@ def list(
filter_list_params.FilterListParams,
),
),
model=Filter,
model=FirewallFilter,
)

def delete(
Expand All @@ -219,7 +219,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Filter:
) -> FirewallFilter:
"""
Deletes an existing filter.
Expand Down Expand Up @@ -250,7 +250,7 @@ def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Filter], ResultWrapper[Filter]),
cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]),
)

def get(
Expand All @@ -264,7 +264,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Filter:
) -> FirewallFilter:
"""
Fetches the details of a filter.
Expand Down Expand Up @@ -294,7 +294,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Filter], ResultWrapper[Filter]),
cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]),
)


Expand Down Expand Up @@ -360,7 +360,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Filter:
) -> FirewallFilter:
"""
Updates an existing filter.
Expand Down Expand Up @@ -391,7 +391,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Filter], ResultWrapper[Filter]),
cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]),
)

def list(
Expand All @@ -411,7 +411,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[Filter, AsyncV4PagePaginationArray[Filter]]:
) -> AsyncPaginator[FirewallFilter, AsyncV4PagePaginationArray[FirewallFilter]]:
"""Fetches filters in a zone.
You can filter the results using several optional
Expand Down Expand Up @@ -446,7 +446,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}")
return self._get_api_list(
f"/zones/{zone_identifier}/filters",
page=AsyncV4PagePaginationArray[Filter],
page=AsyncV4PagePaginationArray[FirewallFilter],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -465,7 +465,7 @@ def list(
filter_list_params.FilterListParams,
),
),
model=Filter,
model=FirewallFilter,
)

async def delete(
Expand All @@ -480,7 +480,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Filter:
) -> FirewallFilter:
"""
Deletes an existing filter.
Expand Down Expand Up @@ -511,7 +511,7 @@ async def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Filter], ResultWrapper[Filter]),
cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]),
)

async def get(
Expand All @@ -525,7 +525,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Filter:
) -> FirewallFilter:
"""
Fetches the details of a filter.
Expand Down Expand Up @@ -555,7 +555,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Filter], ResultWrapper[Filter]),
cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]),
)


Expand Down
38 changes: 19 additions & 19 deletions src/cloudflare/resources/firewall/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
make_request_options,
)
from ...types.firewall import (
Rule,
FirewallRule,
RuleEditResponse,
RuleCreateResponse,
rule_get_params,
Expand Down Expand Up @@ -102,7 +102,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Rule:
) -> FirewallRule:
"""
Updates an existing firewall rule.
Expand Down Expand Up @@ -133,7 +133,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Rule], ResultWrapper[Rule]),
cast_to=cast(Type[FirewallRule], ResultWrapper[FirewallRule]),
)

def list(
Expand All @@ -152,7 +152,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncV4PagePaginationArray[Rule]:
) -> SyncV4PagePaginationArray[FirewallRule]:
"""Fetches firewall rules in a zone.
You can filter the results using several
Expand Down Expand Up @@ -185,7 +185,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}")
return self._get_api_list(
f"/zones/{zone_identifier}/firewall/rules",
page=SyncV4PagePaginationArray[Rule],
page=SyncV4PagePaginationArray[FirewallRule],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -203,7 +203,7 @@ def list(
rule_list_params.RuleListParams,
),
),
model=Rule,
model=FirewallRule,
)

def delete(
Expand All @@ -218,7 +218,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Rule:
) -> FirewallRule:
"""
Deletes an existing firewall rule.
Expand Down Expand Up @@ -254,7 +254,7 @@ def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Rule], ResultWrapper[Rule]),
cast_to=cast(Type[FirewallRule], ResultWrapper[FirewallRule]),
)

def edit(
Expand Down Expand Up @@ -315,7 +315,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Rule:
) -> FirewallRule:
"""
Fetches the details of a firewall rule.
Expand Down Expand Up @@ -348,7 +348,7 @@ def get(
query=maybe_transform({"id": query_id}, rule_get_params.RuleGetParams),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Rule], ResultWrapper[Rule]),
cast_to=cast(Type[FirewallRule], ResultWrapper[FirewallRule]),
)


Expand Down Expand Up @@ -414,7 +414,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Rule:
) -> FirewallRule:
"""
Updates an existing firewall rule.
Expand Down Expand Up @@ -445,7 +445,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Rule], ResultWrapper[Rule]),
cast_to=cast(Type[FirewallRule], ResultWrapper[FirewallRule]),
)

def list(
Expand All @@ -464,7 +464,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[Rule, AsyncV4PagePaginationArray[Rule]]:
) -> AsyncPaginator[FirewallRule, AsyncV4PagePaginationArray[FirewallRule]]:
"""Fetches firewall rules in a zone.
You can filter the results using several
Expand Down Expand Up @@ -497,7 +497,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}")
return self._get_api_list(
f"/zones/{zone_identifier}/firewall/rules",
page=AsyncV4PagePaginationArray[Rule],
page=AsyncV4PagePaginationArray[FirewallRule],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -515,7 +515,7 @@ def list(
rule_list_params.RuleListParams,
),
),
model=Rule,
model=FirewallRule,
)

async def delete(
Expand All @@ -530,7 +530,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Rule:
) -> FirewallRule:
"""
Deletes an existing firewall rule.
Expand Down Expand Up @@ -566,7 +566,7 @@ async def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Rule], ResultWrapper[Rule]),
cast_to=cast(Type[FirewallRule], ResultWrapper[FirewallRule]),
)

async def edit(
Expand Down Expand Up @@ -627,7 +627,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Rule:
) -> FirewallRule:
"""
Fetches the details of a firewall rule.
Expand Down Expand Up @@ -660,7 +660,7 @@ async def get(
query=await async_maybe_transform({"id": query_id}, rule_get_params.RuleGetParams),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Rule], ResultWrapper[Rule]),
cast_to=cast(Type[FirewallRule], ResultWrapper[FirewallRule]),
)


Expand Down
Loading

0 comments on commit 731c333

Please sign in to comment.