Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored May 2, 2024
1 parent 941f238 commit 12df65d
Show file tree
Hide file tree
Showing 45 changed files with 727 additions and 711 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: 1267
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-efb5805d496f252c658aad63c93537ff3b2ff4c164999f326a7061d0b22866a4.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0afa9378dad17dedd91687a59735a917fefb1adadc097a7902ccaae3ebdda360.yml
98 changes: 49 additions & 49 deletions api.md

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions src/cloudflare/resources/acm/total_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

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

import httpx
Expand Down Expand Up @@ -52,7 +52,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TotalTLSCreateResponse:
) -> Optional[TotalTLSCreateResponse]:
"""
Set Total TLS Settings or disable the feature for a Zone.
Expand Down Expand Up @@ -88,9 +88,9 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[TotalTLSCreateResponse]._unwrapper,
post_parser=ResultWrapper[Optional[TotalTLSCreateResponse]]._unwrapper,
),
cast_to=cast(Type[TotalTLSCreateResponse], ResultWrapper[TotalTLSCreateResponse]),
cast_to=cast(Type[Optional[TotalTLSCreateResponse]], ResultWrapper[TotalTLSCreateResponse]),
)

def get(
Expand All @@ -103,7 +103,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TotalTLSGetResponse:
) -> Optional[TotalTLSGetResponse]:
"""
Get Total TLS Settings for a Zone.
Expand All @@ -127,9 +127,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[TotalTLSGetResponse]._unwrapper,
post_parser=ResultWrapper[Optional[TotalTLSGetResponse]]._unwrapper,
),
cast_to=cast(Type[TotalTLSGetResponse], ResultWrapper[TotalTLSGetResponse]),
cast_to=cast(Type[Optional[TotalTLSGetResponse]], ResultWrapper[TotalTLSGetResponse]),
)


Expand All @@ -154,7 +154,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TotalTLSCreateResponse:
) -> Optional[TotalTLSCreateResponse]:
"""
Set Total TLS Settings or disable the feature for a Zone.
Expand Down Expand Up @@ -190,9 +190,9 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[TotalTLSCreateResponse]._unwrapper,
post_parser=ResultWrapper[Optional[TotalTLSCreateResponse]]._unwrapper,
),
cast_to=cast(Type[TotalTLSCreateResponse], ResultWrapper[TotalTLSCreateResponse]),
cast_to=cast(Type[Optional[TotalTLSCreateResponse]], ResultWrapper[TotalTLSCreateResponse]),
)

async def get(
Expand All @@ -205,7 +205,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TotalTLSGetResponse:
) -> Optional[TotalTLSGetResponse]:
"""
Get Total TLS Settings for a Zone.
Expand All @@ -229,9 +229,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[TotalTLSGetResponse]._unwrapper,
post_parser=ResultWrapper[Optional[TotalTLSGetResponse]]._unwrapper,
),
cast_to=cast(Type[TotalTLSGetResponse], ResultWrapper[TotalTLSGetResponse]),
cast_to=cast(Type[Optional[TotalTLSGetResponse]], ResultWrapper[TotalTLSGetResponse]),
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

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

import httpx

Expand Down Expand Up @@ -52,7 +52,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> HostnameAssociationUpdateResponse:
) -> Optional[HostnameAssociationUpdateResponse]:
"""
Replace Hostname Associations
Expand Down Expand Up @@ -87,9 +87,11 @@ def update(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[HostnameAssociationUpdateResponse]._unwrapper,
post_parser=ResultWrapper[Optional[HostnameAssociationUpdateResponse]]._unwrapper,
),
cast_to=cast(
Type[Optional[HostnameAssociationUpdateResponse]], ResultWrapper[HostnameAssociationUpdateResponse]
),
cast_to=cast(Type[HostnameAssociationUpdateResponse], ResultWrapper[HostnameAssociationUpdateResponse]),
)

def get(
Expand All @@ -103,7 +105,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> HostnameAssociationGetResponse:
) -> Optional[HostnameAssociationGetResponse]:
"""
List Hostname Associations
Expand Down Expand Up @@ -135,9 +137,9 @@ def get(
{"mtls_certificate_id": mtls_certificate_id},
hostname_association_get_params.HostnameAssociationGetParams,
),
post_parser=ResultWrapper[HostnameAssociationGetResponse]._unwrapper,
post_parser=ResultWrapper[Optional[HostnameAssociationGetResponse]]._unwrapper,
),
cast_to=cast(Type[HostnameAssociationGetResponse], ResultWrapper[HostnameAssociationGetResponse]),
cast_to=cast(Type[Optional[HostnameAssociationGetResponse]], ResultWrapper[HostnameAssociationGetResponse]),
)


Expand All @@ -162,7 +164,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> HostnameAssociationUpdateResponse:
) -> Optional[HostnameAssociationUpdateResponse]:
"""
Replace Hostname Associations
Expand Down Expand Up @@ -197,9 +199,11 @@ async def update(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[HostnameAssociationUpdateResponse]._unwrapper,
post_parser=ResultWrapper[Optional[HostnameAssociationUpdateResponse]]._unwrapper,
),
cast_to=cast(
Type[Optional[HostnameAssociationUpdateResponse]], ResultWrapper[HostnameAssociationUpdateResponse]
),
cast_to=cast(Type[HostnameAssociationUpdateResponse], ResultWrapper[HostnameAssociationUpdateResponse]),
)

async def get(
Expand All @@ -213,7 +217,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> HostnameAssociationGetResponse:
) -> Optional[HostnameAssociationGetResponse]:
"""
List Hostname Associations
Expand Down Expand Up @@ -245,9 +249,9 @@ async def get(
{"mtls_certificate_id": mtls_certificate_id},
hostname_association_get_params.HostnameAssociationGetParams,
),
post_parser=ResultWrapper[HostnameAssociationGetResponse]._unwrapper,
post_parser=ResultWrapper[Optional[HostnameAssociationGetResponse]]._unwrapper,
),
cast_to=cast(Type[HostnameAssociationGetResponse], ResultWrapper[HostnameAssociationGetResponse]),
cast_to=cast(Type[Optional[HostnameAssociationGetResponse]], ResultWrapper[HostnameAssociationGetResponse]),
)


Expand Down
50 changes: 25 additions & 25 deletions src/cloudflare/resources/client_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

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

import httpx
Expand Down Expand Up @@ -53,7 +53,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ClientCertificate:
) -> Optional[ClientCertificate]:
"""
Create a new API Shield mTLS Client Certificate
Expand Down Expand Up @@ -88,9 +88,9 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ClientCertificate]._unwrapper,
post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper,
),
cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]),
cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]),
)

def list(
Expand Down Expand Up @@ -170,7 +170,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ClientCertificate:
) -> Optional[ClientCertificate]:
"""
Set a API Shield mTLS Client Certificate to pending_revocation status for
processing to revoked status.
Expand Down Expand Up @@ -201,9 +201,9 @@ def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ClientCertificate]._unwrapper,
post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper,
),
cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]),
cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]),
)

def edit(
Expand All @@ -217,7 +217,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ClientCertificate:
) -> Optional[ClientCertificate]:
"""
If a API Shield mTLS Client Certificate is in a pending_revocation state, you
may reactivate it with this endpoint.
Expand Down Expand Up @@ -248,9 +248,9 @@ def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ClientCertificate]._unwrapper,
post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper,
),
cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]),
cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]),
)

def get(
Expand All @@ -264,7 +264,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ClientCertificate:
) -> Optional[ClientCertificate]:
"""
Get Details for a single mTLS API Shield Client Certificate
Expand Down Expand Up @@ -294,9 +294,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ClientCertificate]._unwrapper,
post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper,
),
cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]),
cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]),
)


Expand All @@ -321,7 +321,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ClientCertificate:
) -> Optional[ClientCertificate]:
"""
Create a new API Shield mTLS Client Certificate
Expand Down Expand Up @@ -356,9 +356,9 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ClientCertificate]._unwrapper,
post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper,
),
cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]),
cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]),
)

def list(
Expand Down Expand Up @@ -438,7 +438,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ClientCertificate:
) -> Optional[ClientCertificate]:
"""
Set a API Shield mTLS Client Certificate to pending_revocation status for
processing to revoked status.
Expand Down Expand Up @@ -469,9 +469,9 @@ async def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ClientCertificate]._unwrapper,
post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper,
),
cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]),
cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]),
)

async def edit(
Expand All @@ -485,7 +485,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ClientCertificate:
) -> Optional[ClientCertificate]:
"""
If a API Shield mTLS Client Certificate is in a pending_revocation state, you
may reactivate it with this endpoint.
Expand Down Expand Up @@ -516,9 +516,9 @@ async def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ClientCertificate]._unwrapper,
post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper,
),
cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]),
cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]),
)

async def get(
Expand All @@ -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,
) -> ClientCertificate:
) -> Optional[ClientCertificate]:
"""
Get Details for a single mTLS API Shield Client Certificate
Expand Down Expand Up @@ -562,9 +562,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ClientCertificate]._unwrapper,
post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper,
),
cast_to=cast(Type[ClientCertificate], ResultWrapper[ClientCertificate]),
cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]),
)


Expand Down
Loading

0 comments on commit 12df65d

Please sign in to comment.