Skip to content

Commit

Permalink
feat: OpenAPI spec update via Stainless API (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 12, 2024
1 parent a0b3761 commit aa58312
Show file tree
Hide file tree
Showing 28 changed files with 382 additions and 687 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1256
configured_endpoints: 1255
25 changes: 6 additions & 19 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3410,18 +3410,6 @@ Methods:
- <code title="get /accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations">client.addressing.prefixes.delegations.<a href="./src/cloudflare/resources/addressing/prefixes/delegations.py">list</a>(prefix_id, \*, account_id) -> <a href="./src/cloudflare/types/addressing/prefixes/delegation_list_response.py">Optional</a></code>
- <code title="delete /accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations/{delegation_id}">client.addressing.prefixes.delegations.<a href="./src/cloudflare/resources/addressing/prefixes/delegations.py">delete</a>(delegation_id, \*, account_id, prefix_id) -> <a href="./src/cloudflare/types/addressing/prefixes/delegation_delete_response.py">DelegationDeleteResponse</a></code>

# AuditLogs

Types:

```python
from cloudflare.types import AuditLogListResponse
```

Methods:

- <code title="get /accounts/{account_identifier}/audit_logs">client.audit_logs.<a href="./src/cloudflare/resources/audit_logs.py">list</a>(account_identifier, \*\*<a href="src/cloudflare/types/audit_log_list_params.py">params</a>) -> <a href="./src/cloudflare/types/audit_log_list_response.py">SyncV4PagePaginationArray[AuditLogListResponse]</a></code>

# Billing

## Profiles
Expand Down Expand Up @@ -4370,7 +4358,6 @@ Types:

```python
from cloudflare.types.alerting.v3.destinations import (
AaaPagerduty,
PagerdutyCreateResponse,
PagerdutyDeleteResponse,
PagerdutyGetResponse,
Expand All @@ -4391,11 +4378,11 @@ Types:

```python
from cloudflare.types.alerting.v3.destinations import (
AaaWebhooks,
WebhookCreateResponse,
WebhookUpdateResponse,
WebhookListResponse,
WebhookDeleteResponse,
WebhookGetResponse,
)
```

Expand All @@ -4405,31 +4392,31 @@ Methods:
- <code title="put /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.v3.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/v3/destinations/webhooks.py">update</a>(webhook_id, \*, account_id, \*\*<a href="src/cloudflare/types/alerting/v3/destinations/webhook_update_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/v3/destinations/webhook_update_response.py">WebhookUpdateResponse</a></code>
- <code title="get /accounts/{account_id}/alerting/v3/destinations/webhooks">client.alerting.v3.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/v3/destinations/webhooks.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/alerting/v3/destinations/webhook_list_response.py">Optional</a></code>
- <code title="delete /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.v3.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/v3/destinations/webhooks.py">delete</a>(webhook_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/v3/destinations/webhook_delete_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.v3.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/v3/destinations/webhooks.py">get</a>(webhook_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/v3/destinations/aaa_webhooks.py">AaaWebhooks</a></code>
- <code title="get /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.v3.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/v3/destinations/webhooks.py">get</a>(webhook_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/v3/destinations/webhook_get_response.py">WebhookGetResponse</a></code>

### Histories

Types:

```python
from cloudflare.types.alerting.v3 import AaaHistory
from cloudflare.types.alerting.v3 import HistoryListResponse
```

Methods:

- <code title="get /accounts/{account_id}/alerting/v3/history">client.alerting.v3.histories.<a href="./src/cloudflare/resources/alerting/v3/histories.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/alerting/v3/history_list_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/v3/aaa_history.py">SyncV4PagePaginationArray[AaaHistory]</a></code>
- <code title="get /accounts/{account_id}/alerting/v3/history">client.alerting.v3.histories.<a href="./src/cloudflare/resources/alerting/v3/histories.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/alerting/v3/history_list_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/v3/history_list_response.py">SyncV4PagePaginationArray[HistoryListResponse]</a></code>

### Policies

Types:

```python
from cloudflare.types.alerting.v3 import (
AaaPolicies,
PolicyCreateResponse,
PolicyUpdateResponse,
PolicyListResponse,
PolicyDeleteResponse,
PolicyGetResponse,
)
```

Expand All @@ -4439,7 +4426,7 @@ Methods:
- <code title="put /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.v3.policies.<a href="./src/cloudflare/resources/alerting/v3/policies.py">update</a>(policy_id, \*, account_id, \*\*<a href="src/cloudflare/types/alerting/v3/policy_update_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/v3/policy_update_response.py">PolicyUpdateResponse</a></code>
- <code title="get /accounts/{account_id}/alerting/v3/policies">client.alerting.v3.policies.<a href="./src/cloudflare/resources/alerting/v3/policies.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/alerting/v3/policy_list_response.py">Optional</a></code>
- <code title="delete /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.v3.policies.<a href="./src/cloudflare/resources/alerting/v3/policies.py">delete</a>(policy_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/v3/policy_delete_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.v3.policies.<a href="./src/cloudflare/resources/alerting/v3/policies.py">get</a>(policy_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/v3/aaa_policies.py">AaaPolicies</a></code>
- <code title="get /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.v3.policies.<a href="./src/cloudflare/resources/alerting/v3/policies.py">get</a>(policy_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/v3/policy_get_response.py">PolicyGetResponse</a></code>

# D1

Expand Down
8 changes: 0 additions & 8 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class Cloudflare(SyncAPIClient):
url_normalization: resources.URLNormalization
spectrum: resources.Spectrum
addressing: resources.Addressing
audit_logs: resources.AuditLogs
billing: resources.Billing
brand_protection: resources.BrandProtection
diagnostics: resources.Diagnostics
Expand Down Expand Up @@ -244,7 +243,6 @@ def __init__(
self.url_normalization = resources.URLNormalization(self)
self.spectrum = resources.Spectrum(self)
self.addressing = resources.Addressing(self)
self.audit_logs = resources.AuditLogs(self)
self.billing = resources.Billing(self)
self.brand_protection = resources.BrandProtection(self)
self.diagnostics = resources.Diagnostics(self)
Expand Down Expand Up @@ -502,7 +500,6 @@ class AsyncCloudflare(AsyncAPIClient):
url_normalization: resources.AsyncURLNormalization
spectrum: resources.AsyncSpectrum
addressing: resources.AsyncAddressing
audit_logs: resources.AsyncAuditLogs
billing: resources.AsyncBilling
brand_protection: resources.AsyncBrandProtection
diagnostics: resources.AsyncDiagnostics
Expand Down Expand Up @@ -655,7 +652,6 @@ def __init__(
self.url_normalization = resources.AsyncURLNormalization(self)
self.spectrum = resources.AsyncSpectrum(self)
self.addressing = resources.AsyncAddressing(self)
self.audit_logs = resources.AsyncAuditLogs(self)
self.billing = resources.AsyncBilling(self)
self.brand_protection = resources.AsyncBrandProtection(self)
self.diagnostics = resources.AsyncDiagnostics(self)
Expand Down Expand Up @@ -914,7 +910,6 @@ def __init__(self, client: Cloudflare) -> None:
self.url_normalization = resources.URLNormalizationWithRawResponse(client.url_normalization)
self.spectrum = resources.SpectrumWithRawResponse(client.spectrum)
self.addressing = resources.AddressingWithRawResponse(client.addressing)
self.audit_logs = resources.AuditLogsWithRawResponse(client.audit_logs)
self.billing = resources.BillingWithRawResponse(client.billing)
self.brand_protection = resources.BrandProtectionWithRawResponse(client.brand_protection)
self.diagnostics = resources.DiagnosticsWithRawResponse(client.diagnostics)
Expand Down Expand Up @@ -1002,7 +997,6 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.url_normalization = resources.AsyncURLNormalizationWithRawResponse(client.url_normalization)
self.spectrum = resources.AsyncSpectrumWithRawResponse(client.spectrum)
self.addressing = resources.AsyncAddressingWithRawResponse(client.addressing)
self.audit_logs = resources.AsyncAuditLogsWithRawResponse(client.audit_logs)
self.billing = resources.AsyncBillingWithRawResponse(client.billing)
self.brand_protection = resources.AsyncBrandProtectionWithRawResponse(client.brand_protection)
self.diagnostics = resources.AsyncDiagnosticsWithRawResponse(client.diagnostics)
Expand Down Expand Up @@ -1092,7 +1086,6 @@ def __init__(self, client: Cloudflare) -> None:
self.url_normalization = resources.URLNormalizationWithStreamingResponse(client.url_normalization)
self.spectrum = resources.SpectrumWithStreamingResponse(client.spectrum)
self.addressing = resources.AddressingWithStreamingResponse(client.addressing)
self.audit_logs = resources.AuditLogsWithStreamingResponse(client.audit_logs)
self.billing = resources.BillingWithStreamingResponse(client.billing)
self.brand_protection = resources.BrandProtectionWithStreamingResponse(client.brand_protection)
self.diagnostics = resources.DiagnosticsWithStreamingResponse(client.diagnostics)
Expand Down Expand Up @@ -1184,7 +1177,6 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.url_normalization = resources.AsyncURLNormalizationWithStreamingResponse(client.url_normalization)
self.spectrum = resources.AsyncSpectrumWithStreamingResponse(client.spectrum)
self.addressing = resources.AsyncAddressingWithStreamingResponse(client.addressing)
self.audit_logs = resources.AsyncAuditLogsWithStreamingResponse(client.audit_logs)
self.billing = resources.AsyncBillingWithStreamingResponse(client.billing)
self.brand_protection = resources.AsyncBrandProtectionWithStreamingResponse(client.brand_protection)
self.diagnostics = resources.AsyncDiagnosticsWithStreamingResponse(client.diagnostics)
Expand Down
14 changes: 0 additions & 14 deletions src/cloudflare/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,6 @@
AddressingWithStreamingResponse,
AsyncAddressingWithStreamingResponse,
)
from .audit_logs import (
AuditLogs,
AsyncAuditLogs,
AuditLogsWithRawResponse,
AsyncAuditLogsWithRawResponse,
AuditLogsWithStreamingResponse,
AsyncAuditLogsWithStreamingResponse,
)
from .challenges import (
Challenges,
AsyncChallenges,
Expand Down Expand Up @@ -906,12 +898,6 @@
"AsyncAddressingWithRawResponse",
"AddressingWithStreamingResponse",
"AsyncAddressingWithStreamingResponse",
"AuditLogs",
"AsyncAuditLogs",
"AuditLogsWithRawResponse",
"AsyncAuditLogsWithRawResponse",
"AuditLogsWithStreamingResponse",
"AsyncAuditLogsWithStreamingResponse",
"Billing",
"AsyncBilling",
"BillingWithRawResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def link(
Args:
account_id: The account id
token_id: The token id
token_id: The token integration key
extra_headers: Send extra headers
Expand Down Expand Up @@ -354,7 +354,7 @@ async def link(
Args:
account_id: The account id
token_id: The token id
token_id: The token integration key
extra_headers: Send extra headers
Expand Down
10 changes: 5 additions & 5 deletions src/cloudflare/resources/alerting/v3/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.v3.destinations import (
AaaWebhooks,
WebhookGetResponse,
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:
) -> WebhookGetResponse:
"""
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[WebhookGetResponse], ResultWrapper[WebhookGetResponse]),
)


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:
) -> WebhookGetResponse:
"""
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[WebhookGetResponse], ResultWrapper[WebhookGetResponse]),
)


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

__all__ = ["Histories", "AsyncHistories"]

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[HistoryListResponse]:
"""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[HistoryListResponse],
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=HistoryListResponse,
)


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[HistoryListResponse, AsyncV4PagePaginationArray[HistoryListResponse]]:
"""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[HistoryListResponse],
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=HistoryListResponse,
)


Expand Down
14 changes: 9 additions & 5 deletions src/cloudflare/resources/alerting/v3/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
make_request_options,
)
from ....types.alerting.v3 import (
AaaPolicies,
PolicyGetResponse,
PolicyListResponse,
PolicyCreateResponse,
PolicyDeleteResponse,
Expand Down Expand Up @@ -100,6 +100,7 @@ def create(
"secondary_dns_zone_validation_warning",
"sentinel_alert",
"stream_live_notifications",
"traffic_anomalies_alert",
"tunnel_health_event",
"tunnel_update_event",
"universal_ssl_event_type",
Expand Down Expand Up @@ -229,6 +230,7 @@ def update(
"secondary_dns_zone_validation_warning",
"sentinel_alert",
"stream_live_notifications",
"traffic_anomalies_alert",
"tunnel_health_event",
"tunnel_update_event",
"universal_ssl_event_type",
Expand Down Expand Up @@ -407,7 +409,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AaaPolicies:
) -> PolicyGetResponse:
"""
Get details for a single policy.
Expand Down Expand Up @@ -437,7 +439,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AaaPolicies], ResultWrapper[AaaPolicies]),
cast_to=cast(Type[PolicyGetResponse], ResultWrapper[PolicyGetResponse]),
)


Expand Down Expand Up @@ -504,6 +506,7 @@ async def create(
"secondary_dns_zone_validation_warning",
"sentinel_alert",
"stream_live_notifications",
"traffic_anomalies_alert",
"tunnel_health_event",
"tunnel_update_event",
"universal_ssl_event_type",
Expand Down Expand Up @@ -633,6 +636,7 @@ async def update(
"secondary_dns_zone_validation_warning",
"sentinel_alert",
"stream_live_notifications",
"traffic_anomalies_alert",
"tunnel_health_event",
"tunnel_update_event",
"universal_ssl_event_type",
Expand Down Expand Up @@ -811,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:
) -> PolicyGetResponse:
"""
Get details for a single policy.
Expand Down Expand Up @@ -841,7 +845,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AaaPolicies], ResultWrapper[AaaPolicies]),
cast_to=cast(Type[PolicyGetResponse], ResultWrapper[PolicyGetResponse]),
)


Expand Down
Loading

0 comments on commit aa58312

Please sign in to comment.