Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Jun 10, 2024
1 parent aa86093 commit b827360
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 8 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: 1343
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bdfe21693106fc05b48376c8081959ea29b7484eb76fb778b3a87cfdd4849dd2.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f33a7e8050bdba5caa80d678c9b3de6fe87b6af4bf29184f3f1b07b2793c817b.yml
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,13 @@ class SaaSApplicationSaaSAppAccessOIDCSaaSAppRefreshTokenOptions(TypedDict, tota


class SaaSApplicationSaaSAppAccessOIDCSaaSApp(TypedDict, total=False):
access_token_lifetime: str
"""The lifetime of the OIDC Access Token after creation.
Valid units are m,h. Must be greater than or equal to 1m and less than or equal
to 24h.
"""

allow_pkce_without_client_secret: bool
"""
If client secret should be required on the token endpoint when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,13 @@ class SaaSApplicationSaaSAppAccessOIDCSaaSAppRefreshTokenOptions(BaseModel):


class SaaSApplicationSaaSAppAccessOIDCSaaSApp(BaseModel):
access_token_lifetime: Optional[str] = None
"""The lifetime of the OIDC Access Token after creation.
Valid units are m,h. Must be greater than or equal to 1m and less than or equal
to 24h.
"""

allow_pkce_without_client_secret: Optional[bool] = None
"""
If client secret should be required on the token endpoint when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,13 @@ class SaaSApplicationSaaSAppAccessOIDCSaaSAppRefreshTokenOptions(BaseModel):


class SaaSApplicationSaaSAppAccessOIDCSaaSApp(BaseModel):
access_token_lifetime: Optional[str] = None
"""The lifetime of the OIDC Access Token after creation.
Valid units are m,h. Must be greater than or equal to 1m and less than or equal
to 24h.
"""

allow_pkce_without_client_secret: Optional[bool] = None
"""
If client secret should be required on the token endpoint when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,13 @@ class SaaSApplicationSaaSAppAccessOIDCSaaSAppRefreshTokenOptions(BaseModel):


class SaaSApplicationSaaSAppAccessOIDCSaaSApp(BaseModel):
access_token_lifetime: Optional[str] = None
"""The lifetime of the OIDC Access Token after creation.
Valid units are m,h. Must be greater than or equal to 1m and less than or equal
to 24h.
"""

allow_pkce_without_client_secret: Optional[bool] = None
"""
If client secret should be required on the token endpoint when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,13 @@ class SaaSApplicationSaaSAppAccessOIDCSaaSAppRefreshTokenOptions(TypedDict, tota


class SaaSApplicationSaaSAppAccessOIDCSaaSApp(TypedDict, total=False):
access_token_lifetime: str
"""The lifetime of the OIDC Access Token after creation.
Valid units are m,h. Must be greater than or equal to 1m and less than or equal
to 24h.
"""

allow_pkce_without_client_secret: bool
"""
If client secret should be required on the token endpoint when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,13 @@ class SaaSApplicationSaaSAppAccessOIDCSaaSAppRefreshTokenOptions(BaseModel):


class SaaSApplicationSaaSAppAccessOIDCSaaSApp(BaseModel):
access_token_lifetime: Optional[str] = None
"""The lifetime of the OIDC Access Token after creation.
Valid units are m,h. Must be greater than or equal to 1m and less than or equal
to 24h.
"""

allow_pkce_without_client_secret: Optional[bool] = None
"""
If client secret should be required on the token endpoint when
Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/types/zero_trust/seat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ class Seat(BaseModel):
"""True if the seat is part of Gateway."""

seat_uid: Optional[str] = None
"""Identifier"""
"""The unique API identifier for the Zero Trust seat."""

updated_at: Optional[datetime] = None
3 changes: 3 additions & 0 deletions src/cloudflare/types/zero_trust/seat_edit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ class Body(TypedDict, total=False):

gateway_seat: Required[bool]
"""True if the seat is part of Gateway."""

seat_uid: Required[str]
"""The unique API identifier for the Zero Trust seat."""
36 changes: 30 additions & 6 deletions tests/api_resources/zero_trust/test_seats.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,22 @@ class TestSeats:
@parametrize
def test_method_edit(self, client: Cloudflare) -> None:
seat = client.zero_trust.seats.edit(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="699d98642c564d2e855e9661899b7252",
body=[
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
],
)
Expand All @@ -43,19 +46,22 @@ def test_method_edit(self, client: Cloudflare) -> None:
@parametrize
def test_raw_response_edit(self, client: Cloudflare) -> None:
response = client.zero_trust.seats.with_raw_response.edit(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="699d98642c564d2e855e9661899b7252",
body=[
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
],
)
Expand All @@ -69,19 +75,22 @@ def test_raw_response_edit(self, client: Cloudflare) -> None:
@parametrize
def test_streaming_response_edit(self, client: Cloudflare) -> None:
with client.zero_trust.seats.with_streaming_response.edit(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="699d98642c564d2e855e9661899b7252",
body=[
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
],
) as response:
Expand All @@ -103,14 +112,17 @@ def test_path_params_edit(self, client: Cloudflare) -> None:
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
],
)
Expand All @@ -123,19 +135,22 @@ class TestAsyncSeats:
@parametrize
async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
seat = await async_client.zero_trust.seats.edit(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="699d98642c564d2e855e9661899b7252",
body=[
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
],
)
Expand All @@ -145,19 +160,22 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zero_trust.seats.with_raw_response.edit(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="699d98642c564d2e855e9661899b7252",
body=[
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
],
)
Expand All @@ -171,19 +189,22 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
@parametrize
async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None:
async with async_client.zero_trust.seats.with_streaming_response.edit(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="699d98642c564d2e855e9661899b7252",
body=[
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
],
) as response:
Expand All @@ -205,14 +226,17 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None:
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
{
"access_seat": False,
"gateway_seat": False,
"seat_uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
},
],
)

0 comments on commit b827360

Please sign in to comment.