Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 18, 2024
1 parent 9367d59 commit 8e20edf
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 183 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: 1348
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-36a9d717773ebb507fd0744af578aa64b697030857c602c77458156a911fcab9.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a4ad69b707d0e14c7a716a22c876ab03c40d8aefa59eec101c5c52260cb860f3.yml
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6079,7 +6079,7 @@ Methods:

- <code title="post /accounts/{account_id}/gateway/lists">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/list_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/list_create_response.py">Optional</a></code>
- <code title="put /accounts/{account_id}/gateway/lists/{list_id}">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">update</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/list_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_list.py">Optional</a></code>
- <code title="get /accounts/{account_id}/gateway/lists">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/list_list_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_list.py">SyncSinglePage[GatewayList]</a></code>
- <code title="get /accounts/{account_id}/gateway/lists">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_list.py">SyncSinglePage[GatewayList]</a></code>
- <code title="delete /accounts/{account_id}/gateway/lists/{list_id}">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">delete</a>(list_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/list_delete_response.py">Optional</a></code>
- <code title="patch /accounts/{account_id}/gateway/lists/{list_id}">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">edit</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/list_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_list.py">Optional</a></code>
- <code title="get /accounts/{account_id}/gateway/lists/{list_id}">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">get</a>(list_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_list.py">Optional</a></code>
Expand Down
8 changes: 4 additions & 4 deletions src/cloudflare/resources/zero_trust/gateway/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def edit(
This endpoint can update a
single subcollection of settings such as `antivirus`, `tls_decrypt`,
`activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or
`certificate`, without updating the entire configuration object. Returns an
error if any collection of settings is not properly configured.
`custom_certificate`, without updating the entire configuration object. Returns
an error if any collection of settings is not properly configured.
Args:
settings: account settings.
Expand Down Expand Up @@ -238,8 +238,8 @@ async def edit(
This endpoint can update a
single subcollection of settings such as `antivirus`, `tls_decrypt`,
`activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or
`certificate`, without updating the entire configuration object. Returns an
error if any collection of settings is not properly configured.
`custom_certificate`, without updating the entire configuration object. Returns
an error if any collection of settings is not properly configured.
Args:
settings: account settings.
Expand Down
20 changes: 3 additions & 17 deletions src/cloudflare/resources/zero_trust/gateway/lists/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
AsyncPaginator,
make_request_options,
)
from .....types.zero_trust.gateway import list_edit_params, list_list_params, list_create_params, list_update_params
from .....types.zero_trust.gateway import list_edit_params, list_create_params, list_update_params
from .....types.zero_trust.gateway.gateway_list import GatewayList
from .....types.zero_trust.gateway.gateway_item_param import GatewayItemParam
from .....types.zero_trust.gateway.list_create_response import ListCreateResponse
Expand Down Expand Up @@ -173,7 +173,6 @@ def list(
self,
*,
account_id: str,
type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"] | 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 @@ -185,8 +184,6 @@ def list(
Fetches all Zero Trust lists for an account.
Args:
type: The type of list.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -201,11 +198,7 @@ def list(
f"/accounts/{account_id}/gateway/lists",
page=SyncSinglePage[GatewayList],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"type": type}, list_list_params.ListListParams),
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=GatewayList,
)
Expand Down Expand Up @@ -485,7 +478,6 @@ def list(
self,
*,
account_id: str,
type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"] | 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 @@ -497,8 +489,6 @@ def list(
Fetches all Zero Trust lists for an account.
Args:
type: The type of list.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -513,11 +503,7 @@ def list(
f"/accounts/{account_id}/gateway/lists",
page=AsyncSinglePage[GatewayList],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"type": type}, list_list_params.ListListParams),
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=GatewayList,
)
Expand Down
1 change: 0 additions & 1 deletion src/cloudflare/types/zero_trust/gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from .logging_setting import LoggingSetting as LoggingSetting
from .gateway_settings import GatewaySettings as GatewaySettings
from .list_edit_params import ListEditParams as ListEditParams
from .list_list_params import ListListParams as ListListParams
from .location_network import LocationNetwork as LocationNetwork
from .gateway_item_param import GatewayItemParam as GatewayItemParam
from .list_create_params import ListCreateParams as ListCreateParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
from .browser_isolation_settings import BrowserIsolationSettings
from .custom_certificate_settings import CustomCertificateSettings

__all__ = ["GatewayConfigurationSettings", "Certificate"]


class Certificate(BaseModel):
id: str
"""UUID of certificate to be used for interception."""
__all__ = ["GatewayConfigurationSettings"]


class GatewayConfigurationSettings(BaseModel):
Expand All @@ -38,17 +33,8 @@ class GatewayConfigurationSettings(BaseModel):
browser_isolation: Optional[BrowserIsolationSettings] = None
"""Browser isolation settings."""

certificate: Optional[Certificate] = None
"""Certificate settings for Gateway TLS interception.
If not specified, the Cloudflare Root CA will be used.
"""

custom_certificate: Optional[CustomCertificateSettings] = None
"""Custom certificate settings for BYO-PKI.
(deprecated and replaced by `certificate`)
"""
"""Custom certificate settings for BYO-PKI."""

extended_email_matching: Optional[ExtendedEmailMatching] = None
"""Extended e-mail matching settings."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing_extensions import Required, TypedDict
from typing_extensions import TypedDict

from .tls_settings_param import TLSSettingsParam
from .fips_settings_param import FipsSettingsParam
Expand All @@ -15,12 +15,7 @@
from .browser_isolation_settings_param import BrowserIsolationSettingsParam
from .custom_certificate_settings_param import CustomCertificateSettingsParam

__all__ = ["GatewayConfigurationSettingsParam", "Certificate"]


class Certificate(TypedDict, total=False):
id: Required[str]
"""UUID of certificate to be used for interception."""
__all__ = ["GatewayConfigurationSettingsParam"]


class GatewayConfigurationSettingsParam(TypedDict, total=False):
Expand All @@ -39,17 +34,8 @@ class GatewayConfigurationSettingsParam(TypedDict, total=False):
browser_isolation: BrowserIsolationSettingsParam
"""Browser isolation settings."""

certificate: Certificate
"""Certificate settings for Gateway TLS interception.
If not specified, the Cloudflare Root CA will be used.
"""

custom_certificate: CustomCertificateSettingsParam
"""Custom certificate settings for BYO-PKI.
(deprecated and replaced by `certificate`)
"""
"""Custom certificate settings for BYO-PKI."""

extended_email_matching: ExtendedEmailMatchingParam
"""Extended e-mail matching settings."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@

from __future__ import annotations

from typing import Union
from datetime import datetime
from typing_extensions import Annotated, TypedDict

from ...._utils import PropertyInfo
from typing_extensions import TypedDict

__all__ = ["GatewayItemParam"]


class GatewayItemParam(TypedDict, total=False):
created_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]

value: str
"""The value of the item in a list."""
14 changes: 0 additions & 14 deletions src/cloudflare/types/zero_trust/gateway/list_list_params.py

This file was deleted.

17 changes: 5 additions & 12 deletions src/cloudflare/types/zero_trust/gateway/rule_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ class AuditSSH(BaseModel):

class BisoAdminControls(BaseModel):
dcp: Optional[bool] = None
"""Set to false to enable copy-pasting."""
"""Set to true to enable copy-pasting."""

dd: Optional[bool] = None
"""Set to false to enable downloading."""
"""Set to true to enable downloading."""

dk: Optional[bool] = None
"""Set to false to enable keyboard usage."""
"""Set to true to enable keyboard usage."""

dp: Optional[bool] = None
"""Set to false to enable printing."""
"""Set to true to enable printing."""

du: Optional[bool] = None
"""Set to false to enable uploading."""
"""Set to true to enable uploading."""


class CheckSession(BaseModel):
Expand Down Expand Up @@ -153,13 +153,6 @@ class RuleSetting(BaseModel):
it to indicate local egress via WARP IPs.
"""

ignore_cname_category_matches: Optional[bool] = None
"""Set to true, to ignore the category matches at CNAME domains in a response.
If unchecked, the categories in this rule will be checked against all the CNAME
domain categories in a response.
"""

insecure_disable_dnssec_validation: Optional[bool] = None
"""INSECURE - disable DNSSEC validation (for Allow actions)."""

Expand Down
17 changes: 5 additions & 12 deletions src/cloudflare/types/zero_trust/gateway/rule_setting_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ class AuditSSH(TypedDict, total=False):

class BisoAdminControls(TypedDict, total=False):
dcp: bool
"""Set to false to enable copy-pasting."""
"""Set to true to enable copy-pasting."""

dd: bool
"""Set to false to enable downloading."""
"""Set to true to enable downloading."""

dk: bool
"""Set to false to enable keyboard usage."""
"""Set to true to enable keyboard usage."""

dp: bool
"""Set to false to enable printing."""
"""Set to true to enable printing."""

du: bool
"""Set to false to enable uploading."""
"""Set to true to enable uploading."""


class CheckSession(TypedDict, total=False):
Expand Down Expand Up @@ -154,13 +154,6 @@ class RuleSettingParam(TypedDict, total=False):
it to indicate local egress via WARP IPs.
"""

ignore_cname_category_matches: bool
"""Set to true, to ignore the category matches at CNAME domains in a response.
If unchecked, the categories in this rule will be checked against all the CNAME
domain categories in a response.
"""

insecure_disable_dnssec_validation: bool
"""INSECURE - disable DNSSEC validation (for Allow actions)."""

Expand Down
4 changes: 0 additions & 4 deletions tests/api_resources/zero_trust/gateway/test_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
"non_identity_enabled": True,
"url_browser_isolation_enabled": True,
},
"certificate": {"id": "d1b364c5-1311-466e-a194-f0e943e0799f"},
"custom_certificate": {
"enabled": True,
"id": "d1b364c5-1311-466e-a194-f0e943e0799f",
Expand Down Expand Up @@ -143,7 +142,6 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
"non_identity_enabled": True,
"url_browser_isolation_enabled": True,
},
"certificate": {"id": "d1b364c5-1311-466e-a194-f0e943e0799f"},
"custom_certificate": {
"enabled": True,
"id": "d1b364c5-1311-466e-a194-f0e943e0799f",
Expand Down Expand Up @@ -268,7 +266,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
"non_identity_enabled": True,
"url_browser_isolation_enabled": True,
},
"certificate": {"id": "d1b364c5-1311-466e-a194-f0e943e0799f"},
"custom_certificate": {
"enabled": True,
"id": "d1b364c5-1311-466e-a194-f0e943e0799f",
Expand Down Expand Up @@ -351,7 +348,6 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
"non_identity_enabled": True,
"url_browser_isolation_enabled": True,
},
"certificate": {"id": "d1b364c5-1311-466e-a194-f0e943e0799f"},
"custom_certificate": {
"enabled": True,
"id": "d1b364c5-1311-466e-a194-f0e943e0799f",
Expand Down
Loading

0 comments on commit 8e20edf

Please sign in to comment.