Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#964)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Jun 14, 2024
1 parent 4b8c92f commit f86f14b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 42 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-af1ecaabf305033e1f88b63fa9ff708149d2e8f79c0050c0e046d010c668038c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f5082157bb70165b34f3a552faa44b9693adacaa9613d4b887b251cd744d076f.yml
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ Types:
```python
from cloudflare.types.user import (
CIDRList,
Policy,
Token,
TokenCreateResponse,
TokenUpdateResponse,
Expand Down
9 changes: 5 additions & 4 deletions src/cloudflare/resources/user/tokens/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
PermissionGroupsResourceWithStreamingResponse,
AsyncPermissionGroupsResourceWithStreamingResponse,
)
from ....types.user.policy_param import PolicyParam
from ....types.user.token_create_response import TokenCreateResponse
from ....types.user.token_delete_response import TokenDeleteResponse
from ....types.user.token_verify_response import TokenVerifyResponse
Expand Down Expand Up @@ -72,7 +73,7 @@ def create(
self,
*,
name: str,
policies: Iterable[token_create_params.Policy],
policies: Iterable[PolicyParam],
condition: token_create_params.Condition | NotGiven = NOT_GIVEN,
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -131,7 +132,7 @@ def update(
token_id: object,
*,
name: str,
policies: Iterable[token_update_params.Policy],
policies: Iterable[PolicyParam],
status: Literal["active", "disabled", "expired"],
condition: token_update_params.Condition | NotGiven = NOT_GIVEN,
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -355,7 +356,7 @@ async def create(
self,
*,
name: str,
policies: Iterable[token_create_params.Policy],
policies: Iterable[PolicyParam],
condition: token_create_params.Condition | NotGiven = NOT_GIVEN,
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
not_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -414,7 +415,7 @@ async def update(
token_id: object,
*,
name: str,
policies: Iterable[token_update_params.Policy],
policies: Iterable[PolicyParam],
status: Literal["active", "disabled", "expired"],
condition: token_update_params.Condition | NotGiven = NOT_GIVEN,
expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN,
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/user/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .cidr_list import CIDRList as CIDRList
from .rate_plan import RatePlan as RatePlan
from .organization import Organization as Organization
from .policy_param import PolicyParam as PolicyParam
from .subscription import Subscription as Subscription
from .rate_plan_param import RatePlanParam as RatePlanParam
from .user_edit_params import UserEditParams as UserEditParams
Expand Down
24 changes: 24 additions & 0 deletions src/cloudflare/types/user/policy_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Iterable
from typing_extensions import Literal, Required, TypedDict

__all__ = ["PolicyParam", "PermissionGroup"]


class PermissionGroup(TypedDict, total=False):
meta: object
"""Attributes associated to the permission group."""


class PolicyParam(TypedDict, total=False):
effect: Required[Literal["allow", "deny"]]
"""Allow or deny operations against the resources."""

permission_groups: Required[Iterable[PermissionGroup]]
"""A set of permission groups that are specified to the policy."""

resources: Required[object]
"""A list of resource names that the policy applies to."""
23 changes: 4 additions & 19 deletions src/cloudflare/types/user/token_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@

from typing import List, Union, Iterable
from datetime import datetime
from typing_extensions import Literal, Required, Annotated, TypedDict
from typing_extensions import Required, Annotated, TypedDict

from ..._utils import PropertyInfo
from .cidr_list import CIDRList
from .policy_param import PolicyParam

__all__ = ["TokenCreateParams", "Policy", "PolicyPermissionGroup", "Condition", "ConditionRequestIP"]
__all__ = ["TokenCreateParams", "Condition", "ConditionRequestIP"]


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

policies: Required[Iterable[Policy]]
policies: Required[Iterable[PolicyParam]]
"""List of access policies assigned to the token."""

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


class PolicyPermissionGroup(TypedDict, total=False):
meta: object
"""Attributes associated to the permission group."""


class Policy(TypedDict, total=False):
effect: Required[Literal["allow", "deny"]]
"""Allow or deny operations against the resources."""

permission_groups: Required[Iterable[PolicyPermissionGroup]]
"""A set of permission groups that are specified to the policy."""

resources: Required[object]
"""A list of resource names that the policy applies to."""


_ConditionRequestIPReservedKeywords = TypedDict(
"_ConditionRequestIPReservedKeywords",
{
Expand Down
21 changes: 3 additions & 18 deletions src/cloudflare/types/user/token_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@

from ..._utils import PropertyInfo
from .cidr_list import CIDRList
from .policy_param import PolicyParam

__all__ = ["TokenUpdateParams", "Policy", "PolicyPermissionGroup", "Condition", "ConditionRequestIP"]
__all__ = ["TokenUpdateParams", "Condition", "ConditionRequestIP"]


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

policies: Required[Iterable[Policy]]
policies: Required[Iterable[PolicyParam]]
"""List of access policies assigned to the token."""

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


class PolicyPermissionGroup(TypedDict, total=False):
meta: object
"""Attributes associated to the permission group."""


class Policy(TypedDict, total=False):
effect: Required[Literal["allow", "deny"]]
"""Allow or deny operations against the resources."""

permission_groups: Required[Iterable[PolicyPermissionGroup]]
"""A set of permission groups that are specified to the policy."""

resources: Required[object]
"""A list of resource names that the policy applies to."""


_ConditionRequestIPReservedKeywords = TypedDict(
"_ConditionRequestIPReservedKeywords",
{
Expand Down

0 comments on commit f86f14b

Please sign in to comment.