Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#325)
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 e3a9d7f commit 892540a
Show file tree
Hide file tree
Showing 34 changed files with 1,161 additions and 1,039 deletions.
98 changes: 49 additions & 49 deletions api.md

Large diffs are not rendered by default.

154 changes: 105 additions & 49 deletions src/cloudflare/resources/zero_trust/access/applications/applications.py

Large diffs are not rendered by default.

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

from __future__ import annotations

from typing import Any, Type, cast
from typing import Any, Type, Optional, cast

import httpx

Expand Down Expand Up @@ -47,7 +47,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CACreateResponse:
) -> Optional[CACreateResponse]:
"""
Generates a new short-lived certificate CA and public key.
Expand Down Expand Up @@ -81,7 +81,7 @@ def create(
account_or_zone = "zones"
account_or_zone_id = zone_id
return cast(
CACreateResponse,
Optional[CACreateResponse],
self._post(
f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/ca",
options=make_request_options(
Expand Down Expand Up @@ -158,7 +158,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CADeleteResponse:
) -> Optional[CADeleteResponse]:
"""
Deletes a short-lived certificate CA.
Expand Down Expand Up @@ -200,7 +200,7 @@ def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[CADeleteResponse], ResultWrapper[CADeleteResponse]),
cast_to=cast(Type[Optional[CADeleteResponse]], ResultWrapper[CADeleteResponse]),
)

def get(
Expand All @@ -215,7 +215,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CAGetResponse:
) -> Optional[CAGetResponse]:
"""
Fetches a short-lived certificate CA and its public key.
Expand Down Expand Up @@ -249,7 +249,7 @@ def get(
account_or_zone = "zones"
account_or_zone_id = zone_id
return cast(
CAGetResponse,
Optional[CAGetResponse],
self._get(
f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/ca",
options=make_request_options(
Expand Down Expand Up @@ -287,7 +287,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CACreateResponse:
) -> Optional[CACreateResponse]:
"""
Generates a new short-lived certificate CA and public key.
Expand Down Expand Up @@ -321,7 +321,7 @@ async def create(
account_or_zone = "zones"
account_or_zone_id = zone_id
return cast(
CACreateResponse,
Optional[CACreateResponse],
await self._post(
f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/ca",
options=make_request_options(
Expand Down Expand Up @@ -398,7 +398,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CADeleteResponse:
) -> Optional[CADeleteResponse]:
"""
Deletes a short-lived certificate CA.
Expand Down Expand Up @@ -440,7 +440,7 @@ async def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[CADeleteResponse], ResultWrapper[CADeleteResponse]),
cast_to=cast(Type[Optional[CADeleteResponse]], ResultWrapper[CADeleteResponse]),
)

async def get(
Expand All @@ -455,7 +455,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CAGetResponse:
) -> Optional[CAGetResponse]:
"""
Fetches a short-lived certificate CA and its public key.
Expand Down Expand Up @@ -489,7 +489,7 @@ async def get(
account_or_zone = "zones"
account_or_zone_id = zone_id
return cast(
CAGetResponse,
Optional[CAGetResponse],
await self._get(
f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/ca",
options=make_request_options(
Expand Down
34 changes: 17 additions & 17 deletions src/cloudflare/resources/zero_trust/access/applications/policies.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, Iterable, cast
from typing import Type, Iterable, Optional, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -71,7 +71,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Policy:
) -> Optional[Policy]:
"""
Create a new Access policy for an application.
Expand Down Expand Up @@ -162,7 +162,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Policy], ResultWrapper[Policy]),
cast_to=cast(Type[Optional[Policy]], ResultWrapper[Policy]),
)

def update(
Expand Down Expand Up @@ -190,7 +190,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Policy:
) -> Optional[Policy]:
"""
Update a configured Access policy.
Expand Down Expand Up @@ -285,7 +285,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Policy], ResultWrapper[Policy]),
cast_to=cast(Type[Optional[Policy]], ResultWrapper[Policy]),
)

def list(
Expand Down Expand Up @@ -355,7 +355,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PolicyDeleteResponse:
) -> Optional[PolicyDeleteResponse]:
"""
Delete an Access policy.
Expand Down Expand Up @@ -401,7 +401,7 @@ def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[PolicyDeleteResponse], ResultWrapper[PolicyDeleteResponse]),
cast_to=cast(Type[Optional[PolicyDeleteResponse]], ResultWrapper[PolicyDeleteResponse]),
)

def get(
Expand All @@ -417,7 +417,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Policy:
) -> Optional[Policy]:
"""
Fetches a single Access policy.
Expand Down Expand Up @@ -463,7 +463,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Policy], ResultWrapper[Policy]),
cast_to=cast(Type[Optional[Policy]], ResultWrapper[Policy]),
)


Expand Down Expand Up @@ -500,7 +500,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Policy:
) -> Optional[Policy]:
"""
Create a new Access policy for an application.
Expand Down Expand Up @@ -591,7 +591,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Policy], ResultWrapper[Policy]),
cast_to=cast(Type[Optional[Policy]], ResultWrapper[Policy]),
)

async def update(
Expand Down Expand Up @@ -619,7 +619,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Policy:
) -> Optional[Policy]:
"""
Update a configured Access policy.
Expand Down Expand Up @@ -714,7 +714,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Policy], ResultWrapper[Policy]),
cast_to=cast(Type[Optional[Policy]], ResultWrapper[Policy]),
)

def list(
Expand Down Expand Up @@ -784,7 +784,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PolicyDeleteResponse:
) -> Optional[PolicyDeleteResponse]:
"""
Delete an Access policy.
Expand Down Expand Up @@ -830,7 +830,7 @@ async def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[PolicyDeleteResponse], ResultWrapper[PolicyDeleteResponse]),
cast_to=cast(Type[Optional[PolicyDeleteResponse]], ResultWrapper[PolicyDeleteResponse]),
)

async def get(
Expand All @@ -846,7 +846,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Policy:
) -> Optional[Policy]:
"""
Fetches a single Access policy.
Expand Down Expand Up @@ -892,7 +892,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Policy], ResultWrapper[Policy]),
cast_to=cast(Type[Optional[Policy]], ResultWrapper[Policy]),
)


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 Type, cast
from typing import Type, Optional, cast

import httpx

Expand Down Expand Up @@ -46,7 +46,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> UserPolicyCheckListResponse:
) -> Optional[UserPolicyCheckListResponse]:
"""
Tests if a specific user has permission to access an application.
Expand Down Expand Up @@ -86,7 +86,7 @@ def list(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[UserPolicyCheckListResponse], ResultWrapper[UserPolicyCheckListResponse]),
cast_to=cast(Type[Optional[UserPolicyCheckListResponse]], ResultWrapper[UserPolicyCheckListResponse]),
)


Expand All @@ -111,7 +111,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> UserPolicyCheckListResponse:
) -> Optional[UserPolicyCheckListResponse]:
"""
Tests if a specific user has permission to access an application.
Expand Down Expand Up @@ -151,7 +151,7 @@ async def list(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[UserPolicyCheckListResponse], ResultWrapper[UserPolicyCheckListResponse]),
cast_to=cast(Type[Optional[UserPolicyCheckListResponse]], ResultWrapper[UserPolicyCheckListResponse]),
)


Expand Down
Loading

0 comments on commit 892540a

Please sign in to comment.