Skip to content

Commit dc752c1

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#2201)
1 parent 5be5fe6 commit dc752c1

12 files changed

+1056
-148
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1449
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f3bf5786ed274253519d4c0cf9abb19fb072872380a2c0bf90917f78f16cfaa6.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c6fe7515b7879a7cd51bbe9433aeee5d3d30feaf519f42d0d81c64b19f45875.yml

src/cloudflare/resources/zero_trust/access/applications/applications.py

+128-36
Large diffs are not rendered by default.

src/cloudflare/resources/zero_trust/organizations/organizations.py

+50-2
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ def revoke_users(
335335
email: str,
336336
account_id: str | NotGiven = NOT_GIVEN,
337337
zone_id: str | NotGiven = NOT_GIVEN,
338+
query_devices: bool | NotGiven = NOT_GIVEN,
339+
body_devices: bool | NotGiven = NOT_GIVEN,
340+
user_uid: str | NotGiven = NOT_GIVEN,
341+
warp_session_reauth: bool | NotGiven = NOT_GIVEN,
338342
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
339343
# The extra values given here take precedence over values defined on the client or passed to this method.
340344
extra_headers: Headers | None = None,
@@ -352,6 +356,16 @@ def revoke_users(
352356
353357
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
354358
359+
query_devices: When set to `true`, all devices associated with the user will be revoked.
360+
361+
body_devices: When set to `true`, all devices associated with the user will be revoked.
362+
363+
user_uid: The uuid of the user to revoke.
364+
365+
warp_session_reauth: When set to `true`, the user will be required to re-authenticate to WARP for all
366+
Gateway policies that enforce a WARP client session duration. When `false`, the
367+
user’s WARP session will remain active
368+
355369
extra_headers: Send extra headers
356370
357371
extra_query: Add additional query parameters to the request
@@ -374,12 +388,23 @@ def revoke_users(
374388
account_or_zone_id = zone_id
375389
return self._post(
376390
f"/{account_or_zone}/{account_or_zone_id}/access/organizations/revoke_user",
377-
body=maybe_transform({"email": email}, organization_revoke_users_params.OrganizationRevokeUsersParams),
391+
body=maybe_transform(
392+
{
393+
"email": email,
394+
"body_devices": body_devices,
395+
"user_uid": user_uid,
396+
"warp_session_reauth": warp_session_reauth,
397+
},
398+
organization_revoke_users_params.OrganizationRevokeUsersParams,
399+
),
378400
options=make_request_options(
379401
extra_headers=extra_headers,
380402
extra_query=extra_query,
381403
extra_body=extra_body,
382404
timeout=timeout,
405+
query=maybe_transform(
406+
{"query_devices": query_devices}, organization_revoke_users_params.OrganizationRevokeUsersParams
407+
),
383408
post_parser=ResultWrapper[Optional[OrganizationRevokeUsersResponse]]._unwrapper,
384409
),
385410
cast_to=cast(
@@ -682,6 +707,10 @@ async def revoke_users(
682707
email: str,
683708
account_id: str | NotGiven = NOT_GIVEN,
684709
zone_id: str | NotGiven = NOT_GIVEN,
710+
query_devices: bool | NotGiven = NOT_GIVEN,
711+
body_devices: bool | NotGiven = NOT_GIVEN,
712+
user_uid: str | NotGiven = NOT_GIVEN,
713+
warp_session_reauth: bool | NotGiven = NOT_GIVEN,
685714
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
686715
# The extra values given here take precedence over values defined on the client or passed to this method.
687716
extra_headers: Headers | None = None,
@@ -699,6 +728,16 @@ async def revoke_users(
699728
700729
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
701730
731+
query_devices: When set to `true`, all devices associated with the user will be revoked.
732+
733+
body_devices: When set to `true`, all devices associated with the user will be revoked.
734+
735+
user_uid: The uuid of the user to revoke.
736+
737+
warp_session_reauth: When set to `true`, the user will be required to re-authenticate to WARP for all
738+
Gateway policies that enforce a WARP client session duration. When `false`, the
739+
user’s WARP session will remain active
740+
702741
extra_headers: Send extra headers
703742
704743
extra_query: Add additional query parameters to the request
@@ -722,13 +761,22 @@ async def revoke_users(
722761
return await self._post(
723762
f"/{account_or_zone}/{account_or_zone_id}/access/organizations/revoke_user",
724763
body=await async_maybe_transform(
725-
{"email": email}, organization_revoke_users_params.OrganizationRevokeUsersParams
764+
{
765+
"email": email,
766+
"body_devices": body_devices,
767+
"user_uid": user_uid,
768+
"warp_session_reauth": warp_session_reauth,
769+
},
770+
organization_revoke_users_params.OrganizationRevokeUsersParams,
726771
),
727772
options=make_request_options(
728773
extra_headers=extra_headers,
729774
extra_query=extra_query,
730775
extra_body=extra_body,
731776
timeout=timeout,
777+
query=await async_maybe_transform(
778+
{"query_devices": query_devices}, organization_revoke_users_params.OrganizationRevokeUsersParams
779+
),
732780
post_parser=ResultWrapper[Optional[OrganizationRevokeUsersResponse]]._unwrapper,
733781
),
734782
cast_to=cast(

src/cloudflare/types/zero_trust/access/application_create_params.py

+93-12
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
__all__ = [
2323
"ApplicationCreateParams",
2424
"SelfHostedApplication",
25+
"SelfHostedApplicationDestination",
2526
"SelfHostedApplicationPolicy",
2627
"SelfHostedApplicationPolicyAccessAppPolicyLink",
2728
"SelfHostedApplicationPolicyUnionMember2",
@@ -35,12 +36,14 @@
3536
"SaaSApplicationSCIMConfig",
3637
"SaaSApplicationSCIMConfigAuthentication",
3738
"BrowserSSHApplication",
39+
"BrowserSSHApplicationDestination",
3840
"BrowserSSHApplicationPolicy",
3941
"BrowserSSHApplicationPolicyAccessAppPolicyLink",
4042
"BrowserSSHApplicationPolicyUnionMember2",
4143
"BrowserSSHApplicationSCIMConfig",
4244
"BrowserSSHApplicationSCIMConfigAuthentication",
4345
"BrowserVNCApplication",
46+
"BrowserVNCApplicationDestination",
4447
"BrowserVNCApplicationPolicy",
4548
"BrowserVNCApplicationPolicyAccessAppPolicyLink",
4649
"BrowserVNCApplicationPolicyUnionMember2",
@@ -81,10 +84,9 @@
8184

8285
class SelfHostedApplication(TypedDict, total=False):
8386
domain: Required[str]
84-
"""The primary hostname and path that Access will secure.
87+
"""The primary hostname and path secured by Access.
8588
86-
If the app is visible in the App Launcher dashboard, this is the domain that
87-
will be displayed.
89+
This domain will be displayed if the app is visible in the App Launcher.
8890
"""
8991

9092
type: Required[str]
@@ -144,6 +146,14 @@ class SelfHostedApplication(TypedDict, total=False):
144146
custom_pages: List[str]
145147
"""The custom pages that will be displayed when applicable for this application"""
146148

149+
destinations: Iterable[SelfHostedApplicationDestination]
150+
"""List of destinations secured by Access.
151+
152+
This supersedes `self_hosted_domains` to allow for more flexibility in defining
153+
different types of domains. If `destinations` are provided, then
154+
`self_hosted_domains` will be ignored.
155+
"""
156+
147157
enable_binding_cookie: bool
148158
"""
149159
Enables the binding cookie, which increases security against compromised
@@ -194,7 +204,12 @@ class SelfHostedApplication(TypedDict, total=False):
194204
"""
195205

196206
self_hosted_domains: List[SelfHostedDomains]
197-
"""List of domains that Access will secure."""
207+
"""List of public domains that Access will secure.
208+
209+
This field is deprecated in favor of `destinations` and will be supported until
210+
**November 21, 2025.** If `destinations` are provided, then
211+
`self_hosted_domains` will be ignored.
212+
"""
198213

199214
service_auth_401_redirect: bool
200215
"""Returns a 401 status code when the request is blocked by a Service Auth policy."""
@@ -216,6 +231,20 @@ class SelfHostedApplication(TypedDict, total=False):
216231
"""
217232

218233

234+
class SelfHostedApplicationDestination(TypedDict, total=False):
235+
type: Literal["public", "private"]
236+
237+
uri: str
238+
"""The URI of the destination.
239+
240+
Public destinations can include a domain and path with
241+
[wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).
242+
Private destinations are an early access feature and gated behind a feature
243+
flag. Private destinations support private IPv4, IPv6, and Server Name
244+
Indications (SNI) with optional port ranges.
245+
"""
246+
247+
219248
class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False):
220249
id: str
221250
"""The UUID of the policy"""
@@ -468,10 +497,9 @@ class SaaSApplicationSCIMConfig(TypedDict, total=False):
468497

469498
class BrowserSSHApplication(TypedDict, total=False):
470499
domain: Required[str]
471-
"""The primary hostname and path that Access will secure.
500+
"""The primary hostname and path secured by Access.
472501
473-
If the app is visible in the App Launcher dashboard, this is the domain that
474-
will be displayed.
502+
This domain will be displayed if the app is visible in the App Launcher.
475503
"""
476504

477505
type: Required[str]
@@ -531,6 +559,14 @@ class BrowserSSHApplication(TypedDict, total=False):
531559
custom_pages: List[str]
532560
"""The custom pages that will be displayed when applicable for this application"""
533561

562+
destinations: Iterable[BrowserSSHApplicationDestination]
563+
"""List of destinations secured by Access.
564+
565+
This supersedes `self_hosted_domains` to allow for more flexibility in defining
566+
different types of domains. If `destinations` are provided, then
567+
`self_hosted_domains` will be ignored.
568+
"""
569+
534570
enable_binding_cookie: bool
535571
"""
536572
Enables the binding cookie, which increases security against compromised
@@ -581,7 +617,12 @@ class BrowserSSHApplication(TypedDict, total=False):
581617
"""
582618

583619
self_hosted_domains: List[SelfHostedDomains]
584-
"""List of domains that Access will secure."""
620+
"""List of public domains that Access will secure.
621+
622+
This field is deprecated in favor of `destinations` and will be supported until
623+
**November 21, 2025.** If `destinations` are provided, then
624+
`self_hosted_domains` will be ignored.
625+
"""
585626

586627
service_auth_401_redirect: bool
587628
"""Returns a 401 status code when the request is blocked by a Service Auth policy."""
@@ -603,6 +644,20 @@ class BrowserSSHApplication(TypedDict, total=False):
603644
"""
604645

605646

647+
class BrowserSSHApplicationDestination(TypedDict, total=False):
648+
type: Literal["public", "private"]
649+
650+
uri: str
651+
"""The URI of the destination.
652+
653+
Public destinations can include a domain and path with
654+
[wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).
655+
Private destinations are an early access feature and gated behind a feature
656+
flag. Private destinations support private IPv4, IPv6, and Server Name
657+
Indications (SNI) with optional port ranges.
658+
"""
659+
660+
606661
class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False):
607662
id: str
608663
"""The UUID of the policy"""
@@ -700,10 +755,9 @@ class BrowserSSHApplicationSCIMConfig(TypedDict, total=False):
700755

701756
class BrowserVNCApplication(TypedDict, total=False):
702757
domain: Required[str]
703-
"""The primary hostname and path that Access will secure.
758+
"""The primary hostname and path secured by Access.
704759
705-
If the app is visible in the App Launcher dashboard, this is the domain that
706-
will be displayed.
760+
This domain will be displayed if the app is visible in the App Launcher.
707761
"""
708762

709763
type: Required[str]
@@ -763,6 +817,14 @@ class BrowserVNCApplication(TypedDict, total=False):
763817
custom_pages: List[str]
764818
"""The custom pages that will be displayed when applicable for this application"""
765819

820+
destinations: Iterable[BrowserVNCApplicationDestination]
821+
"""List of destinations secured by Access.
822+
823+
This supersedes `self_hosted_domains` to allow for more flexibility in defining
824+
different types of domains. If `destinations` are provided, then
825+
`self_hosted_domains` will be ignored.
826+
"""
827+
766828
enable_binding_cookie: bool
767829
"""
768830
Enables the binding cookie, which increases security against compromised
@@ -813,7 +875,12 @@ class BrowserVNCApplication(TypedDict, total=False):
813875
"""
814876

815877
self_hosted_domains: List[SelfHostedDomains]
816-
"""List of domains that Access will secure."""
878+
"""List of public domains that Access will secure.
879+
880+
This field is deprecated in favor of `destinations` and will be supported until
881+
**November 21, 2025.** If `destinations` are provided, then
882+
`self_hosted_domains` will be ignored.
883+
"""
817884

818885
service_auth_401_redirect: bool
819886
"""Returns a 401 status code when the request is blocked by a Service Auth policy."""
@@ -835,6 +902,20 @@ class BrowserVNCApplication(TypedDict, total=False):
835902
"""
836903

837904

905+
class BrowserVNCApplicationDestination(TypedDict, total=False):
906+
type: Literal["public", "private"]
907+
908+
uri: str
909+
"""The URI of the destination.
910+
911+
Public destinations can include a domain and path with
912+
[wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).
913+
Private destinations are an early access feature and gated behind a feature
914+
flag. Private destinations support private IPv4, IPv6, and Server Name
915+
Indications (SNI) with optional port ranges.
916+
"""
917+
918+
838919
class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False):
839920
id: str
840921
"""The UUID of the policy"""

0 commit comments

Comments
 (0)