Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1162)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 5, 2024
1 parent 5584fca commit b25c6fc
Show file tree
Hide file tree
Showing 17 changed files with 522 additions and 14 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: 1254
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d8d652bdc7a06e88e4432adbe4d697dae937fcd7edab5323d37610363be6d481.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4312bd23a02e20e5d46c142ec08fbe09bb97ce586a900e10d178982734f44ec.yml
35 changes: 34 additions & 1 deletion src/cloudflare/resources/zero_trust/access/custom_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from __future__ import annotations

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

import httpx
Expand Down Expand Up @@ -51,6 +52,9 @@ def create(
name: str,
type: Literal["identity_denied", "forbidden"],
app_count: int | NotGiven = NOT_GIVEN,
created_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
uid: str | NotGiven = NOT_GIVEN,
updated_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -72,6 +76,8 @@ def create(
app_count: Number of apps the custom page is assigned to.
uid: UUID
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -90,6 +96,9 @@ def create(
"name": name,
"type": type,
"app_count": app_count,
"created_at": created_at,
"uid": uid,
"updated_at": updated_at,
},
custom_page_create_params.CustomPageCreateParams,
),
Expand All @@ -112,6 +121,9 @@ def update(
name: str,
type: Literal["identity_denied", "forbidden"],
app_count: int | NotGiven = NOT_GIVEN,
created_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
uid: str | NotGiven = NOT_GIVEN,
updated_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -135,6 +147,8 @@ def update(
app_count: Number of apps the custom page is assigned to.
uid: UUID
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -155,6 +169,9 @@ def update(
"name": name,
"type": type,
"app_count": app_count,
"created_at": created_at,
"uid": uid,
"updated_at": updated_at,
},
custom_page_update_params.CustomPageUpdateParams,
),
Expand Down Expand Up @@ -310,6 +327,9 @@ async def create(
name: str,
type: Literal["identity_denied", "forbidden"],
app_count: int | NotGiven = NOT_GIVEN,
created_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
uid: str | NotGiven = NOT_GIVEN,
updated_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -331,6 +351,8 @@ async def create(
app_count: Number of apps the custom page is assigned to.
uid: UUID
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -349,6 +371,9 @@ async def create(
"name": name,
"type": type,
"app_count": app_count,
"created_at": created_at,
"uid": uid,
"updated_at": updated_at,
},
custom_page_create_params.CustomPageCreateParams,
),
Expand All @@ -371,6 +396,9 @@ async def update(
name: str,
type: Literal["identity_denied", "forbidden"],
app_count: int | NotGiven = NOT_GIVEN,
created_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
uid: str | NotGiven = NOT_GIVEN,
updated_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -394,6 +422,8 @@ async def update(
app_count: Number of apps the custom page is assigned to.
uid: UUID
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
Expand All @@ -414,6 +444,9 @@ async def update(
"name": name,
"type": type,
"app_count": app_count,
"created_at": created_at,
"uid": uid,
"updated_at": updated_at,
},
custom_page_update_params.CustomPageUpdateParams,
),
Expand Down
47 changes: 42 additions & 5 deletions src/cloudflare/resources/zero_trust/access/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from __future__ import annotations

from typing import Type, Optional, cast
from typing import Type, Union, Optional, cast
from datetime import datetime

import httpx

Expand Down Expand Up @@ -46,6 +47,8 @@ def create(
*,
account_id: str,
name: str,
created_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
updated_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -73,7 +76,14 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
f"/accounts/{account_id}/access/tags",
body=maybe_transform({"name": name}, tag_create_params.TagCreateParams),
body=maybe_transform(
{
"name": name,
"created_at": created_at,
"updated_at": updated_at,
},
tag_create_params.TagCreateParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -90,6 +100,8 @@ def update(
*,
account_id: str,
name: str,
created_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
updated_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -121,7 +133,14 @@ def update(
raise ValueError(f"Expected a non-empty value for `tag_name` but received {tag_name!r}")
return self._put(
f"/accounts/{account_id}/access/tags/{tag_name}",
body=maybe_transform({"name": name}, tag_update_params.TagUpdateParams),
body=maybe_transform(
{
"name": name,
"created_at": created_at,
"updated_at": updated_at,
},
tag_update_params.TagUpdateParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -271,6 +290,8 @@ async def create(
*,
account_id: str,
name: str,
created_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
updated_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -298,7 +319,14 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
f"/accounts/{account_id}/access/tags",
body=await async_maybe_transform({"name": name}, tag_create_params.TagCreateParams),
body=await async_maybe_transform(
{
"name": name,
"created_at": created_at,
"updated_at": updated_at,
},
tag_create_params.TagCreateParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -315,6 +343,8 @@ async def update(
*,
account_id: str,
name: str,
created_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
updated_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -346,7 +376,14 @@ async def update(
raise ValueError(f"Expected a non-empty value for `tag_name` but received {tag_name!r}")
return await self._put(
f"/accounts/{account_id}/access/tags/{tag_name}",
body=await async_maybe_transform({"name": name}, tag_update_params.TagUpdateParams),
body=await async_maybe_transform(
{
"name": name,
"created_at": created_at,
"updated_at": updated_at,
},
tag_update_params.TagUpdateParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down
Loading

0 comments on commit b25c6fc

Please sign in to comment.