Skip to content

Commit 66380bd

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#964)
1 parent e51ae76 commit 66380bd

File tree

7 files changed

+39
-42
lines changed

7 files changed

+39
-42
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1343
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-af1ecaabf305033e1f88b63fa9ff708149d2e8f79c0050c0e046d010c668038c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f5082157bb70165b34f3a552faa44b9693adacaa9613d4b887b251cd744d076f.yml

api.md

+1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ Types:
233233
```python
234234
from cloudflare.types.user import (
235235
CIDRList,
236+
Policy,
236237
Token,
237238
TokenCreateResponse,
238239
TokenUpdateResponse,

src/cloudflare/resources/user/tokens/tokens.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
PermissionGroupsResourceWithStreamingResponse,
4545
AsyncPermissionGroupsResourceWithStreamingResponse,
4646
)
47+
from ....types.user.policy_param import PolicyParam
4748
from ....types.user.token_create_response import TokenCreateResponse
4849
from ....types.user.token_delete_response import TokenDeleteResponse
4950
from ....types.user.token_verify_response import TokenVerifyResponse
@@ -72,7 +73,7 @@ def create(
7273
self,
7374
*,
7475
name: str,
75-
policies: Iterable[token_create_params.Policy],
76+
policies: Iterable[PolicyParam],
7677
condition: token_create_params.Condition | NotGiven = NOT_GIVEN,
7778
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
7879
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
@@ -131,7 +132,7 @@ def update(
131132
token_id: object,
132133
*,
133134
name: str,
134-
policies: Iterable[token_update_params.Policy],
135+
policies: Iterable[PolicyParam],
135136
status: Literal["active", "disabled", "expired"],
136137
condition: token_update_params.Condition | NotGiven = NOT_GIVEN,
137138
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
@@ -355,7 +356,7 @@ async def create(
355356
self,
356357
*,
357358
name: str,
358-
policies: Iterable[token_create_params.Policy],
359+
policies: Iterable[PolicyParam],
359360
condition: token_create_params.Condition | NotGiven = NOT_GIVEN,
360361
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
361362
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
@@ -414,7 +415,7 @@ async def update(
414415
token_id: object,
415416
*,
416417
name: str,
417-
policies: Iterable[token_update_params.Policy],
418+
policies: Iterable[PolicyParam],
418419
status: Literal["active", "disabled", "expired"],
419420
condition: token_update_params.Condition | NotGiven = NOT_GIVEN,
420421
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,

src/cloudflare/types/user/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .cidr_list import CIDRList as CIDRList
77
from .rate_plan import RatePlan as RatePlan
88
from .organization import Organization as Organization
9+
from .policy_param import PolicyParam as PolicyParam
910
from .subscription import Subscription as Subscription
1011
from .rate_plan_param import RatePlanParam as RatePlanParam
1112
from .user_edit_params import UserEditParams as UserEditParams
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Iterable
6+
from typing_extensions import Literal, Required, TypedDict
7+
8+
__all__ = ["PolicyParam", "PermissionGroup"]
9+
10+
11+
class PermissionGroup(TypedDict, total=False):
12+
meta: object
13+
"""Attributes associated to the permission group."""
14+
15+
16+
class PolicyParam(TypedDict, total=False):
17+
effect: Required[Literal["allow", "deny"]]
18+
"""Allow or deny operations against the resources."""
19+
20+
permission_groups: Required[Iterable[PermissionGroup]]
21+
"""A set of permission groups that are specified to the policy."""
22+
23+
resources: Required[object]
24+
"""A list of resource names that the policy applies to."""

src/cloudflare/types/user/token_create_params.py

+4-19
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44

55
from typing import List, Union, Iterable
66
from datetime import datetime
7-
from typing_extensions import Literal, Required, Annotated, TypedDict
7+
from typing_extensions import Required, Annotated, TypedDict
88

99
from ..._utils import PropertyInfo
1010
from .cidr_list import CIDRList
11+
from .policy_param import PolicyParam
1112

12-
__all__ = ["TokenCreateParams", "Policy", "PolicyPermissionGroup", "Condition", "ConditionRequestIP"]
13+
__all__ = ["TokenCreateParams", "Condition", "ConditionRequestIP"]
1314

1415

1516
class TokenCreateParams(TypedDict, total=False):
1617
name: Required[str]
1718
"""Token name."""
1819

19-
policies: Required[Iterable[Policy]]
20+
policies: Required[Iterable[PolicyParam]]
2021
"""List of access policies assigned to the token."""
2122

2223
condition: Condition
@@ -31,22 +32,6 @@ class TokenCreateParams(TypedDict, total=False):
3132
"""The time before which the token MUST NOT be accepted for processing."""
3233

3334

34-
class PolicyPermissionGroup(TypedDict, total=False):
35-
meta: object
36-
"""Attributes associated to the permission group."""
37-
38-
39-
class Policy(TypedDict, total=False):
40-
effect: Required[Literal["allow", "deny"]]
41-
"""Allow or deny operations against the resources."""
42-
43-
permission_groups: Required[Iterable[PolicyPermissionGroup]]
44-
"""A set of permission groups that are specified to the policy."""
45-
46-
resources: Required[object]
47-
"""A list of resource names that the policy applies to."""
48-
49-
5035
_ConditionRequestIPReservedKeywords = TypedDict(
5136
"_ConditionRequestIPReservedKeywords",
5237
{

src/cloudflare/types/user/token_update_params.py

+3-18
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88

99
from ..._utils import PropertyInfo
1010
from .cidr_list import CIDRList
11+
from .policy_param import PolicyParam
1112

12-
__all__ = ["TokenUpdateParams", "Policy", "PolicyPermissionGroup", "Condition", "ConditionRequestIP"]
13+
__all__ = ["TokenUpdateParams", "Condition", "ConditionRequestIP"]
1314

1415

1516
class TokenUpdateParams(TypedDict, total=False):
1617
name: Required[str]
1718
"""Token name."""
1819

19-
policies: Required[Iterable[Policy]]
20+
policies: Required[Iterable[PolicyParam]]
2021
"""List of access policies assigned to the token."""
2122

2223
status: Required[Literal["active", "disabled", "expired"]]
@@ -34,22 +35,6 @@ class TokenUpdateParams(TypedDict, total=False):
3435
"""The time before which the token MUST NOT be accepted for processing."""
3536

3637

37-
class PolicyPermissionGroup(TypedDict, total=False):
38-
meta: object
39-
"""Attributes associated to the permission group."""
40-
41-
42-
class Policy(TypedDict, total=False):
43-
effect: Required[Literal["allow", "deny"]]
44-
"""Allow or deny operations against the resources."""
45-
46-
permission_groups: Required[Iterable[PolicyPermissionGroup]]
47-
"""A set of permission groups that are specified to the policy."""
48-
49-
resources: Required[object]
50-
"""A list of resource names that the policy applies to."""
51-
52-
5338
_ConditionRequestIPReservedKeywords = TypedDict(
5439
"_ConditionRequestIPReservedKeywords",
5540
{

0 commit comments

Comments
 (0)