Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1241)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 31, 2024
1 parent 0605467 commit 3a97c75
Show file tree
Hide file tree
Showing 39 changed files with 361 additions and 1,814 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1265
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1a3d664862c3f2963a1083c7a6fcf46bf03ebdd31a3537cf7454be65a42d5c64.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-900bd7932c19d73286704b0fc0971d9b21520f1086bac0445dce2cf7db87200a.yml
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ Methods:
- <code title="put /zones/{zone_identifier}/firewall/rules/{id}">client.firewall.rules.<a href="./src/cloudflare/resources/firewall/rules.py">update</a>(id, \*, zone_identifier, \*\*<a href="src/cloudflare/types/firewall/rule_update_params.py">params</a>) -> <a href="./src/cloudflare/types/firewall/firewall_rule.py">FirewallRule</a></code>
- <code title="get /zones/{zone_identifier}/firewall/rules">client.firewall.rules.<a href="./src/cloudflare/resources/firewall/rules.py">list</a>(zone_identifier, \*\*<a href="src/cloudflare/types/firewall/rule_list_params.py">params</a>) -> <a href="./src/cloudflare/types/firewall/firewall_rule.py">SyncV4PagePaginationArray[FirewallRule]</a></code>
- <code title="delete /zones/{zone_identifier}/firewall/rules/{id}">client.firewall.rules.<a href="./src/cloudflare/resources/firewall/rules.py">delete</a>(id, \*, zone_identifier) -> <a href="./src/cloudflare/types/firewall/firewall_rule.py">FirewallRule</a></code>
- <code title="patch /zones/{zone_identifier}/firewall/rules/{id}">client.firewall.rules.<a href="./src/cloudflare/resources/firewall/rules.py">edit</a>(id, \*, zone_identifier) -> <a href="./src/cloudflare/types/firewall/rule_edit_response.py">Optional</a></code>
- <code title="patch /zones/{zone_identifier}/firewall/rules/{id}">client.firewall.rules.<a href="./src/cloudflare/resources/firewall/rules.py">edit</a>(id, \*, zone_identifier, \*\*<a href="src/cloudflare/types/firewall/rule_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/firewall/rule_edit_response.py">Optional</a></code>
- <code title="get /zones/{zone_identifier}/firewall/rules/{id}">client.firewall.rules.<a href="./src/cloudflare/resources/firewall/rules.py">get</a>(zone_identifier, \*, path_id, \*\*<a href="src/cloudflare/types/firewall/rule_get_params.py">params</a>) -> <a href="./src/cloudflare/types/firewall/firewall_rule.py">FirewallRule</a></code>

## AccessRules
Expand Down Expand Up @@ -1345,7 +1345,7 @@ from cloudflare.types.firewall.waf import (
Methods:

- <code title="post /zones/{zone_identifier}/firewall/waf/overrides">client.firewall.waf.overrides.<a href="./src/cloudflare/resources/firewall/waf/overrides.py">create</a>(zone_identifier, \*\*<a href="src/cloudflare/types/firewall/waf/override_create_params.py">params</a>) -> <a href="./src/cloudflare/types/firewall/waf/override.py">Override</a></code>
- <code title="put /zones/{zone_identifier}/firewall/waf/overrides/{id}">client.firewall.waf.overrides.<a href="./src/cloudflare/resources/firewall/waf/overrides.py">update</a>(zone_identifier, \*, path_id, \*\*<a href="src/cloudflare/types/firewall/waf/override_update_params.py">params</a>) -> <a href="./src/cloudflare/types/firewall/waf/override.py">Override</a></code>
- <code title="put /zones/{zone_identifier}/firewall/waf/overrides/{id}">client.firewall.waf.overrides.<a href="./src/cloudflare/resources/firewall/waf/overrides.py">update</a>(id, \*, zone_identifier, \*\*<a href="src/cloudflare/types/firewall/waf/override_update_params.py">params</a>) -> <a href="./src/cloudflare/types/firewall/waf/override.py">Override</a></code>
- <code title="get /zones/{zone_identifier}/firewall/waf/overrides">client.firewall.waf.overrides.<a href="./src/cloudflare/resources/firewall/waf/overrides.py">list</a>(zone_identifier, \*\*<a href="src/cloudflare/types/firewall/waf/override_list_params.py">params</a>) -> <a href="./src/cloudflare/types/firewall/waf/override.py">SyncV4PagePaginationArray[Override]</a></code>
- <code title="delete /zones/{zone_identifier}/firewall/waf/overrides/{id}">client.firewall.waf.overrides.<a href="./src/cloudflare/resources/firewall/waf/overrides.py">delete</a>(id, \*, zone_identifier) -> <a href="./src/cloudflare/types/firewall/waf/override_delete_response.py">Optional</a></code>
- <code title="get /zones/{zone_identifier}/firewall/waf/overrides/{id}">client.firewall.waf.overrides.<a href="./src/cloudflare/resources/firewall/waf/overrides.py">get</a>(id, \*, zone_identifier) -> <a href="./src/cloudflare/types/firewall/waf/override.py">Override</a></code>
Expand Down
14 changes: 4 additions & 10 deletions src/cloudflare/resources/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def create(
self,
zone_identifier: str,
*,
expression: str,
body: object,
# 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 All @@ -60,9 +60,6 @@ def create(
Args:
zone_identifier: Identifier
expression: The filter expression. For more information, refer to
[Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -75,7 +72,7 @@ def create(
raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}")
return self._post(
f"/zones/{zone_identifier}/filters",
body=maybe_transform({"expression": expression}, filter_create_params.FilterCreateParams),
body=maybe_transform(body, filter_create_params.FilterCreateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -323,7 +320,7 @@ async def create(
self,
zone_identifier: str,
*,
expression: str,
body: object,
# 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 All @@ -337,9 +334,6 @@ async def create(
Args:
zone_identifier: Identifier
expression: The filter expression. For more information, refer to
[Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -352,7 +346,7 @@ async def create(
raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}")
return await self._post(
f"/zones/{zone_identifier}/filters",
body=await async_maybe_transform({"expression": expression}, filter_create_params.FilterCreateParams),
body=await async_maybe_transform(body, filter_create_params.FilterCreateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down
78 changes: 14 additions & 64 deletions src/cloudflare/resources/firewall/access_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,9 @@ def list(
*,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
configuration: access_rule_list_params.Configuration | NotGiven = NOT_GIVEN,
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
match: Literal["any", "all"] | NotGiven = NOT_GIVEN,
mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"] | NotGiven = NOT_GIVEN,
notes: str | NotGiven = NOT_GIVEN,
egs_pagination: access_rule_list_params.EgsPagination | NotGiven = NOT_GIVEN,
filters: access_rule_list_params.Filters | NotGiven = NOT_GIVEN,
order: Literal["configuration.target", "configuration.value", "mode"] | NotGiven = NOT_GIVEN,
page: float | NotGiven = NOT_GIVEN,
per_page: float | NotGiven = NOT_GIVEN,
Expand All @@ -153,15 +151,6 @@ def list(
direction: The direction used to sort returned rules.
match: When set to `all`, all the search requirements must match. When set to `any`,
only one of the search requirements has to match.
mode: The action to apply to a matched request.
notes: The string to search for in the notes of existing IP Access rules. Notes: For
example, the string 'attack' would match IP Access rules with notes 'Attack
26/02' and 'Attack 27/02'. The search is case insensitive.
order: The field used to sort returned rules.
page: Requested page within paginated list of results.
Expand Down Expand Up @@ -198,11 +187,9 @@ def list(
timeout=timeout,
query=maybe_transform(
{
"configuration": configuration,
"direction": direction,
"match": match,
"mode": mode,
"notes": notes,
"egs_pagination": egs_pagination,
"filters": filters,
"order": order,
"page": page,
"per_page": per_page,
Expand All @@ -215,7 +202,7 @@ def list(

def delete(
self,
identifier: str,
identifier: object,
*,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
Expand All @@ -232,8 +219,6 @@ def delete(
Note: This operation will affect all zones in the account or zone.
Args:
identifier: The unique identifier of the resource.
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
Expand All @@ -246,8 +231,6 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand All @@ -274,7 +257,7 @@ def delete(

def edit(
self,
identifier: str,
identifier: object,
*,
configuration: access_rule_edit_params.Configuration,
mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"],
Expand All @@ -294,8 +277,6 @@ def edit(
Note: This operation will affect all zones in the account or zone.
Args:
identifier: The unique identifier of the resource.
configuration: The rule configuration.
mode: The action to apply to a matched request.
Expand All @@ -314,8 +295,6 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand Down Expand Up @@ -355,7 +334,7 @@ def edit(

def get(
self,
identifier: str,
identifier: object,
*,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
Expand All @@ -370,8 +349,6 @@ def get(
Fetches the details of an IP Access rule defined.
Args:
identifier: The unique identifier of the resource.
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
Expand All @@ -384,8 +361,6 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand Down Expand Up @@ -509,11 +484,9 @@ def list(
*,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
configuration: access_rule_list_params.Configuration | NotGiven = NOT_GIVEN,
direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
match: Literal["any", "all"] | NotGiven = NOT_GIVEN,
mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"] | NotGiven = NOT_GIVEN,
notes: str | NotGiven = NOT_GIVEN,
egs_pagination: access_rule_list_params.EgsPagination | NotGiven = NOT_GIVEN,
filters: access_rule_list_params.Filters | NotGiven = NOT_GIVEN,
order: Literal["configuration.target", "configuration.value", "mode"] | NotGiven = NOT_GIVEN,
page: float | NotGiven = NOT_GIVEN,
per_page: float | NotGiven = NOT_GIVEN,
Expand All @@ -537,15 +510,6 @@ def list(
direction: The direction used to sort returned rules.
match: When set to `all`, all the search requirements must match. When set to `any`,
only one of the search requirements has to match.
mode: The action to apply to a matched request.
notes: The string to search for in the notes of existing IP Access rules. Notes: For
example, the string 'attack' would match IP Access rules with notes 'Attack
26/02' and 'Attack 27/02'. The search is case insensitive.
order: The field used to sort returned rules.
page: Requested page within paginated list of results.
Expand Down Expand Up @@ -582,11 +546,9 @@ def list(
timeout=timeout,
query=maybe_transform(
{
"configuration": configuration,
"direction": direction,
"match": match,
"mode": mode,
"notes": notes,
"egs_pagination": egs_pagination,
"filters": filters,
"order": order,
"page": page,
"per_page": per_page,
Expand All @@ -599,7 +561,7 @@ def list(

async def delete(
self,
identifier: str,
identifier: object,
*,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
Expand All @@ -616,8 +578,6 @@ async def delete(
Note: This operation will affect all zones in the account or zone.
Args:
identifier: The unique identifier of the resource.
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
Expand All @@ -630,8 +590,6 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand All @@ -658,7 +616,7 @@ async def delete(

async def edit(
self,
identifier: str,
identifier: object,
*,
configuration: access_rule_edit_params.Configuration,
mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"],
Expand All @@ -678,8 +636,6 @@ async def edit(
Note: This operation will affect all zones in the account or zone.
Args:
identifier: The unique identifier of the resource.
configuration: The rule configuration.
mode: The action to apply to a matched request.
Expand All @@ -698,8 +654,6 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand Down Expand Up @@ -739,7 +693,7 @@ async def edit(

async def get(
self,
identifier: str,
identifier: object,
*,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
Expand All @@ -754,8 +708,6 @@ async def get(
Fetches the details of an IP Access rule defined.
Args:
identifier: The unique identifier of the resource.
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
Expand All @@ -768,8 +720,6 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
if not identifier:
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
if account_id and zone_id:
raise ValueError("You cannot provide both account_id and zone_id")

Expand Down
Loading

0 comments on commit 3a97c75

Please sign in to comment.