Skip to content

Commit 23499df

Browse files
feat(api): api update
1 parent 0d32330 commit 23499df

9 files changed

Lines changed: 72 additions & 210 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1752
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fec12b67a9b920095500a586ad5fdc3d5085e89cb26da79d719b43fc263f4705.yml
3-
openapi_spec_hash: 7f4c139ae43541e7c636a9282c003996
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3067c2bb6c9724d234be04ae30fd7d84fb04b2ad9fc9808a7e8a60837b300e7e.yml
3+
openapi_spec_hash: 122a9851a2d05c751f47ff5ec875fbb4
44
config_hash: 3638b66b63ea825ab6a770e729104836

src/cloudflare/resources/accounts/tokens/tokens.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ def update(
145145
account_id: str,
146146
name: str,
147147
policies: Iterable[TokenPolicy],
148-
status: Literal["active", "disabled", "expired"],
149148
condition: token_update_params.Condition | NotGiven = NOT_GIVEN,
150149
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
151150
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
151+
status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN,
152152
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
153153
# The extra values given here take precedence over values defined on the client or passed to this method.
154154
extra_headers: Headers | None = None,
@@ -168,13 +168,13 @@ def update(
168168
169169
policies: List of access policies assigned to the token.
170170
171-
status: Status of the token.
172-
173171
expires_on: The expiration time on or after which the JWT MUST NOT be accepted for
174172
processing.
175173
176174
not_before: The time before which the token MUST NOT be accepted for processing.
177175
176+
status: Status of the token.
177+
178178
extra_headers: Send extra headers
179179
180180
extra_query: Add additional query parameters to the request
@@ -193,10 +193,10 @@ def update(
193193
{
194194
"name": name,
195195
"policies": policies,
196-
"status": status,
197196
"condition": condition,
198197
"expires_on": expires_on,
199198
"not_before": not_before,
199+
"status": status,
200200
},
201201
token_update_params.TokenUpdateParams,
202202
),
@@ -492,10 +492,10 @@ async def update(
492492
account_id: str,
493493
name: str,
494494
policies: Iterable[TokenPolicy],
495-
status: Literal["active", "disabled", "expired"],
496495
condition: token_update_params.Condition | NotGiven = NOT_GIVEN,
497496
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
498497
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
498+
status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN,
499499
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
500500
# The extra values given here take precedence over values defined on the client or passed to this method.
501501
extra_headers: Headers | None = None,
@@ -515,13 +515,13 @@ async def update(
515515
516516
policies: List of access policies assigned to the token.
517517
518-
status: Status of the token.
519-
520518
expires_on: The expiration time on or after which the JWT MUST NOT be accepted for
521519
processing.
522520
523521
not_before: The time before which the token MUST NOT be accepted for processing.
524522
523+
status: Status of the token.
524+
525525
extra_headers: Send extra headers
526526
527527
extra_query: Add additional query parameters to the request
@@ -540,10 +540,10 @@ async def update(
540540
{
541541
"name": name,
542542
"policies": policies,
543-
"status": status,
544543
"condition": condition,
545544
"expires_on": expires_on,
546545
"not_before": not_before,
546+
"status": status,
547547
},
548548
token_update_params.TokenUpdateParams,
549549
),

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ def update(
139139
*,
140140
name: str,
141141
policies: Iterable[TokenPolicy],
142-
status: Literal["active", "disabled", "expired"],
143142
condition: token_update_params.Condition | NotGiven = NOT_GIVEN,
144143
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
145144
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
145+
status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN,
146146
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
147147
# The extra values given here take precedence over values defined on the client or passed to this method.
148148
extra_headers: Headers | None = None,
@@ -160,13 +160,13 @@ def update(
160160
161161
policies: List of access policies assigned to the token.
162162
163-
status: Status of the token.
164-
165163
expires_on: The expiration time on or after which the JWT MUST NOT be accepted for
166164
processing.
167165
168166
not_before: The time before which the token MUST NOT be accepted for processing.
169167
168+
status: Status of the token.
169+
170170
extra_headers: Send extra headers
171171
172172
extra_query: Add additional query parameters to the request
@@ -183,10 +183,10 @@ def update(
183183
{
184184
"name": name,
185185
"policies": policies,
186-
"status": status,
187186
"condition": condition,
188187
"expires_on": expires_on,
189188
"not_before": not_before,
189+
"status": status,
190190
},
191191
token_update_params.TokenUpdateParams,
192192
),
@@ -445,10 +445,10 @@ async def update(
445445
*,
446446
name: str,
447447
policies: Iterable[TokenPolicy],
448-
status: Literal["active", "disabled", "expired"],
449448
condition: token_update_params.Condition | NotGiven = NOT_GIVEN,
450449
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
451450
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
451+
status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN,
452452
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
453453
# The extra values given here take precedence over values defined on the client or passed to this method.
454454
extra_headers: Headers | None = None,
@@ -466,13 +466,13 @@ async def update(
466466
467467
policies: List of access policies assigned to the token.
468468
469-
status: Status of the token.
470-
471469
expires_on: The expiration time on or after which the JWT MUST NOT be accepted for
472470
processing.
473471
474472
not_before: The time before which the token MUST NOT be accepted for processing.
475473
474+
status: Status of the token.
475+
476476
extra_headers: Send extra headers
477477
478478
extra_query: Add additional query parameters to the request
@@ -489,10 +489,10 @@ async def update(
489489
{
490490
"name": name,
491491
"policies": policies,
492-
"status": status,
493492
"condition": condition,
494493
"expires_on": expires_on,
495494
"not_before": not_before,
495+
"status": status,
496496
},
497497
token_update_params.TokenUpdateParams,
498498
),

src/cloudflare/types/accounts/token_update_params.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ class TokenUpdateParams(TypedDict, total=False):
2323
policies: Required[Iterable[TokenPolicy]]
2424
"""List of access policies assigned to the token."""
2525

26-
status: Required[Literal["active", "disabled", "expired"]]
27-
"""Status of the token."""
28-
2926
condition: Condition
3027

3128
expires_on: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
@@ -37,6 +34,9 @@ class TokenUpdateParams(TypedDict, total=False):
3734
not_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
3835
"""The time before which the token MUST NOT be accepted for processing."""
3936

37+
status: Literal["active", "disabled", "expired"]
38+
"""Status of the token."""
39+
4040

4141
_ConditionRequestIPReservedKeywords = TypedDict(
4242
"_ConditionRequestIPReservedKeywords",

src/cloudflare/types/shared/token_policy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Optional
3+
from typing import Dict, List, Union, Optional
44
from typing_extensions import Literal
55

66
from ..._models import BaseModel
@@ -35,5 +35,5 @@ class TokenPolicy(BaseModel):
3535
permission_groups: List[PermissionGroup]
3636
"""A set of permission groups that are specified to the policy."""
3737

38-
resources: Dict[str, str]
38+
resources: Dict[str, Union[str, Dict[str, str]]]
3939
"""A list of resource names that the policy applies to."""

src/cloudflare/types/shared_params/token_policy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Iterable
5+
from typing import Dict, Union, Iterable
66
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = ["TokenPolicy", "PermissionGroup", "PermissionGroupMeta"]
@@ -29,5 +29,5 @@ class TokenPolicy(TypedDict, total=False):
2929
permission_groups: Required[Iterable[PermissionGroup]]
3030
"""A set of permission groups that are specified to the policy."""
3131

32-
resources: Required[Dict[str, str]]
32+
resources: Required[Dict[str, Union[str, Dict[str, str]]]]
3333
"""A list of resource names that the policy applies to."""

src/cloudflare/types/user/token_update_params.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class TokenUpdateParams(TypedDict, total=False):
2020
policies: Required[Iterable[TokenPolicy]]
2121
"""List of access policies assigned to the token."""
2222

23-
status: Required[Literal["active", "disabled", "expired"]]
24-
"""Status of the token."""
25-
2623
condition: Condition
2724

2825
expires_on: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
@@ -34,6 +31,9 @@ class TokenUpdateParams(TypedDict, total=False):
3431
not_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
3532
"""The time before which the token MUST NOT be accepted for processing."""
3633

34+
status: Literal["active", "disabled", "expired"]
35+
"""Status of the token."""
36+
3737

3838
_ConditionRequestIPReservedKeywords = TypedDict(
3939
"_ConditionRequestIPReservedKeywords",

0 commit comments

Comments
 (0)