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 #230

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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 136 additions & 79 deletions api.md

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions src/cloudflare/resources/keyless_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import httpx

from ..types import (
TunnelParam,
KeylessCertificateHostname,
UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1,
keyless_certificate_edit_params,
Expand Down Expand Up @@ -55,7 +56,7 @@ def create(
port: float,
bundle_method: UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1 | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
tunnel: keyless_certificate_create_params.Tunnel | NotGiven = NOT_GIVEN,
tunnel: TunnelParam | 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 Down Expand Up @@ -214,7 +215,7 @@ def edit(
host: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
port: float | NotGiven = NOT_GIVEN,
tunnel: keyless_certificate_edit_params.Tunnel | NotGiven = NOT_GIVEN,
tunnel: TunnelParam | 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 Down Expand Up @@ -344,7 +345,7 @@ async def create(
port: float,
bundle_method: UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1 | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
tunnel: keyless_certificate_create_params.Tunnel | NotGiven = NOT_GIVEN,
tunnel: TunnelParam | 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 Down Expand Up @@ -503,7 +504,7 @@ async def edit(
host: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
port: float | NotGiven = NOT_GIVEN,
tunnel: keyless_certificate_edit_params.Tunnel | NotGiven = NOT_GIVEN,
tunnel: TunnelParam | 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 Down
54 changes: 27 additions & 27 deletions src/cloudflare/resources/magic_network_monitoring/rules/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
make_request_options,
)
from ....types.magic_network_monitoring import (
MagicNetworkMonitoringRule,
Rule,
rule_edit_params,
rule_create_params,
rule_delete_params,
Expand Down Expand Up @@ -68,7 +68,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MagicNetworkMonitoringRule]:
) -> Optional[Rule]:
"""Create network monitoring rules for account.

Currently only supports creating a
Expand All @@ -95,7 +95,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]),
cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]),
)

def update(
Expand All @@ -109,7 +109,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MagicNetworkMonitoringRule]:
) -> Optional[Rule]:
"""
Update network monitoring rules for account.

Expand All @@ -134,7 +134,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]),
cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]),
)

def list(
Expand All @@ -147,7 +147,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[Optional[MagicNetworkMonitoringRule]]:
) -> SyncSinglePage[Optional[Rule]]:
"""
Lists network monitoring rules for account.

Expand All @@ -164,11 +164,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/mnm/rules",
page=SyncSinglePage[Optional[MagicNetworkMonitoringRule]],
page=SyncSinglePage[Optional[Rule]],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=MagicNetworkMonitoringRule,
model=Rule,
)

def delete(
Expand All @@ -183,7 +183,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MagicNetworkMonitoringRule]:
) -> Optional[Rule]:
"""
Delete a network monitoring rule for account.

Expand All @@ -210,7 +210,7 @@ def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]),
cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]),
)

def edit(
Expand All @@ -225,7 +225,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MagicNetworkMonitoringRule]:
) -> Optional[Rule]:
"""
Update a network monitoring rule for account.

Expand All @@ -252,7 +252,7 @@ def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]),
cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]),
)

def get(
Expand All @@ -266,7 +266,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MagicNetworkMonitoringRule]:
) -> Optional[Rule]:
"""
List a single network monitoring rule for account.

Expand All @@ -292,7 +292,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]),
cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]),
)


Expand Down Expand Up @@ -320,7 +320,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MagicNetworkMonitoringRule]:
) -> Optional[Rule]:
"""Create network monitoring rules for account.

Currently only supports creating a
Expand All @@ -347,7 +347,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]),
cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]),
)

async def update(
Expand All @@ -361,7 +361,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MagicNetworkMonitoringRule]:
) -> Optional[Rule]:
"""
Update network monitoring rules for account.

Expand All @@ -386,7 +386,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]),
cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]),
)

def list(
Expand All @@ -399,7 +399,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[Optional[MagicNetworkMonitoringRule], AsyncSinglePage[Optional[MagicNetworkMonitoringRule]]]:
) -> AsyncPaginator[Optional[Rule], AsyncSinglePage[Optional[Rule]]]:
"""
Lists network monitoring rules for account.

Expand All @@ -416,11 +416,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/mnm/rules",
page=AsyncSinglePage[Optional[MagicNetworkMonitoringRule]],
page=AsyncSinglePage[Optional[Rule]],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=MagicNetworkMonitoringRule,
model=Rule,
)

async def delete(
Expand All @@ -435,7 +435,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MagicNetworkMonitoringRule]:
) -> Optional[Rule]:
"""
Delete a network monitoring rule for account.

Expand All @@ -462,7 +462,7 @@ async def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]),
cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]),
)

async def edit(
Expand All @@ -477,7 +477,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MagicNetworkMonitoringRule]:
) -> Optional[Rule]:
"""
Update a network monitoring rule for account.

Expand All @@ -504,7 +504,7 @@ async def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]),
cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]),
)

async def get(
Expand All @@ -518,7 +518,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[MagicNetworkMonitoringRule]:
) -> Optional[Rule]:
"""
List a single network monitoring rule for account.

Expand All @@ -544,7 +544,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]),
cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]),
)


Expand Down
5 changes: 3 additions & 2 deletions src/cloudflare/resources/magic_transit/gre_tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import httpx

from ...types import HealthCheckParam
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
maybe_transform,
Expand Down Expand Up @@ -99,7 +100,7 @@ def update(
interface_address: str,
name: str,
description: str | NotGiven = NOT_GIVEN,
health_check: gre_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN,
health_check: HealthCheckParam | NotGiven = NOT_GIVEN,
mtu: int | NotGiven = NOT_GIVEN,
ttl: int | 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 @@ -368,7 +369,7 @@ async def update(
interface_address: str,
name: str,
description: str | NotGiven = NOT_GIVEN,
health_check: gre_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN,
health_check: HealthCheckParam | NotGiven = NOT_GIVEN,
mtu: int | NotGiven = NOT_GIVEN,
ttl: int | 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
9 changes: 5 additions & 4 deletions src/cloudflare/resources/magic_transit/ipsec_tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import httpx

from ...types import HealthCheckParam
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
maybe_transform,
Expand Down Expand Up @@ -57,7 +58,7 @@ def create(
name: str,
customer_endpoint: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
health_check: ipsec_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN,
health_check: HealthCheckParam | NotGiven = NOT_GIVEN,
psk: str | NotGiven = NOT_GIVEN,
replay_protection: bool | 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 @@ -139,7 +140,7 @@ def update(
name: str,
customer_endpoint: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
health_check: ipsec_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN,
health_check: HealthCheckParam | NotGiven = NOT_GIVEN,
psk: str | NotGiven = NOT_GIVEN,
replay_protection: bool | 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 @@ -415,7 +416,7 @@ async def create(
name: str,
customer_endpoint: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
health_check: ipsec_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN,
health_check: HealthCheckParam | NotGiven = NOT_GIVEN,
psk: str | NotGiven = NOT_GIVEN,
replay_protection: bool | 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 @@ -497,7 +498,7 @@ async def update(
name: str,
customer_endpoint: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
health_check: ipsec_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN,
health_check: HealthCheckParam | NotGiven = NOT_GIVEN,
psk: str | NotGiven = NOT_GIVEN,
replay_protection: bool | 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
5 changes: 3 additions & 2 deletions src/cloudflare/resources/magic_transit/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
make_request_options,
)
from ...types.magic_transit import (
ScopeParam,
RouteGetResponse,
RouteListResponse,
RouteEmptyResponse,
Expand Down Expand Up @@ -100,7 +101,7 @@ def update(
prefix: str,
priority: int,
description: str | NotGiven = NOT_GIVEN,
scope: route_update_params.Scope | NotGiven = NOT_GIVEN,
scope: ScopeParam | NotGiven = NOT_GIVEN,
weight: int | 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.
Expand Down Expand Up @@ -398,7 +399,7 @@ async def update(
prefix: str,
priority: int,
description: str | NotGiven = NOT_GIVEN,
scope: route_update_params.Scope | NotGiven = NOT_GIVEN,
scope: ScopeParam | NotGiven = NOT_GIVEN,
weight: int | 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.
Expand Down
Loading