Skip to content

Commit

Permalink
feat(api): api shield operations updates; rename discovery resource (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Dec 18, 2024
1 parent 05c5428 commit 5972580
Show file tree
Hide file tree
Showing 7 changed files with 477 additions and 252 deletions.
8 changes: 4 additions & 4 deletions src/cloudflare/resources/api_gateway/operations/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def create(
self,
*,
zone_id: str,
body: Iterable[operation_create_params.Body],
operations: Iterable[operation_create_params.Operation],
# 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 @@ -100,7 +100,7 @@ def create(
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._post(
f"/zones/{zone_id}/api_gateway/operations",
body=maybe_transform(body, Iterable[operation_create_params.Body]),
body=maybe_transform(operations, Iterable[operation_create_params.Operation]),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -344,7 +344,7 @@ async def create(
self,
*,
zone_id: str,
body: Iterable[operation_create_params.Body],
operations: Iterable[operation_create_params.Operation],
# 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 @@ -375,7 +375,7 @@ async def create(
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._post(
f"/zones/{zone_id}/api_gateway/operations",
body=await async_maybe_transform(body, Iterable[operation_create_params.Body]),
body=await async_maybe_transform(operations, Iterable[operation_create_params.Operation]),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down
1 change: 0 additions & 1 deletion src/cloudflare/types/api_gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from .message import Message as Message
from .settings import Settings as Settings
from .api_shield import APIShield as APIShield
from .configuration import Configuration as Configuration
from .public_schema import PublicSchema as PublicSchema
from .schema_upload import SchemaUpload as SchemaUpload
Expand Down
227 changes: 0 additions & 227 deletions src/cloudflare/types/api_gateway/api_shield.py

This file was deleted.

6 changes: 3 additions & 3 deletions src/cloudflare/types/api_gateway/operation_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
from typing import Iterable
from typing_extensions import Literal, Required, TypedDict

__all__ = ["OperationCreateParams", "Body"]
__all__ = ["OperationCreateParams", "Operation"]


class OperationCreateParams(TypedDict, total=False):
zone_id: Required[str]
"""Identifier"""

body: Required[Iterable[Body]]
operations: Required[Iterable[Operation]]


class Body(TypedDict, total=False):
class Operation(TypedDict, total=False):
endpoint: Required[str]
"""
The endpoint which can contain path parameter templates in curly braces, each
Expand Down
Loading

0 comments on commit 5972580

Please sign in to comment.