Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent c31e274 commit a138540
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 301 deletions.
14 changes: 5 additions & 9 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4771,24 +4771,21 @@ Types:
from cloudflare.types.zero_trust.devices import (
DeviceInput,
DeviceMatch,
DevicePostureRule,
UnnamedSchemaRef34ef0ad73a63c3f76ed170adca181930,
UnnamedSchemaRef41885dd46b9e0294254c49305a273681,
UnnamedSchemaRef9e35ef84511131488ae286ce78ac4b27,
PostureCreateResponse,
PostureUpdateResponse,
PostureListResponse,
PostureDeleteResponse,
PostureGetResponse,
)
```

Methods:

- <code title="post /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_create_response.py">Optional</a></code>
- <code title="put /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">update</a>(rule_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_update_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_list_response.py">SyncSinglePage[PostureListResponse]</a></code>
- <code title="post /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">Optional</a></code>
- <code title="put /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">update</a>(rule_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">Optional</a></code>
- <code title="get /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">SyncSinglePage[DevicePostureRule]</a></code>
- <code title="delete /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">delete</a>(rule_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_delete_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">get</a>(rule_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_get_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">get</a>(rule_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">Optional</a></code>

#### Integrations

Expand Down Expand Up @@ -4903,7 +4900,6 @@ Types:

```python
from cloudflare.types.zero_trust import (
AccessDevicePostureRule,
AccessRule,
AnyValidServiceTokenRule,
AuthenticationMethodRule,
Expand Down
41 changes: 19 additions & 22 deletions src/cloudflare/resources/zero_trust/devices/posture/posture.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@
from .....types.zero_trust.devices import (
DeviceInputParam,
DeviceMatchParam,
PostureGetResponse,
PostureListResponse,
PostureCreateResponse,
DevicePostureRule,
PostureDeleteResponse,
PostureUpdateResponse,
posture_create_params,
posture_delete_params,
posture_update_params,
Expand Down Expand Up @@ -100,7 +97,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[PostureCreateResponse]:
) -> Optional[DevicePostureRule]:
"""
Creates a new device posture rule.
Expand Down Expand Up @@ -152,7 +149,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[PostureCreateResponse]], ResultWrapper[PostureCreateResponse]),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
)

def update(
Expand Down Expand Up @@ -193,7 +190,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[PostureUpdateResponse]:
) -> Optional[DevicePostureRule]:
"""
Updates a device posture rule.
Expand Down Expand Up @@ -249,7 +246,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[PostureUpdateResponse]], ResultWrapper[PostureUpdateResponse]),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
)

def list(
Expand All @@ -262,7 +259,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[PostureListResponse]:
) -> SyncSinglePage[DevicePostureRule]:
"""
Fetches device posture rules for a Zero Trust account.
Expand All @@ -279,11 +276,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/devices/posture",
page=SyncSinglePage[PostureListResponse],
page=SyncSinglePage[DevicePostureRule],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=PostureListResponse,
model=DevicePostureRule,
)

def delete(
Expand Down Expand Up @@ -341,7 +338,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[PostureGetResponse]:
) -> Optional[DevicePostureRule]:
"""
Fetches a single device posture rule.
Expand Down Expand Up @@ -369,7 +366,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[PostureGetResponse]], ResultWrapper[PostureGetResponse]),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
)


Expand Down Expand Up @@ -423,7 +420,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[PostureCreateResponse]:
) -> Optional[DevicePostureRule]:
"""
Creates a new device posture rule.
Expand Down Expand Up @@ -475,7 +472,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[PostureCreateResponse]], ResultWrapper[PostureCreateResponse]),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
)

async def update(
Expand Down Expand Up @@ -516,7 +513,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[PostureUpdateResponse]:
) -> Optional[DevicePostureRule]:
"""
Updates a device posture rule.
Expand Down Expand Up @@ -572,7 +569,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[PostureUpdateResponse]], ResultWrapper[PostureUpdateResponse]),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
)

def list(
Expand All @@ -585,7 +582,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[PostureListResponse, AsyncSinglePage[PostureListResponse]]:
) -> AsyncPaginator[DevicePostureRule, AsyncSinglePage[DevicePostureRule]]:
"""
Fetches device posture rules for a Zero Trust account.
Expand All @@ -602,11 +599,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/devices/posture",
page=AsyncSinglePage[PostureListResponse],
page=AsyncSinglePage[DevicePostureRule],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=PostureListResponse,
model=DevicePostureRule,
)

async def delete(
Expand Down Expand Up @@ -664,7 +661,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[PostureGetResponse]:
) -> Optional[DevicePostureRule]:
"""
Fetches a single device posture rule.
Expand Down Expand Up @@ -692,7 +689,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[PostureGetResponse]], ResultWrapper[PostureGetResponse]),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
)


Expand Down
2 changes: 0 additions & 2 deletions src/cloudflare/types/zero_trust/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
from .external_evaluation_rule import ExternalEvaluationRule as ExternalEvaluationRule
from .github_organization_rule import GitHubOrganizationRule as GitHubOrganizationRule
from .service_token_rule_param import ServiceTokenRuleParam as ServiceTokenRuleParam
from .access_device_posture_rule import AccessDevicePostureRule as AccessDevicePostureRule
from .authentication_method_rule import AuthenticationMethodRule as AuthenticationMethodRule
from .generic_oauth_config_param import GenericOAuthConfigParam as GenericOAuthConfigParam
from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams
Expand All @@ -68,7 +67,6 @@
from .identity_provider_create_params import IdentityProviderCreateParams as IdentityProviderCreateParams
from .identity_provider_list_response import IdentityProviderListResponse as IdentityProviderListResponse
from .identity_provider_update_params import IdentityProviderUpdateParams as IdentityProviderUpdateParams
from .access_device_posture_rule_param import AccessDevicePostureRuleParam as AccessDevicePostureRuleParam
from .authentication_method_rule_param import AuthenticationMethodRuleParam as AuthenticationMethodRuleParam
from .connectivity_setting_edit_params import ConnectivitySettingEditParams as ConnectivitySettingEditParams
from .organization_revoke_users_params import OrganizationRevokeUsersParams as OrganizationRevokeUsersParams
Expand Down
14 changes: 0 additions & 14 deletions src/cloudflare/types/zero_trust/access_device_posture_rule.py

This file was deleted.

This file was deleted.

14 changes: 12 additions & 2 deletions src/cloudflare/types/zero_trust/access_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Union

from .ip_rule import IPRule
from ..._models import BaseModel
from .email_rule import EmailRule
from .group_rule import GroupRule
from .domain_rule import DomainRule
Expand All @@ -18,11 +19,20 @@
from .service_token_rule import ServiceTokenRule
from .external_evaluation_rule import ExternalEvaluationRule
from .github_organization_rule import GitHubOrganizationRule
from .access_device_posture_rule import AccessDevicePostureRule
from .authentication_method_rule import AuthenticationMethodRule
from .any_valid_service_token_rule import AnyValidServiceTokenRule

__all__ = ["AccessRule"]
__all__ = ["AccessRule", "AccessDevicePostureRule", "AccessDevicePostureRuleDevicePosture"]


class AccessDevicePostureRuleDevicePosture(BaseModel):
integration_uid: str
"""The ID of a device posture integration."""


class AccessDevicePostureRule(BaseModel):
device_posture: AccessDevicePostureRuleDevicePosture


AccessRule = Union[
EmailRule,
Expand Down
16 changes: 13 additions & 3 deletions src/cloudflare/types/zero_trust/access_rule_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

from typing import Union
from typing_extensions import Required, TypedDict

from .ip_rule_param import IPRuleParam
from .email_rule_param import EmailRuleParam
Expand All @@ -20,11 +21,20 @@
from .service_token_rule_param import ServiceTokenRuleParam
from .external_evaluation_rule_param import ExternalEvaluationRuleParam
from .github_organization_rule_param import GitHubOrganizationRuleParam
from .access_device_posture_rule_param import AccessDevicePostureRuleParam
from .authentication_method_rule_param import AuthenticationMethodRuleParam
from .any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam

__all__ = ["AccessRuleParam"]
__all__ = ["AccessRuleParam", "AccessDevicePostureRule", "AccessDevicePostureRuleDevicePosture"]


class AccessDevicePostureRuleDevicePosture(TypedDict, total=False):
integration_uid: Required[str]
"""The ID of a device posture integration."""


class AccessDevicePostureRule(TypedDict, total=False):
device_posture: Required[AccessDevicePostureRuleDevicePosture]


AccessRuleParam = Union[
EmailRuleParam,
Expand All @@ -45,5 +55,5 @@
ExternalEvaluationRuleParam,
CountryRuleParam,
AuthenticationMethodRuleParam,
AccessDevicePostureRuleParam,
AccessDevicePostureRule,
]
5 changes: 1 addition & 4 deletions src/cloudflare/types/zero_trust/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,23 @@
from .device_input_param import DeviceInputParam as DeviceInputParam
from .device_match_param import DeviceMatchParam as DeviceMatchParam
from .policy_edit_params import PolicyEditParams as PolicyEditParams
from .device_posture_rule import DevicePostureRule as DevicePostureRule
from .policy_create_params import PolicyCreateParams as PolicyCreateParams
from .policy_delete_params import PolicyDeleteParams as PolicyDeleteParams
from .posture_get_response import PostureGetResponse as PostureGetResponse
from .revoke_create_params import RevokeCreateParams as RevokeCreateParams
from .network_create_params import NetworkCreateParams as NetworkCreateParams
from .network_delete_params import NetworkDeleteParams as NetworkDeleteParams
from .network_update_params import NetworkUpdateParams as NetworkUpdateParams
from .posture_create_params import PostureCreateParams as PostureCreateParams
from .posture_delete_params import PostureDeleteParams as PostureDeleteParams
from .posture_list_response import PostureListResponse as PostureListResponse
from .posture_update_params import PostureUpdateParams as PostureUpdateParams
from .setting_update_params import SettingUpdateParams as SettingUpdateParams
from .dex_test_create_params import DEXTestCreateParams as DEXTestCreateParams
from .dex_test_update_params import DEXTestUpdateParams as DEXTestUpdateParams
from .policy_delete_response import PolicyDeleteResponse as PolicyDeleteResponse
from .unrevoke_create_params import UnrevokeCreateParams as UnrevokeCreateParams
from .network_delete_response import NetworkDeleteResponse as NetworkDeleteResponse
from .posture_create_response import PostureCreateResponse as PostureCreateResponse
from .posture_delete_response import PostureDeleteResponse as PostureDeleteResponse
from .posture_update_response import PostureUpdateResponse as PostureUpdateResponse
from .dex_test_delete_response import DEXTestDeleteResponse as DEXTestDeleteResponse
from .override_code_list_response import OverrideCodeListResponse as OverrideCodeListResponse
from .unnamed_schema_ref_34ef0ad73a63c3f76ed170adca181930 import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from .device_input import DeviceInput
from .device_match import DeviceMatch

__all__ = ["PostureGetResponse"]
__all__ = ["DevicePostureRule"]


class PostureGetResponse(BaseModel):
class DevicePostureRule(BaseModel):
id: Optional[str] = None
"""API UUID."""

Expand Down
Loading

0 comments on commit a138540

Please sign in to comment.