Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent 892540a commit a8d801a
Show file tree
Hide file tree
Showing 36 changed files with 422 additions and 429 deletions.
58 changes: 29 additions & 29 deletions api.md

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/cloudflare/resources/workers/account_settings.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

import httpx

Expand Down Expand Up @@ -48,7 +48,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AccountSettingUpdateResponse:
) -> Optional[AccountSettingUpdateResponse]:
"""
Creates Worker account settings for an account.
Expand All @@ -75,7 +75,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AccountSettingUpdateResponse], ResultWrapper[AccountSettingUpdateResponse]),
cast_to=cast(Type[Optional[AccountSettingUpdateResponse]], ResultWrapper[AccountSettingUpdateResponse]),
)

def get(
Expand All @@ -88,7 +88,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AccountSettingGetResponse:
) -> Optional[AccountSettingGetResponse]:
"""
Fetches Worker account settings for an account.
Expand All @@ -114,7 +114,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AccountSettingGetResponse], ResultWrapper[AccountSettingGetResponse]),
cast_to=cast(Type[Optional[AccountSettingGetResponse]], ResultWrapper[AccountSettingGetResponse]),
)


Expand All @@ -138,7 +138,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AccountSettingUpdateResponse:
) -> Optional[AccountSettingUpdateResponse]:
"""
Creates Worker account settings for an account.
Expand All @@ -165,7 +165,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AccountSettingUpdateResponse], ResultWrapper[AccountSettingUpdateResponse]),
cast_to=cast(Type[Optional[AccountSettingUpdateResponse]], ResultWrapper[AccountSettingUpdateResponse]),
)

async def get(
Expand All @@ -178,7 +178,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AccountSettingGetResponse:
) -> Optional[AccountSettingGetResponse]:
"""
Fetches Worker account settings for an account.
Expand All @@ -204,7 +204,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AccountSettingGetResponse], ResultWrapper[AccountSettingGetResponse]),
cast_to=cast(Type[Optional[AccountSettingGetResponse]], ResultWrapper[AccountSettingGetResponse]),
)


Expand Down
18 changes: 9 additions & 9 deletions src/cloudflare/resources/workers/domains.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

import httpx

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,
) -> Domain:
) -> Optional[Domain]:
"""
Attaches a Worker to a zone and hostname.
Expand Down Expand Up @@ -94,7 +94,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Domain], ResultWrapper[Domain]),
cast_to=cast(Type[Optional[Domain]], ResultWrapper[Domain]),
)

def list(
Expand Down Expand Up @@ -211,7 +211,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Domain:
) -> Optional[Domain]:
"""
Gets a Worker domain.
Expand Down Expand Up @@ -239,7 +239,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Domain], ResultWrapper[Domain]),
cast_to=cast(Type[Optional[Domain]], ResultWrapper[Domain]),
)


Expand All @@ -266,7 +266,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Domain:
) -> Optional[Domain]:
"""
Attaches a Worker to a zone and hostname.
Expand Down Expand Up @@ -307,7 +307,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Domain], ResultWrapper[Domain]),
cast_to=cast(Type[Optional[Domain]], ResultWrapper[Domain]),
)

def list(
Expand Down Expand Up @@ -424,7 +424,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Domain:
) -> Optional[Domain]:
"""
Gets a Worker domain.
Expand Down Expand Up @@ -452,7 +452,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Domain], ResultWrapper[Domain]),
cast_to=cast(Type[Optional[Domain]], ResultWrapper[Domain]),
)


Expand Down
10 changes: 5 additions & 5 deletions src/cloudflare/resources/workers/scripts/content.py
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, Mapping, cast
from typing import List, Type, Mapping, Optional, cast

import httpx

Expand Down Expand Up @@ -62,7 +62,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Script:
) -> Optional[Script]:
"""
Put script content without touching config or metadata
Expand Down Expand Up @@ -115,7 +115,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Script], ResultWrapper[Script]),
cast_to=cast(Type[Optional[Script]], ResultWrapper[Script]),
)

def get(
Expand Down Expand Up @@ -182,7 +182,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Script:
) -> Optional[Script]:
"""
Put script content without touching config or metadata
Expand Down Expand Up @@ -235,7 +235,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Script], ResultWrapper[Script]),
cast_to=cast(Type[Optional[Script]], ResultWrapper[Script]),
)

async def get(
Expand Down
18 changes: 9 additions & 9 deletions src/cloudflare/resources/workers/scripts/deployments.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

import httpx

Expand Down Expand Up @@ -55,7 +55,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DeploymentCreateResponse:
) -> Optional[DeploymentCreateResponse]:
"""
Deployments configure how
[Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions)
Expand Down Expand Up @@ -95,7 +95,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[DeploymentCreateResponse], ResultWrapper[DeploymentCreateResponse]),
cast_to=cast(Type[Optional[DeploymentCreateResponse]], ResultWrapper[DeploymentCreateResponse]),
)

def get(
Expand All @@ -109,7 +109,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DeploymentGetResponse:
) -> Optional[DeploymentGetResponse]:
"""List of Worker Deployments.
The first deployment in the list is the latest
Expand Down Expand Up @@ -141,7 +141,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[DeploymentGetResponse], ResultWrapper[DeploymentGetResponse]),
cast_to=cast(Type[Optional[DeploymentGetResponse]], ResultWrapper[DeploymentGetResponse]),
)


Expand All @@ -167,7 +167,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DeploymentCreateResponse:
) -> Optional[DeploymentCreateResponse]:
"""
Deployments configure how
[Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions)
Expand Down Expand Up @@ -207,7 +207,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[DeploymentCreateResponse], ResultWrapper[DeploymentCreateResponse]),
cast_to=cast(Type[Optional[DeploymentCreateResponse]], ResultWrapper[DeploymentCreateResponse]),
)

async def get(
Expand All @@ -221,7 +221,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DeploymentGetResponse:
) -> Optional[DeploymentGetResponse]:
"""List of Worker Deployments.
The first deployment in the list is the latest
Expand Down Expand Up @@ -253,7 +253,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[DeploymentGetResponse], ResultWrapper[DeploymentGetResponse]),
cast_to=cast(Type[Optional[DeploymentGetResponse]], ResultWrapper[DeploymentGetResponse]),
)


Expand Down
18 changes: 9 additions & 9 deletions src/cloudflare/resources/workers/scripts/schedules.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

import httpx

Expand Down Expand Up @@ -49,7 +49,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ScheduleUpdateResponse:
) -> Optional[ScheduleUpdateResponse]:
"""
Updates Cron Triggers for a Worker.
Expand Down Expand Up @@ -80,7 +80,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ScheduleUpdateResponse], ResultWrapper[ScheduleUpdateResponse]),
cast_to=cast(Type[Optional[ScheduleUpdateResponse]], ResultWrapper[ScheduleUpdateResponse]),
)

def get(
Expand All @@ -94,7 +94,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ScheduleGetResponse:
) -> Optional[ScheduleGetResponse]:
"""
Fetches Cron Triggers for a Worker.
Expand Down Expand Up @@ -124,7 +124,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ScheduleGetResponse], ResultWrapper[ScheduleGetResponse]),
cast_to=cast(Type[Optional[ScheduleGetResponse]], ResultWrapper[ScheduleGetResponse]),
)


Expand All @@ -149,7 +149,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ScheduleUpdateResponse:
) -> Optional[ScheduleUpdateResponse]:
"""
Updates Cron Triggers for a Worker.
Expand Down Expand Up @@ -180,7 +180,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ScheduleUpdateResponse], ResultWrapper[ScheduleUpdateResponse]),
cast_to=cast(Type[Optional[ScheduleUpdateResponse]], ResultWrapper[ScheduleUpdateResponse]),
)

async def get(
Expand All @@ -194,7 +194,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ScheduleGetResponse:
) -> Optional[ScheduleGetResponse]:
"""
Fetches Cron Triggers for a Worker.
Expand Down Expand Up @@ -224,7 +224,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ScheduleGetResponse], ResultWrapper[ScheduleGetResponse]),
cast_to=cast(Type[Optional[ScheduleGetResponse]], ResultWrapper[ScheduleGetResponse]),
)


Expand Down
Loading

0 comments on commit a8d801a

Please sign in to comment.