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

Merged
merged 1 commit into from
Mar 28, 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
  •  
  •  
  •  
886 changes: 434 additions & 452 deletions api.md

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Cloudflare(SyncAPIClient):
custom_hostnames: resources.CustomHostnames
custom_nameservers: resources.CustomNameservers
dns: resources.DNS
dnssec: resources.DNSSEC
dnssec: resources.DNSSECResource
email_routing: resources.EmailRouting
filters: resources.Filters
firewall: resources.Firewall
Expand Down Expand Up @@ -220,7 +220,7 @@ def __init__(
self.custom_hostnames = resources.CustomHostnames(self)
self.custom_nameservers = resources.CustomNameservers(self)
self.dns = resources.DNS(self)
self.dnssec = resources.DNSSEC(self)
self.dnssec = resources.DNSSECResource(self)
self.email_routing = resources.EmailRouting(self)
self.filters = resources.Filters(self)
self.firewall = resources.Firewall(self)
Expand Down Expand Up @@ -478,7 +478,7 @@ class AsyncCloudflare(AsyncAPIClient):
custom_hostnames: resources.AsyncCustomHostnames
custom_nameservers: resources.AsyncCustomNameservers
dns: resources.AsyncDNS
dnssec: resources.AsyncDNSSEC
dnssec: resources.AsyncDNSSECResource
email_routing: resources.AsyncEmailRouting
filters: resources.AsyncFilters
firewall: resources.AsyncFirewall
Expand Down Expand Up @@ -631,7 +631,7 @@ def __init__(
self.custom_hostnames = resources.AsyncCustomHostnames(self)
self.custom_nameservers = resources.AsyncCustomNameservers(self)
self.dns = resources.AsyncDNS(self)
self.dnssec = resources.AsyncDNSSEC(self)
self.dnssec = resources.AsyncDNSSECResource(self)
self.email_routing = resources.AsyncEmailRouting(self)
self.filters = resources.AsyncFilters(self)
self.firewall = resources.AsyncFirewall(self)
Expand Down Expand Up @@ -890,7 +890,7 @@ def __init__(self, client: Cloudflare) -> None:
self.custom_hostnames = resources.CustomHostnamesWithRawResponse(client.custom_hostnames)
self.custom_nameservers = resources.CustomNameserversWithRawResponse(client.custom_nameservers)
self.dns = resources.DNSWithRawResponse(client.dns)
self.dnssec = resources.DNSSECWithRawResponse(client.dnssec)
self.dnssec = resources.DNSSECResourceWithRawResponse(client.dnssec)
self.email_routing = resources.EmailRoutingWithRawResponse(client.email_routing)
self.filters = resources.FiltersWithRawResponse(client.filters)
self.firewall = resources.FirewallWithRawResponse(client.firewall)
Expand Down Expand Up @@ -978,7 +978,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.custom_hostnames = resources.AsyncCustomHostnamesWithRawResponse(client.custom_hostnames)
self.custom_nameservers = resources.AsyncCustomNameserversWithRawResponse(client.custom_nameservers)
self.dns = resources.AsyncDNSWithRawResponse(client.dns)
self.dnssec = resources.AsyncDNSSECWithRawResponse(client.dnssec)
self.dnssec = resources.AsyncDNSSECResourceWithRawResponse(client.dnssec)
self.email_routing = resources.AsyncEmailRoutingWithRawResponse(client.email_routing)
self.filters = resources.AsyncFiltersWithRawResponse(client.filters)
self.firewall = resources.AsyncFirewallWithRawResponse(client.firewall)
Expand Down Expand Up @@ -1068,7 +1068,7 @@ def __init__(self, client: Cloudflare) -> None:
self.custom_hostnames = resources.CustomHostnamesWithStreamingResponse(client.custom_hostnames)
self.custom_nameservers = resources.CustomNameserversWithStreamingResponse(client.custom_nameservers)
self.dns = resources.DNSWithStreamingResponse(client.dns)
self.dnssec = resources.DNSSECWithStreamingResponse(client.dnssec)
self.dnssec = resources.DNSSECResourceWithStreamingResponse(client.dnssec)
self.email_routing = resources.EmailRoutingWithStreamingResponse(client.email_routing)
self.filters = resources.FiltersWithStreamingResponse(client.filters)
self.firewall = resources.FirewallWithStreamingResponse(client.firewall)
Expand Down Expand Up @@ -1160,7 +1160,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.custom_hostnames = resources.AsyncCustomHostnamesWithStreamingResponse(client.custom_hostnames)
self.custom_nameservers = resources.AsyncCustomNameserversWithStreamingResponse(client.custom_nameservers)
self.dns = resources.AsyncDNSWithStreamingResponse(client.dns)
self.dnssec = resources.AsyncDNSSECWithStreamingResponse(client.dnssec)
self.dnssec = resources.AsyncDNSSECResourceWithStreamingResponse(client.dnssec)
self.email_routing = resources.AsyncEmailRoutingWithStreamingResponse(client.email_routing)
self.filters = resources.AsyncFiltersWithStreamingResponse(client.filters)
self.firewall = resources.AsyncFirewallWithStreamingResponse(client.firewall)
Expand Down
24 changes: 12 additions & 12 deletions src/cloudflare/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@
AsyncZonesWithStreamingResponse,
)
from .dnssec import (
DNSSEC,
AsyncDNSSEC,
DNSSECWithRawResponse,
AsyncDNSSECWithRawResponse,
DNSSECWithStreamingResponse,
AsyncDNSSECWithStreamingResponse,
DNSSECResource,
AsyncDNSSECResource,
DNSSECResourceWithRawResponse,
AsyncDNSSECResourceWithRawResponse,
DNSSECResourceWithStreamingResponse,
AsyncDNSSECResourceWithStreamingResponse,
)
from .images import (
Images,
Expand Down Expand Up @@ -762,12 +762,12 @@
"AsyncDNSWithRawResponse",
"DNSWithStreamingResponse",
"AsyncDNSWithStreamingResponse",
"DNSSEC",
"AsyncDNSSEC",
"DNSSECWithRawResponse",
"AsyncDNSSECWithRawResponse",
"DNSSECWithStreamingResponse",
"AsyncDNSSECWithStreamingResponse",
"DNSSECResource",
"AsyncDNSSECResource",
"DNSSECResourceWithRawResponse",
"AsyncDNSSECResourceWithRawResponse",
"DNSSECResourceWithStreamingResponse",
"AsyncDNSSECResourceWithStreamingResponse",
"EmailRouting",
"AsyncEmailRouting",
"EmailRoutingWithRawResponse",
Expand Down
10 changes: 5 additions & 5 deletions src/cloudflare/resources/alerting/destinations/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
make_request_options,
)
from ....types.alerting.destinations import (
AaaWebhooks,
AlertingWebhooks,
WebhookListResponse,
WebhookCreateResponse,
WebhookDeleteResponse,
Expand Down Expand Up @@ -267,7 +267,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AaaWebhooks:
) -> AlertingWebhooks:
"""
Get details for a single webhooks destination.
Expand Down Expand Up @@ -297,7 +297,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AaaWebhooks], ResultWrapper[AaaWebhooks]),
cast_to=cast(Type[AlertingWebhooks], ResultWrapper[AlertingWebhooks]),
)


Expand Down Expand Up @@ -532,7 +532,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AaaWebhooks:
) -> AlertingWebhooks:
"""
Get details for a single webhooks destination.
Expand Down Expand Up @@ -562,7 +562,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AaaWebhooks], ResultWrapper[AaaWebhooks]),
cast_to=cast(Type[AlertingWebhooks], ResultWrapper[AlertingWebhooks]),
)


Expand Down
14 changes: 7 additions & 7 deletions src/cloudflare/resources/alerting/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
AsyncPaginator,
make_request_options,
)
from ...types.alerting import AaaHistory, history_list_params
from ...types.alerting import AlertingHistory, history_list_params

__all__ = ["History", "AsyncHistory"]

Expand Down Expand Up @@ -50,7 +50,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncV4PagePaginationArray[AaaHistory]:
) -> SyncV4PagePaginationArray[AlertingHistory]:
"""Gets a list of history records for notifications sent to an account.
The records
Expand Down Expand Up @@ -82,7 +82,7 @@ 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}/alerting/v3/history",
page=SyncV4PagePaginationArray[AaaHistory],
page=SyncV4PagePaginationArray[AlertingHistory],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -98,7 +98,7 @@ def list(
history_list_params.HistoryListParams,
),
),
model=AaaHistory,
model=AlertingHistory,
)


Expand All @@ -125,7 +125,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[AaaHistory, AsyncV4PagePaginationArray[AaaHistory]]:
) -> AsyncPaginator[AlertingHistory, AsyncV4PagePaginationArray[AlertingHistory]]:
"""Gets a list of history records for notifications sent to an account.
The records
Expand Down Expand Up @@ -157,7 +157,7 @@ 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}/alerting/v3/history",
page=AsyncV4PagePaginationArray[AaaHistory],
page=AsyncV4PagePaginationArray[AlertingHistory],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -173,7 +173,7 @@ def list(
history_list_params.HistoryListParams,
),
),
model=AaaHistory,
model=AlertingHistory,
)


Expand Down
10 changes: 5 additions & 5 deletions src/cloudflare/resources/alerting/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
make_request_options,
)
from ...types.alerting import (
AaaPolicies,
AlertingPolicies,
PolicyListResponse,
PolicyCreateResponse,
PolicyDeleteResponse,
Expand Down Expand Up @@ -409,7 +409,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AaaPolicies:
) -> AlertingPolicies:
"""
Get details for a single policy.
Expand Down Expand Up @@ -439,7 +439,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AaaPolicies], ResultWrapper[AaaPolicies]),
cast_to=cast(Type[AlertingPolicies], ResultWrapper[AlertingPolicies]),
)


Expand Down Expand Up @@ -815,7 +815,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AaaPolicies:
) -> AlertingPolicies:
"""
Get details for a single policy.
Expand Down Expand Up @@ -845,7 +845,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AaaPolicies], ResultWrapper[AaaPolicies]),
cast_to=cast(Type[AlertingPolicies], ResultWrapper[AlertingPolicies]),
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
make_request_options,
)
from ...types.certificate_authorities import (
TLSCertificatesAndHostnamesHostnameAssociation,
TLSHostnameAssociation,
hostname_association_get_params,
hostname_association_update_params,
)
Expand Down Expand Up @@ -53,7 +53,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TLSCertificatesAndHostnamesHostnameAssociation:
) -> TLSHostnameAssociation:
"""
Replace Hostname Associations
Expand Down Expand Up @@ -90,10 +90,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Type[TLSCertificatesAndHostnamesHostnameAssociation],
ResultWrapper[TLSCertificatesAndHostnamesHostnameAssociation],
),
cast_to=cast(Type[TLSHostnameAssociation], ResultWrapper[TLSHostnameAssociation]),
)

def get(
Expand All @@ -107,7 +104,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TLSCertificatesAndHostnamesHostnameAssociation:
) -> TLSHostnameAssociation:
"""
List Hostname Associations
Expand Down Expand Up @@ -141,10 +138,7 @@ def get(
),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Type[TLSCertificatesAndHostnamesHostnameAssociation],
ResultWrapper[TLSCertificatesAndHostnamesHostnameAssociation],
),
cast_to=cast(Type[TLSHostnameAssociation], ResultWrapper[TLSHostnameAssociation]),
)


Expand All @@ -169,7 +163,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TLSCertificatesAndHostnamesHostnameAssociation:
) -> TLSHostnameAssociation:
"""
Replace Hostname Associations
Expand Down Expand Up @@ -206,10 +200,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Type[TLSCertificatesAndHostnamesHostnameAssociation],
ResultWrapper[TLSCertificatesAndHostnamesHostnameAssociation],
),
cast_to=cast(Type[TLSHostnameAssociation], ResultWrapper[TLSHostnameAssociation]),
)

async def get(
Expand All @@ -223,7 +214,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TLSCertificatesAndHostnamesHostnameAssociation:
) -> TLSHostnameAssociation:
"""
List Hostname Associations
Expand Down Expand Up @@ -257,10 +248,7 @@ async def get(
),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Type[TLSCertificatesAndHostnamesHostnameAssociation],
ResultWrapper[TLSCertificatesAndHostnamesHostnameAssociation],
),
cast_to=cast(Type[TLSHostnameAssociation], ResultWrapper[TLSHostnameAssociation]),
)


Expand Down
Loading