Skip to content

Commit

Permalink
feat(api): api update (#2203)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 21, 2024
1 parent ace26df commit 1c97b11
Show file tree
Hide file tree
Showing 12 changed files with 1,056 additions and 148 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: 1449
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f3bf5786ed274253519d4c0cf9abb19fb072872380a2c0bf90917f78f16cfaa6.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c6fe7515b7879a7cd51bbe9433aeee5d3d30feaf519f42d0d81c64b19f45875.yml
164 changes: 128 additions & 36 deletions src/cloudflare/resources/zero_trust/access/applications/applications.py

Large diffs are not rendered by default.

52 changes: 50 additions & 2 deletions src/cloudflare/resources/zero_trust/organizations/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ def revoke_users(
email: str,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
query_devices: bool | NotGiven = NOT_GIVEN,
body_devices: bool | NotGiven = NOT_GIVEN,
user_uid: str | NotGiven = NOT_GIVEN,
warp_session_reauth: bool | 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 All @@ -352,6 +356,16 @@ def revoke_users(
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
query_devices: When set to `true`, all devices associated with the user will be revoked.
body_devices: When set to `true`, all devices associated with the user will be revoked.
user_uid: The uuid of the user to revoke.
warp_session_reauth: When set to `true`, the user will be required to re-authenticate to WARP for all
Gateway policies that enforce a WARP client session duration. When `false`, the
user’s WARP session will remain active
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -374,12 +388,23 @@ def revoke_users(
account_or_zone_id = zone_id
return self._post(
f"/{account_or_zone}/{account_or_zone_id}/access/organizations/revoke_user",
body=maybe_transform({"email": email}, organization_revoke_users_params.OrganizationRevokeUsersParams),
body=maybe_transform(
{
"email": email,
"body_devices": body_devices,
"user_uid": user_uid,
"warp_session_reauth": warp_session_reauth,
},
organization_revoke_users_params.OrganizationRevokeUsersParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{"query_devices": query_devices}, organization_revoke_users_params.OrganizationRevokeUsersParams
),
post_parser=ResultWrapper[Optional[OrganizationRevokeUsersResponse]]._unwrapper,
),
cast_to=cast(
Expand Down Expand Up @@ -682,6 +707,10 @@ async def revoke_users(
email: str,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
query_devices: bool | NotGiven = NOT_GIVEN,
body_devices: bool | NotGiven = NOT_GIVEN,
user_uid: str | NotGiven = NOT_GIVEN,
warp_session_reauth: bool | 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 All @@ -699,6 +728,16 @@ async def revoke_users(
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
query_devices: When set to `true`, all devices associated with the user will be revoked.
body_devices: When set to `true`, all devices associated with the user will be revoked.
user_uid: The uuid of the user to revoke.
warp_session_reauth: When set to `true`, the user will be required to re-authenticate to WARP for all
Gateway policies that enforce a WARP client session duration. When `false`, the
user’s WARP session will remain active
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -722,13 +761,22 @@ async def revoke_users(
return await self._post(
f"/{account_or_zone}/{account_or_zone_id}/access/organizations/revoke_user",
body=await async_maybe_transform(
{"email": email}, organization_revoke_users_params.OrganizationRevokeUsersParams
{
"email": email,
"body_devices": body_devices,
"user_uid": user_uid,
"warp_session_reauth": warp_session_reauth,
},
organization_revoke_users_params.OrganizationRevokeUsersParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"query_devices": query_devices}, organization_revoke_users_params.OrganizationRevokeUsersParams
),
post_parser=ResultWrapper[Optional[OrganizationRevokeUsersResponse]]._unwrapper,
),
cast_to=cast(
Expand Down
105 changes: 93 additions & 12 deletions src/cloudflare/types/zero_trust/access/application_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
__all__ = [
"ApplicationCreateParams",
"SelfHostedApplication",
"SelfHostedApplicationDestination",
"SelfHostedApplicationPolicy",
"SelfHostedApplicationPolicyAccessAppPolicyLink",
"SelfHostedApplicationPolicyUnionMember2",
Expand All @@ -35,12 +36,14 @@
"SaaSApplicationSCIMConfig",
"SaaSApplicationSCIMConfigAuthentication",
"BrowserSSHApplication",
"BrowserSSHApplicationDestination",
"BrowserSSHApplicationPolicy",
"BrowserSSHApplicationPolicyAccessAppPolicyLink",
"BrowserSSHApplicationPolicyUnionMember2",
"BrowserSSHApplicationSCIMConfig",
"BrowserSSHApplicationSCIMConfigAuthentication",
"BrowserVNCApplication",
"BrowserVNCApplicationDestination",
"BrowserVNCApplicationPolicy",
"BrowserVNCApplicationPolicyAccessAppPolicyLink",
"BrowserVNCApplicationPolicyUnionMember2",
Expand Down Expand Up @@ -81,10 +84,9 @@

class SelfHostedApplication(TypedDict, total=False):
domain: Required[str]
"""The primary hostname and path that Access will secure.
"""The primary hostname and path secured by Access.
If the app is visible in the App Launcher dashboard, this is the domain that
will be displayed.
This domain will be displayed if the app is visible in the App Launcher.
"""

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

destinations: Iterable[SelfHostedApplicationDestination]
"""List of destinations secured by Access.
This supersedes `self_hosted_domains` to allow for more flexibility in defining
different types of domains. If `destinations` are provided, then
`self_hosted_domains` will be ignored.
"""

enable_binding_cookie: bool
"""
Enables the binding cookie, which increases security against compromised
Expand Down Expand Up @@ -194,7 +204,12 @@ class SelfHostedApplication(TypedDict, total=False):
"""

self_hosted_domains: List[SelfHostedDomains]
"""List of domains that Access will secure."""
"""List of public domains that Access will secure.
This field is deprecated in favor of `destinations` and will be supported until
**November 21, 2025.** If `destinations` are provided, then
`self_hosted_domains` will be ignored.
"""

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


class SelfHostedApplicationDestination(TypedDict, total=False):
type: Literal["public", "private"]

uri: str
"""The URI of the destination.
Public destinations can include a domain and path with
[wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).
Private destinations are an early access feature and gated behind a feature
flag. Private destinations support private IPv4, IPv6, and Server Name
Indications (SNI) with optional port ranges.
"""


class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False):
id: str
"""The UUID of the policy"""
Expand Down Expand Up @@ -468,10 +497,9 @@ class SaaSApplicationSCIMConfig(TypedDict, total=False):

class BrowserSSHApplication(TypedDict, total=False):
domain: Required[str]
"""The primary hostname and path that Access will secure.
"""The primary hostname and path secured by Access.
If the app is visible in the App Launcher dashboard, this is the domain that
will be displayed.
This domain will be displayed if the app is visible in the App Launcher.
"""

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

destinations: Iterable[BrowserSSHApplicationDestination]
"""List of destinations secured by Access.
This supersedes `self_hosted_domains` to allow for more flexibility in defining
different types of domains. If `destinations` are provided, then
`self_hosted_domains` will be ignored.
"""

enable_binding_cookie: bool
"""
Enables the binding cookie, which increases security against compromised
Expand Down Expand Up @@ -581,7 +617,12 @@ class BrowserSSHApplication(TypedDict, total=False):
"""

self_hosted_domains: List[SelfHostedDomains]
"""List of domains that Access will secure."""
"""List of public domains that Access will secure.
This field is deprecated in favor of `destinations` and will be supported until
**November 21, 2025.** If `destinations` are provided, then
`self_hosted_domains` will be ignored.
"""

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


class BrowserSSHApplicationDestination(TypedDict, total=False):
type: Literal["public", "private"]

uri: str
"""The URI of the destination.
Public destinations can include a domain and path with
[wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).
Private destinations are an early access feature and gated behind a feature
flag. Private destinations support private IPv4, IPv6, and Server Name
Indications (SNI) with optional port ranges.
"""


class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False):
id: str
"""The UUID of the policy"""
Expand Down Expand Up @@ -700,10 +755,9 @@ class BrowserSSHApplicationSCIMConfig(TypedDict, total=False):

class BrowserVNCApplication(TypedDict, total=False):
domain: Required[str]
"""The primary hostname and path that Access will secure.
"""The primary hostname and path secured by Access.
If the app is visible in the App Launcher dashboard, this is the domain that
will be displayed.
This domain will be displayed if the app is visible in the App Launcher.
"""

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

destinations: Iterable[BrowserVNCApplicationDestination]
"""List of destinations secured by Access.
This supersedes `self_hosted_domains` to allow for more flexibility in defining
different types of domains. If `destinations` are provided, then
`self_hosted_domains` will be ignored.
"""

enable_binding_cookie: bool
"""
Enables the binding cookie, which increases security against compromised
Expand Down Expand Up @@ -813,7 +875,12 @@ class BrowserVNCApplication(TypedDict, total=False):
"""

self_hosted_domains: List[SelfHostedDomains]
"""List of domains that Access will secure."""
"""List of public domains that Access will secure.
This field is deprecated in favor of `destinations` and will be supported until
**November 21, 2025.** If `destinations` are provided, then
`self_hosted_domains` will be ignored.
"""

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


class BrowserVNCApplicationDestination(TypedDict, total=False):
type: Literal["public", "private"]

uri: str
"""The URI of the destination.
Public destinations can include a domain and path with
[wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).
Private destinations are an early access feature and gated behind a feature
flag. Private destinations support private IPv4, IPv6, and Server Name
Indications (SNI) with optional port ranges.
"""


class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False):
id: str
"""The UUID of the policy"""
Expand Down
Loading

0 comments on commit 1c97b11

Please sign in to comment.