Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update via SDK Studio #229

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
377 changes: 241 additions & 136 deletions api.md

Large diffs are not rendered by default.

160 changes: 21 additions & 139 deletions src/cloudflare/resources/healthchecks/healthchecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
from __future__ import annotations

from typing import List, Type, Optional, cast
from typing_extensions import Literal

import httpx

from ...types import (
Healthcheck,
CheckRegionItem,
TcpConfigurationParam,
HTTPConfigurationParam,
HealthcheckDeleteResponse,
healthcheck_edit_params,
healthcheck_create_params,
Expand Down Expand Up @@ -65,35 +67,15 @@ def create(
zone_id: str,
address: str,
name: str,
check_regions: Optional[
List[
Literal[
"WNAM",
"ENAM",
"WEU",
"EEU",
"NSAM",
"SSAM",
"OC",
"ME",
"NAF",
"SAF",
"IN",
"SEAS",
"NEAS",
"ALL_REGIONS",
]
]
]
| NotGiven = NOT_GIVEN,
check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN,
consecutive_fails: int | NotGiven = NOT_GIVEN,
consecutive_successes: int | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
http_config: Optional[healthcheck_create_params.HTTPConfig] | NotGiven = NOT_GIVEN,
http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN,
interval: int | NotGiven = NOT_GIVEN,
retries: int | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
tcp_config: Optional[healthcheck_create_params.TcpConfig] | NotGiven = NOT_GIVEN,
tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN,
healthcheck_timeout: int | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -190,35 +172,15 @@ def update(
zone_id: str,
address: str,
name: str,
check_regions: Optional[
List[
Literal[
"WNAM",
"ENAM",
"WEU",
"EEU",
"NSAM",
"SSAM",
"OC",
"ME",
"NAF",
"SAF",
"IN",
"SEAS",
"NEAS",
"ALL_REGIONS",
]
]
]
| NotGiven = NOT_GIVEN,
check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN,
consecutive_fails: int | NotGiven = NOT_GIVEN,
consecutive_successes: int | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
http_config: Optional[healthcheck_update_params.HTTPConfig] | NotGiven = NOT_GIVEN,
http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN,
interval: int | NotGiven = NOT_GIVEN,
retries: int | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
tcp_config: Optional[healthcheck_update_params.TcpConfig] | NotGiven = NOT_GIVEN,
tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN,
healthcheck_timeout: int | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -401,35 +363,15 @@ def edit(
zone_id: str,
address: str,
name: str,
check_regions: Optional[
List[
Literal[
"WNAM",
"ENAM",
"WEU",
"EEU",
"NSAM",
"SSAM",
"OC",
"ME",
"NAF",
"SAF",
"IN",
"SEAS",
"NEAS",
"ALL_REGIONS",
]
]
]
| NotGiven = NOT_GIVEN,
check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN,
consecutive_fails: int | NotGiven = NOT_GIVEN,
consecutive_successes: int | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
http_config: Optional[healthcheck_edit_params.HTTPConfig] | NotGiven = NOT_GIVEN,
http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN,
interval: int | NotGiven = NOT_GIVEN,
retries: int | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
tcp_config: Optional[healthcheck_edit_params.TcpConfig] | NotGiven = NOT_GIVEN,
tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN,
healthcheck_timeout: int | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -587,35 +529,15 @@ async def create(
zone_id: str,
address: str,
name: str,
check_regions: Optional[
List[
Literal[
"WNAM",
"ENAM",
"WEU",
"EEU",
"NSAM",
"SSAM",
"OC",
"ME",
"NAF",
"SAF",
"IN",
"SEAS",
"NEAS",
"ALL_REGIONS",
]
]
]
| NotGiven = NOT_GIVEN,
check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN,
consecutive_fails: int | NotGiven = NOT_GIVEN,
consecutive_successes: int | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
http_config: Optional[healthcheck_create_params.HTTPConfig] | NotGiven = NOT_GIVEN,
http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN,
interval: int | NotGiven = NOT_GIVEN,
retries: int | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
tcp_config: Optional[healthcheck_create_params.TcpConfig] | NotGiven = NOT_GIVEN,
tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN,
healthcheck_timeout: int | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -712,35 +634,15 @@ async def update(
zone_id: str,
address: str,
name: str,
check_regions: Optional[
List[
Literal[
"WNAM",
"ENAM",
"WEU",
"EEU",
"NSAM",
"SSAM",
"OC",
"ME",
"NAF",
"SAF",
"IN",
"SEAS",
"NEAS",
"ALL_REGIONS",
]
]
]
| NotGiven = NOT_GIVEN,
check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN,
consecutive_fails: int | NotGiven = NOT_GIVEN,
consecutive_successes: int | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
http_config: Optional[healthcheck_update_params.HTTPConfig] | NotGiven = NOT_GIVEN,
http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN,
interval: int | NotGiven = NOT_GIVEN,
retries: int | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
tcp_config: Optional[healthcheck_update_params.TcpConfig] | NotGiven = NOT_GIVEN,
tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN,
healthcheck_timeout: int | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -923,35 +825,15 @@ async def edit(
zone_id: str,
address: str,
name: str,
check_regions: Optional[
List[
Literal[
"WNAM",
"ENAM",
"WEU",
"EEU",
"NSAM",
"SSAM",
"OC",
"ME",
"NAF",
"SAF",
"IN",
"SEAS",
"NEAS",
"ALL_REGIONS",
]
]
]
| NotGiven = NOT_GIVEN,
check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN,
consecutive_fails: int | NotGiven = NOT_GIVEN,
consecutive_successes: int | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
http_config: Optional[healthcheck_edit_params.HTTPConfig] | NotGiven = NOT_GIVEN,
http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN,
interval: int | NotGiven = NOT_GIVEN,
retries: int | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
tcp_config: Optional[healthcheck_edit_params.TcpConfig] | NotGiven = NOT_GIVEN,
tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN,
healthcheck_timeout: int | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down
61 changes: 12 additions & 49 deletions src/cloudflare/resources/healthchecks/previews.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
from __future__ import annotations

from typing import List, Type, Optional, cast
from typing_extensions import Literal

import httpx

from ...types import Healthcheck
from ...types import (
Healthcheck,
TcpConfigurationParam,
HTTPConfigurationParam,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
maybe_transform,
Expand All @@ -25,7 +28,7 @@
from ..._base_client import (
make_request_options,
)
from ...types.healthchecks import PreviewDeleteResponse, preview_create_params, preview_delete_params
from ...types.healthchecks import CheckRegionItem, PreviewDeleteResponse, preview_create_params, preview_delete_params

__all__ = ["Previews", "AsyncPreviews"]

Expand All @@ -45,35 +48,15 @@ def create(
zone_id: str,
address: str,
name: str,
check_regions: Optional[
List[
Literal[
"WNAM",
"ENAM",
"WEU",
"EEU",
"NSAM",
"SSAM",
"OC",
"ME",
"NAF",
"SAF",
"IN",
"SEAS",
"NEAS",
"ALL_REGIONS",
]
]
]
| NotGiven = NOT_GIVEN,
check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN,
consecutive_fails: int | NotGiven = NOT_GIVEN,
consecutive_successes: int | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
http_config: Optional[preview_create_params.HTTPConfig] | NotGiven = NOT_GIVEN,
http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN,
interval: int | NotGiven = NOT_GIVEN,
retries: int | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
tcp_config: Optional[preview_create_params.TcpConfig] | NotGiven = NOT_GIVEN,
tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN,
healthcheck_timeout: int | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -269,35 +252,15 @@ async def create(
zone_id: str,
address: str,
name: str,
check_regions: Optional[
List[
Literal[
"WNAM",
"ENAM",
"WEU",
"EEU",
"NSAM",
"SSAM",
"OC",
"ME",
"NAF",
"SAF",
"IN",
"SEAS",
"NEAS",
"ALL_REGIONS",
]
]
]
| NotGiven = NOT_GIVEN,
check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN,
consecutive_fails: int | NotGiven = NOT_GIVEN,
consecutive_successes: int | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
http_config: Optional[preview_create_params.HTTPConfig] | NotGiven = NOT_GIVEN,
http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN,
interval: int | NotGiven = NOT_GIVEN,
retries: int | NotGiven = NOT_GIVEN,
suspended: bool | NotGiven = NOT_GIVEN,
tcp_config: Optional[preview_create_params.TcpConfig] | NotGiven = NOT_GIVEN,
tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN,
healthcheck_timeout: int | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down
Loading