feat(api): api update (#2587)

This commit is contained in:
stainless-app[bot] 2025-05-06 09:47:08 -04:00
parent 6452b4fc1c
commit 8d92a4da2d
8 changed files with 134 additions and 6 deletions

View file

@ -1,4 +1,4 @@
configured_endpoints: 1664
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4e988c584e8eacb13347475cb6ac38171cedd948f5101b03c37ec712341b9d7a.yml
openapi_spec_hash: c4e86fdb536ff8299ffc1faed7e3e573
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3f1027f7740afd5fbb6aa554575dd2fd7dd68c0d7c394c68b5515753860eaf8e.yml
openapi_spec_hash: fbe090182fbea3b046b951f6f4fb3b33
config_hash: af2dbb6a6332cef477c4697db6a78d79

View file

@ -3,6 +3,7 @@
from __future__ import annotations
from typing import Type, Optional, cast
from typing_extensions import Literal
import httpx
@ -79,6 +80,9 @@ class EventsResource(SyncAPIResource):
shuffle_at_event_start: bool | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
total_active_users: Optional[int] | NotGiven = NOT_GIVEN,
turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN,
turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]]
| 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,
@ -143,6 +147,12 @@ class EventsResource(SyncAPIResource):
while it is active. If null, the event will inherit it. This can only be set if
the event's `new_users_per_minute` property is also set.
turnstile_action: If set, the event will override the waiting room's `turnstile_action` property
while it is active. If null, the event will inherit it.
turnstile_mode: If set, the event will override the waiting room's `turnstile_mode` property
while it is active. If null, the event will inherit it.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@ -172,6 +182,8 @@ class EventsResource(SyncAPIResource):
"shuffle_at_event_start": shuffle_at_event_start,
"suspended": suspended,
"total_active_users": total_active_users,
"turnstile_action": turnstile_action,
"turnstile_mode": turnstile_mode,
},
event_create_params.EventCreateParams,
),
@ -204,6 +216,9 @@ class EventsResource(SyncAPIResource):
shuffle_at_event_start: bool | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
total_active_users: Optional[int] | NotGiven = NOT_GIVEN,
turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN,
turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]]
| 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,
@ -262,6 +277,12 @@ class EventsResource(SyncAPIResource):
while it is active. If null, the event will inherit it. This can only be set if
the event's `new_users_per_minute` property is also set.
turnstile_action: If set, the event will override the waiting room's `turnstile_action` property
while it is active. If null, the event will inherit it.
turnstile_mode: If set, the event will override the waiting room's `turnstile_mode` property
while it is active. If null, the event will inherit it.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@ -293,6 +314,8 @@ class EventsResource(SyncAPIResource):
"shuffle_at_event_start": shuffle_at_event_start,
"suspended": suspended,
"total_active_users": total_active_users,
"turnstile_action": turnstile_action,
"turnstile_mode": turnstile_mode,
},
event_update_params.EventUpdateParams,
),
@ -425,6 +448,9 @@ class EventsResource(SyncAPIResource):
shuffle_at_event_start: bool | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
total_active_users: Optional[int] | NotGiven = NOT_GIVEN,
turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN,
turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]]
| 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,
@ -483,6 +509,12 @@ class EventsResource(SyncAPIResource):
while it is active. If null, the event will inherit it. This can only be set if
the event's `new_users_per_minute` property is also set.
turnstile_action: If set, the event will override the waiting room's `turnstile_action` property
while it is active. If null, the event will inherit it.
turnstile_mode: If set, the event will override the waiting room's `turnstile_mode` property
while it is active. If null, the event will inherit it.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@ -514,6 +546,8 @@ class EventsResource(SyncAPIResource):
"shuffle_at_event_start": shuffle_at_event_start,
"suspended": suspended,
"total_active_users": total_active_users,
"turnstile_action": turnstile_action,
"turnstile_mode": turnstile_mode,
},
event_edit_params.EventEditParams,
),
@ -615,6 +649,9 @@ class AsyncEventsResource(AsyncAPIResource):
shuffle_at_event_start: bool | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
total_active_users: Optional[int] | NotGiven = NOT_GIVEN,
turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN,
turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]]
| 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,
@ -679,6 +716,12 @@ class AsyncEventsResource(AsyncAPIResource):
while it is active. If null, the event will inherit it. This can only be set if
the event's `new_users_per_minute` property is also set.
turnstile_action: If set, the event will override the waiting room's `turnstile_action` property
while it is active. If null, the event will inherit it.
turnstile_mode: If set, the event will override the waiting room's `turnstile_mode` property
while it is active. If null, the event will inherit it.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@ -708,6 +751,8 @@ class AsyncEventsResource(AsyncAPIResource):
"shuffle_at_event_start": shuffle_at_event_start,
"suspended": suspended,
"total_active_users": total_active_users,
"turnstile_action": turnstile_action,
"turnstile_mode": turnstile_mode,
},
event_create_params.EventCreateParams,
),
@ -740,6 +785,9 @@ class AsyncEventsResource(AsyncAPIResource):
shuffle_at_event_start: bool | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
total_active_users: Optional[int] | NotGiven = NOT_GIVEN,
turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN,
turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]]
| 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,
@ -798,6 +846,12 @@ class AsyncEventsResource(AsyncAPIResource):
while it is active. If null, the event will inherit it. This can only be set if
the event's `new_users_per_minute` property is also set.
turnstile_action: If set, the event will override the waiting room's `turnstile_action` property
while it is active. If null, the event will inherit it.
turnstile_mode: If set, the event will override the waiting room's `turnstile_mode` property
while it is active. If null, the event will inherit it.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@ -829,6 +883,8 @@ class AsyncEventsResource(AsyncAPIResource):
"shuffle_at_event_start": shuffle_at_event_start,
"suspended": suspended,
"total_active_users": total_active_users,
"turnstile_action": turnstile_action,
"turnstile_mode": turnstile_mode,
},
event_update_params.EventUpdateParams,
),
@ -961,6 +1017,9 @@ class AsyncEventsResource(AsyncAPIResource):
shuffle_at_event_start: bool | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
total_active_users: Optional[int] | NotGiven = NOT_GIVEN,
turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN,
turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]]
| 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,
@ -1019,6 +1078,12 @@ class AsyncEventsResource(AsyncAPIResource):
while it is active. If null, the event will inherit it. This can only be set if
the event's `new_users_per_minute` property is also set.
turnstile_action: If set, the event will override the waiting room's `turnstile_action` property
while it is active. If null, the event will inherit it.
turnstile_mode: If set, the event will override the waiting room's `turnstile_mode` property
while it is active. If null, the event will inherit it.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@ -1050,6 +1115,8 @@ class AsyncEventsResource(AsyncAPIResource):
"shuffle_at_event_start": shuffle_at_event_start,
"suspended": suspended,
"total_active_users": total_active_users,
"turnstile_action": turnstile_action,
"turnstile_mode": turnstile_mode,
},
event_edit_params.EventEditParams,
),

View file

@ -2,6 +2,7 @@
from typing import Optional
from datetime import datetime
from typing_extensions import Literal
from ..._models import BaseModel
@ -95,3 +96,15 @@ class Event(BaseModel):
while it is active. If null, the event will inherit it. This can only be set if
the event's `new_users_per_minute` property is also set.
"""
turnstile_action: Optional[Literal["log", "infinite_queue"]] = None
"""
If set, the event will override the waiting room's `turnstile_action` property
while it is active. If null, the event will inherit it.
"""
turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]] = None
"""
If set, the event will override the waiting room's `turnstile_mode` property
while it is active. If null, the event will inherit it.
"""

View file

@ -3,7 +3,7 @@
from __future__ import annotations
from typing import Optional
from typing_extensions import Required, TypedDict
from typing_extensions import Literal, Required, TypedDict
__all__ = ["EventCreateParams"]
@ -92,3 +92,15 @@ class EventCreateParams(TypedDict, total=False):
while it is active. If null, the event will inherit it. This can only be set if
the event's `new_users_per_minute` property is also set.
"""
turnstile_action: Optional[Literal["log", "infinite_queue"]]
"""
If set, the event will override the waiting room's `turnstile_action` property
while it is active. If null, the event will inherit it.
"""
turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]]
"""
If set, the event will override the waiting room's `turnstile_mode` property
while it is active. If null, the event will inherit it.
"""

View file

@ -3,7 +3,7 @@
from __future__ import annotations
from typing import Optional
from typing_extensions import Required, TypedDict
from typing_extensions import Literal, Required, TypedDict
__all__ = ["EventEditParams"]
@ -94,3 +94,15 @@ class EventEditParams(TypedDict, total=False):
while it is active. If null, the event will inherit it. This can only be set if
the event's `new_users_per_minute` property is also set.
"""
turnstile_action: Optional[Literal["log", "infinite_queue"]]
"""
If set, the event will override the waiting room's `turnstile_action` property
while it is active. If null, the event will inherit it.
"""
turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]]
"""
If set, the event will override the waiting room's `turnstile_mode` property
while it is active. If null, the event will inherit it.
"""

View file

@ -3,7 +3,7 @@
from __future__ import annotations
from typing import Optional
from typing_extensions import Required, TypedDict
from typing_extensions import Literal, Required, TypedDict
__all__ = ["EventUpdateParams"]
@ -94,3 +94,15 @@ class EventUpdateParams(TypedDict, total=False):
while it is active. If null, the event will inherit it. This can only be set if
the event's `new_users_per_minute` property is also set.
"""
turnstile_action: Optional[Literal["log", "infinite_queue"]]
"""
If set, the event will override the waiting room's `turnstile_action` property
while it is active. If null, the event will inherit it.
"""
turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]]
"""
If set, the event will override the waiting room's `turnstile_mode` property
while it is active. If null, the event will inherit it.
"""

View file

@ -4,4 +4,4 @@ from typing_extensions import Literal, TypeAlias
__all__ = ["Type"]
Type: TypeAlias = Literal["full", "partial", "secondary"]
Type: TypeAlias = Literal["full", "partial", "secondary", "internal"]

View file

@ -50,6 +50,8 @@ class TestEvents:
shuffle_at_event_start=True,
suspended=True,
total_active_users=200,
turnstile_action="log",
turnstile_mode="off",
)
assert_matches_type(Event, event, path=["response"])
@ -136,6 +138,8 @@ class TestEvents:
shuffle_at_event_start=True,
suspended=True,
total_active_users=200,
turnstile_action="log",
turnstile_mode="off",
)
assert_matches_type(Event, event, path=["response"])
@ -354,6 +358,8 @@ class TestEvents:
shuffle_at_event_start=True,
suspended=True,
total_active_users=200,
turnstile_action="log",
turnstile_mode="off",
)
assert_matches_type(Event, event, path=["response"])
@ -516,6 +522,8 @@ class TestAsyncEvents:
shuffle_at_event_start=True,
suspended=True,
total_active_users=200,
turnstile_action="log",
turnstile_mode="off",
)
assert_matches_type(Event, event, path=["response"])
@ -602,6 +610,8 @@ class TestAsyncEvents:
shuffle_at_event_start=True,
suspended=True,
total_active_users=200,
turnstile_action="log",
turnstile_mode="off",
)
assert_matches_type(Event, event, path=["response"])
@ -820,6 +830,8 @@ class TestAsyncEvents:
shuffle_at_event_start=True,
suspended=True,
total_active_users=200,
turnstile_action="log",
turnstile_mode="off",
)
assert_matches_type(Event, event, path=["response"])